rivet is hosted by Hepforge, IPPP Durham
ATLAS_2014_I1325553.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_I1325553 : public Analysis {
00012   public:
00013 
00014     /// Constructor
00015     ATLAS_2014_I1325553()
00016       : Analysis("ATLAS_2014_I1325553")
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 ybins[] = {0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0};
00038 
00039       size_t ptDsOffset(0);
00040       for (size_t alg = 0; alg < 2; ++alg) {
00041         for (size_t i = 0; i < 6; ++i) {
00042           _pt[alg].addHistogram(ybins[i], ybins[i + 1], bookHisto1D(1 + ptDsOffset, 1, i + 1));
00043         }
00044         ptDsOffset += 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(Cuts::pT > 100*GeV && Cuts::absrap < 3.0);
00053       jetAr[AKT6] = applyProjection<FastJets>(event, "AntiKT06").jetsByPt(Cuts::pT > 100*GeV && Cuts::absrap < 3.0);
00054 
00055       // Loop over jet "radii" used in analysis
00056       for (size_t alg = 0; alg < 2; ++alg) {
00057 
00058         // fill the 1D pt histograms with all the jets passing the cuts
00059         foreach (const Jet& jet, jetAr[alg]) {
00060           const double absrap = jet.absrap();
00061           if (absrap < 3.0) {
00062               const double pt = jet.pT();
00063               if (pt/GeV > 100*GeV) {
00064                 _pt[alg].fill(absrap, pt/GeV, event.weight());
00065               }
00066           }
00067         }
00068       }
00069     }
00070 
00071 
00072     /// Normalise histograms etc., after the run
00073     void finalize() {
00074 
00075 
00076       /// Print summary info
00077       const double xs_pb( crossSection() / picobarn );
00078       const double sumW( sumOfWeights() );
00079       const double xs_norm_factor( 0.5*xs_pb / sumW );
00080       MSG_INFO( "Cross-Section/pb     : " << xs_pb       );
00081       MSG_INFO( "Sum of weights       : " << sumW        );
00082       MSG_INFO( "nEvents              : " << numEvents() );
00083 
00084       for (size_t alg = 0; alg < 2; ++alg) {
00085         _pt[alg].scale(xs_norm_factor, this);
00086       }
00087     }
00088 
00089     //@}
00090 
00091 
00092   private:
00093 
00094     // Data members like post-cuts event weight counters go here
00095     enum Alg { AKT4=0, AKT6=1 };
00096 
00097     /// The inclusive jet spectrum binned in rapidity for akt6 and akt4 jets (array index is jet type from enum above)
00098     BinnedHistogram<double> _pt[2];
00099 
00100   };
00101 
00102 
00103   // The hook for the plugin system
00104   DECLARE_RIVET_PLUGIN(ATLAS_2014_I1325553);
00105 
00106 }