CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/GeneratorInterface/RivetInterface/src/CMS_2011_S8968497.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Projections/FastJets.hh"
00004 #include "Rivet/Tools/BinnedHistogram.hh"
00005 
00006 namespace Rivet {
00007 
00008   class CMS_2011_S8968497 : public Analysis {
00009   public:
00010     CMS_2011_S8968497() : Analysis("CMS_2011_S8968497") {
00011        setBeams(PROTON, PROTON);
00012     }
00013 //=====================================================INIT
00014     void init() {
00015       FinalState fs;
00016       FastJets antikt(fs, FastJets::ANTIKT, 0.5);
00017       addProjection(antikt, "ANTIKT");
00018       _h_chi_dijet.addHistogram(2200., 7000., bookHistogram1D(1, 1, 1));
00019       _h_chi_dijet.addHistogram(1800., 2200., bookHistogram1D(2, 1, 1));
00020       _h_chi_dijet.addHistogram(1400., 1800., bookHistogram1D(3, 1, 1));
00021       _h_chi_dijet.addHistogram(1100., 1400., bookHistogram1D(4, 1, 1));
00022       _h_chi_dijet.addHistogram(850., 1100., bookHistogram1D(5, 1, 1));
00023       _h_chi_dijet.addHistogram(650., 850., bookHistogram1D(6, 1, 1));
00024       _h_chi_dijet.addHistogram(500., 650., bookHistogram1D(7, 1, 1));
00025       _h_chi_dijet.addHistogram(350., 500., bookHistogram1D(8, 1, 1));
00026       _h_chi_dijet.addHistogram(250., 350., bookHistogram1D(9, 1, 1));
00027     }
00028 //=====================================================ANALYZE
00029     void analyze(const Event& event) {
00030       const double weight = event.weight();
00031       const Jets& jets = applyProjection<JetAlg>(event, "ANTIKT").jetsByPt();
00032       if (jets.size() < 2) vetoEvent;
00033       FourMomentum j0(jets[0].momentum());
00034       FourMomentum j1(jets[1].momentum());
00035       double y0 = j0.rapidity();
00036       double y1 = j1.rapidity();
00037       if (fabs(y0+y1)/2. > 1.11) vetoEvent;
00038       double mjj = FourMomentum(j0+j1).mass();
00039       double chi = exp(fabs(y0-y1));
00040       _h_chi_dijet.fill(mjj, chi, weight);
00041 
00042     }
00043 //=====================================================FINALIZE
00044     void finalize() {
00045       foreach (AIDA::IHistogram1D* hist, _h_chi_dijet.getHistograms()) {
00046         normalize(hist);
00047       }
00048     }
00049 //=====================================================DECLARATIONS
00050   private:
00051     BinnedHistogram<double> _h_chi_dijet;
00052    };
00053   // This global object acts as a hook for the plugin system
00054   AnalysisBuilder<CMS_2011_S8968497> plugin_CMS_2011_S8968497;
00055 }
00056