rivet is hosted by Hepforge, IPPP Durham
CMS_2011_S8950903.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Tools/BinnedHistogram.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/FastJets.hh"
00007 #include "Rivet/RivetYODA.hh"
00008 
00009 namespace Rivet {
00010 
00011   // CMS azimuthal decorrelations
00012   class CMS_2011_S8950903 : public Analysis {
00013   public:
00014 
00015     CMS_2011_S8950903() : Analysis("CMS_2011_S8950903") {}
00016 
00017 
00018     void init() {
00019       FinalState fs;
00020       FastJets akt(fs, FastJets::ANTIKT, 0.5);
00021       addProjection(akt, "antikT");
00022 
00023       _h_deltaPhi.addHistogram( 80.,  110., bookHisto1D(1, 1, 1));
00024       _h_deltaPhi.addHistogram(110.,  140., bookHisto1D(2, 1, 1));
00025       _h_deltaPhi.addHistogram(140.,  200., bookHisto1D(3, 1, 1));
00026       _h_deltaPhi.addHistogram(200.,  300., bookHisto1D(4, 1, 1));
00027       _h_deltaPhi.addHistogram(300., 7000., bookHisto1D(5, 1, 1));
00028     }
00029 
00030 
00031     void analyze(const Event & event) {
00032       const double weight = event.weight();
00033 
00034       const Jets& jets = applyProjection<JetAlg>(event, "antikT").jetsByPt();
00035       if (jets.size() < 2) vetoEvent;
00036 
00037       if (fabs(jets[0].momentum().eta()) > 1.1 || jets[0].momentum().pT() < 80.) vetoEvent;
00038       if (fabs(jets[1].momentum().eta()) > 1.1 || jets[1].momentum().pT() < 30.) vetoEvent;
00039 
00040       double dphi = deltaPhi(jets[0].momentum(), jets[1].momentum().phi());
00041 
00042       _h_deltaPhi.fill(jets[0].momentum().pT(), dphi, weight);
00043     }
00044 
00045 
00046     void finalize() {
00047       foreach (Histo1DPtr histo, _h_deltaPhi.getHistograms()) {
00048         normalize(histo, 1.);
00049       }
00050     }
00051 
00052   private:
00053 
00054     BinnedHistogram<double> _h_deltaPhi;
00055 
00056   };
00057 
00058   // This global object acts as a hook for the plugin system
00059   DECLARE_RIVET_PLUGIN(CMS_2011_S8950903);
00060 
00061 }
00062