00001
00002 #include "Rivet/Analysis.hh"
00003 #include "Rivet/RivetAIDA.hh"
00004 #include "Rivet/Tools/Logging.hh"
00005 #include "Rivet/Tools/ParticleIdUtils.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/VetoedFinalState.hh"
00008 #include "Rivet/Projections/InvMassFinalState.hh"
00009 #include "Rivet/Projections/FastJets.hh"
00010 #include <algorithm>
00011
00012 namespace Rivet {
00013
00014
00015
00016
00017
00018
00019
00020 class CDF_2008_S7541902 : public Analysis {
00021 public:
00022
00023
00024 CDF_2008_S7541902()
00025 : Analysis("CDF_2008_S7541902"),
00026 _electronETCut(20.0*GeV), _electronETACut(1.1),
00027 _eTmissCut(30.0*GeV), _mTCut(20.0*GeV),
00028 _jetEtCutA(20.0*GeV), _jetEtCutB(25.0*GeV), _jetETA(2.0),
00029 _xpoint(1960.)
00030 { }
00031
00032
00033
00034
00035
00036 void init() {
00037
00038
00039 FinalState fs(-3.6, 3.6);
00040 addProjection(fs, "FS");
00041
00042
00043 vector<pair<PdgId,PdgId> > vids;
00044 vids += make_pair(ELECTRON, NU_EBAR);
00045 vids += make_pair(POSITRON, NU_E);
00046 FinalState fs2(-3.6, 3.6, 20*GeV);
00047 InvMassFinalState invfs(fs2, vids, 65*GeV, 95*GeV);
00048 addProjection(invfs, "INVFS");
00049
00050
00051 VetoedFinalState vfs(fs);
00052 vfs.addVetoOnThisFinalState(invfs);
00053 addProjection(vfs, "VFS");
00054 addProjection(FastJets(vfs, FastJets::CDFJETCLU, 0.4), "Jets");
00055
00056
00057 for (int i = 0 ; i < 4 ; ++i) {
00058 _histJetEt[i] = bookHistogram1D(i+1, 1, 1);
00059 _histJetMultRatio[i] = bookDataPointSet(5 , 1, i+1);
00060 _histJetMult[i] = bookHistogram1D(i+6, 1, 1);
00061 }
00062 _histJetMultNorm = bookHistogram1D("norm", 1, _xpoint, _xpoint+1.);
00063 }
00064
00065
00066
00067 void analyze(const Event& event) {
00068
00069 const InvMassFinalState& invMassFinalState = applyProjection<InvMassFinalState>(event, "INVFS");
00070 const ParticleVector& wDecayProducts = invMassFinalState.particles();
00071
00072 FourMomentum electronP, neutrinoP;
00073 bool gotElectron(false), gotNeutrino(false);
00074 foreach (const Particle& p, wDecayProducts) {
00075 FourMomentum p4 = p.momentum();
00076 if (p4.Et() > _electronETCut && fabs(p4.eta()) < _electronETACut && abs(p.pdgId()) == ELECTRON) {
00077 electronP = p4;
00078 gotElectron = true;
00079 }
00080 else if (p4.Et() > _eTmissCut && abs(p.pdgId()) == NU_E) {
00081 neutrinoP = p4;
00082 gotNeutrino = true;
00083 }
00084 }
00085
00086
00087 if (!gotElectron || !gotNeutrino) vetoEvent;
00088
00089
00090 double mT2 = 2.0 * ( electronP.pT()*neutrinoP.pT() - electronP.px()*neutrinoP.px() - electronP.py()*neutrinoP.py() );
00091 if (sqrt(mT2) < _mTCut ) vetoEvent;
00092
00093
00094 const JetAlg& jetProj = applyProjection<FastJets>(event, "Jets");
00095 Jets theJets = jetProj.jetsByEt(_jetEtCutA);
00096 size_t njetsA(0), njetsB(0);
00097 foreach (const Jet& j, theJets) {
00098 const FourMomentum pj = j.momentum();
00099 if (fabs(pj.rapidity()) < _jetETA) {
00100
00101 if (njetsA < 4 && pj.Et() > _jetEtCutA) {
00102 ++njetsA;
00103 _histJetEt[njetsA-1]->fill(pj.Et(), event.weight());
00104 }
00105
00106 if (pj.Et() > _jetEtCutB) ++njetsB;
00107 }
00108 }
00109
00110
00111 _histJetMultNorm->fill(_xpoint, event.weight());
00112 for (size_t i = 1; i <= njetsB; ++i) {
00113 _histJetMult[i-1]->fill(_xpoint, event.weight());
00114 if (i == 4) break;
00115 }
00116 }
00117
00118
00119
00120
00121 void finalize() {
00122 const double xsec = crossSection()/sumOfWeights();
00123
00124
00125 std::vector<double> xval; xval.push_back(_xpoint);
00126 std::vector<double> xerr; xerr.push_back(.5);
00127
00128 double ratio1to0 = 0.;
00129 if (_histJetMultNorm->binHeight(0) > 0.) ratio1to0 = _histJetMult[0]->binHeight(0)/_histJetMultNorm->binHeight(0);
00130
00131 double frac_err1to0 = 0.;
00132 if (_histJetMult[0]->binHeight(0) > 0.) frac_err1to0 = _histJetMult[0]->binError(0)/_histJetMult[0]->binHeight(0);
00133 if (_histJetMultNorm->binHeight(0) > 0.) {
00134 frac_err1to0 *= frac_err1to0;
00135 frac_err1to0 += pow(_histJetMultNorm->binError(0)/_histJetMultNorm->binHeight(0),2.);
00136 frac_err1to0 = sqrt(frac_err1to0);
00137 }
00138
00139
00140 vector<double> yval[4]; yval[0].push_back(ratio1to0);
00141 vector<double> yerr[4]; yerr[0].push_back(ratio1to0*frac_err1to0);
00142 _histJetMultRatio[0]->setCoordinate(0,xval,xerr);
00143 _histJetMultRatio[0]->setCoordinate(1,yval[0],yerr[0]);
00144 for (int i = 0; i < 4; ++i) {
00145 if (i < 3) {
00146 float ratio = 0.0;
00147 if (_histJetMult[i]->binHeight(0) > 0.0) ratio = _histJetMult[i+1]->binHeight(0)/_histJetMult[i]->binHeight(0);
00148 float frac_err = 0.0;
00149 if (_histJetMult[i]->binHeight(0) > 0.0) frac_err = _histJetMult[i]->binError(0)/_histJetMult[i]->binHeight(0);
00150 if (_histJetMult[i+1]->binHeight(0) > 0.0) {
00151 frac_err *= frac_err;
00152 frac_err += pow(_histJetMult[i+1]->binError(0)/_histJetMult[i+1]->binHeight(0),2.);
00153 frac_err = sqrt(frac_err);
00154 }
00155 yval[i+1].push_back(ratio);
00156 yerr[i+1].push_back(ratio*frac_err);
00157 _histJetMultRatio[i+1]->setCoordinate(0,xval,xerr);
00158 _histJetMultRatio[i+1]->setCoordinate(1,yval[i+1],yerr[i+1]);
00159 }
00160 _histJetEt[i]->scale(xsec);
00161 _histJetMult[i]->scale(xsec);
00162 }
00163 _histJetMultNorm->scale(xsec);
00164 }
00165
00166
00167
00168
00169 private:
00170
00171
00172
00173
00174 double _electronETCut;
00175
00176 double _electronETACut;
00177
00178 double _eTmissCut;
00179
00180 double _mTCut;
00181
00182 double _jetEtCutA;
00183
00184 double _jetEtCutB;
00185
00186 double _jetETA;
00187
00188
00189 double _xpoint;
00190
00191
00192
00193 AIDA::IHistogram1D* _histJetEt[4];
00194 AIDA::IHistogram1D* _histJetMultNorm;
00195 AIDA::IDataPointSet* _histJetMultRatio[4];
00196 AIDA::IHistogram1D* _histJetMult[4];
00197
00198
00199 };
00200
00201
00202
00203
00204 DECLARE_RIVET_PLUGIN(CDF_2008_S7541902);
00205
00206 }