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 setBeams(PROTON, ANTIPROTON);
00030 }
00031
00032
00033
00034
00035
00036
00037 void init() {
00038
00039
00040 const WFinder wfe(-5, 5, 0.0*GeV, ELECTRON, 60.0*GeV, 100.0*GeV, 0*GeV, 0.2);
00041 addProjection(wfe, "WFe");
00042
00043
00044 const BinEdges& edges = binEdges(1,1,1);
00045 _h_dsigplus_deta_25_35 = bookHistogram1D("/dsigplus_deta_25_35", edges);
00046 _h_dsigminus_deta_25_35 = bookHistogram1D("/dsigminus_deta_25_35", edges);
00047 _h_dsigplus_deta_35 = bookHistogram1D("/dsigplus_deta_35", edges);
00048 _h_dsigminus_deta_35 = bookHistogram1D("/dsigminus_deta_35", edges);
00049 _h_dsigplus_deta_25 = bookHistogram1D("/dsigplus_deta_25", edges);
00050 _h_dsigminus_deta_25 = bookHistogram1D("/dsigminus_deta_25", edges);
00051 }
00052
00053
00054
00055 void analyze(const Event & event) {
00056 const WFinder& wf = applyProjection<WFinder>(event, "WFe");
00057 if (wf.size() == 0) {
00058 getLog() << Log::DEBUG << "No W candidates found: vetoing" << endl;
00059 vetoEvent;
00060 }
00061
00062
00063
00064
00065 FourMomentum p_e;
00066 int chg_e = 0;
00067 foreach (const Particle& l, wf.constituentsFinalState().particles()) {
00068 const FourMomentum pl = l.momentum();
00069 if (abs(l.pdgId()) == ELECTRON) {
00070 chg_e = PID::threeCharge(l.pdgId());
00071 p_e = pl;
00072 }
00073 if (pl.Et()/GeV < 25.0) {
00074 getLog() << Log::DEBUG << l.pdgId() << " fails Et cut" << endl;
00075 vetoEvent;
00076 }
00077 }
00078 assert(chg_e != 0);
00079
00080 const double weight = event.weight();
00081 const double eta_e = fabs(p_e.pseudorapidity());
00082 const double et_e = p_e.Et();
00083 if (et_e < 35*GeV) {
00084
00085 if (chg_e < 0) {
00086 _h_dsigminus_deta_25_35->fill(eta_e, weight);
00087 } else {
00088 _h_dsigplus_deta_25_35->fill(eta_e, weight);
00089 }
00090 } else {
00091
00092 if (chg_e < 0) {
00093 _h_dsigminus_deta_35->fill(eta_e, weight);
00094 } else {
00095 _h_dsigplus_deta_35->fill(eta_e, weight);
00096 }
00097 }
00098
00099 if (chg_e < 0) {
00100 _h_dsigminus_deta_25->fill(eta_e, weight);
00101 } else {
00102 _h_dsigplus_deta_25->fill(eta_e, weight);
00103 }
00104 }
00105
00106
00107
00108 void finalize() {
00109
00110 AIDA::IHistogramFactory& hf = histogramFactory();
00111
00112 IHistogram1D* num25_35 = hf.subtract("/num25_35", *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35);
00113 IHistogram1D* denom25_35 = hf.add("/denom25_35", *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35);
00114 assert(num25_35 && denom25_35);
00115 hf.divide(histoDir() + "/d01-x01-y01", *num25_35, *denom25_35);
00116 hf.destroy(num25_35);
00117 hf.destroy(denom25_35);
00118
00119 IHistogram1D* num35 = hf.subtract("/num35", *_h_dsigplus_deta_35, *_h_dsigminus_deta_35);
00120 IHistogram1D* denom35 = hf.add("/denom35", *_h_dsigplus_deta_35, *_h_dsigminus_deta_35);
00121 assert(num35 && denom35);
00122 hf.divide(histoDir() + "/d01-x01-y02", *num35, *denom35);
00123 hf.destroy(num35);
00124 hf.destroy(denom35);
00125
00126 IHistogram1D* num25 = hf.subtract("/num25", *_h_dsigplus_deta_25, *_h_dsigminus_deta_25);
00127 IHistogram1D* denom25 = hf.add("/denom25", *_h_dsigplus_deta_25, *_h_dsigminus_deta_25);
00128 assert(num25 && denom25);
00129 hf.divide(histoDir() + "/d01-x01-y03", *num25, *denom25);
00130 hf.destroy(num25);
00131 hf.destroy(denom25);
00132
00133
00134 hf.destroy(_h_dsigplus_deta_25_35);
00135 hf.destroy(_h_dsigminus_deta_25_35);
00136 hf.destroy(_h_dsigplus_deta_35);
00137 hf.destroy(_h_dsigminus_deta_35);
00138 hf.destroy(_h_dsigplus_deta_25);
00139 hf.destroy(_h_dsigminus_deta_25);
00140 }
00141
00142
00143
00144
00145 private:
00146
00147
00148
00149 AIDA::IHistogram1D *_h_dsigplus_deta_25_35, *_h_dsigminus_deta_25_35;
00150 AIDA::IHistogram1D *_h_dsigplus_deta_35, *_h_dsigminus_deta_35;
00151 AIDA::IHistogram1D *_h_dsigplus_deta_25, *_h_dsigminus_deta_25;
00152
00153
00154 };
00155
00156
00157
00158 AnalysisBuilder<D0_2008_S7837160> plugin_D0_2008_S7837160;
00159
00160 }