rivet is hosted by Hepforge, IPPP Durham
CDF_2008_S8093652.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FinalState.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   /// @brief CDF dijet mass spectrum
00010   class CDF_2008_S8093652 : public Analysis {
00011   public:
00012 
00013     /// Constructor
00014     CDF_2008_S8093652()
00015       : Analysis("CDF_2008_S8093652")
00016     {    }
00017 
00018 
00019     /// @name Analysis methods
00020     //@{
00021 
00022     /// Book histograms
00023     void init() {
00024       FinalState fs;
00025       FastJets conefinder(fs, FastJets::CDFMIDPOINT, 0.7);
00026       addProjection(conefinder, "ConeFinder");
00027 
00028       _h_m_dijet = bookHisto1D(1, 1, 1);
00029     }
00030 
00031 
00032     /// Do the analysis
00033     void analyze(const Event & e) {
00034       const double weight = e.weight();
00035 
00036       const JetAlg& jetpro = applyProjection<JetAlg>(e, "ConeFinder");
00037       const Jets& jets = jetpro.jetsByPt();
00038 
00039       if (jets.size() < 2) vetoEvent;
00040 
00041       const FourMomentum j0(jets[0].momentum());
00042       const FourMomentum j1(jets[1].momentum());
00043       if (fabs(j1.rapidity()) > 1.0 || fabs(j0.rapidity()) > 1.0) {
00044         vetoEvent;
00045       }
00046 
00047       double mjj = FourMomentum(j0+j1).mass();
00048       _h_m_dijet->fill(mjj, weight);
00049     }
00050 
00051 
00052     /// Finalize
00053     void finalize() {
00054       scale(_h_m_dijet, crossSection()/sumOfWeights());
00055     }
00056     //@}
00057 
00058 
00059   private:
00060 
00061     /// @name Histograms
00062     //@{
00063     Histo1DPtr _h_m_dijet;
00064     //@}
00065 
00066   };
00067 
00068 
00069 
00070   // The hook for the plugin system
00071   DECLARE_RIVET_PLUGIN(CDF_2008_S8093652);
00072 
00073 }