D0_2010_S8566488.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/Tools/BinnedHistogram.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/FastJets.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /// @brief D0 dijet invariant mass measurement
00013   class D0_2010_S8566488 : public Analysis {
00014   public:
00015 
00016     /// @name Constructors etc.
00017     //@{
00018 
00019     /// Constructor
00020     D0_2010_S8566488()
00021       : Analysis("D0_2010_S8566488")
00022     {
00023       setBeams(PROTON, ANTIPROTON);
00024       setNeedsCrossSection(true);
00025     }
00026 
00027     //@}
00028 
00029 
00030   public:
00031 
00032     /// @name Analysis methods
00033     //@{
00034 
00035     /// Book histograms and initialise projections before the run
00036     void init() {
00037 
00038       FinalState fs;
00039       FastJets conefinder(fs, FastJets::D0ILCONE, 0.7);
00040       addProjection(conefinder, "ConeFinder");
00041 
00042       _h_m_dijet.addHistogram(0.0, 0.4, bookHistogram1D(1, 1, 1));
00043       _h_m_dijet.addHistogram(0.4, 0.8, bookHistogram1D(2, 1, 1));
00044       _h_m_dijet.addHistogram(0.8, 1.2, bookHistogram1D(3, 1, 1));
00045       _h_m_dijet.addHistogram(1.2, 1.6, bookHistogram1D(4, 1, 1));
00046       _h_m_dijet.addHistogram(1.6, 2.0, bookHistogram1D(5, 1, 1));
00047       _h_m_dijet.addHistogram(2.0, 2.4, bookHistogram1D(6, 1, 1));
00048     }
00049 
00050 
00051     /// Perform the per-event analysis
00052     void analyze(const Event& e) {
00053       const double weight = e.weight();
00054 
00055       const Jets& jets = applyProjection<JetAlg>(e, "ConeFinder").jetsByPt(40.0*GeV);
00056       if (jets.size() < 2) vetoEvent;
00057 
00058       FourMomentum j0(jets[0].momentum());
00059       FourMomentum j1(jets[1].momentum());
00060       double ymax = std::max(fabs(j0.rapidity()), fabs(j1.rapidity()));
00061       double mjj = FourMomentum(j0+j1).mass();
00062 
00063       _h_m_dijet.fill(ymax, mjj/TeV, weight);
00064     }
00065 
00066 
00067     /// Normalise histograms etc., after the run
00068     void finalize() {
00069       _h_m_dijet.scale(crossSection()/sumOfWeights(), this);
00070     }
00071 
00072     //@}
00073 
00074 
00075   private:
00076 
00077     // Data members like post-cuts event weight counters go here
00078 
00079 
00080   private:
00081 
00082     /// @name Histograms
00083     //@{
00084     BinnedHistogram<double> _h_m_dijet;
00085     //@}
00086 
00087   };
00088 
00089 
00090 
00091   // This global object acts as a hook for the plugin system
00092   AnalysisBuilder<D0_2010_S8566488> plugin_D0_2010_S8566488;
00093 
00094 
00095 }