StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoMcTrack.h
1 
8 #ifndef StPicoMcTrack_h
9 #define StPicoMcTrack_h
10 
11 // C++ headers
12 #include <vector>
13 
14 // ROOT headers
15 #include "TObject.h"
16 #include "TVector3.h"
17 #include "TLorentzVector.h"
18 
19 // PicoDst headers
20 #include "StPicoHelix.h"
21 #include "StPicoPhysicalHelix.h"
22 
23 #if defined (_VANILLA_ROOT_)
24 #include "SystemOfUnits.h"
25 #include "PhysicalConstants.h"
26 #else
27 #include "StarClassLibrary/SystemOfUnits.h"
28 #include "StarClassLibrary/PhysicalConstants.h"
29 #endif
30 
31 //_________________
32 class StPicoMcTrack : public TObject {
33 
34  public:
35 
37  StPicoMcTrack();
41  virtual ~StPicoMcTrack();
43  virtual void Print(const Char_t *option = "") const;
44 
46  enum EHIT {ktpc, ksvt, kssd, kctb, keem, kemc, kesm,
47  kftp, kgem, khpd, kist, kigt, kfst, kfgt,
48  kfpd, kmwc, kpgc, kpmd, ksmd, kpix, ktof,
49  kvpd, ketr, khca, kfts, keto, kstg, kwca,
50  kpre, kepd, ktot};
51 
52  //
53  // Getters
54  //
55 
57  Int_t id() const { return mId; }
59  Int_t pdgId() const;
61  Int_t geantId() const { return (Int_t)mGePid; }
63  Int_t charge() const { return (Int_t)mCharge; }
65  TVector3 p() const { return TVector3(mPx, mPy, mPz); }
67  Float_t pt() const { return p().Perp(); }
69  Float_t ptot() const { return p().Mag(); }
71  Float_t eta() const { return p().PseudoRapidity(); }
73  TLorentzVector fourMomentum() const { return TLorentzVector(mPx,mPy,mPz,mE); }
75  Float_t energy() const { return mE; }
77  Float_t rapidity() const { return fourMomentum().Rapidity(); }
79  Bool_t isFromShower() const { return mIsFromShower; }
81  Int_t idVtxStart() const { return mIdVtxStart; }
83  Int_t idVtxStop() const { return mIdVtxStop; }
85  Int_t idVtxItrmd() const { return mIdVtxItrmd; }
87  Int_t nHits() const
88  { Int_t n=0; for (Int_t i=ktpc; i<ktot; i++) n+=nHits(i); return n; }
90  UChar_t nHits(Int_t k) const { return mHits[k]; }
92  UChar_t nHitsCtb() const { return mHits[kctb]; }
94  UChar_t nHitsEEmc() const { return mHits[keem]; }
96  UChar_t nHitsBEmc() const { return mHits[kemc]; }
98  UChar_t nHitsEsm() const { return mHits[kesm]; }
100  UChar_t nHitsFtpc() const { return mHits[kftp]; }
102  UChar_t nHitsGem() const { return mHits[kgem]; }
104  UChar_t nHitsHpd() const { return mHits[khpd]; }
106  UChar_t nHitsIst() const { return mHits[kist]; }
108  UChar_t nHitsIgt() const { return mHits[kigt]; }
110  UChar_t nHitsFst() const { return mHits[kfst]; }
112  UChar_t nHitsFgt() const { return mHits[kfgt]; }
114  UChar_t nHitsFpd() const { return mHits[kfpd]; }
116  UChar_t nHitsMwc() const { return mHits[kmwc]; }
118  UChar_t nHitsPgc() const { return mHits[kpgc]; }
120  UChar_t nHitsPmd() const { return mHits[kpmd]; }
122  UChar_t nHitsBsmd() const { return mHits[ksmd]; }
124  UChar_t nHitsSsd() const { return mHits[kssd]; }
126  UChar_t nHitsSvt() const { return mHits[ksvt]; }
128  UChar_t nHitsPxl() const { return mHits[kpix]; }
130  UChar_t nHitsTof() const { return mHits[ktof]; }
132  UChar_t nHitsTpc() const { return mHits[ktpc]; }
134  UChar_t nHitsVpd() const { return mHits[kvpd]; }
136  UChar_t nHitsEtr() const { return mHits[ketr]; }
138  UChar_t nHitsHca() const { return mHits[khca]; }
140  UChar_t nHitsFts() const { return mHits[kfts]; }
142  UChar_t nHitsEto() const { return mHits[keto]; }
144  UChar_t nHitsStg() const { return mHits[kstg]; }
146  UChar_t nHitsWca() const { return mHits[kwca]; }
148  UChar_t nHitsPre() const { return mHits[kpre]; }
150  UChar_t nHitsEpd() const { return mHits[kepd]; }
152  const Char_t *geName();
154  Int_t correctGePid(Int_t id);
155 
156  //
157  // Setters
158  //
159 
161  void setId(Int_t id);
163  void setGeantId(Int_t id) { mGePid = id; }
165  void setCharge(Int_t charge) { mCharge = (Char_t)charge; }
169  void setNHits(Int_t k, UChar_t n) { mHits[k] = n; }
171  void setP(Float_t px, Float_t py, Float_t pz) { mPx = px; mPy = py; mPz = pz; }
173  void setE(Float_t e) { mE = e; }
175  void setIsFromShower(Bool_t isFrom) { mIsFromShower = isFrom; }
177  void setIdVtxStart(Int_t id) { mIdVtxStart = (Short_t)id; }
179  void setIdVtxStop(Int_t id) { mIdVtxStop = (Short_t)id; }
181  void setIdVtxItrmd(Int_t id) { mIdVtxItrmd = (Short_t)id; }
182 
183 
184  private:
185 
187  UShort_t mId;
190  Int_t mGePid;
192  Char_t mCharge;
194  UChar_t mHits[ktot];
196  Float_t mPx;
198  Float_t mPy;
200  Float_t mPz;
202  Float_t mE;
206  Bool_t mIsFromShower;
208  Short_t mIdVtxStart;
210  Short_t mIdVtxStop;
212  Short_t mIdVtxItrmd;
213 
214  ClassDef(StPicoMcTrack, 1)
215 };
216 
217 #endif // #define StPicoMcTrack_h
void setE(Float_t e)
Set energy.
UChar_t nHitsEtr() const
Return number of hits in ETR.
UChar_t nHitsPxl() const
Return number of hits in PXL.
UChar_t nHitsMwc() const
Return number of hits in MWC.
StPicoMcTrack()
Default constructor.
Float_t pt() const
Return pT of the track.
Definition: StPicoMcTrack.h:67
void setIdVtxStop(Int_t id)
Set stop MC vertex index.
UChar_t nHitsBEmc() const
Return number of hits in BEMC.
Definition: StPicoMcTrack.h:96
UChar_t nHitsEpd() const
Return number of hits in EPD.
UChar_t nHitsPmd() const
Return number of hits in PMD.
UChar_t nHitsTpc() const
Return number of hits in TPC.
UChar_t nHitsBsmd() const
Return number of hits in BSMD.
Int_t geantId() const
Return particle ID defined by GEANT (accordingly to GPART)
Definition: StPicoMcTrack.h:61
UChar_t nHitsIgt() const
Return number of hits in IGT.
Int_t pdgId() const
Return particle ID defined by PDG.
UChar_t nHitsPgc() const
Return number of hits in PGC.
const Char_t * geName()
Return particle names (GEANT ID according to GPART)
UChar_t nHitsIst() const
Return number of hits in IST.
Int_t id() const
Return MC track ID (GEANT track ID)
Definition: StPicoMcTrack.h:57
UChar_t nHitsFtpc() const
Return number of hits in forward TPC.
void setIsFromShower(Bool_t isFrom)
Set flag if track comes from shower.
UChar_t nHitsTof() const
Return number of hits in TOF.
UChar_t nHitsFgt() const
Return number of hits in FGT.
EHIT
Detector names.
Definition: StPicoMcTrack.h:46
UChar_t nHitsGem() const
Return number of hits in barrel GEM.
UChar_t nHitsStg() const
Return number of hits in STG.
UChar_t nHitsHca() const
Return number of hits in HCA.
Int_t idVtxStop() const
ID of stop MC vertex.
Definition: StPicoMcTrack.h:83
UChar_t nHitsWca() const
Return number of hits in WCA.
Int_t nHits() const
Return total number of hits.
Definition: StPicoMcTrack.h:87
UChar_t nHitsFpd() const
Return number of hits in FPD.
UChar_t nHitsSvt() const
Return number of hits in SVT.
void setId(Int_t id)
Set MC track ID (primary key/GEANT track ID)
Int_t correctGePid(Int_t id)
Return corrected GePid (to take embedding into account)
UChar_t nHitsFts() const
Return number of hits in FTS.
void setNHits(Int_t k, UChar_t n)
Int_t idVtxItrmd() const
ID of intermediate MC vertex.
Definition: StPicoMcTrack.h:85
Int_t idVtxStart() const
ID of start MC vertex.
Definition: StPicoMcTrack.h:81
UChar_t nHitsVpd() const
Return number of hits in VPD.
Float_t ptot() const
Return track total momentum.
Definition: StPicoMcTrack.h:69
Holds information about Monte Carlo track parameters.
Definition: StPicoMcTrack.h:32
UChar_t nHitsFst() const
Return number of hits in FST.
UChar_t nHitsEsm() const
Return number of hits in EEMC shower max detector.
Definition: StPicoMcTrack.h:98
virtual void Print(const Char_t *option="") const
Print MC track parameters.
Bool_t isFromShower() const
Check if track is from shower.
Definition: StPicoMcTrack.h:79
Float_t rapidity() const
Rapidity of the track.
Definition: StPicoMcTrack.h:77
Float_t energy() const
Energy of the track.
Definition: StPicoMcTrack.h:75
UChar_t nHitsCtb() const
Return number of hits in CTB.
Definition: StPicoMcTrack.h:92
TVector3 p() const
Return track three-momentum.
Definition: StPicoMcTrack.h:65
Int_t charge() const
Return charge of the particle.
Definition: StPicoMcTrack.h:63
UChar_t nHits(Int_t k) const
Return number of hits in a given detector.
Definition: StPicoMcTrack.h:90
virtual ~StPicoMcTrack()
Destructor.
void setIdVtxStart(Int_t id)
Set start MC vertex index.
UChar_t nHitsSsd() const
Return number of hits in SSD.
UChar_t nHitsPre() const
Return number of hits in PRE.
Float_t eta() const
Return pseudorapidity of the track.
Definition: StPicoMcTrack.h:71
UChar_t nHitsEto() const
Return number of hits in ETO.
TLorentzVector fourMomentum() const
Four-momentum of the track.
Definition: StPicoMcTrack.h:73
UChar_t nHitsHpd() const
Return number of hits in HPD.
void setIdVtxItrmd(Int_t id)
Set first intermediate MC vertex index.
UChar_t nHitsEEmc() const
Return number of hits in EEMC.
Definition: StPicoMcTrack.h:94
void setGeantId(Int_t id)
Set GEANT ID (according to GPART)
void setCharge(Int_t charge)
Set particle charge.
void setP(Float_t px, Float_t py, Float_t pz)
Set three-momentum.