rivet is hosted by Hepforge, IPPP Durham
ATLAS_2014_I1326641.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     class ATLAS_2014_I1326641 : public Analysis {
00011         public:
00012 
00013             /// @name Constructors etc.
00014             //@{
00015 
00016             /// Constructor
00017             ATLAS_2014_I1326641()
00018                 : Analysis("ATLAS_2014_I1326641")
00019             {
00020                 setNeedsCrossSection(true);
00021             }
00022 
00023             //@}
00024 
00025 
00026         public:
00027 
00028             /// @name Analysis methods
00029             //@{
00030 
00031             /// Book histograms and initialise projections before the run
00032             void init() {
00033                 //std::cout << " HELLO ANALYSIS : init " << std::endl;
00034                 const FinalState fs;
00035 
00036                 FastJets fj04(fs, FastJets::ANTIKT, 0.4);
00037                 fj04.useInvisibles();
00038                 addProjection(fj04, "AntiKT04");
00039 
00040                 FastJets fj06(fs, FastJets::ANTIKT, 0.6);
00041                 fj06.useInvisibles();
00042                 addProjection(fj06, "AntiKT06");
00043 
00044                 double ystarBins[] = { 0.0, 2.0, 4.0, 6.0, 8.0, 10.0 };
00045 
00046                 size_t massDsOffset(0);
00047                 for (size_t alg = 0; alg < 2; ++alg) {
00048                     for (size_t i = 0; i < 5; ++i) {
00049                         h_trijet_Mass[alg].addHistogram(ystarBins[i], ystarBins[i+1], bookHisto1D(1 + massDsOffset, 1, 1));
00050                         massDsOffset += 1;
00051                     }
00052                 }
00053             }
00054 
00055             /// Perform the per-event analysis
00056             void analyze(const Event& event) {
00057 
00058                 Jets jetAr[2];
00059                 jetAr[AKT4] = applyProjection<FastJets>(event, "AntiKT04").jetsByPt(Cuts::pT > 50*GeV);
00060                 jetAr[AKT6] = applyProjection<FastJets>(event, "AntiKT06").jetsByPt(Cuts::pT > 50*GeV);
00061 
00062                 const size_t nJets = 3;
00063                 double ptCut[nJets] = { 150., 100., 50.};
00064 
00065                 // Loop over jet "radii" used in analysis
00066                 for (size_t alg = 0; alg < 2; ++alg) {
00067                     // Identify 3jets
00068                     vector<FourMomentum> leadJets;
00069                     foreach (const Jet& jet, jetAr[alg]) {
00070                         if (jet.absrap() < 3.0 && leadJets.size() < nJets){
00071                             int filledJets = leadJets.size();
00072                             if (jet.pT() < ptCut[filledJets])  continue;
00073                             leadJets.push_back(jet.momentum());
00074                         }
00075                     }
00076 
00077                     if (leadJets.size() < nJets) {
00078                         MSG_DEBUG("Could not find three suitable leading jets");
00079                         continue;
00080                     }
00081 
00082                     const double y1 = leadJets[0].rapidity();
00083                     const double y2 = leadJets[1].rapidity();
00084                     const double y3 = leadJets[2].rapidity();
00085 
00086                     const double yStar = fabs(y1-y2) + fabs(y2-y3) + fabs(y1-y3);
00087                     const double m = (leadJets[0] + leadJets[1] + leadJets[2]).mass();
00088                     h_trijet_Mass[alg].fill(yStar, m, event.weight());
00089                 }
00090             }
00091 
00092 
00093             /// Normalise histograms etc., after the run
00094             void finalize() {
00095 
00096                 //const double sf( 0.5 * crossSection() / sumOfWeights() );
00097                 const double sf( crossSection() / sumOfWeights() );
00098                 for (size_t alg = 0; alg < 2; ++alg) {
00099                     h_trijet_Mass[alg].scale(sf, this);
00100                 }
00101 
00102             }
00103 
00104             //@}
00105 
00106 
00107         private:
00108 
00109             // Data members like post-cuts event weight counters go here
00110             enum Alg { AKT4=0, AKT6=1 };
00111 
00112         private:
00113 
00114             // The 3 jets mass spectrum for anti-kt 4 and anti-kt 6 jets (array index is jet type from enum above)
00115             BinnedHistogram<double>  h_trijet_Mass[2];
00116     };
00117 
00118     // The hook for the plugin system
00119     DECLARE_RIVET_PLUGIN(ATLAS_2014_I1326641);
00120 }