D0_2008_S7837160.cc
Go to the documentation of this file.00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Tools/ParticleIdUtils.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/WFinder.hh"
00007 #include "Rivet/Projections/LeadingParticlesFinalState.hh"
00008 #include "Rivet/Projections/IdentifiedFinalState.hh"
00009 #include "Rivet/RivetAIDA.hh"
00010
00011 #include "LWH/Histogram1D.h"
00012 #include "LWH/HistogramFactory.h"
00013
00014 namespace Rivet {
00015
00016
00017
00018
00019
00020 class D0_2008_S7837160 : public Analysis {
00021
00022 public:
00023
00024
00025 D0_2008_S7837160()
00026 : Analysis("D0_2008_S7837160")
00027 {
00028
00029 }
00030
00031
00032
00033
00034
00035
00036 void init() {
00037
00038
00039 const WFinder wfe(-5, 5, 25.0*GeV, ELECTRON, 60.0*GeV, 100.0*GeV, 25.0*GeV, 0.2);
00040 addProjection(wfe, "WFe");
00041
00042
00043 const BinEdges& edges = binEdges(1,1,1);
00044 _h_dsigplus_deta_25_35 = bookHistogram1D("/dsigplus_deta_25_35", edges);
00045 _h_dsigminus_deta_25_35 = bookHistogram1D("/dsigminus_deta_25_35", edges);
00046 _h_dsigplus_deta_35 = bookHistogram1D("/dsigplus_deta_35", edges);
00047 _h_dsigminus_deta_35 = bookHistogram1D("/dsigminus_deta_35", edges);
00048 _h_dsigplus_deta_25 = bookHistogram1D("/dsigplus_deta_25", edges);
00049 _h_dsigminus_deta_25 = bookHistogram1D("/dsigminus_deta_25", edges);
00050 }
00051
00052
00053
00054 void analyze(const Event & event) {
00055 const WFinder& wf = applyProjection<WFinder>(event, "WFe");
00056 if (wf.bosons().size() == 0) {
00057 MSG_DEBUG("No W candidates found: vetoing");
00058 vetoEvent;
00059 }
00060
00061
00062
00063
00064 FourMomentum p_e=wf.constituentLeptons()[0].momentum();
00065 int chg_e = PID::threeCharge(wf.constituentLeptons()[0].pdgId());
00066 if (p_e.eta() < 0) chg_e *= -1;
00067 assert(chg_e != 0);
00068
00069 const double weight = event.weight();
00070 const double eta_e = fabs(p_e.eta());
00071 const double et_e = p_e.Et();
00072 if (et_e < 35*GeV) {
00073
00074 if (chg_e < 0) {
00075 _h_dsigminus_deta_25_35->fill(eta_e, weight);
00076 } else {
00077 _h_dsigplus_deta_25_35->fill(eta_e, weight);
00078 }
00079 } else {
00080
00081 if (chg_e < 0) {
00082 _h_dsigminus_deta_35->fill(eta_e, weight);
00083 } else {
00084 _h_dsigplus_deta_35->fill(eta_e, weight);
00085 }
00086 }
00087
00088 if (chg_e < 0) {
00089 _h_dsigminus_deta_25->fill(eta_e, weight);
00090 } else {
00091 _h_dsigplus_deta_25->fill(eta_e, weight);
00092 }
00093 }
00094
00095
00096
00097 void finalize() {
00098
00099 AIDA::IHistogramFactory& hf = histogramFactory();
00100
00101 IHistogram1D* num25_35 = hf.subtract("/num25_35", *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35);
00102 num25_35->scale(100.);
00103 IHistogram1D* denom25_35 = hf.add("/denom25_35", *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35);
00104 assert(num25_35 && denom25_35);
00105 hf.divide(histoDir() + "/d01-x01-y01", *num25_35, *denom25_35);
00106 hf.destroy(num25_35);
00107 hf.destroy(denom25_35);
00108
00109 IHistogram1D* num35 = hf.subtract("/num35", *_h_dsigplus_deta_35, *_h_dsigminus_deta_35);
00110 num35->scale(100.);
00111 IHistogram1D* denom35 = hf.add("/denom35", *_h_dsigplus_deta_35, *_h_dsigminus_deta_35);
00112 assert(num35 && denom35);
00113 hf.divide(histoDir() + "/d01-x01-y02", *num35, *denom35);
00114 hf.destroy(num35);
00115 hf.destroy(denom35);
00116
00117 IHistogram1D* num25 = hf.subtract("/num25", *_h_dsigplus_deta_25, *_h_dsigminus_deta_25);
00118 num25->scale(100.);
00119 IHistogram1D* denom25 = hf.add("/denom25", *_h_dsigplus_deta_25, *_h_dsigminus_deta_25);
00120 assert(num25 && denom25);
00121 hf.divide(histoDir() + "/d01-x01-y03", *num25, *denom25);
00122 hf.destroy(num25);
00123 hf.destroy(denom25);
00124
00125
00126 hf.destroy(_h_dsigplus_deta_25_35);
00127 hf.destroy(_h_dsigminus_deta_25_35);
00128 hf.destroy(_h_dsigplus_deta_35);
00129 hf.destroy(_h_dsigminus_deta_35);
00130 hf.destroy(_h_dsigplus_deta_25);
00131 hf.destroy(_h_dsigminus_deta_25);
00132 }
00133
00134
00135
00136
00137 private:
00138
00139
00140
00141 AIDA::IHistogram1D *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35;
00142 AIDA::IHistogram1D *_h_dsigplus_deta_35, *_h_dsigminus_deta_35;
00143 AIDA::IHistogram1D *_h_dsigplus_deta_25, *_h_dsigminus_deta_25;
00144
00145
00146 };
00147
00148
00149
00150
00151 DECLARE_RIVET_PLUGIN(D0_2008_S7837160);
00152
00153 }