79 #ifndef ST_PYTHIA_EVENT
80 #define ST_PYTHIA_EVENT
84 #include "TParticle.h"
85 #include "TClonesArray.h"
96 enum PDF { LO=0, NLO=1, STD=1, ZERO=2, MAX=3, MIN=4, M015=5, M030=6, M045=7, M060=8, M075=9, M090=10, M105=11, P030=12, P045=13, P060=14, P070=15, GS_NLOA=16, GS_NLOB=17, GS_NLOC=18, DSSV=19, LSS1=20, LSS2=21, LSS3=22, AAC1=23, AAC2=24, AAC3=25, BB1=26, BB2=27, DNS1=28, DNS2=29, DSSV2009a=30, LSS2010_delGpos=31, LSS2010_chsign_delG=32, BB2010=33 };
99 int processId()
const;
101 const TVector3&
vertex()
const;
106 float cosTheta()
const;
113 float partonALL()
const;
114 float dF1(PDF scenario = STD)
const;
115 float dF2(PDF scenario = STD)
const;
116 float f1(PDF scenario = STD)
const;
117 float f2(PDF scenario = STD)
const;
118 float ALL(PDF scenario = STD)
const;
120 const TClonesArray* particles()
const;
121 int numberOfParticles()
const;
122 const TParticle* particle(
int i)
const;
124 void Clear(Option_t* option =
"");
125 void setRunId(
int id);
126 void setEventId(
int id);
127 void setProcessId(
int id);
128 void setTune(
int tune);
129 void setVertex(
const TVector3& v);
133 void setPt(
float pt);
134 void setCosTheta(
float cosTheta);
135 void setX1(
float x1);
136 void setX2(
float x2);
137 void setMstu72(
int mstu72);
138 void setMstu73(
int mstu73);
139 void setMstp111(
int mstp111);
140 void setPartonALL(
float a);
141 void setDF1(PDF scenario,
float val);
142 void setDF2(PDF scenario,
float val);
143 void setF1(PDF scenario,
float val);
144 void setF2(PDF scenario,
float val);
146 void addParticle(
const TParticle& particle);
148 void printHelper(
int first,
int last)
const;
172 TClonesArray* mParticles;
177 inline int StPythiaEvent::runId()
const {
return mRunId; }
178 inline int StPythiaEvent::eventId()
const {
return mEventId; }
179 inline int StPythiaEvent::processId()
const {
return mProcessId; }
180 inline int StPythiaEvent::tune()
const {
return mTune; }
181 inline const TVector3& StPythiaEvent::vertex()
const {
return mVertex; }
182 inline float StPythiaEvent::s()
const {
return mS; }
183 inline float StPythiaEvent::t()
const {
return mT; }
184 inline float StPythiaEvent::u()
const {
return mU; }
185 inline float StPythiaEvent::pt()
const {
return mPt; }
186 inline float StPythiaEvent::cosTheta()
const {
return mCosTheta; }
187 inline float StPythiaEvent::x1()
const {
return mX1; }
188 inline float StPythiaEvent::x2()
const {
return mX2; }
189 inline int StPythiaEvent::mstu72()
const {
return mMstu72; }
190 inline int StPythiaEvent::mstu73()
const {
return mMstu73; }
191 inline int StPythiaEvent::mstp111()
const {
return mMstp111; }
192 inline float StPythiaEvent::Q2()
const {
return mPt * mPt; }
193 inline float StPythiaEvent::partonALL()
const {
return mPartonALL; }
194 inline float StPythiaEvent::dF1(PDF scenario)
const {
return mDF1[scenario]; }
195 inline float StPythiaEvent::dF2(PDF scenario)
const {
return mDF2[scenario]; }
197 inline float StPythiaEvent::f1(PDF scenario)
const
199 return (scenario == LO) ? mF1[LO] : mF1[NLO];
202 inline float StPythiaEvent::f2(PDF scenario)
const
204 return (scenario == LO) ? mF2[LO] : mF2[NLO];
207 inline float StPythiaEvent::ALL(PDF scenario)
const
209 return (dF1(scenario)*dF2(scenario)*partonALL())/(f1(scenario)*f2(scenario));
212 inline const TClonesArray* StPythiaEvent::particles()
const {
return mParticles; }
213 inline int StPythiaEvent::numberOfParticles()
const {
return mParticles->GetEntriesFast(); }
214 inline const TParticle* StPythiaEvent::particle(
int i)
const {
return (TParticle*)mParticles->At(i); }
216 inline void StPythiaEvent::addParticle(
const TParticle& particle)
218 new ((*mParticles)[mParticles->GetEntriesFast()]) TParticle(particle);
221 inline void StPythiaEvent::Clear(Option_t* option)
227 mVertex.SetXYZ(0, 0, 0);
239 fill(mDF1,mDF1+NPDF,0);
240 fill(mDF2,mDF2+NPDF,0);
241 mF1[0] = 0; mF1[1] = 0;
242 mF2[0] = 0; mF2[1] = 0;
244 if (mParticles) mParticles->Clear(option);
247 inline void StPythiaEvent::setRunId(
int id) { mRunId = id; }
248 inline void StPythiaEvent::setEventId(
int id) { mEventId = id; }
249 inline void StPythiaEvent::setProcessId(
int id) { mProcessId = id; }
250 inline void StPythiaEvent::setTune(
int tune) { mTune = tune; }
251 inline void StPythiaEvent::setVertex(
const TVector3& v) { mVertex = v; }
252 inline void StPythiaEvent::setS(
float s) { mS = s; }
253 inline void StPythiaEvent::setT(
float t) { mT = t; }
254 inline void StPythiaEvent::setU(
float u) { mU = u; }
255 inline void StPythiaEvent::setPt(
float pt) { mPt = pt; }
256 inline void StPythiaEvent::setCosTheta(
float cosTheta) { mCosTheta = cosTheta; }
257 inline void StPythiaEvent::setX1(
float x1) { mX1 = x1; }
258 inline void StPythiaEvent::setX2(
float x2) { mX2 = x2; }
259 inline void StPythiaEvent::setMstu72(
int mstu72) { mMstu72 = mstu72; }
260 inline void StPythiaEvent::setMstu73(
int mstu73) { mMstu73 = mstu73; }
261 inline void StPythiaEvent::setMstp111(
int mstp111) { mMstp111 = mstp111; }
262 inline void StPythiaEvent::setPartonALL(
float a) { mPartonALL = a; }
263 inline void StPythiaEvent::setDF1(PDF scenario,
float val) { mDF1[scenario] = val; }
264 inline void StPythiaEvent::setDF2(PDF scenario,
float val) { mDF2[scenario] = val; }
266 inline void StPythiaEvent::setF1(PDF scenario,
float val)
268 if(scenario == LO) mF1[0] = val;
272 inline void StPythiaEvent::setF2(PDF scenario,
float val)
274 if(scenario == LO) mF2[0] = val;
279 inline void StPythiaEvent::print()
const
282 puts(
" Event listing (standard)\n");
283 puts(
" I particle/jet K(I,1) K(I,2) K(I,3) K(I,4) K(I,5) P(I,1) P(I,2) P(I,3) P(I,4) P(I,5)\n");
287 puts(
" ==================================================================================================================================");
290 printHelper(2,mstu72());
291 puts(
" ==================================================================================================================================");
294 printHelper(mstu72(),mstu73());
295 puts(
" ==================================================================================================================================");
298 printHelper(mstu73(),numberOfParticles());
299 puts(
" ==================================================================================================================================");
302 inline void StPythiaEvent::printHelper(
int first,
int last)
const
304 for (
int i = first; i < last; ++i) {
305 const TParticle* part = particle(i);
308 printf(
"%5d%14s%8d%9d%7d%11d%12d%13f%13f%13f%13f%13f\n",i+1,part->GetName(),part->GetStatusCode(),part->GetPdgCode(),part->GetFirstMother(),part->GetFirstDaughter(),part->GetLastDaughter(),mom.Px(),mom.Py(),mom.Pz(),mom.E(),mom.M());