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