rivet is hosted by Hepforge, IPPP Durham
ATLAS_2012_I1082936.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetYODA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FastJets.hh"
00006 #include "Rivet/Tools/BinnedHistogram.hh"
00007 #include "Rivet/Projections/FinalState.hh"
00008 
00009 namespace Rivet {
00010 
00011 
00012   class ATLAS_2012_I1082936 : public Analysis {
00013   public:
00014 
00015     /// @name Constructors etc.
00016     //@{
00017 
00018     /// Constructor
00019     ATLAS_2012_I1082936()
00020       : Analysis("ATLAS_2012_I1082936")
00021     {
00022     }
00023 
00024     //@}
00025 
00026 
00027   public:
00028 
00029     /// @name Analysis methods
00030     //@{
00031 
00032     /// Book histograms and initialise projections before the run
00033     void init() {
00034 
00035       const FinalState fs;
00036       addProjection(fs,"FinalState");
00037 
00038       FastJets fj04(fs,  FastJets::ANTIKT, 0.4);
00039       fj04.useInvisibles();
00040       addProjection(fj04, "AntiKT04");
00041 
00042       FastJets fj06(fs,  FastJets::ANTIKT, 0.6);
00043       fj06.useInvisibles();
00044       addProjection(fj06, "AntiKT06");
00045 
00046 
00047       // Histogram booking copied from the previous analysis
00048       double ybins[] = { 0.0, 0.3, 0.8, 1.2, 2.1, 2.8, 3.6, 4.4 };
00049       double ystarbins[] = { 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.4};
00050 
00051       size_t ptDsOffset(0), massDsOffset(2);
00052       for (size_t alg = 0; alg < 2; ++alg) {
00053         for (size_t i = 0; i < 7; ++i) {
00054           _pThistos[alg].addHistogram(ybins[i], ybins[i+1], bookHisto1D(1 + ptDsOffset, 1, i+1));
00055         }
00056         ptDsOffset += 1;
00057 
00058         for (size_t i = 0; i < 9; ++i) {
00059           _mass[alg].addHistogram(ystarbins[i], ystarbins[i+1], bookHisto1D(1 + massDsOffset, 1, i+1));
00060         }
00061         massDsOffset += 1;
00062       }
00063     }
00064 
00065     /// Perform the per-event analysis
00066     void analyze(const Event& event) {
00067       const double weight = event.weight();
00068       Jets jetAr[2];
00069       jetAr[AKT6] = applyProjection<FastJets>(event, "AntiKT06").jetsByPt(20*GeV);
00070       jetAr[AKT4] = applyProjection<FastJets>(event, "AntiKT04").jetsByPt(20*GeV);
00071 
00072       // Loop over jet "radii" used in analysis
00073       for (size_t alg = 0; alg < 2; ++alg) {
00074         // Identify dijets
00075         vector<FourMomentum> leadjets;
00076         foreach (const Jet& jet, jetAr[alg]) {
00077           const double pT = jet.momentum().pT();
00078           const double absy = fabs(jet.momentum().rapidity());
00079           _pThistos[alg].fill(absy, pT/GeV, weight);
00080 
00081           if (absy < 4.4 && leadjets.size() < 2) {
00082             if (leadjets.empty() && pT < 30*GeV) continue;
00083             leadjets.push_back(jet.momentum());
00084           }
00085         }
00086         // Make sure we have a leading jet with pT >30 GeV and a second to leading jet with pT>20 GeV
00087         if (leadjets.size() < 2) {
00088           MSG_DEBUG("Could not find two suitable leading jets");
00089           continue;
00090         }
00091 
00092         const double y1 = leadjets[0].rapidity();
00093         const double y2 = leadjets[1].rapidity();
00094         const double ystar = fabs(y1-y2)/2.;
00095         const double m = (leadjets[0] + leadjets[1]).mass();
00096         // Fill mass histogram
00097         _mass[alg].fill(ystar, m/TeV, weight);
00098       }
00099     }
00100 
00101 
00102     /// Normalise histograms etc., after the run
00103     void finalize() {
00104       for (size_t alg = 0; alg < 2; ++alg) {
00105         // factor 0.5 needed because it is differential in dy and not d|y|
00106         _pThistos[alg].scale(0.5*crossSectionPerEvent()/picobarn, this);
00107         _mass[alg].scale(crossSectionPerEvent()/picobarn, this);
00108 }
00109     }
00110 
00111     //@}
00112 
00113 
00114   private:
00115 
00116     // Data members like post-cuts event weight counters go here
00117 
00118     enum Alg { AKT4=0, AKT6=1 };
00119 
00120   private:
00121 
00122     /// The inclusive pT spectrum for akt6 and akt4 jets (array index is jet type from enum above)
00123     BinnedHistogram<double> _pThistos[2];
00124 
00125     /// The di-jet mass spectrum binned in rapidity for akt6 and akt4 jets (array index is jet type from enum above)
00126     BinnedHistogram<double> _mass[2];
00127   };
00128 
00129   // The hook for the plugin system
00130   DECLARE_RIVET_PLUGIN(ATLAS_2012_I1082936);
00131 
00132 }