rivet is hosted by Hepforge, IPPP Durham
CDF_2007_S7057202.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/BinnedHistogram.hh"
00004 #include "Rivet/Projections/FastJets.hh"
00005 
00006 namespace Rivet {
00007 
00008 
00009   /// @brief CDF inclusive jet cross-section using the \f$ k_\perp \f$ algorithm
00010   class CDF_2007_S7057202 : public Analysis {
00011   public:
00012 
00013     CDF_2007_S7057202()
00014       : Analysis("CDF_2007_S7057202")
00015     {    }
00016 
00017 
00018     void init() {
00019       // Set up projections
00020       const FinalState fs;
00021       addProjection(FastJets(fs, FastJets::KT, 0.5), "JetsD05");
00022       addProjection(FastJets(fs, FastJets::KT, 0.7), "JetsD07");
00023       addProjection(FastJets(fs, FastJets::KT, 1.0), "JetsD10");
00024 
00025       // Book histos
00026       _binnedHistosD07.addHistogram(  0, 0.1, bookHisto1D(1, 1, 1));
00027       _binnedHistosD07.addHistogram(0.1, 0.7, bookHisto1D(2, 1, 1));
00028       _binnedHistosD07.addHistogram(0.7, 1.1, bookHisto1D(3, 1, 1));
00029       _binnedHistosD07.addHistogram(1.1, 1.6, bookHisto1D(4, 1, 1));
00030       _binnedHistosD07.addHistogram(1.6, 2.1, bookHisto1D(5, 1, 1));
00031       _histoD05 = bookHisto1D(6, 1, 1);
00032       _histoD10 = bookHisto1D(7, 1, 1);
00033     }
00034 
00035 
00036     void analyze(const Event& event) {
00037       const double weight = event.weight();
00038 
00039       foreach (const Jet& jet, applyProjection<JetAlg>(event, "JetsD07").jets(Cuts::pT > 54*GeV))
00040         _binnedHistosD07.fill(jet.absrap(), jet.pT(), weight);
00041 
00042       foreach (const Jet& jet, applyProjection<JetAlg>(event, "JetsD05").jets(Cuts::pT > 54*GeV))
00043         if (inRange(jet.absrap(), 0.1, 0.7)) _histoD05->fill(jet.pT(), weight);
00044 
00045       foreach (const Jet& jet, applyProjection<JetAlg>(event, "JetsD10").jets(Cuts::pT > 54*GeV))
00046         if (inRange(jet.absrap(), 0.1, 0.7)) _histoD10->fill(jet.pT(), weight);
00047     }
00048 
00049 
00050     // Normalise histograms to cross-section
00051     void finalize() {
00052       const double xSec = crossSectionPerEvent()/nanobarn;
00053 
00054       scale(_histoD05, xSec);
00055       scale(_histoD10, xSec);
00056       // scale to xSec/yBinWidth and take into account the double yBinWidth due
00057       // to the absolute value of y
00058       _binnedHistosD07.scale(xSec/2.0, this);
00059     }
00060 
00061   private:
00062 
00063     BinnedHistogram<double> _binnedHistosD07;
00064 
00065     // Single histogram for the \f$R=0.5\f$ \f$k_\perp\f$ jets
00066     Histo1DPtr _histoD05;
00067 
00068     // Single histogram for the \f$R=1.0\f$ \f$k_\perp\f$ jets
00069     Histo1DPtr _histoD10;
00070     //@}
00071 
00072   };
00073 
00074 
00075 
00076   // The hook for the plugin system
00077   DECLARE_RIVET_PLUGIN(CDF_2007_S7057202);
00078 
00079 }