rivet is hosted by Hepforge, IPPP Durham
CMS_2011_S9088458.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 
00012    // CMS Ratio of the 3-jet to 2-jet Cross Sections by Tomo
00013    class CMS_2011_S9088458 : public Analysis {
00014    public:
00015 
00016      CMS_2011_S9088458() : Analysis("CMS_2011_S9088458") {}
00017 
00018 
00019      void init() {
00020        FinalState fs;
00021        FastJets akt(fs, FastJets::ANTIKT, 0.5);
00022        addProjection(akt, "antikT");
00023 
00024        _h_dijet = bookHisto1D(1, 1, 1, "dijet");
00025        _h_trijet = bookHisto1D(1, 1, 1, "trijet");
00026        _h_r32 = bookScatter2D(1, 1, 1);
00027      }
00028 
00029 
00030      void analyze(const Event & event) {
00031        const double weight = event.weight();
00032 
00033        Jets highpT_jets;
00034        double HT = 0;
00035        foreach(const Jet & jet, applyProjection<JetAlg>(event, "antikT").jetsByPt(50.0*GeV)) {
00036          if (fabs(jet.momentum().eta()) < 2.5) {
00037            highpT_jets.push_back(jet);
00038            HT += jet.momentum().pT();
00039          }
00040        }
00041        if (highpT_jets.size() < 2) vetoEvent;
00042 
00043        if (highpT_jets.size() >= 2) _h_dijet->fill(HT/TeV, weight) ;
00044        if (highpT_jets.size() >= 3) _h_trijet->fill(HT/TeV, weight) ;
00045      }
00046 
00047 
00048      void finalize() {
00049        // \todo YODA
00050        // vector<double> yval_R32, yerr_R32;
00051        // for (size_t i = 0;  i < 30; ++i) {
00052        //   double yval, yerr;
00053        //   if (_h_dijet->binHeight(i)==0.0 || _h_trijet->binHeight(i)==0.0) {
00054        //     yval = 0.0;
00055        //     yerr = 0.0;
00056        //   }
00057        //   else {
00058        //     yval =  _h_trijet->binHeight(i)/_h_dijet->binHeight(i);
00059        //     yerr = sqrt(_h_dijet->binError(i)*_h_dijet->binError(i)/(_h_dijet->binHeight(i) * _h_dijet->binHeight(i)) +
00060        //                 _h_trijet->binError(i)*_h_trijet->binError(i)/(_h_trijet->binHeight(i) * _h_trijet->binHeight(i))) * yval;
00061        //   }
00062        //   yval_R32.push_back(yval);
00063        //   yerr_R32.push_back(yerr);
00064        // }
00065        // _h_r32->setCoordinate(1, yval_R32, yerr_R32);
00066        // histogramFactory().destroy(_h_dijet);
00067        // histogramFactory().destroy(_h_trijet);
00068      }
00069 
00070 
00071    private:
00072 
00073      Histo1DPtr _h_dijet, _h_trijet;
00074      Scatter2DPtr _h_r32;
00075 
00076   };
00077 
00078   // This global object acts as a hook for the plugin system
00079   DECLARE_RIVET_PLUGIN(CMS_2011_S9088458);
00080 
00081 }
00082 
00083