12 #include "TParticle.h" 13 #ifndef ROOT_TParticlePDG 14 #include "TParticlePDG.h" 16 #ifndef ROOT_TDatabasePDG 17 #include "TDatabasePDG.h" 19 #include "FairRunSim.h" 38 Double_t py, Double_t pz, Double_t x, Double_t y,
39 Double_t z, Double_t t, Int_t nPoints = 0)
52 if (nPoints >= 0) fNPoints = nPoints;
57 fMass = CalculateMass();
58 fEnergy = CalculateEnergy();
69 fStartY(track.fStartY),
70 fStartZ(track.fStartZ),
71 fStartT(track.fStartT),
72 fNPoints(track.fNPoints),
74 fEnergy(track.fEnergy)
89 fStartT(part->T()*1e09),
92 fID(part->GetStatusCode())
94 fMomentum.SetXYZT(
fPx,fPy,fPz,fEnergy);
95 fMass = CalculateMass();
96 fEnergy = CalculateEnergy();
97 fPhi = fMomentum.Phi();
98 fTheta = fMomentum.Theta();
110 Double_t ERMCTrack::GetMass()
const {
114 Double_t ERMCTrack::GetCharge()
const {
115 if ( TDatabasePDG::Instance() ) {
116 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(
fPdgCode);
117 if ( particle )
return particle->Charge();
123 Double_t ERMCTrack::GetRapidity()
const {
124 Double_t e = GetEnergy();
125 Double_t y = 0.5 * TMath::Log( (e+fPz) / (e-fPz) );
147 void ERMCTrack::SetNPoints(Int_t iDet, Int_t nPoints) {
208 TLorentzVector ERMCTrack::GetVector(){
209 fMomentum.SetXYZT(
fPx,fPy,fPz,fEnergy);
213 Double_t ERMCTrack::GetTheta(){
214 fMomentum.SetXYZT(
fPx,fPy,fPz,fEnergy);
215 fTheta = fMomentum.Theta();
219 Double_t ERMCTrack::GetPhi(){
220 fMomentum.SetXYZT(
fPx,fPy,fPz,fEnergy);
221 fPhi = fMomentum.Phi();
225 Double_t ERMCTrack::CalculateMass() {
226 if ( TDatabasePDG::Instance() ) {
227 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(
fPdgCode);
228 return particle->Mass();
233 Double_t ERMCTrack::CalculateEnergy() {
234 return TMath::Sqrt(fMass*fMass +
fPx*
fPx + fPy*fPy + fPz*fPz );
Int_t GetNPoints(DetectorId detId) const
void Print(Int_t iTrack=0) const