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