rivet is hosted by Hepforge, IPPP Durham
CMS_2013_I1265659.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 
00006 namespace Rivet {
00007 
00008 
00009   class CMS_2013_I1265659 : public Analysis {
00010   public:
00011 
00012     /// Constructor
00013     CMS_2013_I1265659()
00014       : Analysis("CMS_2013_I1265659")
00015     {    }
00016 
00017 
00018     /// Book histograms and initialise projections before the run
00019     void init() {
00020       const FastJets jets(FinalState(-10, 10, 0.0*GeV), FastJets::ANTIKT, 0.5);
00021       addProjection(jets, "Jets");
00022 
00023       _h_hTotD = bookHisto1D(1, 1, 1);
00024       _h_hTotDF = bookHisto1D(1, 1, 2);
00025     }
00026 
00027 
00028     /// Perform the per-event analysis
00029     void analyze(const Event& event) {
00030       const Jets& jets = applyProjection<FastJets>(event, "Jets").jetsByPt(30.0*GeV);
00031       if (jets.size() < 3) vetoEvent;
00032 
00033       const FourMomentum jet1 = jets[0].momentum();
00034       const FourMomentum jet2 = jets[1].momentum();
00035       const FourMomentum jet3 = jets[2].momentum();
00036 
00037       // Cut on lead jet pT and lead/sublead jet centrality
00038       if (jet1.pT() < 100*GeV) vetoEvent;
00039       if (jet1.abseta() > 2.5 || jet2.abseta() > 2.5) vetoEvent;
00040 
00041       // Construct eta & phi distances between 2nd and 3rd jets
00042       double dEta23 = jet3.eta() - jet2.eta(); ///< Note not abs
00043       double dPhi23 = jet3.phi() - jet2.phi(); ///< Note not abs
00044       if (dPhi23 > M_PI)  dPhi23 -= 2*M_PI; ///< @todo Use mapTo... functions?
00045       if (dPhi23 < -M_PI) dPhi23 += 2*M_PI; ///< @todo Use mapTo... functions?
00046 
00047       // Cut on distance between 2nd and 3rd jets
00048       const double R23 = add_quad(dPhi23, dEta23);
00049       if (!inRange(R23, 0.5, 1.5)) vetoEvent;
00050 
00051       // Cut on dijet mass
00052       const FourMomentum diJet = jet1 + jet2;
00053       if (diJet.mass() < 220*GeV) vetoEvent;
00054 
00055       // Calc beta and fill histogram (choose central or fwd histo inline)
00056       double beta = fabs(atan2(dPhi23, sign(jet2.eta())*dEta23));
00057       ((jet2.abseta() < 0.8) ? _h_hTotD : _h_hTotDF)->fill(beta, event.weight());
00058     }
00059 
00060 
00061     /// Normalise histograms etc., after the run
00062     void finalize() {
00063       const double width = _h_hTotD->bin(0).xWidth();
00064       normalize(_h_hTotD, width);
00065       normalize(_h_hTotDF, width);
00066     }
00067 
00068 
00069   private:
00070 
00071     /// @name Histograms
00072     Histo1DPtr _h_hTotD;
00073     Histo1DPtr _h_hTotDF;
00074     //@}
00075 
00076   };
00077 
00078 
00079 
00080   // The hook for the plugin system
00081   DECLARE_RIVET_PLUGIN(CMS_2013_I1265659);
00082 
00083 }