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