rivet is hosted by Hepforge, IPPP Durham
ATLAS_2010_S8817804.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 #include "Rivet/Analysis.hh"
00004 #include "Rivet/Tools/BinnedHistogram.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// @brief ATLAS inclusive jet pT spectrum, di-jet Mass and di-jet chi
00011   class ATLAS_2010_S8817804: public Analysis {
00012   public:
00013 
00014     ATLAS_2010_S8817804() : Analysis("ATLAS_2010_S8817804")
00015     {    }
00016 
00017 
00018   private:
00019 
00020     enum Alg { AKT4=0, AKT6=1 };
00021 
00022 
00023   public:
00024 
00025     void init() {
00026       FinalState fs;
00027       addProjection(fs, "FinalState");
00028       addProjection(FastJets(fs, FastJets::ANTIKT, 0.6), "AntiKT06");
00029       addProjection(FastJets(fs, FastJets::ANTIKT, 0.4), "AntiKT04");
00030 
00031       double ybins[] = { 0.0, 0.3, 0.8, 1.2, 2.1, 2.8 };
00032       double massBinsForChi[] = { 340, 520, 800, 1200 };
00033 
00034 
00035       size_t ptDsOffset(0), massDsOffset(10), chiDsOffset(20);
00036       for (size_t alg = 0; alg < 2; ++alg) {
00037         for (size_t i = 0; i < 5; ++i) {
00038           _pThistos[alg].addHistogram(ybins[i], ybins[i+1], bookHisto1D(i + 1 + ptDsOffset, 1, 1));
00039         }
00040         ptDsOffset += 5;
00041 
00042         for (size_t i = 0; i < 5; ++i) {
00043           _massVsY[alg].addHistogram(ybins[i], ybins[i+1], bookHisto1D(i + 1 + massDsOffset, 1, 1));
00044         }
00045         massDsOffset += 5;
00046 
00047         for (size_t i = 0; i < 3; ++i) {
00048           _chiVsMass[alg].addHistogram(massBinsForChi[i], massBinsForChi[i+1], bookHisto1D(i + 1 + chiDsOffset, 1, 1));
00049         }
00050         chiDsOffset += 3;
00051       }
00052     }
00053 
00054 
00055     void analyze(const Event& evt) {
00056       Jets jetAr[2];
00057       jetAr[AKT6] = applyProjection<FastJets>(evt, "AntiKT06").jetsByPt(30*GeV);
00058       jetAr[AKT4] = applyProjection<FastJets>(evt, "AntiKT04").jetsByPt(30*GeV);
00059 
00060       // Identify the dijets
00061       for (size_t alg = 0; alg < 2; ++alg) {
00062         vector<FourMomentum> leadjets;
00063         foreach (const Jet& jet, jetAr[alg]) {
00064           const double pT = jet.pT();
00065           const double absy = fabs(jet.rapidity());
00066           _pThistos[alg].fill(absy, pT/GeV, evt.weight());
00067 
00068           if (absy < 2.8 && leadjets.size() < 2) {
00069             if (leadjets.empty() && pT < 60*GeV) continue;
00070             leadjets.push_back(jet.momentum());
00071           }
00072         }
00073 
00074         // Veto if no acceptable dijet found
00075         if (leadjets.size() < 2) {
00076           MSG_DEBUG("Could not find two suitable leading jets");
00077           continue;
00078         }
00079 
00080         const double rap1 = leadjets[0].rapidity();
00081         const double rap2 = leadjets[1].rapidity();
00082         const double mass = (leadjets[0] + leadjets[1]).mass();
00083         const double ymax = max(fabs(rap1), fabs(rap2));
00084         const double chi = exp(fabs(rap1 - rap2));
00085         if (fabs(rap1 + rap2) < 2.2) {
00086           _chiVsMass[alg].fill(mass/GeV, chi, evt.weight());
00087         }
00088         _massVsY[alg].fill(ymax, mass/GeV, evt.weight());
00089 
00090       }
00091     }
00092 
00093 
00094     void finalize() {
00095       for (size_t alg = 0; alg < 2; ++alg) {
00096         // factor 0.5 needed because it is differential in dy and not d|y|
00097         _pThistos[alg].scale(0.5*crossSectionPerEvent()/picobarn, this);
00098         _massVsY[alg].scale(crossSectionPerEvent()/picobarn, this);
00099         _chiVsMass[alg].scale(crossSectionPerEvent()/picobarn, this);
00100       }
00101     }
00102 
00103 
00104   private:
00105 
00106     /// The inclusive pT spectrum for akt6 and akt4 jets (array index is jet type from enum above)
00107     BinnedHistogram<double> _pThistos[2];
00108 
00109     /// The di-jet mass spectrum binned in rapidity for akt6 and akt4 jets (array index is jet type from enum above)
00110     BinnedHistogram<double> _massVsY[2];
00111 
00112     /// The di-jet chi distribution binned in mass for akt6 and akt4 jets (array index is jet type from enum above)
00113     BinnedHistogram<double> _chiVsMass[2];
00114 
00115   };
00116 
00117 
00118 
00119   // The hook for the plugin system
00120   DECLARE_RIVET_PLUGIN(ATLAS_2010_S8817804);
00121 
00122 }