rivet is hosted by Hepforge, IPPP Durham
ATLAS_2013_I1244522.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/PromptFinalState.hh"
00005 #include "Rivet/Projections/LeadingParticlesFinalState.hh"
00006 #include "Rivet/Projections/VetoedFinalState.hh"
00007 #include "Rivet/Projections/FastJets.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   /// @brief Measurement of isolated gamma + jet + X differential cross-sections
00013   class ATLAS_2013_I1244522 : public Analysis {
00014   public:
00015 
00016     // Constructor
00017     ATLAS_2013_I1244522()
00018       : Analysis("ATLAS_2013_I1244522")
00019     {  
00020       _eta_bins_areaoffset.push_back(0.0);
00021       _eta_bins_areaoffset.push_back(1.5);
00022       _eta_bins_areaoffset.push_back(3.0);
00023     }
00024 
00025   public:
00026 
00027     // Book histograms and initialise projections before the run
00028     void init() {
00029       FinalState fs;
00030 
00031       // Voronoi eta-phi tassellation with KT jets, for ambient energy density calculation
00032       FastJets fj(fs, FastJets::KT, 0.5);
00033       _area_def = new fastjet::AreaDefinition(fastjet::VoronoiAreaSpec());
00034       fj.useJetArea(_area_def);
00035       addProjection(fj, "KtJetsD05");
00036 
00037       // Leading photon
00038       LeadingParticlesFinalState photonfs(PromptFinalState(FinalState(-2.37, 2.37, 45.0*GeV)));
00039       photonfs.addParticleId(PID::PHOTON);
00040       addProjection(photonfs, "LeadingPhoton");
00041 
00042       // FS excluding the leading photon
00043       VetoedFinalState vfs(fs);
00044       vfs.addVetoOnThisFinalState(photonfs);
00045       addProjection(vfs, "JetFS");
00046 
00047       // Jets
00048       FastJets jetpro(vfs, FastJets::ANTIKT, 0.6);
00049       jetpro.useInvisibles();
00050       addProjection(jetpro, "Jets");
00051 
00052       _h_ph_pt      = bookHisto1D(1, 1, 1);
00053       _h_jet_pt     = bookHisto1D(2, 1, 1);
00054       _h_jet_rap    = bookHisto1D(3, 1, 1);
00055       _h_dphi_phjet = bookHisto1D(4, 1, 1);
00056 
00057       _h_costheta_biased_phjet = bookHisto1D(5, 1, 1);
00058       _h_mass_phjet            = bookHisto1D(6, 1, 1);
00059       _h_costheta_phjet        = bookHisto1D(7, 1, 1);
00060 
00061     }//init
00062 
00063     size_t getEtaBin(double eta_w) const {
00064       const double eta = fabs(eta_w);
00065       return binIndex(eta, _eta_bins_areaoffset);
00066     }
00067 
00068     // Perform the per-event analysis
00069     void analyze(const Event& event) {
00070       const double weight = event.weight();
00071 
00072       // Get the photon
00073       Particles photons = applyProjection<LeadingParticlesFinalState>(event, "LeadingPhoton").particles();
00074       if (photons.size() != 1 )  vetoEvent;
00075       const Particle& photon = photons[0];
00076 
00077       if (inRange(photon.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       const Particles& fs = applyProjection<VetoedFinalState>(event, "JetFS").particles();
00082       foreach (const Particle& p, fs) {
00083         // Check if it's outside the cone of 0.4
00084         if (deltaR(photon, p) >= 0.4) continue;
00085         // Increment isolation energy
00086         mom_in_EtCone += p.momentum();
00087       }
00088 
00089       // Get the jet
00090       Jets jets, alljets = applyProjection<FastJets>(event, "Jets").jetsByPt(40.0*GeV);
00091 
00092       foreach (Jet jet, alljets)
00093         if (deltaR(photon, jet) > 1.0)  jets += jet;
00094 
00095       if (jets.empty())  vetoEvent;
00096       Jet leadingJet = jets[0];
00097       if (leadingJet.absrap() > 2.37)  vetoEvent;
00098 
00099       // Get the area-filtered jet inputs for computing median energy density, etc.
00100       vector<double> ptDensity, sigma, Njets;
00101       vector< vector<double> > ptDensities(_eta_bins_areaoffset.size()-1);
00102       FastJets fast_jets = applyProjection<FastJets>(event, "KtJetsD05");
00103       const fastjet::ClusterSequenceArea* clust_seq_area = fast_jets.clusterSeqArea();
00104       foreach (const Jet& jet, fast_jets.jets()) {
00105         const double area = clust_seq_area->area(jet);
00106         if (area > 10e-4 && jet.abseta() < _eta_bins_areaoffset.back())
00107           ptDensities.at( getEtaBin(jet.abseta()) ).push_back(jet.pT()/area);
00108       }
00109 
00110       // Compute the median energy density, etc.
00111       for (size_t b = 0; b < _eta_bins_areaoffset.size() - 1; ++b) {
00112         const int njets = ptDensities[b].size();
00113         const double ptmedian = (njets > 0) ? median(ptDensities[b]) : 0;
00114         const double ptsigma = (njets > 0) ? ptDensities[b][(size_t)(0.15865*njets)] : 0;
00115         ptDensity.push_back(ptmedian);
00116         sigma.push_back(ptsigma);
00117         Njets.push_back(njets);
00118       }
00119 
00120       // Compute the isolation energy correction (cone area*energy density)
00121       const double etCone_area = PI*sqr(0.4) - (5.0*.025)*(7.0*PI/128.);
00122       const double correction = ptDensity[getEtaBin(photon.abseta())] * etCone_area;
00123 
00124       // Apply isolation cut on area-corrected value
00125       if (mom_in_EtCone.Et() - correction >= 4*GeV)  vetoEvent;
00126 
00127       // Fill histos
00128       float photon_pt = photon.pT() * GeV;
00129       float jet_pt = leadingJet.pT() * GeV;
00130       float jet_y = leadingJet.absrap();
00131       float dphi_phj = deltaPhi(photon, leadingJet);
00132       float dy = deltaRap(photon, leadingJet);
00133       float mass_phj = (photon.momentum() + leadingJet.momentum()).mass() * GeV;
00134       float costheta_phj = tanh(dy/2);
00135       
00136         _h_ph_pt->fill(photon_pt, weight); 
00137       _h_jet_pt->fill(jet_pt,   weight);
00138       _h_jet_rap->fill(jet_y,   weight);
00139 
00140       _h_dphi_phjet->fill(dphi_phj, weight);
00141       _h_costheta_biased_phjet->fill(costheta_phj, weight);
00142 
00143       if (mass_phj > 160.939) {
00144         if (fabs(photon.eta() + leadingJet.rap()) < 2.37) {
00145           if (costheta_phj < 0.829022) {
00146             _h_mass_phjet->fill(mass_phj,         weight);
00147             _h_costheta_phjet->fill(costheta_phj, weight);
00148           }
00149         }
00150       }
00151     }
00152 
00153     /// Normalise histograms etc., after the run
00154     void finalize() {
00155       const double sf( crossSection() / sumOfWeights() );
00156       scale(_h_ph_pt,                 sf);
00157       scale(_h_jet_pt,                sf);
00158       scale(_h_jet_rap,               sf);
00159       scale(_h_dphi_phjet,            sf);
00160       scale(_h_costheta_biased_phjet, sf);
00161       scale(_h_mass_phjet,            sf);
00162       scale(_h_costheta_phjet,        sf);
00163     }
00164 
00165 
00166   private:
00167 
00168     Histo1DPtr _h_ph_pt;
00169     Histo1DPtr _h_jet_pt;
00170     Histo1DPtr _h_jet_rap;
00171     Histo1DPtr _h_dphi_phjet;
00172     Histo1DPtr _h_costheta_biased_phjet;
00173     Histo1DPtr _h_mass_phjet;
00174     Histo1DPtr _h_costheta_phjet;
00175 
00176     fastjet::AreaDefinition* _area_def;
00177 
00178     std::vector<float> _eta_bins_areaoffset;
00179 
00180   };
00181 
00182   // The hook for the plugin system
00183   DECLARE_RIVET_PLUGIN(ATLAS_2013_I1244522);
00184 
00185 }