rivet is hosted by Hepforge, IPPP Durham
STAR_2006_S6870392.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   /// @brief STAR inclusive jet cross-section in pp at 200 GeV
00010   class STAR_2006_S6870392 : public Analysis {
00011   public:
00012 
00013     /// Constructor
00014     STAR_2006_S6870392()
00015       : Analysis("STAR_2006_S6870392")
00016     {    }
00017 
00018 
00019     /// @name Analysis methods
00020     //@{
00021 
00022     /// Book projections and histograms
00023     void init() {
00024       FinalState fs(-2.0, 2.0);
00025       addProjection(fs, "FS");
00026       addProjection(FastJets(fs, FastJets::CDFMIDPOINT, 0.4, JetAlg::ALL_MUONS, JetAlg::NO_INVISIBLES, 0.5), "MidpointJets");
00027 
00028       _h_jet_pT_MB = bookHisto1D(1, 1, 1);
00029       _h_jet_pT_HT = bookHisto1D(2, 1, 1);
00030     }
00031 
00032 
00033     /// Do the analysis
00034     void analyze(const Event& event) {
00035       const double weight = event.weight();
00036 
00037       // Skip if the event is empty
00038       const FinalState& fs = applyProjection<FinalState>(event, "FS");
00039       if (fs.empty()) {
00040         MSG_DEBUG("Skipping event " << numEvents() << " because no final state found ");
00041         vetoEvent;
00042       }
00043 
00044       // Find jets
00045       const FastJets& jetpro = applyProjection<FastJets>(event, "MidpointJets");
00046       const Jets& jets = jetpro.jetsByPt();
00047       if (!jets.empty()) {
00048         const Jet& j1 = jets.front();
00049         if (inRange(fabs(j1.eta()), 0.2, 0.8)) {
00050           foreach (const Jet& j, jets) {
00051             const FourMomentum pj = j.momentum();
00052             _h_jet_pT_MB->fill(pj.pT(), weight);
00053             _h_jet_pT_HT->fill(pj.pT(), weight);
00054           }
00055         }
00056       }
00057     }
00058 
00059 
00060 
00061     /// Finalize
00062     void finalize() {
00063       double normalisation = crossSection()/picobarn/sumOfWeights()/(2*0.6*2*M_PI);
00064       scale(_h_jet_pT_MB, normalisation);
00065       scale(_h_jet_pT_HT, normalisation);
00066     }
00067 
00068     //@}
00069 
00070 
00071   private:
00072 
00073     /// @name Histograms
00074     //@{
00075     Histo1DPtr _h_jet_pT_MB;
00076     Histo1DPtr _h_jet_pT_HT;
00077     //@}
00078 
00079   };
00080 
00081 
00082 
00083   // The hook for the plugin system
00084   DECLARE_RIVET_PLUGIN(STAR_2006_S6870392);
00085 
00086 }