D0_2006_S6438750.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Projections/FinalState.hh"
00005 #include "Rivet/Projections/LeadingParticlesFinalState.hh"
00006 #include "Rivet/Projections/VetoedFinalState.hh"
00007 #include "Rivet/RivetAIDA.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /// @brief Inclusive isolated photon cross-section, differential in \f$ p_\perp(gamma) \f$.
00013   /// @author Andy Buckley
00014   /// @author Gavin Hesketh
00015   class D0_2006_S6438750 : public Analysis {
00016 
00017   public:
00018 
00019     /// @name Constructors etc.
00020     //@{
00021 
00022     /// Default constructor.
00023     D0_2006_S6438750() : Analysis("D0_2006_S6438750")
00024     {
00025       setBeams(PROTON, ANTIPROTON);
00026       setNeedsCrossSection(true);
00027     }
00028  
00029     //@}
00030 
00031 
00032     /// @name Analysis methods
00033     //@{
00034 
00035     void init() {
00036       // General FS for photon isolation
00037       FinalState fs;
00038       addProjection(fs, "AllFS");
00039    
00040       // Get leading photon
00041       LeadingParticlesFinalState photonfs(FinalState(-1.0, 1.0, 23.0*GeV));
00042       photonfs.addParticleId(PHOTON);
00043       addProjection(photonfs, "LeadingPhoton");
00044 
00045       // Book histograms
00046       _h_pTgamma = bookHistogram1D(1, 1, 1);
00047     }
00048  
00049 
00050     /// Do the analysis
00051     void analyze(const Event& event) {
00052 
00053       // Get the photon
00054       const FinalState& photonfs = applyProjection<FinalState>(event, "LeadingPhoton");
00055       if (photonfs.particles().size() != 1) {
00056         getLog() << Log::DEBUG << "No photon found" << endl;
00057         vetoEvent;
00058       }
00059       const FourMomentum photon = photonfs.particles().front().momentum();
00060       if (photon.pT()/GeV < 23) {
00061         getLog() << Log::DEBUG << "Leading photon has pT < 23 GeV: " << photon.pT()/GeV << endl;
00062         vetoEvent;
00063       }
00064    
00065       // Get all other particles
00066       const FinalState& fs = applyProjection<FinalState>(event, "AllFS");
00067       if (fs.empty()) {
00068         vetoEvent;
00069       }
00070    
00071       // Isolate photon by ensuring that a 0.4 cone around it contains less than 7% of the photon's energy
00072       const double egamma = photon.E();
00073       // Energy inside R = 0.2
00074       double econe_02 = 0.0;
00075       // Energy between R = [0.2, 0.4]
00076       double econe_02_04 = 0.0;
00077       foreach (const Particle& p, fs.particles()) {
00078         const double dr = deltaR(photon.pseudorapidity(), photon.azimuthalAngle(),
00079                                  p.momentum().pseudorapidity(), p.momentum().azimuthalAngle());
00080         if (dr < 0.2) {
00081           econe_02 += p.momentum().E();
00082         } else if (dr < 0.4) {
00083           econe_02_04 += p.momentum().E();
00084         }
00085       }
00086       // Veto if outer hollow cone contains more than 10% of the energy of the inner cone
00087       // or if the non-photon energy in the inner cone exceeds 5% of the photon energy.
00088       if (econe_02_04/econe_02 > 0.1 || (econe_02-egamma)/egamma > 0.05) {
00089         getLog() << Log::DEBUG << "Vetoing event because photon is insufficiently isolated" << endl;
00090         vetoEvent;
00091       }
00092    
00093       // Veto if leading jet is outside plotted rapidity regions
00094       const double eta_gamma = fabs(photon.pseudorapidity());
00095       if (eta_gamma > 0.9) {
00096         getLog() << Log::DEBUG << "Leading photon falls outside acceptance range; "
00097                  << "|eta_gamma| = " << eta_gamma << endl;
00098         vetoEvent;
00099       }
00100    
00101       // Fill histo
00102       const double weight = event.weight();
00103       _h_pTgamma->fill(photon.pT(), weight);
00104     }
00105  
00106  
00107 
00108     // Finalize
00109     void finalize() {
00110       /// @todo Generator cross-section from Pythia gives ~7500, vs. expected 2988!
00111       //normalize(_h_pTgamma, 2988.4869);
00112    
00113       const double lumi_gen = sumOfWeights()/crossSection();
00114       // Divide by effective lumi, plus rapidity bin width of 1.8
00115       scale(_h_pTgamma, 1/lumi_gen * 1/1.8);
00116     }
00117  
00118     //@}
00119 
00120 
00121   private:
00122 
00123     /// @name Histograms
00124     //@{
00125     AIDA::IHistogram1D* _h_pTgamma;
00126     //@}
00127 
00128   };
00129 
00130 
00131 
00132   // This global object acts as a hook for the plugin system
00133   AnalysisBuilder<D0_2006_S6438750> plugin_D0_2006_S6438750;
00134 
00135 }