CDF_2008_S8093652.cc

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