[Rivet-svn] r1770 - in trunk: data/plotinfo include/Rivet/Analyses src/Analyses

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Wed Aug 19 21:22:40 BST 2009


Author: fsiegert
Date: Wed Aug 19 21:22:40 2009
New Revision: 1770

Log:
Add more observables to MC_TVT1960_ZJETS and make it use the new
MC_JetAnalysis for all its jet observables.

Modified:
   trunk/data/plotinfo/MC_TVT1960_ZJETS.plot
   trunk/include/Rivet/Analyses/MC_TVT1960_ZJETS.hh
   trunk/src/Analyses/MC_JetAnalysis.cc
   trunk/src/Analyses/MC_TVT1960_ZJETS.cc

Modified: trunk/data/plotinfo/MC_TVT1960_ZJETS.plot
==============================================================================
--- trunk/data/plotinfo/MC_TVT1960_ZJETS.plot	Wed Aug 19 17:52:54 2009	(r1769)
+++ trunk/data/plotinfo/MC_TVT1960_ZJETS.plot	Wed Aug 19 21:22:40 2009	(r1770)
@@ -1,105 +1,155 @@
+# BEGIN PLOT /MC_TVT1960_ZJETS/Z_jet1_dR
+Title=
+XLabel=$\Delta R(\text{Z, 1st jet})$
+YLabel=$\text{d}\sigma/\text{d}\Delta R(\text{Z, 1st jet})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/Z_jet1_deta
+Title=
+XLabel=$\Delta{\eta}(\text{Z, 1st jet})$
+YLabel=$\text{d}\sigma/\text{d}\Delta{\eta}(\text{Z, 1st jet})$
+# END PLOT
+
 # BEGIN PLOT /MC_TVT1960_ZJETS/Z_mass
 Title=Z mass
 XLabel=$m_{\text{Z}}$ [GeV]
-YLabel=$1/\sigma \text{d}\sigma/\text{d}m_{\text{Z}}$
+YLabel=$\text{d}\sigma/\text{d}m_{\text{Z}}$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/Z_pT
+Title=Z $p_\perp$
+XLabel=$p_\perp^{\text{Z}}$ [GeV]
+YLabel=$\text{d}\sigma/\text{d}y_{\text{Z}}$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/Z_y
+Title=Z rapidity
+XLabel=$y_{\text{Z}}$
+YLabel=$\text{d}\sigma/\text{d}y_{\text{Z}}$
 # END PLOT
 
-# BEGIN PLOT /MC_TVT1960_ZJETS/dR_jet2_jet3
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_dR_12
 Title=
-XLabel=$|\Delta{R}(\text{2nd jet, 3rd jet})|$
-YLabel=$1/\sigma \text{d}\sigma/\text{d}|\Delta{R}(\text{2nd jet, 3rd jet})|$
+XLabel=$\Delta{R}(\text{jet 1, jet 2})$
+YLabel=$\text{d}\sigma/\text{d}\Delta{R}(\text{jet 1, jet 2})$
 # END PLOT
 
-# BEGIN PLOT /MC_TVT1960_ZJETS/deta_Z_jet2
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_dR_13
 Title=
-XLabel=$|\Delta{\eta}(\text{Z, 1st jet})|$
-YLabel=$1/\sigma \text{d}\sigma/\text{d}|\Delta{\eta}(\text{Z, 1st jet})|$
+XLabel=$\Delta{R}(\text{jet 1, jet 3})$
+YLabel=$\text{d}\sigma/\text{d}\Delta{R}(\text{jet 1, jet 3})$
 # END PLOT
 
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet10_multi_exclusive
-Title=Exclusive jet multiplicity
-XLabel=$N_{\text{jet(}\geq 10 \text{GeV)}}$
-YLabel=$\sigma(N_{\text{jet}})/\sigma(N_{\text{jet}}=0)$
-XMajorTickMarks=1
-XMinorTickMarks=0
-ErrorBands=1
-LegendXPos=1.15
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_dR_14
+Title=
+XLabel=$\Delta{R}(\text{jet 1, jet 4})$
+YLabel=$\text{d}\sigma/\text{d}\Delta{R}(\text{jet 1, jet 4})$
 # END PLOT
 
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet10_multi_inclusive
-Title=Inclusive jet multiplicity
-XLabel=$N_{\text{jet(}\geq 10 \text{GeV)}}$
-YLabel=$\sigma(\geq N_{\text{jet}})/\sigma(\text{inclusive})$
-XMajorTickMarks=1
-XMinorTickMarks=0
-ErrorBands=1
-LegendXPos=1.15
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_dR_23
+Title=
+XLabel=$\Delta{R}(\text{jet 2, jet 3})$
+YLabel=$\text{d}\sigma/\text{d}\Delta{R}(\text{jet 2, jet 3})$
 # END PLOT
 
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet10_multi_ratio
-Title=Ratio of jet multiplicity
-XLabel=$N_{\text{jet(}\geq 10 \text{GeV)}}$
-YLabel=$\sigma(\geq N_{\text{jet}})/\sigma(\geq N_{\text{jet}}-1)$
-XMajorTickMarks=10
-XMinorTickMarks=0
-LogY=0
-ErrorBands=1
-LegendXPos=0.5
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_dR_24
+Title=
+XLabel=$\Delta{R}(\text{jet 2, jet 4})$
+YLabel=$\text{d}\sigma/\text{d}\Delta{R}(\text{jet 2, jet 4})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_dR_34
+Title=
+XLabel=$\Delta{R}(\text{jet 3, jet 4})$
+YLabel=$\text{d}\sigma/\text{d}\Delta{R}(\text{jet 3, jet 4})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_deta_12
+Title=
+XLabel=$\Delta\eta(\text{jet 1, jet 2})$
+YLabel=$\text{d}\sigma/\text{d}\Delta\eta(\text{jet 1, jet 2})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_deta_13
+Title=
+XLabel=$\Delta\eta(\text{jet 1, jet 3})$
+YLabel=$\text{d}\sigma/\text{d}\Delta\eta(\text{jet 1, jet 3})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_deta_14
+Title=
+XLabel=$\Delta\eta(\text{jet 1, jet 4})$
+YLabel=$\text{d}\sigma/\text{d}\Delta\eta(\text{jet 1, jet 4})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_deta_23
+Title=
+XLabel=$\Delta\eta(\text{jet 2, jet 3})$
+YLabel=$\text{d}\sigma/\text{d}\Delta\eta(\text{jet 2, jet 3})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_deta_24
+Title=
+XLabel=$\Delta\eta(\text{jet 2, jet 4})$
+YLabel=$\text{d}\sigma/\text{d}\Delta\eta(\text{jet 2, jet 4})$
 # END PLOT
 
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet1_pT
-Title=pT of 1st jet
-XLabel=$p_{\perp}^{\text{1st jet}}$ [GeV]
-YLabel=$1/\sigma \text{d}\sigma/\text{d}p_{\perp}^{\text{1st jet}}$
+# BEGIN PLOT /MC_TVT1960_ZJETS/jets_deta_34
+Title=
+XLabel=$\Delta\eta(\text{jet 3, jet 4})$
+YLabel=$\text{d}\sigma/\text{d}\Delta\eta(\text{jet 3, jet 4})$
 # END PLOT
 
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet20_multi_exclusive
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_eta_1
+Title=
+XLabel=$\eta(\text{jet 1})$
+YLabel=$\text{d}\sigma/\text{d}\eta(\text{jet 1})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_eta_2
+Title=
+XLabel=$\eta(\text{jet 2})$
+YLabel=$\text{d}\sigma/\text{d}\eta(\text{jet 2})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_eta_3
+Title=
+XLabel=$\eta(\text{jet 3})$
+YLabel=$\text{d}\sigma/\text{d}\eta(\text{jet 3})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_eta_4
+Title=
+XLabel=$\eta(\text{jet 4})$
+YLabel=$\text{d}\sigma/\text{d}\eta(\text{jet 4})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_multi_exclusive
 Title=Exclusive jet multiplicity
-XLabel=$N_{\text{jet(}\geq 20 \text{GeV)}}$
-YLabel=$\sigma(N_{\text{jet}})/\sigma(N_{\text{jet}}=0)$
-XMajorTickMarks=1
+XLabel=$N_{\text{jet}}$
+YLabel=$\sigma(N_{\text{jet}})$
+XMajorTickMarks=10
 XMinorTickMarks=0
 ErrorBands=1
-LegendXPos=1.15
 # END PLOT
 
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet20_multi_inclusive
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_multi_inclusive
 Title=Inclusive jet multiplicity
-XLabel=$N_{\text{jet(}\geq 20 \text{GeV)}}$
-YLabel=$\sigma(\geq N_{\text{jet}})/\sigma(\text{inclusive})$
-XMajorTickMarks=1
+XLabel=$N_{\text{jet}}$
+YLabel=$\sigma(\geq N_{\text{jet}})$
+XMajorTickMarks=10
 XMinorTickMarks=0
 ErrorBands=1
-LegendXPos=1.15
 # END PLOT
 
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet20_multi_ratio
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_multi_ratio
 Title=Ratio of jet multiplicity
-XLabel=$N_{\text{jet(}\geq 20 \text{GeV)}}$
+XLabel=$N_{\text{jet}}$
 YLabel=$\sigma(\geq N_{\text{jet}})/\sigma(\geq N_{\text{jet}}-1)$
 XMajorTickMarks=10
 XMinorTickMarks=0
 LogY=0
 ErrorBands=1
-LegendXPos=0.5
-# END PLOT
-
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet2_pT
-Title=pT of 2nd jet
-XLabel=$p_{\perp}^{\text{2nd jet}}$ [GeV]
-YLabel=$1/\sigma \text{d}\sigma/\text{d}p_{\perp}^{\text{2nd jet}}$
-# END PLOT
-
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet3_pT
-Title=pT of 3rd jet
-XLabel=$p_{\perp}^{\text{3rd jet}}$ [GeV]
-YLabel=$1/\sigma \text{d}\sigma/\text{d}p_{\perp}^{\text{3rd jet}}$
-# END PLOT
-
-# BEGIN PLOT /MC_TVT1960_ZJETS/jet4_pT
-Title=pT of 4th jet
-XLabel=$p_{\perp}^{\text{4th jet}}$ [GeV]
-YLabel=$1/\sigma \text{d}\sigma/\text{d}p_{\perp}^{\text{4th jet}}$
 # END PLOT
 
 # BEGIN PLOT /MC_TVT1960_ZJETS/log10_R_0
@@ -107,8 +157,6 @@
 XLabel=$\log_{10}(d_{\text{cut}}/\text{GeV})$
 YLabel=$R_{0}$
 Rebin=2
-YMin=9e-4
-YMax=1.5
 LegendYPos=0.8
 LegendXPos=1.2
 # END PLOT
@@ -117,8 +165,6 @@
 Title=$\log_{10}$(Integrated $1$ jet rate in $k_\perp$ [GeV])
 XLabel=$\log_{10}(d_{\text{cut}}/\text{GeV})$
 YLabel=$R_{1}$
-YMin=9e-6
-YMax=0.5
 Rebin=2
 # END PLOT
 
@@ -126,8 +172,6 @@
 Title=$\log_{10}$(Integrated $2$ jet rate in $k_\perp$ [GeV])
 XLabel=$\log_{10}(d_{\text{cut}}/\text{GeV})$
 YLabel=$R_{2}$
-YMin=9e-6
-YMax=0.5
 Rebin=2
 # END PLOT
 
@@ -135,8 +179,6 @@
 Title=$\log_{10}$(Integrated $3$ jet rate in $k_\perp$ [GeV])
 XLabel=$\log_{10}(d_{\text{cut}}/\text{GeV})$
 YLabel=$R_{3}$
-YMin=9e-6
-YMax=0.5
 Rebin=2
 # END PLOT
 
@@ -144,8 +186,6 @@
 Title=$\log_{10}$(Integrated $4$ jet rate in $k_\perp$ [GeV])
 XLabel=$\log_{10}(d_{\text{cut}}/\text{GeV})$
 YLabel=$R_{\geq4}$
-YMin=9e-6
-YMax=0.5
 Rebin=2
 # END PLOT
 
@@ -155,8 +195,6 @@
 YLabel=$\text{d}\sigma/\text{d}\log_{10}(d_{01})$
 LegendXPos=0.5
 LegendYPos=0.5
-YMin=9e-6
-YMax=3.0
 Rebin=2
 # END PLOT
 
@@ -166,8 +204,6 @@
 YLabel=$\text{d}\sigma/\text{d}\log_{10}(d_{12})$
 LegendXPos=0.5
 LegendYPos=0.5
-YMin=9e-6
-YMax=3.0
 Rebin=2
 # END PLOT
 
@@ -177,8 +213,6 @@
 YLabel=$\text{d}\sigma/\text{d}\log_{10}(d_{23})$
 LegendXPos=0.5
 LegendYPos=0.5
-YMin=9e-6
-YMax=3.0
 Rebin=2
 # END PLOT
 
@@ -188,8 +222,30 @@
 YLabel=$\text{d}\sigma/\text{d}\log_{10}(d_{34})$
 LegendXPos=0.5
 LegendYPos=0.5
-YMin=9e-6
-YMax=3.0
 Rebin=2
 # END PLOT
 
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_pT_1
+Title=
+XLabel=$p_\perp(\text{jet 1})$
+YLabel=$\text{d}\sigma/\text{d}p_\perp(\text{jet 1})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_pT_2
+Title=
+XLabel=$p_\perp(\text{jet 2})$
+YLabel=$\text{d}\sigma/\text{d}p_\perp(\text{jet 2})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_pT_3
+Title=
+XLabel=$p_\perp(\text{jet 3})$
+YLabel=$\text{d}\sigma/\text{d}p_\perp(\text{jet 3})$
+# END PLOT
+
+# BEGIN PLOT /MC_TVT1960_ZJETS/jet_pT_4
+Title=
+XLabel=$p_\perp(\text{jet 4})$
+YLabel=$\text{d}\sigma/\text{d}p_\perp(\text{jet 4})$
+# END PLOT
+

Modified: trunk/include/Rivet/Analyses/MC_TVT1960_ZJETS.hh
==============================================================================
--- trunk/include/Rivet/Analyses/MC_TVT1960_ZJETS.hh	Wed Aug 19 17:52:54 2009	(r1769)
+++ trunk/include/Rivet/Analyses/MC_TVT1960_ZJETS.hh	Wed Aug 19 21:22:40 2009	(r1770)
@@ -2,14 +2,14 @@
 #ifndef RIVET_MC_TVT1960_ZJETS_HH
 #define RIVET_MC_TVT1960_ZJETS_HH
 
-#include "Rivet/Analysis.hh"
+#include "Rivet/Analyses/MC_JetAnalysis.hh"
 
 namespace Rivet {
 
 
   /// @brief Monte Carlo validation observables for Z[e+ e-] + jets production at Tevatron Run II
   /// @author Frank Siegert
-  class MC_TVT1960_ZJETS : public Analysis {
+  class MC_TVT1960_ZJETS : public MC_JetAnalysis {
 
   public:
 
@@ -35,20 +35,12 @@
     /// @name Histograms
     //@{
     AIDA::IHistogram1D * _h_Z_mass;
-    AIDA::IHistogram1D * _h_jet1_pT;
-    AIDA::IHistogram1D * _h_jet2_pT;
-    AIDA::IHistogram1D * _h_jet3_pT;
-    AIDA::IHistogram1D * _h_jet4_pT;
-    AIDA::IHistogram1D * _h_jet20_multi_exclusive;
-    AIDA::IHistogram1D * _h_jet20_multi_inclusive;
-    AIDA::IDataPointSet * _h_jet20_multi_ratio;
-    AIDA::IHistogram1D * _h_jet10_multi_exclusive;
-    AIDA::IHistogram1D * _h_jet10_multi_inclusive;
-    AIDA::IDataPointSet * _h_jet10_multi_ratio;
-    AIDA::IHistogram1D * _h_deta_Z_jet1;
-    AIDA::IHistogram1D * _h_dR_jet2_jet3;
-    AIDA::IHistogram1D * _h_log10_d[4];
-    AIDA::IDataPointSet * _h_log10_R[5];
+    AIDA::IHistogram1D * _h_Z_pT;
+    AIDA::IHistogram1D * _h_Z_y;
+    AIDA::IHistogram1D * _h_Z_jet1_deta;
+    AIDA::IHistogram1D * _h_Z_jet1_dR;
+    AIDA::IHistogram1D * _h_lepton_pT;
+    AIDA::IHistogram1D * _h_lepton_eta;
     //@}
 
   };

Modified: trunk/src/Analyses/MC_JetAnalysis.cc
==============================================================================
--- trunk/src/Analyses/MC_JetAnalysis.cc	Wed Aug 19 17:52:54 2009	(r1769)
+++ trunk/src/Analyses/MC_JetAnalysis.cc	Wed Aug 19 21:22:40 2009	(r1770)
@@ -31,24 +31,24 @@
       _h_log10_R[i] = bookDataPointSet(Rname.str(), 50, 0.2, 2.6);
       
       stringstream pTname;
-      pTname<<"pT_jet_"<<i;
+      pTname<<"jet_pT_"<<i+1;
       double pTmax = 1.0/(double(i)+2.0)*m_sqrts/2.0;
       int nbins = 100/(i+1);
       _h_pT_jet[i] = bookHistogram1D(pTname.str(), nbins, 0.0, pTmax);
       
       stringstream etaname;
-      etaname<<"eta_jet_"<<i;
+      etaname<<"jet_eta_"<<i+1;
       _h_eta_jet[i] = bookHistogram1D(etaname.str(), 50, -5.0, 5.0);
       
       for (size_t j=i+1; j<m_njet; ++j) {
         std::pair<size_t, size_t> ij(std::make_pair(i, j));
         
         stringstream detaname;
-        detaname<<"deta_jets_"<<i<<j;
+        detaname<<"jets_deta_"<<i+1<<j+1;
         _h_deta_jets.insert(make_pair(ij, bookHistogram1D(detaname.str(), 50, -5.0, 5.0)));
         
         stringstream dRname;
-        dRname<<"dR_jets_"<<i<<j;
+        dRname<<"jets_dR_"<<i+1<<j+1;
         _h_dR_jets.insert(make_pair(ij, bookHistogram1D(dRname.str(), 25, 0.0, 5.0)));
       }
     }
@@ -151,16 +151,12 @@
     int Nbins=_h_jet_multi_inclusive->axis().bins();
     std::vector<double> ratio(Nbins-1, 0.0);
     std::vector<double> err(Nbins-1, 0.0);
-    std::cout<<"Nbins="<<Nbins<<std::endl;
-    std::cout<<"m_njet+2="<<m_njet+2<<std::endl;
     for (int i=0; i<Nbins-1; ++i) {
-      std::cout<<"i="<<i<<std::endl;
       if (_h_jet_multi_inclusive->binHeight(i)>0.0 && _h_jet_multi_inclusive->binHeight(i+1)>0.0) {
         ratio[i]=_h_jet_multi_inclusive->binHeight(i+1)/_h_jet_multi_inclusive->binHeight(i);
         double relerr_i=_h_jet_multi_inclusive->binError(i)/_h_jet_multi_inclusive->binHeight(i);
         double relerr_j=_h_jet_multi_inclusive->binError(i+1)/_h_jet_multi_inclusive->binHeight(i+1);
         err[i]=ratio[i]*(relerr_i+relerr_j);
-        std::cout<<"ratio[i]="<<ratio[i]<<std::endl;
       }
     }
     _h_jet_multi_ratio->setCoordinate(1, ratio, err);

Modified: trunk/src/Analyses/MC_TVT1960_ZJETS.cc
==============================================================================
--- trunk/src/Analyses/MC_TVT1960_ZJETS.cc	Wed Aug 19 17:52:54 2009	(r1769)
+++ trunk/src/Analyses/MC_TVT1960_ZJETS.cc	Wed Aug 19 21:22:40 2009	(r1770)
@@ -9,43 +9,30 @@
 
 
   MC_TVT1960_ZJETS::MC_TVT1960_ZJETS()
-    : Analysis("MC_TVT1960_ZJETS")
+    : MC_JetAnalysis("MC_TVT1960_ZJETS", 1960.0, 4, "Jets")
   {
     setBeams(PROTON, ANTIPROTON);
+    setNeedsCrossSection(true);
     
-    ZFinder zfinder(-2.5, 2.5, 25.0*GeV, ELECTRON, 65.0*GeV, 115.0*GeV, 0.2);
+    ZFinder zfinder(-3.5, 3.5, 25.0*GeV, ELECTRON, 65.0*GeV, 115.0*GeV, 0.2);
     addProjection(zfinder, "ZFinder");
-    FastJets jetpro(zfinder.remainingFinalState(), FastJets::KT, 0.7);
+    FastJets jetpro(zfinder.remainingFinalState(), FastJets::KT, 0.7, 20.0*GeV);
     addProjection(jetpro, "Jets");
-  } 
+  }
 
 
 
   // Book histograms
   void MC_TVT1960_ZJETS::init() {
     _h_Z_mass = bookHistogram1D("Z_mass", 50, 66.0, 116.0);
-    _h_jet1_pT = bookHistogram1D("jet1_pT", 50, 0.0, 500.0);
-    _h_jet2_pT = bookHistogram1D("jet2_pT", 30, 0.0, 300.0);
-    _h_jet3_pT = bookHistogram1D("jet3_pT", 20, 0.0, 200.0);
-    _h_jet4_pT = bookHistogram1D("jet4_pT", 10, 0.0, 100.0);
-    _h_jet20_multi_exclusive = bookHistogram1D("jet20_multi_exclusive", 10, -0.5, 9.5);
-    _h_jet20_multi_inclusive = bookHistogram1D("jet20_multi_inclusive", 10, -0.5, 9.5);
-    _h_jet20_multi_ratio = bookDataPointSet("jet20_multi_ratio", 9, 0.5, 9.5);
-    _h_jet10_multi_exclusive = bookHistogram1D("jet10_multi_exclusive", 10, -0.5, 9.5);
-    _h_jet10_multi_inclusive = bookHistogram1D("jet10_multi_inclusive", 10, -0.5, 9.5);
-    _h_jet10_multi_ratio = bookDataPointSet("jet10_multi_ratio", 9, 0.5, 9.5);
-    _h_deta_Z_jet1 = bookHistogram1D("deta_Z_jet2", 20, 0.0, 5.0);
-    _h_dR_jet2_jet3 = bookHistogram1D("dR_jet2_jet3", 20, 0.0, 5.0);
-    for (size_t i=0; i<4; ++i) {
-      stringstream name;
-      name<<"log10_d_"<<i<<i+1;
-      _h_log10_d[i] = bookHistogram1D(name.str(), 50, 0.2, 2.6);
-    }
-    for (size_t i=0; i<5; ++i) {
-      stringstream name;
-      name<<"log10_R_"<<i;
-      _h_log10_R[i] = bookDataPointSet(name.str(), 50, 0.2, 2.6);
-    }
+    _h_Z_pT = bookHistogram1D("Z_pT", 100, 0.0, 500.0);
+    _h_Z_y = bookHistogram1D("Z_y", 40, -4.0, 4.0);
+    _h_Z_jet1_deta = bookHistogram1D("Z_jet1_deta", 50, -5.0, 5.0);
+    _h_Z_jet1_dR = bookHistogram1D("Z_jet1_dR", 25, 0.5, 7.0);
+    _h_lepton_pT = bookHistogram1D("lepton_pT", 100, 0.0, 500.0);
+    _h_lepton_eta = bookHistogram1D("lepton_eta", 40, -4.0, 4.0);
+    
+    MC_JetAnalysis::init();
   }
 
 
@@ -58,209 +45,38 @@
     if (zfinder.particles().size()!=1) {
       vetoEvent;
     }
-    const FastJets& jetpro = applyProjection<FastJets>(e, "Jets");
-
-    // jet resolutions and integrated jet rates
-    const fastjet::ClusterSequence* seq = jetpro.clusterSeq();
-    if (seq!=NULL) {
-      double d_01=log10(sqrt(seq->exclusive_dmerge_max(0)));
-      double d_12=log10(sqrt(seq->exclusive_dmerge_max(1)));
-      double d_23=log10(sqrt(seq->exclusive_dmerge_max(2)));
-      double d_34=log10(sqrt(seq->exclusive_dmerge_max(3)));
-
-      _h_log10_d[0]->fill(d_01, weight);
-      _h_log10_d[1]->fill(d_12, weight);
-      _h_log10_d[2]->fill(d_23, weight);
-      _h_log10_d[3]->fill(d_34, weight);
-
-      /// @todo: can't this be calculated in the finalize method?
-      for (int i=0; i<_h_log10_R[0]->size(); ++i) {
-        IDataPoint* dp=_h_log10_R[0]->point(i);
-        if (d_01 < dp->coordinate(0)->value()) {
-          dp->coordinate(1)->setValue(dp->coordinate(1)->value()+weight);
-        }
-      }
-      for (int i=0; i<_h_log10_R[1]->size(); ++i) {
-        IDataPoint* dp=_h_log10_R[1]->point(i);
-        double dcut=dp->coordinate(0)->value();
-        if (d_12<dcut && d_01>dcut) {
-          dp->coordinate(1)->setValue(dp->coordinate(1)->value()+weight);
-        }
-      }
-      for (int i=0; i<_h_log10_R[2]->size(); ++i) {
-        IDataPoint* dp=_h_log10_R[2]->point(i);
-        double dcut=dp->coordinate(0)->value();
-        if (d_23<dcut && d_12>dcut) {
-          dp->coordinate(1)->setValue(dp->coordinate(1)->value()+weight);
-        }
-      }
-      for (int i=0; i<_h_log10_R[3]->size(); ++i) {
-        IDataPoint* dp=_h_log10_R[3]->point(i);
-        double dcut=dp->coordinate(0)->value();
-        if (d_34<dcut && d_23>dcut) {
-          dp->coordinate(1)->setValue(dp->coordinate(1)->value()+weight);
-        }
-      }
-      for (int i=0; i<_h_log10_R[4]->size(); ++i) {
-        IDataPoint* dp=_h_log10_R[4]->point(i);
-        double dcut=dp->coordinate(0)->value();
-        if (d_34>dcut) {
-          dp->coordinate(1)->setValue(dp->coordinate(1)->value()+weight);
-        }
-      }
-    }
-
-    const Jets& jets = jetpro.jetsByPt(20.0*GeV);
-    Jets jets_cut;
-    foreach (const Jet& j, jets) {
-      if (fabs(j.momentum().pseudorapidity()) < 2.0) {
-        jets_cut.push_back(j);
-      }
-    }
-    
-    // fill jet multi
-    _h_jet20_multi_exclusive->fill(jets_cut.size(), weight);
-    _h_jet20_multi_inclusive->fill(0, weight);
 
     FourMomentum zmom(zfinder.particles()[0].momentum());
     _h_Z_mass->fill(zmom.mass(),weight);
-    if (jets_cut.size()>0) {
-      _h_jet1_pT->fill(jets_cut[0].momentum().pT(), weight);
-      double deta=fabs(zmom.pseudorapidity()-jets_cut[0].momentum().pseudorapidity());
-      _h_deta_Z_jet1->fill(deta, weight);
-      _h_jet20_multi_inclusive->fill(1, weight);
+    _h_Z_pT->fill(zmom.pT(),weight);
+    _h_Z_y->fill(zmom.rapidity(),weight);
+    foreach (const Particle& l, zfinder.constituentsFinalState().particles()) {
+      _h_lepton_pT->fill(l.momentum().pT(), weight);
+      _h_lepton_eta->fill(l.momentum().eta(), weight);
     }
-    if (jets_cut.size()>1) {
-      _h_jet2_pT->fill(jets_cut[1].momentum().pT(), weight);
-      _h_jet20_multi_inclusive->fill(2, weight);
-    }
-    if (jets_cut.size()>2) {
-      _h_jet3_pT->fill(jets_cut[2].momentum().pT(), weight);
-      double dR23=deltaR(jets_cut[1].momentum().pseudorapidity(), jets_cut[1].momentum().azimuthalAngle(),
-                         jets_cut[2].momentum().pseudorapidity(), jets_cut[2].momentum().azimuthalAngle());
-      _h_dR_jet2_jet3->fill(dR23, weight);
-      _h_jet20_multi_inclusive->fill(3, weight);
-    }
-    if (jets_cut.size()>3) {
-      _h_jet4_pT->fill(jets_cut[3].momentum().pT(), weight);
-      _h_jet20_multi_inclusive->fill(4, weight);
-    }
-    if (jets_cut.size()>4) {
-      _h_jet20_multi_inclusive->fill(5, weight);
-    }
-    if (jets_cut.size()>5) {
-      _h_jet20_multi_inclusive->fill(6, weight);
-    }
-    if (jets_cut.size()>6) {
-      _h_jet20_multi_inclusive->fill(7, weight);
-    }
-    if (jets_cut.size()>7) {
-      _h_jet20_multi_inclusive->fill(8, weight);
-    }
-    if (jets_cut.size()>8) {
-      _h_jet20_multi_inclusive->fill(9, weight);
-    }
-    if (jets_cut.size()>9) {
-      _h_jet20_multi_inclusive->fill(10, weight); // for overflow
-    }
-
-    // do the multis also for jets > 10 GeV
-    const Jets& jets10 = jetpro.jetsByPt(10.0*GeV);
-    Jets jets10_cut;
-    foreach (const Jet& j, jets10) {
-      if (fabs(j.momentum().pseudorapidity()) < 2.0) {
-        jets10_cut.push_back(j);
-      }
+    
+    const FastJets& jetpro = applyProjection<FastJets>(e, "Jets");
+    const Jets& jets = jetpro.jetsByPt(20.0*GeV);
+    if (jets.size()>0) {
+      _h_Z_jet1_deta->fill(zmom.eta()-jets[0].momentum().eta(), weight);
+      _h_Z_jet1_dR->fill(deltaR(zmom, jets[0].momentum()), weight);
     }
 
-    // fill jet multi
-    _h_jet10_multi_exclusive->fill(jets10_cut.size(), weight);
-    _h_jet10_multi_inclusive->fill(0, weight);
-
-    if (jets10_cut.size()>0) {
-      _h_jet10_multi_inclusive->fill(1, weight);
-    }
-    if (jets10_cut.size()>1) {
-      _h_jet10_multi_inclusive->fill(2, weight);
-    }
-    if (jets10_cut.size()>2) {
-      _h_jet10_multi_inclusive->fill(3, weight);
-    }
-    if (jets10_cut.size()>3) {
-      _h_jet10_multi_inclusive->fill(4, weight);
-    }
-    if (jets10_cut.size()>4) {
-      _h_jet10_multi_inclusive->fill(5, weight);
-    }
-    if (jets10_cut.size()>5) {
-      _h_jet10_multi_inclusive->fill(6, weight);
-    }
-    if (jets10_cut.size()>6) {
-      _h_jet10_multi_inclusive->fill(7, weight);
-    }
-    if (jets10_cut.size()>7) {
-      _h_jet10_multi_inclusive->fill(8, weight);
-    }
-    if (jets10_cut.size()>8) {
-      _h_jet10_multi_inclusive->fill(9, weight);
-    }
-    if (jets10_cut.size()>9) {
-      _h_jet10_multi_inclusive->fill(10, weight);
-    }
+    MC_JetAnalysis::analyze(e);
   }
 
 
   // Finalize
   void MC_TVT1960_ZJETS::finalize() {
-    normalize(_h_Z_mass,1.0);
-    normalize(_h_jet1_pT,1.0);
-    normalize(_h_jet2_pT,1.0);
-    normalize(_h_jet3_pT,1.0);
-    normalize(_h_jet4_pT,1.0);
-
-    normalize(_h_deta_Z_jet1,1.0);
-    normalize(_h_dR_jet2_jet3,1.0);
-    for (size_t i=0; i<4; ++i) {
-      scale(_h_log10_d[i],1.0/sumOfWeights());
-    }
-    for (size_t n=0; n<5; ++n) {
-      /// scale integrated jet rates to 1
-      for (int i=0; i<_h_log10_R[n]->size(); ++i) {
-        IDataPoint* dp=_h_log10_R[n]->point(i);
-        dp->coordinate(1)->setValue(dp->coordinate(1)->value()*1.0/sumOfWeights());
-      }
-    }
-
-    // fill inclusive jet multi ratio
-    int Nbins=_h_jet20_multi_inclusive->axis().bins();
-    std::vector<double> ratio(Nbins-1, 0.0);
-    std::vector<double> err(Nbins-1, 0.0);
-    for (int i=0; i<Nbins-1; ++i) {
-      if (_h_jet20_multi_inclusive->binHeight(i)>0.0 && _h_jet20_multi_inclusive->binHeight(i+1)>0.0) {
-        ratio[i]=_h_jet20_multi_inclusive->binHeight(i+1)/_h_jet20_multi_inclusive->binHeight(i);
-        double relerr_i=_h_jet20_multi_inclusive->binError(i)/_h_jet20_multi_inclusive->binHeight(i);
-        double relerr_j=_h_jet20_multi_inclusive->binError(i+1)/_h_jet20_multi_inclusive->binHeight(i+1);
-        err[i]=ratio[i]*(relerr_i+relerr_j);
-      }
-    }
-    _h_jet20_multi_ratio->setCoordinate(1, ratio, err);
-
-    // fill inclusive jet10 multi ratio
-    for (int i=0; i<Nbins-1; ++i) {
-      if (_h_jet10_multi_inclusive->binHeight(i)>0.0 && _h_jet10_multi_inclusive->binHeight(i+1)>0.0) {
-        ratio[i]=_h_jet10_multi_inclusive->binHeight(i+1)/_h_jet10_multi_inclusive->binHeight(i);
-        double relerr_i=_h_jet10_multi_inclusive->binError(i)/_h_jet10_multi_inclusive->binHeight(i);
-        double relerr_j=_h_jet10_multi_inclusive->binError(i+1)/_h_jet10_multi_inclusive->binHeight(i+1);
-        err[i]=ratio[i]*(relerr_i+relerr_j);
-      }
-    }
-    _h_jet10_multi_ratio->setCoordinate(1, ratio, err);
-
-    // scale exclusive and inclusive jet_multi to first bin = 1.0
-    scale(_h_jet20_multi_exclusive, 1.0/_h_jet20_multi_exclusive->binHeight(0));
-    scale(_h_jet20_multi_inclusive, 1.0/_h_jet20_multi_inclusive->binHeight(0));
-    scale(_h_jet10_multi_exclusive, 1.0/_h_jet10_multi_exclusive->binHeight(0));
-    scale(_h_jet10_multi_inclusive, 1.0/_h_jet10_multi_inclusive->binHeight(0));
+    scale(_h_Z_mass, crossSection()/sumOfWeights());
+    scale(_h_Z_pT, crossSection()/sumOfWeights());
+    scale(_h_Z_y, crossSection()/sumOfWeights());
+    scale(_h_Z_jet1_deta, crossSection()/sumOfWeights());
+    scale(_h_Z_jet1_dR, crossSection()/sumOfWeights());
+    scale(_h_lepton_pT, crossSection()/sumOfWeights());
+    scale(_h_lepton_eta, crossSection()/sumOfWeights());
+    
+    MC_JetAnalysis::finalize();
   }
 
 }


More information about the Rivet-svn mailing list