rivet is hosted by Hepforge, IPPP Durham
D0_2008_S7863608.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/ZFinder.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   /// @brief D0 differential Z/\f$ \gamma^* \f$ + jet + \f$ X \f$ cross sections
00010   /// @author Gavin Hesketh, Andy Buckley, Frank Siegert
00011   class D0_2008_S7863608 : public Analysis {
00012   public:
00013 
00014     /// @name Construction
00015     //@{
00016     /// Constructor
00017     D0_2008_S7863608()
00018       : Analysis("D0_2008_S7863608")
00019     {    }
00020 
00021     //@}
00022 
00023 
00024     /// @name Analysis methods
00025     //@{
00026 
00027     /// Book histograms
00028     void init() {
00029       FinalState fs;
00030       ZFinder zfinder(fs, -1.7, 1.7, 15.0*GeV, PID::MUON, 65.0*GeV, 115.0*GeV, 0.2, false, true);
00031       addProjection(zfinder, "ZFinder");
00032 
00033       FastJets conefinder(zfinder.remainingFinalState(), FastJets::D0ILCONE, 0.5);
00034       addProjection(conefinder, "ConeFinder");
00035 
00036       _sum_of_weights_inclusive=0.0;
00037 
00038       _h_jet_pT_cross_section = bookHisto1D(1, 1, 1);
00039       _h_jet_pT_normalised = bookHisto1D(1, 1, 2);
00040       _h_jet_y_cross_section = bookHisto1D(2, 1, 1);
00041       _h_jet_y_normalised = bookHisto1D(2, 1, 2);
00042       _h_Z_pT_cross_section = bookHisto1D(3, 1, 1);
00043       _h_Z_pT_normalised = bookHisto1D(3, 1, 2);
00044       _h_Z_y_cross_section = bookHisto1D(4, 1, 1);
00045       _h_Z_y_normalised = bookHisto1D(4, 1, 2);
00046       _h_total_cross_section = bookHisto1D(5, 1, 1);
00047     }
00048 
00049 
00050 
00051     // Do the analysis
00052     void analyze(const Event& e) {
00053       const double weight = e.weight();
00054 
00055       const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder");
00056       if (zfinder.bosons().size()==1) {
00057         _sum_of_weights_inclusive += weight;
00058         const JetAlg& jetpro = applyProjection<JetAlg>(e, "ConeFinder");
00059         const Jets& jets = jetpro.jetsByPt(20.0*GeV);
00060         Jets jets_cut;
00061         foreach (const Jet& j, jets) {
00062           if (fabs(j.momentum().pseudorapidity()) < 2.8) {
00063             jets_cut.push_back(j);
00064           }
00065         }
00066 
00067         // Return if there are no jets:
00068         if(jets_cut.size()<1) {
00069           MSG_DEBUG("Skipping event " << numEvents() << " because no jets pass cuts ");
00070           vetoEvent;
00071         }
00072 
00073         const FourMomentum Zmom = zfinder.bosons()[0].momentum();
00074 
00075         // In jet pT
00076         _h_jet_pT_cross_section->fill( jets_cut[0].pT(), weight);
00077         _h_jet_pT_normalised->fill( jets_cut[0].pT(), weight);
00078         _h_jet_y_cross_section->fill( fabs(jets_cut[0].rapidity()), weight);
00079         _h_jet_y_normalised->fill( fabs(jets_cut[0].rapidity()), weight);
00080 
00081         // In Z pT
00082         _h_Z_pT_cross_section->fill(Zmom.pT(), weight);
00083         _h_Z_pT_normalised->fill(Zmom.pT(), weight);
00084         _h_Z_y_cross_section->fill(fabs(Zmom.rapidity()), weight);
00085         _h_Z_y_normalised->fill(fabs(Zmom.rapidity()), weight);
00086 
00087         _h_total_cross_section->fill(1960.0, weight);
00088       }
00089     }
00090 
00091 
00092 
00093     /// Finalize
00094     void finalize() {
00095       const double invlumi = crossSection()/sumOfWeights();
00096       scale(_h_total_cross_section, invlumi);
00097       scale(_h_jet_pT_cross_section, invlumi);
00098       scale(_h_jet_y_cross_section, invlumi);
00099       scale(_h_Z_pT_cross_section, invlumi);
00100       scale(_h_Z_y_cross_section, invlumi);
00101 
00102       double factor=1.0/_sum_of_weights_inclusive;
00103       if (_sum_of_weights_inclusive==0.0) factor=0.0;
00104       scale(_h_jet_pT_normalised, factor);
00105       scale(_h_jet_y_normalised, factor);
00106       scale(_h_Z_pT_normalised, factor);
00107       scale(_h_Z_y_normalised, factor);
00108     }
00109 
00110     //@}
00111 
00112 
00113   private:
00114 
00115     /// @name Histograms
00116     //@{
00117     Histo1DPtr _h_jet_pT_cross_section;
00118     Histo1DPtr _h_jet_y_cross_section;
00119     Histo1DPtr _h_Z_pT_cross_section;
00120     Histo1DPtr _h_Z_y_cross_section;
00121     Histo1DPtr _h_total_cross_section;
00122     Histo1DPtr _h_jet_pT_normalised;
00123     Histo1DPtr _h_jet_y_normalised;
00124     Histo1DPtr _h_Z_pT_normalised;
00125     Histo1DPtr _h_Z_y_normalised;
00126     //@}
00127 
00128     double _sum_of_weights_inclusive;
00129 
00130   };
00131 
00132 
00133 
00134   // The hook for the plugin system
00135   DECLARE_RIVET_PLUGIN(D0_2008_S7863608);
00136 
00137 }