StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StarGenParticle.h
1 #ifndef __StarGenParticle_h__
2 #define __StarGenParticle_h__
3 
4 #include "TObject.h"
5 #include "TRef.h"
6 #include "TMath.h"
7 #include "TLorentzVector.h"
8 
69 class StarGenParticle : public TObject
70 {
71  public:
73  ~StarGenParticle(){ };
74 
75 
76  enum State { kNull,
82  };
83 
84 
86  void SetStatus( Int_t status ){ mStatus = status; }
87 
89  Int_t GetStatus() { return mStatus; }
93  void SetId( Int_t id );
95  Int_t GetId() { return mId; }
97  void SetFirstMother( Int_t first ) { mMother[0]=first; }
100  Int_t GetFirstMother() { return mMother[0]; }
102  void SetLastMother( Int_t last ) { mMother[1]=last; }
105  Int_t GetLastMother(){ return mMother[1]; }
107  void SetFirstDaughter( Int_t first ) { mDaughter[0]=first; }
110  Int_t GetFirstDaughter() { return mDaughter[0]; }
112  void SetLastDaughter( Int_t last ) { mDaughter[1]=last; }
115  Int_t GetLastDaughter(){ return mDaughter[1]; }
116 
118  void SetPx( Float_t px ){ mPx = px; }
120  Float_t GetPx(){ return mPx; }
122  void SetPy( Float_t py ){ mPy = py; }
124  Float_t GetPy(){ return mPy; }
126  void SetPz( Float_t pz ){ mPz = pz; }
128  Float_t GetPz(){ return mPz; }
129 
131  Float_t pt(){ return TMath::Sqrt(pt2()); }
133  Float_t pt2(){ return mPx*mPx+mPy*mPy; }
135  Float_t mt(){ return TMath::Sqrt(mt2()); }
137  Float_t mt2(){ return mMass*mMass+mPx*mPx+mPy*mPy; }
138 
140  TLorentzVector momentum(){ return TLorentzVector(mPx,mPy,mPz,mEnergy); }
141 
142 
143 
145  void SetEnergy( Float_t energy ){ mEnergy = energy; }
147  Float_t GetEnergy(){ return mEnergy; }
149  void SetMass( Float_t mass ){ mMass = mass; }
151  Float_t GetMass(){ return mMass; }
152 
154  void SetVx( Float_t vx ){ mVx = vx; }
156  Float_t GetVx(){ return mVx; }
158  void SetVy( Float_t vy ){ mVy = vy; }
160  Float_t GetVy(){ return mVy; }
162  void SetVz( Float_t vz ){ mVz = vz; }
164  Float_t GetVz(){ return mVz; }
166  void SetTof( Float_t tof ){ mTof = tof; }
168  Float_t GetTof(){ return mTof; }
169 
171  void SetIndex( Int_t i ) { mIndex = i; }
173  Int_t GetIndex(){ return mIndex; }
174 
176  void SetStack( Int_t i ){ mStack = i; }
178  Int_t GetStack(){ return mStack; }
179 
180  void SetPrimaryKey( Int_t k ){ mPrimaryKey = k; }
181  Int_t GetPrimaryKey(){ return mPrimaryKey; }
182 
183  void SetGeneratorId( Int_t id ){ mGeneratorId = id; }
184  Int_t GetGeneratorId(){ return mGeneratorId; }
185 
187  void Print( const Option_t *opts="" ) const;
188 
191  Bool_t Simulate();
192 
193  private:
194 
195  // ------------------------------------------------------
196  // Start of hepevt entry. These variables must remain
197  // packed together in this order in order to emulate the
198  // HEPEVT record
199  Int_t mStatus;
200  Int_t mId;
201  Int_t mMother[2];
202  Int_t mDaughter[2];
203  Float_t mPx, mPy, mPz, mEnergy, mMass;
204  Float_t mVx, mVy, mVz, mTof;
205  // End of hepevt entry. Address is returned using, and
206  // used in StarPrimaryMaker to fill the g2t particle
207  // table for backwards compatability with the starsim era
208  // framework
209  void *get_hepevt_address(){ return &mStatus; }
210  // ------------------------------------------------------
211 
212 
215 
216 
217  protected:
218  Int_t mIndex;
219  Int_t mStack;
220  Int_t mPrimaryKey;
221 
222  Int_t mGeneratorId;
223 
224  friend class StarPrimaryMaker;
225 
226  ClassDef(StarGenParticle,1);
227 };
228 
229 #endif
230 /*
231 struct particle_st {
232  int isthep; //status code of the entry
233  int idhep; //particle identity, accordingly to the PDG standard
234  int jmohep[2]; //pointer(s) to position where the mother(s) stored
235  int jdahep[2]; //pointers to position of the first/last daughter
236  float phep[5]; //p4 and mass (GeV)
237  float vhep[4]; //production vertex (mm) and time (mm/c)
238 }
239  */
Int_t GetIndex()
Get the line number in the event record.
Float_t GetVz()
Get the z-component of the start vertex.
void SetPx(Float_t px)
Set the x-component of the momentum.
Float_t pt()
Returns the transverse momentum of the particle.
void SetVy(Float_t vy)
Set the y-component of the start vertex.
void SetLastMother(Int_t last)
Set the last mother particle in the array of particles.
Yet another particle class.
Int_t GetStatus()
Get the status code of the particle according to the HEPEVT standard.
Float_t GetTof()
Get the tof.
Float_t GetPz()
Get the z-component of the momentum.
Float_t GetEnergy()
Get the energy.
Definition: tof.h:15
void SetVz(Float_t vz)
Set the z-component of the start vertex.
void SetStack(Int_t i)
Set the line number in the particle stack.
void SetVx(Float_t vx)
Set the x-component of the start vertex.
void SetIndex(Int_t i)
Set the line number in the event record.
void SetId(Int_t id)
Int_t GetId()
Get the id code of the particle according to the PDG standard.
Int_t GetStack()
Get the line number in the particle stack.
void SetStatus(Int_t status)
Set the status code of the particle according to the HEPEVT standard.
void SetPz(Float_t pz)
Set the z-component of the momentum.
void SetMass(Float_t mass)
Set the mass.
Float_t pt2()
Returns the transverse momentum squared.
void SetTof(Float_t tof)
Set the tof.
Float_t GetPx()
Get the x-component of the momentum.
TLorentzVector momentum()
Return the 4-momentum of the particle.
Int_t GetLastMother()
Get the last mother particle.
Float_t GetVy()
Get the y-component of the start vertex.
Float_t GetPy()
Get the y-component of the momentum.
Int_t GetFirstMother()
Get the first mother particle.
Float_t mt2()
Returns the transverse mass squared.
void SetLastDaughter(Int_t last)
Set the last daughter particle in the array of particles.
Float_t GetVx()
Get the x-component of the start vertex.
Int_t GetLastDaughter()
Get the last daughter particle.
void SetFirstDaughter(Int_t first)
Set the first daughter particle in the array of particles.
Main steering class for event generation.
void SetPy(Float_t py)
Set the y-component of the momentum.
void SetEnergy(Float_t energy)
Set the energy.
void Print(const Option_t *opts="") const
Print the particle.
void SetFirstMother(Int_t first)
Set the first mother particle in the array of particles.
Float_t GetMass()
Get the mass.
Int_t GetFirstDaughter()
Get the first daughter particle.
Float_t mt()
Returns the transverse mass of the particle.