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