rivet is hosted by Hepforge, IPPP Durham
CDF_2009_S8436959.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/LeadingParticlesFinalState.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   /// @brief CDF inclusive isolated prompt photon cross-section
00010   class CDF_2009_S8436959 : public Analysis {
00011   public:
00012 
00013     /// @name Constructors etc.
00014     //@{
00015 
00016     /// Constructor
00017     CDF_2009_S8436959()
00018       : Analysis("CDF_2009_S8436959")
00019     {    }
00020 
00021     //@}
00022 
00023 
00024   public:
00025 
00026     /// @name Analysis methods
00027     //@{
00028 
00029     /// Book histograms and initialise projections before the run
00030     void init() {
00031       FinalState fs;
00032       addProjection(fs, "FS");
00033 
00034       LeadingParticlesFinalState photonfs(FinalState(-1.0, 1.0, 30.0*GeV));
00035       photonfs.addParticleId(PID::PHOTON);
00036       addProjection(photonfs, "LeadingPhoton");
00037 
00038       _h_Et_photon = bookHisto1D(1, 1, 1);
00039     }
00040 
00041 
00042     /// Perform the per-event analysis
00043     void analyze(const Event& event) {
00044       const double weight = event.weight();
00045 
00046       Particles fs = applyProjection<FinalState>(event, "FS").particles();
00047       Particles photons = applyProjection<LeadingParticlesFinalState>(event, "LeadingPhoton").particles();
00048       if (photons.size()!=1) {
00049         vetoEvent;
00050       }
00051       FourMomentum leadingPhoton = photons[0].momentum();
00052       double eta_P = leadingPhoton.eta();
00053       double phi_P = leadingPhoton.phi();
00054       FourMomentum mom_in_cone;
00055       foreach (const Particle& p, fs) {
00056         if (deltaR(eta_P, phi_P, p.eta(), p.momentum().phi()) < 0.4) {
00057             mom_in_cone += p.momentum();
00058         }
00059       }
00060       if ( (mom_in_cone.Et() - leadingPhoton.Et()) > 2.0*GeV) {
00061         vetoEvent;
00062       }
00063       _h_Et_photon->fill(leadingPhoton.Et(), weight);
00064     }
00065 
00066 
00067     /// Normalise histograms etc., after the run
00068     void finalize() {
00069       scale(_h_Et_photon, crossSection()/sumOfWeights()/2.0);
00070     }
00071 
00072     //@}
00073 
00074 
00075   private:
00076 
00077     /// @name Histograms
00078     //@{
00079     Histo1DPtr _h_Et_photon;
00080     //@}
00081 
00082   };
00083 
00084 
00085 
00086   // The hook for the plugin system
00087   DECLARE_RIVET_PLUGIN(CDF_2009_S8436959);
00088 
00089 }