D0_2008_S7863608.cc

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