StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPythiaEvent.cxx
1 //
2 // Pibero Djawotho <pibero@indiana.edu>
3 // Indiana University
4 // 12 July 2007
5 //
6 // $Log: StPythiaEvent.cxx,v $
7 // Revision 1.6 2012/12/10 21:52:46 pibero
8 // More simplifications...
9 //
10 // Revision 1.5 2012/01/18 18:11:36 pibero
11 // Added PYTHIA variables: MSTU(72), MSTU(73), and MSTP(111)
12 //
13 // Revision 1.4 2011/09/13 16:24:21 pibero
14 // Added DSSV2009 grid
15 //
16 // Revision 1.3 2010/10/04 19:18:29 pibero
17 // Fix copy constructor and assignment operator. Thanks, Alice!
18 //
19 // Revision 1.2 2009/12/08 15:14:24 pibero
20 // Added Pythia tune per Helen Caines request.
21 //
22 // Revision 1.1 2008/06/01 05:31:42 tai
23 // moved StPythiaEvent to StSpinPool/StJetSkimEvent
24 //
25 // Revision 1.5 2008/05/01 01:36:39 rfatemi
26 // check in D. Staszak modifications - additional grids
27 //
28 // Revision 1.4 2008/02/03 01:27:17 rfatemi
29 // Included Gehrmann-Stirling PDFs
30 //
31 // Revision 1.3 2007/11/01 02:48:10 rfatemi
32 // Dave Staszak update for additional GRSV grids
33 //
34 // Revision 1.2 2007/07/19 02:05:38 kocolosk
35 // fix two small bugs I missed in the last commit.
36 //
37 // Revision 1.1 2007/07/19 01:40:41 kocolosk
38 // use Pibero's StPythiaEvent class to supply mcAsymMaker results to user
39 //
40 
41 #include <algorithm>
42 #include "StPythiaEvent.h"
43 
44 using std::copy;
45 
46 ClassImp(StPythiaEvent);
47 
48 StPythiaEvent::StPythiaEvent()
49 {
50  mParticles = new TClonesArray("TParticle");
51 
52  Clear();
53 }
54 
55 StPythiaEvent::~StPythiaEvent()
56 {
57  Clear();
58 
59  if (mParticles) { delete mParticles; mParticles = 0; }
60 }
61 
62 StPythiaEvent::StPythiaEvent(const StPythiaEvent& t)
63 {
64  mRunId = t.mRunId;
65  mEventId = t.mEventId;
66  mProcessId = t.mProcessId;
67  mTune = t.mTune;
68  mVertex = t.mVertex;
69  mS = t.mS;
70  mT = t.mT;
71  mU = t.mU;
72  mPt = t.mPt;
73  mCosTheta = t.mCosTheta;
74  mX1 = t.mX1;
75  mX2 = t.mX2;
76  mMstu72 = t.mMstu72;
77  mMstu73 = t.mMstu73;
78  mMstp111 = t.mMstp111;
79  mPartonALL = t.mPartonALL;
80 
81  copy(t.mDF1,t.mDF1+NPDF,mDF1);
82  copy(t.mDF2,t.mDF2+NPDF,mDF2);
83 
84  copy(t.mF1,t.mF1+2,mF1);
85  copy(t.mF2,t.mF2+2,mF2);
86 
87  mParticles = new TClonesArray("TParticle");
88 
89  for (int i = 0; i < t.mParticles->GetEntriesFast(); ++i) {
90  TParticle* p = (TParticle*)t.mParticles->At(i);
91  new ((*mParticles)[i]) TParticle(*p);
92  }
93 }
94 
95 StPythiaEvent& StPythiaEvent::operator=(const StPythiaEvent& rhs)
96 {
97  if(this == &rhs) return *this;
98 
99  mRunId = rhs.mRunId;
100  mEventId = rhs.mEventId;
101  mProcessId = rhs.mProcessId;
102  mTune = rhs.mTune;
103  mVertex = rhs.mVertex;
104  mS = rhs.mS;
105  mT = rhs.mT;
106  mU = rhs.mU;
107  mPt = rhs.mPt;
108  mCosTheta = rhs.mCosTheta;
109  mX1 = rhs.mX1;
110  mX2 = rhs.mX2;
111  mMstu72 = rhs.mMstu72;
112  mMstu73 = rhs.mMstu73;
113  mMstp111 = rhs.mMstp111;
114  mPartonALL = rhs.mPartonALL;
115 
116  copy(rhs.mDF1,rhs.mDF1+NPDF,mDF1);
117  copy(rhs.mDF2,rhs.mDF2+NPDF,mDF2);
118 
119  copy(rhs.mF1,rhs.mF1+2,mF1);
120  copy(rhs.mF2,rhs.mF2+2,mF2);
121 
122  mParticles->Clear();
123 
124  for (int i = 0; i < rhs.mParticles->GetEntriesFast(); ++i) {
125  TParticle* p = (TParticle*)rhs.mParticles->At(i);
126  new ((*mParticles)[i]) TParticle(*p);
127  }
128 
129  return *this;
130 }