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     /// Constructor
00015     D0_2008_S7863608()
00016       : Analysis("D0_2008_S7863608")
00017     {    }
00018 
00019 
00020     /// @name Analysis methods
00021     //@{
00022 
00023     /// Book histograms
00024     void init() {
00025       /// @todo These clustering arguments look odd: are they ok?
00026       ZFinder zfinder(FinalState(), -1.7, 1.7, 15*GeV, PID::MUON, 65*GeV, 115*GeV, 0.2, ZFinder::NOCLUSTER, ZFinder::TRACK);
00027       addProjection(zfinder, "ZFinder");
00028 
00029       FastJets conefinder(zfinder.remainingFinalState(), FastJets::D0ILCONE, 0.5);
00030       addProjection(conefinder, "ConeFinder");
00031 
00032       _sum_of_weights_inclusive = 0;
00033 
00034       _h_jet_pT_cross_section = bookHisto1D(1, 1, 1);
00035       _h_jet_pT_normalised = bookHisto1D(1, 1, 2);
00036       _h_jet_y_cross_section = bookHisto1D(2, 1, 1);
00037       _h_jet_y_normalised = bookHisto1D(2, 1, 2);
00038       _h_Z_pT_cross_section = bookHisto1D(3, 1, 1);
00039       _h_Z_pT_normalised = bookHisto1D(3, 1, 2);
00040       _h_Z_y_cross_section = bookHisto1D(4, 1, 1);
00041       _h_Z_y_normalised = bookHisto1D(4, 1, 2);
00042       _h_total_cross_section = bookHisto1D(5, 1, 1);
00043     }
00044 
00045 
00046     // Do the analysis
00047     void analyze(const Event& e) {
00048       const double weight = e.weight();
00049 
00050       const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder");
00051       if (zfinder.bosons().size()==1) {
00052         _sum_of_weights_inclusive += weight;
00053         const JetAlg& jetpro = applyProjection<JetAlg>(e, "ConeFinder");
00054         const Jets& jets = jetpro.jetsByPt(20*GeV);
00055         Jets jets_cut;
00056         foreach (const Jet& j, jets) {
00057           if (fabs(j.momentum().pseudorapidity()) < 2.8) {
00058             jets_cut.push_back(j);
00059           }
00060         }
00061 
00062         // Return if there are no jets:
00063         if(jets_cut.size()<1) {
00064           MSG_DEBUG("Skipping event " << numEvents() << " because no jets pass cuts ");
00065           vetoEvent;
00066         }
00067 
00068         const FourMomentum Zmom = zfinder.bosons()[0].momentum();
00069 
00070         // In jet pT
00071         _h_jet_pT_cross_section->fill( jets_cut[0].pT(), weight);
00072         _h_jet_pT_normalised->fill( jets_cut[0].pT(), weight);
00073         _h_jet_y_cross_section->fill( fabs(jets_cut[0].rapidity()), weight);
00074         _h_jet_y_normalised->fill( fabs(jets_cut[0].rapidity()), weight);
00075 
00076         // In Z pT
00077         _h_Z_pT_cross_section->fill(Zmom.pT(), weight);
00078         _h_Z_pT_normalised->fill(Zmom.pT(), weight);
00079         _h_Z_y_cross_section->fill(fabs(Zmom.rapidity()), weight);
00080         _h_Z_y_normalised->fill(fabs(Zmom.rapidity()), weight);
00081 
00082         _h_total_cross_section->fill(1960, weight);
00083       }
00084     }
00085 
00086 
00087     /// Finalize
00088     void finalize() {
00089       const double invlumi = crossSection()/sumOfWeights();
00090       scale(_h_total_cross_section, invlumi);
00091       scale(_h_jet_pT_cross_section, invlumi);
00092       scale(_h_jet_y_cross_section, invlumi);
00093       scale(_h_Z_pT_cross_section, invlumi);
00094       scale(_h_Z_y_cross_section, invlumi);
00095 
00096       double factor=1/_sum_of_weights_inclusive;
00097       if (_sum_of_weights_inclusive == 0) factor = 0;
00098       scale(_h_jet_pT_normalised, factor);
00099       scale(_h_jet_y_normalised, factor);
00100       scale(_h_Z_pT_normalised, factor);
00101       scale(_h_Z_y_normalised, factor);
00102     }
00103 
00104     //@}
00105 
00106 
00107   private:
00108 
00109     /// @name Histograms
00110     //@{
00111     Histo1DPtr _h_jet_pT_cross_section;
00112     Histo1DPtr _h_jet_y_cross_section;
00113     Histo1DPtr _h_Z_pT_cross_section;
00114     Histo1DPtr _h_Z_y_cross_section;
00115     Histo1DPtr _h_total_cross_section;
00116     Histo1DPtr _h_jet_pT_normalised;
00117     Histo1DPtr _h_jet_y_normalised;
00118     Histo1DPtr _h_Z_pT_normalised;
00119     Histo1DPtr _h_Z_y_normalised;
00120     //@}
00121 
00122     double _sum_of_weights_inclusive;
00123 
00124   };
00125 
00126 
00127 
00128   // The hook for the plugin system
00129   DECLARE_RIVET_PLUGIN(D0_2008_S7863608);
00130 
00131 }