rivet is hosted by Hepforge, IPPP Durham
ATLAS_2014_I1268975.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/FastJets.hh"
00005 #include "Rivet/Tools/BinnedHistogram.hh"
00006 
00007 namespace Rivet {
00008 
00009 
00010   /// Jet mass as a function of ystar
00011   class ATLAS_2014_I1268975 : public Analysis {
00012   public:
00013 
00014     /// Constructor
00015     ATLAS_2014_I1268975()
00016       : Analysis("ATLAS_2014_I1268975")
00017     {    }
00018 
00019 
00020     /// @name Analysis methods
00021     //@{
00022 
00023     /// Book histograms and initialise projections before the run
00024     void init() {
00025 
00026       const FinalState fs;
00027       addProjection(fs,"FinalState");
00028 
00029       FastJets fj04(fs,  FastJets::ANTIKT, 0.4);
00030       fj04.useInvisibles();
00031       addProjection(fj04, "AntiKT04");
00032 
00033       FastJets fj06(fs,  FastJets::ANTIKT, 0.6);
00034       fj06.useInvisibles();
00035       addProjection(fj06, "AntiKT06");
00036 
00037       double ystarbins[] = { 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0};
00038 
00039       size_t massDsOffset(0);
00040       for (size_t alg = 0; alg < 2; ++alg) {
00041         for (size_t i = 0; i < 6; ++i) {
00042           _mass[alg].addHistogram(ystarbins[i], ystarbins[i+1], bookHisto1D(1 + massDsOffset, 1, i+1));
00043         }
00044         massDsOffset += 1;
00045       }
00046     }
00047 
00048 
00049     /// Perform the per-event analysis
00050     void analyze(const Event& event) {
00051       Jets jetAr[2];
00052       jetAr[AKT4] = applyProjection<FastJets>(event, "AntiKT04").jetsByPt(50*GeV);
00053       jetAr[AKT6] = applyProjection<FastJets>(event, "AntiKT06").jetsByPt(50*GeV);
00054 
00055       // Loop over jet "radii" used in analysis
00056       for (size_t alg = 0; alg < 2; ++alg) {
00057 
00058         // Identify dijets
00059         vector<FourMomentum> leadjets;
00060         foreach (const Jet& jet, jetAr[alg]) {
00061           if (jet.absrap() < 3.0 && leadjets.size() < 2) {
00062             if (leadjets.empty() && jet.pT() < 100*GeV) continue;
00063             leadjets.push_back(jet.momentum());
00064           }
00065         }
00066 
00067         // Make sure we have a leading jet with pT > 100 GeV and a second to leading jet with pT > 50 GeV
00068         if (leadjets.size() < 2) {
00069           MSG_DEBUG("Could not find two suitable leading jets");
00070           continue;
00071         }
00072 
00073         const double y1    = leadjets[0].rapidity();
00074         const double y2    = leadjets[1].rapidity();
00075         const double ystar = fabs(y1-y2) / 2.;
00076         const double m     = (leadjets[0] + leadjets[1]).mass();
00077 
00078         // Fill mass histogram
00079         _mass[alg].fill(ystar, m/TeV, event.weight());
00080       }
00081     }
00082 
00083 
00084     /// Normalise histograms etc., after the run
00085     void finalize() {
00086       for (size_t alg = 0; alg < 2; ++alg) {
00087         _mass[alg].scale(crossSectionPerEvent()/picobarn, this);
00088       }
00089     }
00090 
00091     //@}
00092 
00093 
00094   private:
00095 
00096     // Data members like post-cuts event weight counters go here
00097     enum Alg { AKT4=0, AKT6=1 };
00098 
00099     /// The di-jet mass spectrum binned in rapidity for akt6 and akt4 jets (array index is jet type from enum above)
00100     BinnedHistogram<double> _mass[2];
00101 
00102   };
00103 
00104 
00105   // The hook for the plugin system
00106   DECLARE_RIVET_PLUGIN(ATLAS_2014_I1268975);
00107 
00108 }