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(Cuts::pT > 50*GeV)) {
00069         const double pt = j.pT();
00070         const double y = j.absrap();
00071         MSG_TRACE("Filling histos: pT = " << pt/GeV << ", |y| = " << y);
00072         if (y < 0.4) {
00073           _h_dsigdptdy_y00_04->fill(pt/GeV, weight);
00074         } else if (y < 0.8) {
00075           _h_dsigdptdy_y04_08->fill(pt/GeV, weight);
00076         } else if (y < 1.2) {
00077           _h_dsigdptdy_y08_12->fill(pt/GeV, weight);
00078         } else if (y < 1.6) {
00079           _h_dsigdptdy_y12_16->fill(pt/GeV, weight);
00080         } else if (y < 2.0) {
00081           _h_dsigdptdy_y16_20->fill(pt/GeV, weight);
00082         } else if (y < 2.4) {
00083           _h_dsigdptdy_y20_24->fill(pt/GeV, weight);
00084         }
00085       }
00086 
00087     }
00088 
00089 
00090     /// Finalize
00091     void finalize() {
00092       /// Scale by L_eff = sig_MC * L_exp / num_MC
00093       const double lumi_mc = sumOfWeights() / crossSection();
00094       const double scalefactor =  1 / lumi_mc;
00095       scale(_h_dsigdptdy_y00_04, scalefactor);
00096       scale(_h_dsigdptdy_y04_08, scalefactor);
00097       scale(_h_dsigdptdy_y08_12, scalefactor);
00098       scale(_h_dsigdptdy_y12_16, scalefactor);
00099       scale(_h_dsigdptdy_y16_20, scalefactor);
00100       scale(_h_dsigdptdy_y20_24, scalefactor);
00101     }
00102 
00103     //@}
00104 
00105   private:
00106 
00107     /// @name Histograms
00108     //@{
00109     Histo1DPtr _h_dsigdptdy_y00_04;
00110     Histo1DPtr _h_dsigdptdy_y04_08;
00111     Histo1DPtr _h_dsigdptdy_y08_12;
00112     Histo1DPtr _h_dsigdptdy_y12_16;
00113     Histo1DPtr _h_dsigdptdy_y16_20;
00114     Histo1DPtr _h_dsigdptdy_y20_24;
00115     //@}
00116 
00117   };
00118 
00119 
00120 
00121   // The hook for the plugin system
00122   DECLARE_RIVET_PLUGIN(D0_2008_S7662670);
00123 
00124 }