CDF_2001_S4563131.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/FastJets.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   class CDF_2001_S4563131 : public Analysis {
00012   public:
00013 
00014     /// @name Constructors etc.
00015     //@{
00016 
00017     /// Constructor
00018     CDF_2001_S4563131()
00019       : Analysis("CDF_2001_S4563131")
00020     {
00021       setBeams(PROTON, ANTIPROTON);
00022       setNeedsCrossSection(true);
00023     }
00024 
00025     //@}
00026 
00027 
00028   public:
00029 
00030     /// @name Analysis methods
00031     //@{
00032 
00033     /// Book histograms and initialise projections before the run
00034     void init() {
00035       FinalState fs(-4,2, 4.2);
00036       addProjection(FastJets(fs, FastJets::CDFJETCLU, 0.7), "Jets");
00037 
00038       _h_ET = bookHistogram1D(1, 1, 1);
00039 
00040     }
00041 
00042 
00043     /// Perform the per-event analysis
00044     void analyze(const Event& event) {
00045       const double weight = event.weight();
00046 
00047       Jets jets = applyProjection<FastJets>(event, "Jets").jetsByEt(40.0*GeV);
00048       foreach (const Jet& jet, jets) {
00049         double eta = fabs(jet.momentum().eta());
00050         if (eta>0.1 && eta<0.7) {
00051           _h_ET->fill(jet.momentum().Et(), weight);
00052         }
00053       }
00054    
00055     }
00056 
00057 
00058     /// Normalise histograms etc., after the run
00059     void finalize() {
00060       double deta = 1.2;
00061       scale(_h_ET, crossSection()/sumOfWeights()/deta/nanobarn);
00062     }
00063 
00064     //@}
00065 
00066 
00067   private:
00068 
00069     /// @name Histograms
00070     //@{
00071     AIDA::IHistogram1D *_h_ET;
00072     //@}
00073 
00074   };
00075 
00076 
00077 
00078   // This global object acts as a hook for the plugin system
00079   AnalysisBuilder<CDF_2001_S4563131> plugin_CDF_2001_S4563131;
00080 
00081 
00082 }