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);
00034       addProjection(zfinder, "ZFinder");
00035 
00036       FastJets conefinder(zfinder.remainingFinalState(), FastJets::D0ILCONE, 0.5);
00037       addProjection(conefinder, "ConeFinder");
00038 
00039       _h_jet_pT_cross_section = bookHistogram1D(1, 1, 1);
00040       _h_jet_y_cross_section = bookHistogram1D(2, 1, 1);
00041       _h_Z_pT_cross_section = bookHistogram1D(3, 1, 1);
00042       _h_Z_y_cross_section = bookHistogram1D(4, 1, 1);
00043       _h_total_cross_section = bookHistogram1D(5, 1, 1);
00044     }
00045 
00046 
00047 
00048     // Do the analysis
00049     void analyze(const Event& e) {
00050       const double weight = e.weight();
00051 
00052       const ZFinder& zfinder = applyProjection<ZFinder>(e, "ZFinder");
00053       if (zfinder.particles().size()==1) {
00054         const JetAlg& jetpro = applyProjection<JetAlg>(e, "ConeFinder");
00055         const Jets& jets = jetpro.jetsByPt(20.0*GeV);
00056         Jets jets_cut;
00057         foreach (const Jet& j, jets) {
00058           if (fabs(j.momentum().pseudorapidity()) < 2.8) {
00059             jets_cut.push_back(j);
00060           }
00061         }
00062 
00063         // Return if there are no jets:
00064         if(jets_cut.size()<1) {
00065           getLog() << Log::DEBUG << "Skipping event " << e.genEvent().event_number()
00066                    << " because no jets pass cuts " << endl;
00067           vetoEvent;
00068         }
00069 
00070         // cut on Delta R between jet and muons
00071         foreach (const Jet& j, jets_cut) {
00072           foreach (const Particle& mu, zfinder.constituentsFinalState().particles()) {
00073             if (deltaR(mu.momentum().pseudorapidity(), mu.momentum().azimuthalAngle(),
00074                        j.momentum().pseudorapidity(), j.momentum().azimuthalAngle()) < 0.5) {
00075               vetoEvent;
00076             }
00077           }
00078         }
00079 
00080         const FourMomentum Zmom = zfinder.particles()[0].momentum();
00081 
00082         // In jet pT
00083         _h_jet_pT_cross_section->fill( jets_cut[0].momentum().pT(), weight);
00084         _h_jet_y_cross_section->fill( fabs(jets_cut[0].momentum().rapidity()), weight);
00085 
00086         // In Z pT
00087         _h_Z_pT_cross_section->fill(Zmom.pT(), weight);
00088         _h_Z_y_cross_section->fill(fabs(Zmom.rapidity()), weight);
00089 
00090         _h_total_cross_section->fill(1960.0, weight);
00091       }
00092     }
00093 
00094 
00095 
00096     /// Finalize
00097     void finalize() {
00098       const double invlumi = crossSection()/sumOfWeights();
00099       scale(_h_total_cross_section, invlumi);
00100       scale(_h_jet_pT_cross_section, invlumi);
00101       scale(_h_jet_y_cross_section, invlumi);
00102       scale(_h_Z_pT_cross_section, invlumi);
00103       scale(_h_Z_y_cross_section, invlumi);
00104     }
00105 
00106     //@}
00107 
00108 
00109   private:
00110 
00111     /// @name Histograms
00112     //@{
00113     AIDA::IHistogram1D * _h_jet_pT_cross_section;
00114     AIDA::IHistogram1D * _h_jet_y_cross_section;
00115     AIDA::IHistogram1D * _h_Z_pT_cross_section;
00116     AIDA::IHistogram1D * _h_Z_y_cross_section;
00117     AIDA::IHistogram1D * _h_total_cross_section;
00118     //@}
00119 
00120   };
00121 
00122 
00123 
00124   // This global object acts as a hook for the plugin system
00125   AnalysisBuilder<D0_2008_S7863608> plugin_D0_2008_S7863608;
00126 
00127 }