rivet is hosted by Hepforge, IPPP Durham
MC_PHOTONINC.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/LeadingParticlesFinalState.hh"
00004 #include "Rivet/Projections/VetoedFinalState.hh"
00005 
00006 namespace Rivet {
00007 
00008   
00009 
00010 
00011   /// @brief MC validation analysis for single photon events
00012   class MC_PHOTONINC : public Analysis {
00013   public:
00014 
00015     /// Default constructor
00016     MC_PHOTONINC()
00017       : Analysis("MC_PHOTONINC")
00018     {    }
00019 
00020 
00021     /// @name Analysis methods
00022     //@{
00023 
00024     /// Book histograms
00025     void init() {
00026       // General FS
00027       FinalState fs(-5.0, 5.0);
00028       addProjection(fs, "FS");
00029 
00030       // Get leading photon
00031       LeadingParticlesFinalState photonfs(FinalState(-1.0, 1.0, 30.0*GeV));
00032       photonfs.addParticleId(PID::PHOTON);
00033       addProjection(photonfs, "LeadingPhoton");
00034 
00035       // FS for isolation excludes the leading photon
00036       VetoedFinalState vfs(fs);
00037       vfs.addVetoOnThisFinalState(photonfs);
00038       addProjection(vfs, "JetFS");
00039 
00040       _h_photon_pT = bookHisto1D("photon_pT", logspace(50, 30.0, 0.5*(sqrtS()>0.?sqrtS():14000.)));
00041       _h_photon_pT_lin = bookHisto1D("photon_pT_lin", 50, 0.0, 70.0);
00042       _h_photon_y = bookHisto1D("photon_y", 50, -5.0, 5.0);
00043     }
00044 
00045 
00046     /// Do the analysis
00047     void analyze(const Event& e) {
00048       // Get the photon
00049       const Particles photons = applyProjection<FinalState>(e, "LeadingPhoton").particles();
00050       if (photons.size() != 1) {
00051         vetoEvent;
00052       }
00053       const FourMomentum photon = photons.front().momentum();
00054 
00055       // Get all charged particles
00056       const FinalState& fs = applyProjection<FinalState>(e, "JetFS");
00057       if (fs.empty()) {
00058         vetoEvent;
00059       }
00060 
00061       // Passed cuts, so get the weight
00062       const double weight = e.weight();
00063 
00064       // Isolate photon by ensuring that a 0.4 cone around it contains less than 7% of the photon's energy
00065       const double egamma = photon.E();
00066       double econe = 0.0;
00067       foreach (const Particle& p, fs.particles()) {
00068         if (deltaR(photon, p.momentum()) < 0.4) {
00069           econe += p.E();
00070           // Veto as soon as E_cone gets larger
00071           if (econe/egamma > 0.07) {
00072             vetoEvent;
00073           }
00074         }
00075       }
00076 
00077       _h_photon_pT->fill(photon.pT(),weight);
00078       _h_photon_pT_lin->fill(photon.pT(),weight);
00079       _h_photon_y->fill(photon.rapidity(),weight);
00080     }
00081 
00082 
00083     // Finalize
00084     void finalize() {
00085       scale(_h_photon_pT, crossSectionPerEvent());
00086       scale(_h_photon_pT_lin, crossSectionPerEvent());
00087       scale(_h_photon_y, crossSectionPerEvent());
00088     }
00089 
00090     //@}
00091 
00092 
00093   private:
00094 
00095     /// @name Histograms
00096     //@{
00097     Histo1DPtr _h_photon_pT;
00098     Histo1DPtr _h_photon_pT_lin;
00099     Histo1DPtr _h_photon_y;
00100     //@}
00101 
00102   };
00103 
00104 
00105 
00106   // The hook for the plugin system
00107   DECLARE_RIVET_PLUGIN(MC_PHOTONINC);
00108 
00109 }