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/FastJets.hh"
00005 #include "Rivet/Tools/Logging.hh"
00006 #include "Rivet/RivetAIDA.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   /// @brief MC validation analysis for photon + jets events
00012   class MC_PHOTONJETS : public MC_JetAnalysis {
00013   public:
00014 
00015     /// Default constructor
00016     MC_PHOTONJETS()
00017       : MC_JetAnalysis("MC_PHOTONJETS", 4, "Jets")
00018     {
00019       setNeedsCrossSection(true);
00020     }
00021 
00022 
00023     /// @name Analysis methods
00024     //@{
00025 
00026     /// Book histograms
00027     void init() {
00028       // General FS
00029       FinalState fs(-5.0, 5.0);
00030       addProjection(fs, "FS");
00031 
00032       // Get leading photon
00033       LeadingParticlesFinalState photonfs(FinalState(-1.0, 1.0, 30.0*GeV));
00034       photonfs.addParticleId(PHOTON);
00035       addProjection(photonfs, "LeadingPhoton");
00036 
00037       // FS for jets excludes the leading photon
00038       VetoedFinalState vfs(fs);
00039       vfs.addVetoOnThisFinalState(photonfs);
00040       addProjection(vfs, "JetFS");
00041       FastJets jetpro(vfs, FastJets::KT, 0.7);
00042       addProjection(jetpro, "Jets");
00043 
00044       _h_photon_pT = bookHistogram1D("photon_pT", logBinEdges(50, 30.0, 0.5*sqrtS()));
00045       _h_photon_pT_lin = bookHistogram1D("photon_pT_lin", 50, 0.0, 70.0);
00046       _h_photon_y = bookHistogram1D("photon_y", 50, -5.0, 5.0);
00047       _h_photon_jet1_deta = bookHistogram1D("photon_jet1_deta", 50, -5.0, 5.0);
00048       _h_photon_jet1_dphi = bookHistogram1D("photon_jet1_dphi", 20, 0.0, M_PI);
00049       _h_photon_jet1_dR = bookHistogram1D("photon_jet1_dR", 25, 0.5, 7.0);
00050 
00051       MC_JetAnalysis::init();
00052     }
00053 
00054 
00055     /// Do the analysis
00056     void analyze(const Event& e) {
00057       // Get the photon
00058       const ParticleVector photons = applyProjection<FinalState>(e, "LeadingPhoton").particles();
00059       if (photons.size() != 1) {
00060         vetoEvent;
00061       }
00062       const FourMomentum photon = photons.front().momentum();
00063 
00064       // Get all charged particles
00065       const FinalState& fs = applyProjection<FinalState>(e, "JetFS");
00066       if (fs.empty()) {
00067         vetoEvent;
00068       }
00069 
00070       // Passed cuts, so get the weight
00071       const double weight = e.weight();
00072 
00073       // Isolate photon by ensuring that a 0.4 cone around it contains less than 7% of the photon's energy
00074       const double egamma = photon.E();
00075       double econe = 0.0;
00076       foreach (const Particle& p, fs.particles()) {
00077         if (deltaR(photon, p.momentum()) < 0.4) {
00078           econe += p.momentum().E();
00079           // Veto as soon as E_cone gets larger
00080           if (econe/egamma > 0.07) {
00081             vetoEvent;
00082           }
00083         }
00084       }
00085 
00086       _h_photon_pT->fill(photon.pT(),weight);
00087       _h_photon_pT_lin->fill(photon.pT(),weight);
00088       _h_photon_y->fill(photon.rapidity(),weight);
00089 
00090       const FastJets& jetpro = applyProjection<FastJets>(e, "Jets");
00091       const Jets& jets = jetpro.jetsByPt(20.0*GeV);
00092       if (jets.size()>0) {
00093         _h_photon_jet1_deta->fill(photon.eta()-jets[0].momentum().eta(), weight);
00094         _h_photon_jet1_dphi->fill(mapAngle0ToPi(photon.phi()-jets[0].momentum().phi()), weight);
00095         _h_photon_jet1_dR->fill(deltaR(photon, jets[0].momentum()), weight);
00096       }
00097 
00098       MC_JetAnalysis::analyze(e);
00099     }
00100 
00101 
00102     // Finalize
00103     void finalize() {
00104       scale(_h_photon_pT, crossSectionPerEvent());
00105       scale(_h_photon_pT_lin, crossSectionPerEvent());
00106       scale(_h_photon_y, crossSectionPerEvent());
00107       scale(_h_photon_jet1_deta, crossSectionPerEvent());
00108       scale(_h_photon_jet1_dphi, crossSectionPerEvent());
00109       scale(_h_photon_jet1_dR, crossSectionPerEvent());
00110 
00111       MC_JetAnalysis::finalize();
00112     }
00113 
00114     //@}
00115 
00116 
00117   private:
00118 
00119     /// @name Histograms
00120     //@{
00121     AIDA::IHistogram1D * _h_photon_pT;
00122     AIDA::IHistogram1D * _h_photon_pT_lin;
00123     AIDA::IHistogram1D * _h_photon_y;
00124     AIDA::IHistogram1D * _h_photon_jet1_deta;
00125     AIDA::IHistogram1D * _h_photon_jet1_dphi;
00126     AIDA::IHistogram1D * _h_photon_jet1_dR;
00127     //@}
00128 
00129   };
00130 
00131 
00132 
00133   // This global object acts as a hook for the plugin system
00134   AnalysisBuilder<MC_PHOTONJETS> plugin_MC_PHOTONJETS;
00135 
00136 }