MC_DIPHOTON.cc
Go to the documentation of this file.
00001 // -*- C++ -*- 00002 #include "Rivet/Analysis.hh" 00003 #include "Rivet/RivetYODA.hh" 00004 #include "Rivet/Projections/FinalState.hh" 00005 #include "Rivet/Projections/IdentifiedFinalState.hh" 00006 #include "Rivet/Tools/Logging.hh" 00007 00008 namespace Rivet { 00009 00010 00011 /// @brief MC validation analysis for isolated di-photon events 00012 class MC_DIPHOTON : public Analysis { 00013 public: 00014 00015 /// Constructor 00016 MC_DIPHOTON() 00017 : Analysis("MC_DIPHOTON") 00018 { } 00019 00020 00021 /// @name Analysis methods 00022 //@{ 00023 00024 void init() { 00025 FinalState fs; 00026 addProjection(fs, "FS"); 00027 00028 IdentifiedFinalState ifs(-2.0, 2.0, 20.0*GeV); 00029 ifs.acceptId(PHOTON); 00030 addProjection(ifs, "IFS"); 00031 00032 _h_m_PP = bookHisto1D("m_PP", logspace(50, 1.0, 0.25*sqrtS())); 00033 _h_pT_PP = bookHisto1D("pT_PP", logspace(50, 1.0, 0.25*sqrtS())); 00034 _h_pT_P1 = bookHisto1D("pT_P1", 50, 0.0, 70.0); 00035 _h_pT_P2 = bookHisto1D("pT_P2", 50, 0.0, 70.0); 00036 _h_dphi_PP = bookHisto1D("dphi_PP", 20, 0.0, M_PI); 00037 } 00038 00039 00040 void analyze(const Event& event) { 00041 const double weight = event.weight(); 00042 00043 ParticleVector photons = applyProjection<IdentifiedFinalState>(event, "IFS").particles(); 00044 00045 if (photons.size() < 2) { 00046 vetoEvent; 00047 } 00048 00049 // Isolate photons with ET_sum in cone 00050 ParticleVector isolated_photons; 00051 ParticleVector fs = applyProjection<FinalState>(event, "FS").particlesByPt(); 00052 foreach (const Particle& photon, photons) { 00053 FourMomentum mom_in_cone; 00054 double eta_P = photon.momentum().eta(); 00055 double phi_P = photon.momentum().phi(); 00056 foreach (const Particle& p, fs) { 00057 if (deltaR(eta_P, phi_P, p.momentum().eta(), p.momentum().phi()) < 0.4) { 00058 mom_in_cone += p.momentum(); 00059 } 00060 } 00061 if (mom_in_cone.Et()-photon.momentum().Et() < 4.0*GeV) { 00062 isolated_photons.push_back(photon); 00063 } 00064 } 00065 00066 if (isolated_photons.size() != 2) { 00067 vetoEvent; 00068 } 00069 00070 _h_pT_P1->fill(isolated_photons[0].momentum().pT(), weight); 00071 _h_pT_P2->fill(isolated_photons[1].momentum().pT(), weight); 00072 FourMomentum mom_PP = isolated_photons[0].momentum() + isolated_photons[1].momentum(); 00073 _h_m_PP->fill(mom_PP.mass(), weight); 00074 _h_pT_PP->fill(mom_PP.pT(), weight); 00075 _h_dphi_PP->fill(deltaPhi(isolated_photons[0].momentum().phi(), 00076 isolated_photons[1].momentum().phi()), weight); 00077 } 00078 00079 00080 void finalize() { 00081 scale(_h_m_PP, crossSection()/sumOfWeights()); 00082 scale(_h_pT_PP, crossSection()/sumOfWeights()); 00083 scale(_h_pT_P1, crossSection()/sumOfWeights()); 00084 scale(_h_pT_P2, crossSection()/sumOfWeights()); 00085 scale(_h_dphi_PP, crossSection()/sumOfWeights()); 00086 } 00087 00088 //@} 00089 00090 00091 private: 00092 00093 /// @name Histograms 00094 //@{ 00095 Histo1DPtr _h_m_PP; 00096 Histo1DPtr _h_pT_PP; 00097 Histo1DPtr _h_pT_P1; 00098 Histo1DPtr _h_pT_P2; 00099 Histo1DPtr _h_dphi_PP; 00100 //@} 00101 00102 00103 }; 00104 00105 00106 00107 // The hook for the plugin system 00108 DECLARE_RIVET_PLUGIN(MC_DIPHOTON); 00109 00110 } 00111 Generated on Fri Dec 21 2012 15:03:41 for The Rivet MC analysis system by ![]() |