D0_2008_S7662670.cc
Go to the documentation of this file.00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.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
00014
00015
00016 class D0_2008_S7662670 : public Analysis {
00017
00018 public:
00019
00020
00021
00022
00023
00024 D0_2008_S7662670()
00025 : Analysis("D0_2008_S7662670")
00026 { }
00027
00028
00029
00030
00031
00032
00033
00034 void init()
00035 {
00036
00037
00038 FinalState fs;
00039 addProjection(fs, "FS");
00040
00041
00042 FastJets jetpro(fs, FastJets::D0ILCONE, 0.7);
00043 addProjection(jetpro, "Jets");
00044
00045
00046 _h_dsigdptdy_y00_04 = bookHistogram1D(1, 1, 1);
00047 _h_dsigdptdy_y04_08 = bookHistogram1D(2, 1, 1);
00048 _h_dsigdptdy_y08_12 = bookHistogram1D(3, 1, 1);
00049 _h_dsigdptdy_y12_16 = bookHistogram1D(4, 1, 1);
00050 _h_dsigdptdy_y16_20 = bookHistogram1D(5, 1, 1);
00051 _h_dsigdptdy_y20_24 = bookHistogram1D(6, 1, 1);
00052 }
00053
00054
00055
00056
00057 void analyze(const Event& event) {
00058 const double weight = event.weight();
00059
00060
00061 const FinalState& fs = applyProjection<FinalState>(event, "FS");
00062 if (fs.empty()) {
00063 MSG_DEBUG("Empty event!");
00064 vetoEvent;
00065 }
00066
00067
00068 const JetAlg& jetpro = applyProjection<JetAlg>(event, "Jets");
00069
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
00094 void finalize() {
00095
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
00111
00112 AIDA::IHistogram1D* _h_dsigdptdy_y00_04;
00113 AIDA::IHistogram1D* _h_dsigdptdy_y04_08;
00114 AIDA::IHistogram1D* _h_dsigdptdy_y08_12;
00115 AIDA::IHistogram1D* _h_dsigdptdy_y12_16;
00116 AIDA::IHistogram1D* _h_dsigdptdy_y16_20;
00117 AIDA::IHistogram1D* _h_dsigdptdy_y20_24;
00118
00119
00120 };
00121
00122
00123
00124
00125 DECLARE_RIVET_PLUGIN(D0_2008_S7662670);
00126
00127 }