00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/ParticleIdUtils.hh"
00005 #include "Rivet/Projections/FinalState.hh"
00006 #include "Rivet/Projections/ChargedFinalState.hh"
00007 #include "Rivet/Projections/MissingMomentum.hh"
00008
00009 namespace Rivet {
00010
00011
00012
00013 class UA1_1990_S2044935 : public Analysis {
00014 public:
00015
00016
00017 UA1_1990_S2044935() : Analysis("UA1_1990_S2044935") {
00018 setBeams(PROTON, ANTIPROTON);
00019 setNeedsCrossSection(true);
00020 _sumwTrig = 0;
00021 _sumwTrig08 = 0;
00022 _sumwTrig40 = 0;
00023 _sumwTrig80 = 0;
00024 }
00025
00026
00027
00028
00029
00030
00031 void init() {
00032 addProjection(ChargedFinalState(-5.5, 5.5), "TriggerFS");
00033 addProjection(ChargedFinalState(-2.5, 2.5), "TrackFS");
00034 const FinalState trkcalofs(-2.5, 2.5);
00035 addProjection(MissingMomentum(trkcalofs), "MET25");
00036 const FinalState calofs(-6.0, 6.0);
00037 addProjection(MissingMomentum(calofs), "MET60");
00038
00039 if (fuzzyEquals(sqrtS()/GeV, 63)) {
00040 _hist_Pt = bookProfile1D(8,1,1);
00041 } else if (fuzzyEquals(sqrtS()/GeV, 200)) {
00042 _hist_Nch = bookHistogram1D(1,1,1);
00043 _hist_Esigd3p = bookHistogram1D(2,1,1);
00044 _hist_Pt = bookProfile1D(6,1,1);
00045 _hist_Et = bookHistogram1D(9,1,1);
00046 _hist_Etavg = bookProfile1D(12,1,1);
00047 } else if (fuzzyEquals(sqrtS()/GeV, 500)) {
00048 _hist_Nch = bookHistogram1D(1,1,2);
00049 _hist_Esigd3p = bookHistogram1D(2,1,2);
00050 _hist_Et = bookHistogram1D(10,1,1);
00051 _hist_Etavg = bookProfile1D(12,1,2);
00052 } else if (fuzzyEquals(sqrtS()/GeV, 900)) {
00053 _hist_Nch = bookHistogram1D(1,1,3);
00054 _hist_Esigd3p = bookHistogram1D(2,1,3);
00055 _hist_Pt = bookProfile1D(7,1,1);
00056 _hist_Et = bookHistogram1D(11,1,1);
00057 _hist_Etavg = bookProfile1D(12,1,3);
00058 _hist_Esigd3p08 = bookHistogram1D(3,1,1);
00059 _hist_Esigd3p40 = bookHistogram1D(4,1,1);
00060 _hist_Esigd3p80 = bookHistogram1D(5,1,1);
00061 }
00062
00063 }
00064
00065
00066 void analyze(const Event& event) {
00067
00068 const FinalState& trigfs = applyProjection<FinalState>(event, "TriggerFS");
00069 unsigned int n_minus(0), n_plus(0);
00070 foreach (const Particle& p, trigfs.particles()) {
00071 const double eta = p.momentum().eta();
00072 if (inRange(eta, -5.5, -1.5)) n_minus++;
00073 else if (inRange(eta, 1.5, 5.5)) n_plus++;
00074 }
00075 MSG_DEBUG("Trigger -: " << n_minus << ", Trigger +: " << n_plus);
00076 if (n_plus == 0 || n_minus == 0) vetoEvent;
00077 const double weight = event.weight();
00078 _sumwTrig += weight;
00079
00080
00081 const FinalState& cfs = applyProjection<FinalState>(event, "TrackFS");
00082 const double Et25 = applyProjection<MissingMomentum>(event, "MET25").scalarET();
00083 const double Et60 = applyProjection<MissingMomentum>(event, "MET60").scalarET();
00084 const unsigned int nch = cfs.size();
00085
00086
00087 if (!fuzzyEquals(sqrtS()/GeV, 63, 1E-3)) {
00088 _hist_Nch->fill(nch, weight);
00089 _hist_Et->fill(Et60/GeV, weight);
00090 _hist_Etavg->fill(nch, Et25/GeV, weight);
00091 }
00092
00093
00094 const double deta = 2 * 5.0;
00095 const double dphi = TWOPI;
00096 const double dnch_deta = nch/deta;
00097 foreach (const Particle& p, cfs.particles()) {
00098 const double pt = p.momentum().pT();
00099 const double scaled_weight = weight/(deta*dphi*pt/GeV);
00100 if (!fuzzyEquals(sqrtS()/GeV, 500, 1E-3)) {
00101 _hist_Pt->fill(nch, pt/GeV, weight);
00102 }
00103 if (!fuzzyEquals(sqrtS()/GeV, 63, 1E-3)) {
00104 _hist_Esigd3p->fill(pt/GeV, scaled_weight);
00105 }
00106
00107 if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00108 if (inRange(dnch_deta, 0.8, 4.0)) {
00109 _sumwTrig08 += weight;
00110 _hist_Esigd3p08->fill(pt/GeV, scaled_weight);
00111 } else if (inRange(dnch_deta, 4.0, 8.0)) {
00112 _sumwTrig40 += weight;
00113 _hist_Esigd3p40->fill(pt/GeV, scaled_weight);
00114 } else {
00115
00116 if (dnch_deta > 8.0) {
00117 _sumwTrig80 += weight;
00118 _hist_Esigd3p80->fill(pt/GeV, scaled_weight);
00119 }
00120 }
00121 }
00122 }
00123
00124 }
00125
00126
00127 void finalize() {
00128 if (_sumwTrig <= 0) {
00129 MSG_WARNING("No events passed the trigger!");
00130 return;
00131 }
00132 const double xsec = crossSectionPerEvent();
00133 if (!fuzzyEquals(sqrtS()/GeV, 63, 1E-3)) {
00134 scale(_hist_Nch, 2*xsec/millibarn);
00135 scale(_hist_Esigd3p, xsec/millibarn);
00136 scale(_hist_Et, xsec/millibarn);
00137 }
00138 if (fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {
00139
00140 const double scale08 = (_hist_Esigd3p08->binHeight(0) > 0) ?
00141 0.933e5/(_hist_Esigd3p08->binHeight(0)/_hist_Esigd3p08->axis().binWidth(0)) : 0;
00142 scale(_hist_Esigd3p08, scale08);
00143 const double scale40 = (_hist_Esigd3p40->binHeight(0) > 0) ?
00144 1.369e5/(_hist_Esigd3p40->binHeight(0)/_hist_Esigd3p40->axis().binWidth(0)) : 0;
00145 scale(_hist_Esigd3p40, scale40);
00146 const double scale80 = (_hist_Esigd3p80->binHeight(0) > 0) ?
00147 1.657e5/(_hist_Esigd3p80->binHeight(0)/_hist_Esigd3p80->axis().binWidth(0)) : 0;
00148 scale(_hist_Esigd3p80, scale80);
00149 }
00150 }
00151
00152
00153
00154
00155 private:
00156
00157
00158
00159 double _sumwTrig, _sumwTrig08, _sumwTrig40, _sumwTrig80;
00160
00161
00162
00163
00164 AIDA::IHistogram1D* _hist_Nch;
00165 AIDA::IHistogram1D* _hist_Esigd3p;
00166 AIDA::IHistogram1D* _hist_Esigd3p08;
00167 AIDA::IHistogram1D* _hist_Esigd3p40;
00168 AIDA::IHistogram1D* _hist_Esigd3p80;
00169 AIDA::IProfile1D* _hist_Pt;
00170 AIDA::IProfile1D* _hist_Etavg;
00171 AIDA::IHistogram1D* _hist_Et;
00172
00173
00174 };
00175
00176
00177
00178
00179 AnalysisBuilder<UA1_1990_S2044935> plugin_UA1_1990_S2044935;
00180
00181 }