rivet is hosted by Hepforge, IPPP Durham
D0_2008_S7662670.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetYODA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/LeadingParticlesFinalState.hh"
00007 #include "Rivet/Projections/VetoedFinalState.hh"
00008 #include "Rivet/Projections/FastJets.hh"
00009 
00010 namespace Rivet {
00011 
00012 
00013   /// @brief D0 differential jet cross sections
00014   /// @author Andy Buckley
00015   /// @author Gavin Hesketh
00016   class D0_2008_S7662670 : public Analysis {
00017 
00018   public:
00019 
00020     /// @name Constructors etc.
00021     //@{
00022 
00023     /// Constructor
00024     D0_2008_S7662670()
00025       : Analysis("D0_2008_S7662670")
00026     {    }
00027 
00028     //@}
00029 
00030 
00031     /// @name Analysis methods
00032     //@{
00033 
00034     void init()
00035     {
00036 
00037       // Full final state
00038       FinalState fs;
00039       addProjection(fs, "FS");
00040 
00041       // Jets
00042       FastJets jetpro(fs, FastJets::D0ILCONE, 0.7);
00043       addProjection(jetpro, "Jets");
00044 
00045       // Book histograms
00046       _h_dsigdptdy_y00_04 = bookHisto1D(1, 1, 1);
00047       _h_dsigdptdy_y04_08 = bookHisto1D(2, 1, 1);
00048       _h_dsigdptdy_y08_12 = bookHisto1D(3, 1, 1);
00049       _h_dsigdptdy_y12_16 = bookHisto1D(4, 1, 1);
00050       _h_dsigdptdy_y16_20 = bookHisto1D(5, 1, 1);
00051       _h_dsigdptdy_y20_24 = bookHisto1D(6, 1, 1);
00052     }
00053 
00054 
00055 
00056     /// Do the analysis
00057     void analyze(const Event& event) {
00058       const double weight = event.weight();
00059 
00060       // Skip if the event is empty
00061       const FinalState& fs = applyProjection<FinalState>(event, "FS");
00062       if (fs.empty()) {
00063         MSG_DEBUG("Empty event!");
00064         vetoEvent;
00065       }
00066 
00067       // Find the jets
00068       const JetAlg& jetpro = applyProjection<JetAlg>(event, "Jets");
00069       // Fill histo for each jet
00070       foreach (const Jet& j, jetpro.jets(50.0*GeV)) {
00071         const double pt = j.momentum().pT();
00072         const double y = fabs(j.momentum().rapidity());
00073         MSG_TRACE("Filling histos: pT = " << pt/GeV
00074             << ", |y| = " << y);
00075         if (y < 0.4) {
00076           _h_dsigdptdy_y00_04->fill(pt/GeV, weight);
00077         } else if (y < 0.8) {
00078           _h_dsigdptdy_y04_08->fill(pt/GeV, weight);
00079         } else if (y < 1.2) {
00080           _h_dsigdptdy_y08_12->fill(pt/GeV, weight);
00081         } else if (y < 1.6) {
00082           _h_dsigdptdy_y12_16->fill(pt/GeV, weight);
00083         } else if (y < 2.0) {
00084           _h_dsigdptdy_y16_20->fill(pt/GeV, weight);
00085         } else if (y < 2.4) {
00086           _h_dsigdptdy_y20_24->fill(pt/GeV, weight);
00087         }
00088       }
00089 
00090     }
00091 
00092 
00093     /// Finalize
00094     void finalize() {
00095       /// Scale by L_eff = sig_MC * L_exp / num_MC
00096       const double lumi_mc = sumOfWeights() / crossSection();
00097       const double scalefactor =  1 / lumi_mc;
00098       scale(_h_dsigdptdy_y00_04, scalefactor);
00099       scale(_h_dsigdptdy_y04_08, scalefactor);
00100       scale(_h_dsigdptdy_y08_12, scalefactor);
00101       scale(_h_dsigdptdy_y12_16, scalefactor);
00102       scale(_h_dsigdptdy_y16_20, scalefactor);
00103       scale(_h_dsigdptdy_y20_24, scalefactor);
00104     }
00105 
00106     //@}
00107 
00108   private:
00109 
00110     /// @name Histograms
00111     //@{
00112     Histo1DPtr _h_dsigdptdy_y00_04;
00113     Histo1DPtr _h_dsigdptdy_y04_08;
00114     Histo1DPtr _h_dsigdptdy_y08_12;
00115     Histo1DPtr _h_dsigdptdy_y12_16;
00116     Histo1DPtr _h_dsigdptdy_y16_20;
00117     Histo1DPtr _h_dsigdptdy_y20_24;
00118     //@}
00119 
00120   };
00121 
00122 
00123 
00124   // The hook for the plugin system
00125   DECLARE_RIVET_PLUGIN(D0_2008_S7662670);
00126 
00127 }