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