[Rivet-svn] r1871 - trunk/src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Tue Oct 6 11:05:12 BST 2009


Author: buckley
Date: Tue Oct  6 11:05:12 2009
New Revision: 1871

Log:
Tidying UA1 analysis logic and trying to get the cross-section/norm choices correct

Modified:
   trunk/src/Analyses/CDF_2009_S8233977.cc
   trunk/src/Analyses/UA1_1990_S2044935.cc

Modified: trunk/src/Analyses/CDF_2009_S8233977.cc
==============================================================================
--- trunk/src/Analyses/CDF_2009_S8233977.cc	Tue Oct  6 08:59:27 2009	(r1870)
+++ trunk/src/Analyses/CDF_2009_S8233977.cc	Tue Oct  6 11:05:12 2009	(r1871)
@@ -92,7 +92,7 @@
         const double mPi = 139.57*MeV;
         const double root = sqrt(mPi*mPi + (1+sinh1)*pT*pT);
         const double dy = std::log((root+apT)/(root-apT));
-        const double dphi = 2*M_PI;
+        const double dphi = TWOPI;
         _hist_pt->fill(pT, weight/(pT*dphi*dy));
       }
 

Modified: trunk/src/Analyses/UA1_1990_S2044935.cc
==============================================================================
--- trunk/src/Analyses/UA1_1990_S2044935.cc	Tue Oct  6 08:59:27 2009	(r1870)
+++ trunk/src/Analyses/UA1_1990_S2044935.cc	Tue Oct  6 11:05:12 2009	(r1871)
@@ -17,6 +17,11 @@
     /// Constructor
     UA1_1990_S2044935() : Analysis("UA1_1990_S2044935") {
       setBeams(PROTON, ANTIPROTON);
+      setNeedsCrossSection(true);
+      _sumwTrig = 0;
+      _sumwTrig08 = 0;
+      _sumwTrig40 = 0;
+      _sumwTrig80 = 0;
     }
     
 
@@ -31,15 +36,15 @@
       const FinalState calofs(-6.0, 6.0);
       addProjection(TotalVisibleMomentum(calofs), "Mom");
 
-      _hist_sigma200 = bookHistogram1D(1,1,1);
-      _hist_sigma500 = bookHistogram1D(1,1,2);
-      _hist_sigma900 = bookHistogram1D(1,1,3);
-      _hist_Esigma200 = bookHistogram1D(2,1,1);
-      _hist_Esigma500 = bookHistogram1D(2,1,2);
-      _hist_Esigma900 = bookHistogram1D(2,1,3);
-      _hist_Esigmapoint8 = bookHistogram1D(3,1,1);
-      _hist_Esigma4 = bookHistogram1D(4,1,1);
-      _hist_Esigma8 = bookHistogram1D(5,1,1);
+      _hist_Nch200 = bookHistogram1D(1,1,1);
+      _hist_Nch500 = bookHistogram1D(1,1,2);
+      _hist_Nch900 = bookHistogram1D(1,1,3);
+      _hist_Esigd3p200 = bookHistogram1D(2,1,1);
+      _hist_Esigd3p500 = bookHistogram1D(2,1,2);
+      _hist_Esigd3p900 = bookHistogram1D(2,1,3);
+      _hist_Esigd3p08 = bookHistogram1D(3,1,1);
+      _hist_Esigd3p40 = bookHistogram1D(4,1,1);
+      _hist_Esigd3p80 = bookHistogram1D(5,1,1);
       _hist_Et200 = bookHistogram1D(9,1,1);
       _hist_Et500 = bookHistogram1D(10,1,1);
       _hist_Et900 = bookHistogram1D(11,1,1);
@@ -64,100 +69,103 @@
       getLog() << Log::DEBUG << "Trigger -: " << n_minus << ", Trigger +: " << n_plus << endl;
       if (n_plus == 0 || n_minus == 0) vetoEvent;      
       const double weight = event.weight();
+      _sumwTrig += weight;
 
       // Use good central detector tracks
       const double sqrtS = applyProjection<Beam>(event, "Beam").sqrtS();
       const FinalState& cfs = applyProjection<FinalState>(event, "TrackFS");
-      const double nch = cfs.size();
-      if (fuzzyEquals(sqrtS/GeV, 200, 1E-4)) {
-        _hist_sigma200->fill(nch, weight);
-      } else if (fuzzyEquals(sqrtS/GeV, 500)) {
-        _hist_sigma500->fill(nch, weight);
-      }	else if (fuzzyEquals(sqrtS/GeV, 900)) {
-        _hist_sigma900->fill(nch, weight);
-      }
-      foreach (const Particle& p, cfs.particles()) {
-        /// @todo Check d3p weight factors
-        const double pt = p.momentum().pT();
-        const double scaled_weight = weight/(2*5*PI*pt);
-        if (fuzzyEquals(sqrtS/GeV, 200, 1E-4)) {
-          _hist_Esigma200->fill(pt/GeV, scaled_weight);
-        }
-        if (fuzzyEquals(sqrtS/GeV, 500)) {
-          _hist_Esigma500->fill(pt/GeV, scaled_weight);
-        }
-        if (fuzzyEquals(sqrtS/GeV, 900)) {
-          _hist_Esigma900->fill(pt/GeV, scaled_weight);
-          // Also fill dNc/deta for 900 GeV
-          const double dnch_deta = nch/5.0;
-          if (inRange(dnch_deta, 0.8, 4)) {
-            _hist_Esigmapoint8->fill(pt/GeV, scaled_weight);
-          } else if (dnch_deta > 4 && dnch_deta <= 8) {
-            _hist_Esigma4->fill(pt/GeV, scaled_weight);
-          } else if(dnch_deta > 8) {
-            _hist_Esigma8->fill(pt/GeV, scaled_weight);
-          }
-        }                
-      }
-      
       const double Et = applyProjection<TotalVisibleMomentum>(event, "Mom").scalarET();
+      const unsigned int nch = cfs.size();
+
+      // Event level histos
       if (fuzzyEquals(sqrtS/GeV, 200, 1E-4)) {
+        _hist_Nch200->fill(nch, weight);
         _hist_Et200->fill(Et/GeV, weight);
       } else if (fuzzyEquals(sqrtS/GeV, 500)) {
+        _hist_Nch500->fill(nch, weight);
         _hist_Et500->fill(Et/GeV, weight);
-      } else if (fuzzyEquals(sqrtS/GeV, 900)) {
+      }	else if (fuzzyEquals(sqrtS/GeV, 900)) {
+        _hist_Nch900->fill(nch, weight);
         _hist_Et900->fill(Et/GeV, weight);
       }
 
+      // Particle/track level histos
+      const double deta = 2 * 5.0;
+      const double dphi = TWOPI;
+      const double dnch_deta = nch/5.0; //< @todo d(eta) definitely not _2_ * 5.0?
       foreach (const Particle& p, cfs.particles()) {
+        const double pt = p.momentum().pT();
+        const double scaled_weight = weight/(deta*dphi*pt);
         if (fuzzyEquals(sqrtS/GeV, 63, 1E-3)) {
-          _hist_Pt63->fill(nch, p.momentum().pT()/GeV, weight);
+          _hist_Pt63->fill(nch, pt/GeV, weight);
         } else if (fuzzyEquals(sqrtS/GeV, 200, 1E-4)) {
-          _hist_Pt200->fill(nch, p.momentum().pT()/GeV, weight);
+          _hist_Pt200->fill(nch, pt/GeV, weight);
           _hist_Etavg200->fill(nch, Et/GeV, weight);
+          _hist_Esigd3p200->fill(pt/GeV, scaled_weight);
         } else if (fuzzyEquals(sqrtS/GeV, 500)) {
           _hist_Etavg500->fill(nch, Et/GeV, weight);
+          _hist_Esigd3p500->fill(pt/GeV, scaled_weight);
         } else if (fuzzyEquals(sqrtS/GeV, 900)) {
           _hist_Pt900->fill(nch, p.momentum().pT()/GeV, weight);
           _hist_Etavg900->fill(nch, Et/GeV, weight);
-        }
+          _hist_Esigd3p900->fill(pt/GeV, scaled_weight);
+          // Also fill for specific dNch/deta ranges for 900 GeV
+          if (inRange(dnch_deta, 0.8, 4)) {
+            _sumwTrig08 += weight;
+            _hist_Esigd3p08->fill(pt/GeV, scaled_weight);
+          } else if (dnch_deta > 4 && dnch_deta <= 8) {
+            _sumwTrig40 += weight;
+            _hist_Esigd3p40->fill(pt/GeV, scaled_weight);
+          } else if(dnch_deta > 8) {
+            _sumwTrig80 += weight;
+            _hist_Esigd3p80->fill(pt/GeV, scaled_weight);
+          }
+        } 
       }
+      
     }
     
     
     void finalize() {
-      ///@todo: get the total cross-sections from the generator
-      ///@todo: check if the scaling for Esigmpoint8, Esigma4 and Esigma8 are correct.
-      normalize(_hist_sigma200, 27.9);
-      normalize(_hist_sigma500, 31.5);
-      normalize(_hist_sigma900, 34.4);
-      scale(_hist_Esigma200, 27.9/sumOfWeights());
-      scale(_hist_Esigma500, 31.5/sumOfWeights());
-      scale(_hist_Esigma900, 34.4/sumOfWeights());
-      scale(_hist_Esigmapoint8, 34400./sumOfWeights());
-      scale(_hist_Esigma4, 3440./sumOfWeights());
-      scale(_hist_Esigma8, 344./sumOfWeights());
-      normalize(_hist_Et200, 27.9);
-      normalize(_hist_Et500, 31.5);
-      normalize(_hist_Et900, 34.4);
+      const double xsec = crossSection();
+      if (_sumwTrig > 0) {
+        normalize(_hist_Nch200, xsec/millibarn * _sumwTrig/sumOfWeights());
+        normalize(_hist_Nch500, xsec/millibarn * _sumwTrig/sumOfWeights());
+        normalize(_hist_Nch900, xsec/millibarn * _sumwTrig/sumOfWeights());
+        //
+        scale(_hist_Esigd3p200, xsec/millibarn * 1/_sumwTrig);
+        scale(_hist_Esigd3p500, xsec/millibarn * 1/_sumwTrig);
+        scale(_hist_Esigd3p900, xsec/millibarn * 1/_sumwTrig);
+        //
+        if (_sumwTrig08 > 0) scale(_hist_Esigd3p08, xsec/microbarn * 1/_sumwTrig08);
+        if (_sumwTrig40 > 0) scale(_hist_Esigd3p40, xsec/microbarn * 1/_sumwTrig40);
+        if (_sumwTrig80 > 0) scale(_hist_Esigd3p80, xsec/microbarn * 1/_sumwTrig80);
+        //
+        normalize(_hist_Et200, xsec/millibarn * _sumwTrig/sumOfWeights());
+        normalize(_hist_Et500, xsec/millibarn * _sumwTrig/sumOfWeights());
+        normalize(_hist_Et900, xsec/millibarn * _sumwTrig/sumOfWeights());
+      }
     }
     
     //@}
 
     
   private:
+
+    /// Weight counters
+    double _sumwTrig, _sumwTrig08, _sumwTrig40, _sumwTrig80;
     
     /// @name Histogram collections
     //@{
-    AIDA::IHistogram1D* _hist_sigma200;
-    AIDA::IHistogram1D* _hist_sigma500;
-    AIDA::IHistogram1D* _hist_sigma900;
-    AIDA::IHistogram1D* _hist_Esigma200;
-    AIDA::IHistogram1D* _hist_Esigma500;
-    AIDA::IHistogram1D* _hist_Esigma900;
-    AIDA::IHistogram1D* _hist_Esigmapoint8;
-    AIDA::IHistogram1D* _hist_Esigma4;
-    AIDA::IHistogram1D* _hist_Esigma8;
+    AIDA::IHistogram1D* _hist_Nch200;
+    AIDA::IHistogram1D* _hist_Nch500;
+    AIDA::IHistogram1D* _hist_Nch900;
+    AIDA::IHistogram1D* _hist_Esigd3p200;
+    AIDA::IHistogram1D* _hist_Esigd3p500;
+    AIDA::IHistogram1D* _hist_Esigd3p900;
+    AIDA::IHistogram1D* _hist_Esigd3p08;
+    AIDA::IHistogram1D* _hist_Esigd3p40;
+    AIDA::IHistogram1D* _hist_Esigd3p80;
     AIDA::IProfile1D* _hist_Pt63;
     AIDA::IProfile1D* _hist_Pt200;
     AIDA::IProfile1D* _hist_Pt900;


More information about the Rivet-svn mailing list