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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Sat Nov 27 02:37:15 GMT 2010


Author: buckley
Date: Sat Nov 27 02:37:14 2010
New Revision: 2787

Log:
CDF 1994 histo norms done properly

Modified:
   trunk/src/Analyses/CDF_1994_S2952106.cc

Modified: trunk/src/Analyses/CDF_1994_S2952106.cc
==============================================================================
--- trunk/src/Analyses/CDF_1994_S2952106.cc	Sat Nov 27 01:24:13 2010	(r2786)
+++ trunk/src/Analyses/CDF_1994_S2952106.cc	Sat Nov 27 02:37:14 2010	(r2787)
@@ -32,6 +32,11 @@
       addProjection(fs, "FS");
       addProjection(FastJets(fs, FastJets::CDFJETCLU, 0.7), "Jets");
 
+      // Zero event weight passed-cuts counters
+      _sumw1 = 0;
+      _sumw2 = 0;
+
+      // Output histograms
       _histJet1Et  = bookHistogram1D(1,1,1);
       _histJet2Et  = bookHistogram1D(2,1,1);
       _histJet3eta = bookDataPointSet(3,1,1);
@@ -78,14 +83,18 @@
       MSG_DEBUG("Jet 1 & 2 phi requirement fulfilled");
 
       const double weight = event.weight();
+      _sumw1 += weight;
+
+      // Fill histos
       _histJet1Et->fill(pj1.pT(), weight);
       _histJet2Et->fill(pj2.pT(), weight);
-      _tmphistR23->fill(deltaR(pj2, pj3), weight);
       _tmphistJet3eta->fill(pj3.eta(), weight);
+      _tmphistR23->fill(deltaR(pj2, pj3), weight);
 
       // Next cut only required for alpha studies
       if (pj3.pT() < 10.0*GeV) vetoEvent;
       MSG_DEBUG("3rd jet passes alpha histo pT cut");
+      _sumw2 += weight;
 
       // Calc and plot alpha
       const double dPhi = deltaPhi(pj3.phi(), pj2.phi());
@@ -98,6 +107,10 @@
     /// Apply bin-wise detector correction factors
     void finalize() {
 
+      // Normal scalings
+      scale(_histJet1Et, 1/_sumw1);
+      scale(_histJet2Et, 1/_sumw1);
+
       // eta3 correction
       const double eta3_CDF_sim[] =
         { 0.0013, 0.0037, 0.0047, 0.0071, 0.0093, 0.0117, 0.0151, 0.0149, 0.0197, 0.0257,
@@ -117,9 +130,9 @@
       vector<double> yval_eta3, yerr_eta3;
       for (size_t i = 0;  i < 40; ++i) {
         const double yval = _tmphistJet3eta->binHeight(i) * (eta3_CDF_sim[i]/eta3_Ideal_sim[i]);
-        yval_eta3.push_back(yval);
+        yval_eta3.push_back(yval/_sumw1);
         const double yerr = _tmphistJet3eta->binError(i) * (eta3_CDF_sim_err[i]/eta3_Ideal_sim[i]);
-        yerr_eta3.push_back(yerr);
+        yerr_eta3.push_back(yerr/_sumw1);
       }
       _histJet3eta->setCoordinate(1, yval_eta3, yerr_eta3);
 
@@ -142,9 +155,9 @@
       vector<double> yval_R23, yerr_R23;
       for (size_t i = 0;  i < 35; ++i) {
         const double yval = _tmphistR23->binHeight(i) * (R23_CDF_sim[i]/R23_Ideal_sim[i]);
-        yval_R23.push_back(yval);
+        yval_R23.push_back(yval/_sumw1);
         const double yerr = _tmphistR23->binError(i) * (R23_CDF_sim_err[i]/R23_Ideal_sim[i]);
-        yerr_R23.push_back(yerr);
+        yerr_R23.push_back(yerr/_sumw1);
       }
       _histR23->setCoordinate(1, yval_R23, yerr_R23);
 
@@ -167,19 +180,11 @@
       vector<double> yval_alpha, yerr_alpha;
       for (size_t i = 0;  i < 40; ++i) {
         const double yval = _tmphistAlpha->binHeight(i) * (alpha_CDF_sim[i]/alpha_Ideal_sim[i]);
-        yval_alpha.push_back(yval);
+        yval_alpha.push_back(yval/_sumw2);
         const double yerr = _tmphistAlpha->binError(i) * (alpha_CDF_sim_err[i]/alpha_Ideal_sim[i]);
-        yerr_alpha.push_back(yerr);
+        yerr_alpha.push_back(yerr/_sumw2);
       }
       _histAlpha->setCoordinate(1, yval_alpha, yerr_alpha);
-
-      // Normalize to data
-      normalize(_histJet1Et, 12.3);
-      normalize(_histJet2Et, 12.3);
-      /// @todo These normalisations need to go into the DPS construction *sigh*
-      // normalize(_histJet3eta, 0.2);
-      // normalize(_histR23, 0.126);
-      // normalize(_histAlpha, 4.5);
     }
 
     //@}
@@ -187,6 +192,14 @@
 
   private:
 
+    /// @name Event weight counters
+    //@{
+
+    double _sumw1, _sumw2;
+
+    //@}
+
+
     /// @name Histograms
     //@{
 


More information about the Rivet-svn mailing list