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