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