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