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