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       declare(fs, "FS");
00026       declare(FastJets(fs, FastJets::CDFMIDPOINT, 0.4,
00027                              JetAlg::ALL_MUONS, JetAlg::NO_INVISIBLES,
00028                              nullptr, 0.5), "MidpointJets");
00029 
00030       _h_jet_pT_MB = bookHisto1D(1, 1, 1);
00031       _h_jet_pT_HT = bookHisto1D(2, 1, 1);
00032     }
00033 
00034 
00035     /// Do the analysis
00036     void analyze(const Event& event) {
00037       const double weight = event.weight();
00038 
00039       // Skip if the event is empty
00040       const FinalState& fs = apply<FinalState>(event, "FS");
00041       if (fs.empty()) {
00042         MSG_DEBUG("Skipping event " << numEvents() << " because no final state found ");
00043         vetoEvent;
00044       }
00045 
00046       // Find jets
00047       const FastJets& jetpro = apply<FastJets>(event, "MidpointJets");
00048       const Jets& jets = jetpro.jetsByPt();
00049       if (!jets.empty()) {
00050         const Jet& j1 = jets.front();
00051         if (inRange(fabs(j1.eta()), 0.2, 0.8)) {
00052           foreach (const Jet& j, jets) {
00053             const FourMomentum pj = j.momentum();
00054             _h_jet_pT_MB->fill(pj.pT(), weight);
00055             _h_jet_pT_HT->fill(pj.pT(), weight);
00056           }
00057         }
00058       }
00059     }
00060 
00061 
00062 
00063     /// Finalize
00064     void finalize() {
00065       double normalisation = crossSection()/picobarn/sumOfWeights()/(2*0.6*2*M_PI);
00066       scale(_h_jet_pT_MB, normalisation);
00067       scale(_h_jet_pT_HT, normalisation);
00068     }
00069 
00070     //@}
00071 
00072 
00073   private:
00074 
00075     /// @name Histograms
00076     //@{
00077     Histo1DPtr _h_jet_pT_MB;
00078     Histo1DPtr _h_jet_pT_HT;
00079     //@}
00080 
00081   };
00082 
00083 
00084 
00085   // The hook for the plugin system
00086   DECLARE_RIVET_PLUGIN(STAR_2006_S6870392);
00087 
00088 }