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