rivet is hosted by Hepforge, IPPP Durham
ATLAS_2013_I1263495.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/LeadingParticlesFinalState.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// Inclusive isolated prompt photon analysis with 2011 LHC data
00011   class ATLAS_2013_I1263495 : public Analysis {
00012   public:
00013 
00014     /// Constructor
00015     ATLAS_2013_I1263495()
00016       : Analysis("ATLAS_2013_I1263495")
00017     {
00018       _eta_bins.push_back( 0.00);
00019       _eta_bins.push_back( 1.37);
00020       _eta_bins.push_back( 1.52);
00021       _eta_bins.push_back( 2.37);
00022 
00023       _eta_bins_areaoffset.push_back(0.0);
00024       _eta_bins_areaoffset.push_back(1.5);
00025       _eta_bins_areaoffset.push_back(3.0);
00026     }
00027 
00028 
00029     /// Book histograms and initialise projections before the run
00030     void init() {
00031 
00032       FinalState fs;
00033       addProjection(fs, "FS");
00034 
00035       // Consider the final state jets for the energy density calculation
00036       FastJets fj(fs, FastJets::KT, 0.5);
00037       /// @todo Memory leak! (Once per run, not serious)
00038       _area_def = new fastjet::AreaDefinition(fastjet::VoronoiAreaSpec()); ///< @todo FastJets should deep copy the pointer if possible
00039       fj.useJetArea(_area_def);
00040       addProjection(fj, "KtJetsD05");
00041 
00042       // Consider the leading pt photon with |eta| < 2.37 and pT > 100 GeV
00043       LeadingParticlesFinalState photonfs(FinalState(-2.37, 2.37, 100.0*GeV));
00044       photonfs.addParticleId(PID::PHOTON);
00045       addProjection(photonfs, "LeadingPhoton");
00046 
00047       // Book the dsigma/dEt (in eta bins) histograms
00048       for (size_t i = 0; i < _eta_bins.size() - 1; i++) {
00049         if (fuzzyEquals(_eta_bins[i], 1.37)) continue; // skip this bin
00050         _h_Et_photon[i] = bookHisto1D(1, 1, i+1);
00051       }
00052 
00053       // Book the dsigma/d|eta| histogram
00054       _h_eta_photon = bookHisto1D(1,2,1);
00055     }
00056 
00057 
00058     /// Return eta bin for either dsigma/dET histogram (area_eta=false) or energy density correction (area_eta=true)
00059     size_t _getEtaBin(double eta_w, bool area_eta) const {
00060       const double eta = fabs(eta_w);
00061       if (!area_eta) {
00062         return binIndex(eta, _eta_bins);
00063       } else {
00064         return binIndex(eta, _eta_bins_areaoffset);
00065       }
00066     }
00067 
00068 
00069     /// Perform the per-event analysis
00070     void analyze(const Event& event) {
00071       // Retrieve leading photon
00072       Particles photons = applyProjection<LeadingParticlesFinalState>(event, "LeadingPhoton").particles();
00073       if (photons.size() != 1) vetoEvent;
00074       const Particle& leadingPhoton = photons[0];
00075 
00076       // Veto events with photon in ECAL crack
00077       if (inRange(leadingPhoton.abseta(), 1.37, 1.52)) vetoEvent;
00078 
00079       // Compute isolation energy in cone of radius .4 around photon (all particles)
00080       FourMomentum mom_in_EtCone;
00081       Particles fs = applyProjection<FinalState>(event, "FS").particles();
00082       foreach (const Particle& p, fs) {
00083         // Check if it's outside the cone of 0.4
00084         if (deltaR(leadingPhoton, p) >= 0.4) continue;
00085         // Don't count particles in the 5x7 central core
00086         if (deltaEta(leadingPhoton, p) < .025*5.0*0.5 &&
00087             deltaPhi(leadingPhoton, p) < (PI/128.)*7.0*0.5) continue;
00088         // Increment isolation energy
00089         mom_in_EtCone += p.momentum();
00090       }
00091 
00092       // Get the area-filtered jet inputs for computing median energy density, etc.
00093       vector<double> ptDensity, ptSigma, nJets;
00094       vector< vector<double> > ptDensities(_eta_bins_areaoffset.size()-1);
00095       FastJets fast_jets =applyProjection<FastJets>(event, "KtJetsD05");
00096       const fastjet::ClusterSequenceArea* clust_seq_area = fast_jets.clusterSeqArea();
00097       foreach (const Jet& jet, fast_jets.jets()) {
00098         const double area = clust_seq_area->area(jet);
00099         if (area > 10e-4 && jet.abseta() < _eta_bins_areaoffset.back())
00100           ptDensities.at( _getEtaBin(jet.abseta(), true) ).push_back(jet.pT()/area);
00101       }
00102       // Compute the median energy density, etc.
00103       for (size_t b = 0; b < _eta_bins_areaoffset.size()-1; b++) {
00104         const int njets = ptDensities[b].size();
00105         const double ptmedian = (njets > 0) ? median(ptDensities[b]) : 0;
00106         const double ptsigma = (njets > 0) ? ptDensities[b][(size_t)(0.15865*njets)] : 0;
00107         nJets.push_back(njets);
00108         ptDensity.push_back(ptmedian);
00109         ptSigma.push_back(ptsigma);
00110       }
00111       // Compute the isolation energy correction (cone area*energy density)
00112       const double etCone_area = PI*sqr(0.4) - (7.0*.025)*(5.0*PI/128.);
00113       const double correction = ptDensity[_getEtaBin(leadingPhoton.abseta(), true)]*etCone_area;
00114 
00115       // Apply isolation cut on area-corrected value
00116       if (mom_in_EtCone.Et() - correction > 7*GeV) vetoEvent;
00117 
00118       // Fill histograms
00119       const size_t eta_bin = _getEtaBin(leadingPhoton.abseta(), false);
00120       _h_Et_photon[eta_bin]->fill(leadingPhoton.Et(), event.weight());
00121       _h_eta_photon->fill(leadingPhoton.abseta(), event.weight());
00122     }
00123 
00124 
00125     /// Normalise histograms etc., after the run
00126     void finalize() {
00127       for (size_t i = 0; i < _eta_bins.size()-1; i++) {
00128         if (fuzzyEquals(_eta_bins[i], 1.37)) continue;
00129         scale(_h_Et_photon[i], crossSection()/picobarn/sumOfWeights());
00130       }
00131       scale(_h_eta_photon, crossSection()/picobarn/sumOfWeights());
00132     }
00133 
00134 
00135   private:
00136 
00137     Histo1DPtr _h_Et_photon[3];
00138     Histo1DPtr _h_eta_photon;
00139 
00140     fastjet::AreaDefinition* _area_def;
00141 
00142     vector<double> _eta_bins, _eta_bins_areaoffset;
00143 
00144   };
00145 
00146 
00147   DECLARE_RIVET_PLUGIN(ATLAS_2013_I1263495);
00148 
00149 }