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