rivet is hosted by Hepforge, IPPP Durham
CMS_2012_I1102908.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 #include <sstream>
00009 
00010 namespace Rivet {
00011 
00012   /// @cond
00013   inline double _invert(double x) { return (x > 0) ? 1/x : 0; }
00014   /// @endcond
00015 
00016 
00017   /// @brief CMS inclusive and exclusive dijet production ratio at large rapidity intervals
00018   class CMS_2012_I1102908 : public Analysis {
00019   public:
00020 
00021     CMS_2012_I1102908()
00022       : Analysis("CMS_2012_I1102908")
00023     {  }
00024 
00025 
00026   void init() {
00027     // Projections
00028     addProjection(FastJets(FinalState(), FastJets::ANTIKT, 0.5), "antikT");
00029 
00030     // Histograms
00031     /// @todo Can we manage to only register these as they are "really" created in the finalize()?
00032     _h_dijet_ratio = bookScatter2D(1, 1, 1);
00033     _h_MN_dijet_ratio = bookScatter2D(2, 1, 1);
00034 
00035     // Temporary histograms (directly instantiated)
00036     _h_DeltaY_exclusive = Histo1D(referenceData(1, 1, 1));
00037     _h_DeltaY_inclusive = Histo1D(referenceData(1, 1, 1));
00038     _h_DeltaY_MN = Histo1D(referenceData(1, 1, 1));
00039   }
00040 
00041 
00042   void analyze(const Event & event) {
00043     const double weight = event.weight();
00044 
00045     // Jets with  pT > 35.0, -4.7 < y < 4.7
00046     const JetAlg& jet_alg = applyProjection<JetAlg>(event, "antikT");
00047     const Jets& jets = jet_alg.jets(35.0/GeV, Rivet::MAXDOUBLE, -4.7, 4.7, RAPIDITY);
00048 
00049     // Veto event if number of jets less than 2
00050     if (jets.size() < 2) return;
00051 
00052     // Loop over jet pairs
00053     double deltaY_MN = 0.0;
00054     for (size_t ij1 = 0; ij1 < jets.size(); ++ij1) {
00055       for (size_t ij2 = ij1 + 1; ij2 < jets.size(); ++ij2) {
00056         const double deltaY = fabs(jets[ij1].momentum().rapidity() - jets[ij1].momentum().rapidity());
00057         // Exclusive dijet case:
00058         if (jets.size() == 2) _h_DeltaY_exclusive.fill(deltaY, weight);
00059         // Inclusive jets case:
00060         _h_DeltaY_inclusive.fill(deltaY, weight);
00061         // Mueller-Navelet:
00062         if (deltaY > deltaY_MN) deltaY_MN = deltaY;
00063       }
00064     }
00065     _h_DeltaY_MN.fill(deltaY_MN, weight);
00066   }
00067 
00068 
00069 
00070   void finalize() {
00071     *_h_dijet_ratio = YODA::efficiency(_h_DeltaY_inclusive, _h_DeltaY_exclusive);
00072     *_h_MN_dijet_ratio = YODA::efficiency(_h_DeltaY_MN, _h_DeltaY_exclusive);
00073     transformY(*_h_dijet_ratio, _invert);
00074     transformY(*_h_MN_dijet_ratio, _invert);
00075   }
00076 
00077 
00078   private:
00079 
00080     /// @name Histograms
00081     //@{
00082     Scatter2DPtr _h_dijet_ratio, _h_MN_dijet_ratio;
00083     Histo1D _h_DeltaY_inclusive, _h_DeltaY_exclusive, _h_DeltaY_MN;
00084     //@}
00085 
00086   };
00087 
00088 
00089   DECLARE_RIVET_PLUGIN(CMS_2012_I1102908);
00090 
00091 }