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(54.0*GeV)) {
00040         double y = fabs(jet.rapidity());
00041         _binnedHistosD07.fill(y, jet.pT(), weight);
00042       }
00043 
00044       foreach (const Jet& jet, applyProjection<JetAlg>(event, "JetsD05").jets(54.0*GeV)) {
00045         double y = fabs(jet.rapidity());
00046         if (y >= 0.1 && y < 0.7) _histoD05->fill(jet.pT(), weight);
00047       }
00048 
00049       foreach (const Jet& jet, applyProjection<JetAlg>(event, "JetsD10").jets(54.0*GeV)) {
00050         double y = fabs(jet.rapidity());
00051         if (y >= 0.1 && y < 0.7) _histoD10->fill(jet.pT(), weight);
00052       }
00053     }
00054 
00055 
00056     // Normalise histograms to cross-section
00057     void finalize() {
00058       const double xSec = crossSectionPerEvent()/nanobarn;
00059 
00060       scale(_histoD05, xSec);
00061       scale(_histoD10, xSec);
00062       // scale to xSec/yBinWidth and take into account the double yBinWidth due
00063       // to the absolute value of y
00064       _binnedHistosD07.scale(xSec/2.0, this);
00065     }
00066 
00067   private:
00068 
00069     BinnedHistogram<double> _binnedHistosD07;
00070 
00071     // Single histogram for the \f$R=0.5\f$ \f$k_\perp\f$ jets
00072     Histo1DPtr _histoD05;
00073 
00074     // Single histogram for the \f$R=1.0\f$ \f$k_\perp\f$ jets
00075     Histo1DPtr _histoD10;
00076     //@}
00077 
00078   };
00079 
00080 
00081 
00082   // The hook for the plugin system
00083   DECLARE_RIVET_PLUGIN(CDF_2007_S7057202);
00084 
00085 }