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