CDF_2008_S7828950.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // CDF Run II inclusive jet cross-section using the midpoint algorithm.
00003 
00004 #include "Rivet/Analysis.hh"
00005 #include "Rivet/RivetAIDA.hh"
00006 #include "Rivet/Tools/Logging.hh"
00007 #include "Rivet/Tools/BinnedHistogram.hh"
00008 #include "Rivet/Projections/FastJets.hh"
00009 
00010 namespace Rivet {
00011 
00012 
00013   /// CDF Run II inclusive jet cross-section using the Midpoint algorithm.
00014   /// The analysis includes 1.1fb^-1 of CDF data and is the first with a
00015   /// cone algorithm to include the forward region of the detector.
00016   /// arXiv:0807.2204 to be published in PRD
00017   class CDF_2008_S7828950 : public Analysis {
00018   public:
00019  
00020     /// Constructor
00021     CDF_2008_S7828950() : Analysis("CDF_2008_S7828950")
00022     {
00023       setBeams(PROTON, ANTIPROTON);
00024       setNeedsCrossSection(true);
00025     }
00026 
00027 
00028     /// @name Analysis methods
00029     //@{
00030 
00031     // Book histos and set counters for number of events passed in each one
00032     void init() {
00033       const FinalState fs;
00034       addProjection(FastJets(fs, FastJets::CDFMIDPOINT, 0.7), "JetsM07");
00035 
00036       /// @todo What actually are these histos showing?
00037       _binnedHistosR07.addHistogram(  0, 0.1, bookHistogram1D(1, 1, 1));
00038       _binnedHistosR07.addHistogram(0.1, 0.7, bookHistogram1D(2, 1, 1));
00039       _binnedHistosR07.addHistogram(0.7, 1.1, bookHistogram1D(3, 1, 1));
00040       _binnedHistosR07.addHistogram(1.1, 1.6, bookHistogram1D(4, 1, 1));
00041       _binnedHistosR07.addHistogram(1.6, 2.1, bookHistogram1D(5, 1, 1));
00042 
00043       size_t yind = 0;
00044       foreach (AIDA::IHistogram1D* hist, _binnedHistosR07.getHistograms()) {
00045         _yBinWidths[hist] = 2.0 * (_ybins[yind+1]-_ybins[yind]);
00046         ++yind;
00047       }
00048     }
00049 
00050 
00051     // Do the analysis
00052     void analyze(const Event& event) {
00053       const double weight = event.weight();
00054       foreach (const Jet& jet, applyProjection<FastJets>(event, "JetsM07").jets(62.0*GeV)) {
00055         _binnedHistosR07.fill(fabs(jet.momentum().rapidity()), jet.momentum().pT(), weight);
00056       }
00057     }
00058 
00059 
00060     // Normalise histograms to cross-section
00061     void finalize() {
00062       foreach (AIDA::IHistogram1D* hist, _binnedHistosR07.getHistograms()) {
00063         scale(hist, crossSection()/nanobarn/sumOfWeights()/_yBinWidths[hist]);
00064       }
00065     }
00066 
00067     //@}
00068 
00069 
00070   private:
00071  
00072     /// @name Histograms
00073     //@{
00074 
00075     /// The y bin width of each histogram
00076     map<AIDA::IHistogram1D*, double> _yBinWidths;
00077 
00078     /// The y bin edge values
00079     /// @todo Yuck!
00080     static const double _ybins[6];
00081 
00082     /// Histograms in different eta regions
00083     BinnedHistogram<double> _binnedHistosR07;
00084 
00085   };
00086 
00087 
00088   // Initialise static
00089   const double CDF_2008_S7828950::_ybins[] = { 0.0, 0.1, 0.7, 1.1, 1.6, 2.1 };
00090 
00091 
00092   // This global object acts as a hook for the plugin system
00093   AnalysisBuilder<CDF_2008_S7828950> plugin_CDF_2008_S7828950;
00094 
00095 }