7 #include <FairLogger.h>
9 #include <TDatabasePDG.h>
10 #include <TMCProcess.h>
13 #include <TParticle.h>
14 #include <TParticlePDG.h>
19 using std::stringstream;
25 , fProcessId(kPNoProcess)
52 , fProcessId(kPNoProcess)
64 if (nPoints >= 0)
fNPoints = nPoints;
73 , fProcessId(track.fProcessId)
74 , fPdgCode(track.fPdgCode)
75 , fMotherId(track.fMotherId)
79 , fE(track.GetEnergy())
80 , fStartX(track.fStartX)
81 , fStartY(track.fStartY)
82 , fStartZ(track.fStartZ)
83 , fStartT(track.fStartT)
84 , fNPoints(track.fNPoints) {
93 , fProcessId(part->GetUniqueID())
94 , fPdgCode(part->GetPdgCode())
95 , fMotherId(part->GetMother(0))
100 , fStartX(part->Vx())
101 , fStartY(part->Vy())
102 , fStartZ(part->Vz())
103 , fStartT(part->T() * 1e09)
116 if (TDatabasePDG::Instance()) {
117 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(
fPdgCode);
120 if (particle)
return particle->Mass();
136 LOG(fatal) <<
"CbmMCTrack: Unknown PDG code " <<
fPdgCode;
139 LOG(fatal) <<
"CbmMCTrack: No TDatabasePDG";
148 if (TDatabasePDG::Instance()) {
149 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(
fPdgCode);
152 if (particle)
return particle->Charge();
158 return Double_t((
fPdgCode % 10000000) / 10000);
167 LOG(fatal) <<
"CbmMCTrack: Unknown PDG code " <<
fPdgCode;
170 LOG(fatal) <<
"CbmMCTrack: No TDatabasePDG";
179 Double_t
y = 0.5 * TMath::Log((e +
fPz) / (e -
fPz));
190 return ((
fNPoints & (7 << 1)) >> 1);
192 return ((
fNPoints & (31 << 4)) >> 4);
194 return ((
fNPoints & (1 << 9)) >> 9);
196 return ((
fNPoints & (31 << 10)) >> 10);
198 return ((
fNPoints & (31 << 15)) >> 15);
200 return ((
fNPoints & (15 << 20)) >> 20);
202 return ((
fNPoints & (1 << 24)) >> 24);
204 return ((
fNPoints & (1 << 25)) >> 25);
206 LOG(error) <<
"GetNPoints: Unknown detector ID " << detId;
219 else if (nPoints > 1)
227 else if (nPoints > 7)
235 else if (nPoints > 31)
243 else if (nPoints > 1)
251 else if (nPoints > 31)
259 else if (nPoints > 31)
267 else if (nPoints > 15)
275 else if (nPoints > 1)
283 else if (nPoints > 1)
289 LOG(error) <<
"Unknown detector ID " << iDet;
297 ss <<
"MCTrack: mother " <<
fMotherId <<
", GeantProcess "
299 <<
fPx <<
", " <<
fPy <<
", " <<
fPz <<
") GeV" << std::endl;