13#include <TDatabasePDG.h>
14#include <TMCProcess.h>
17#include <TParticlePDG.h>
22using std::stringstream;
47 double t, int32_t nPoints = 0)
62 if (nPoints >= 0)
fNPoints = nPoints;
118 if (TDatabasePDG::Instance()) {
119 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(
fPdgCode);
122 if (particle)
return particle->Mass();
128 int32_t a = (
fPdgCode % 10000) / 10;
138 LOG(error) <<
"CbmMCTrack: Unknown PDG code " <<
fPdgCode;
143 LOG(fatal) <<
"CbmMCTrack: No TDatabasePDG";
153 if (TDatabasePDG::Instance()) {
154 TParticlePDG* particle = TDatabasePDG::Instance()->GetParticle(
fPdgCode);
158 double electron_charge = abs(TDatabasePDG::Instance()->GetParticle(11)->Charge());
159 return particle->Charge() / electron_charge;
166 return double((
fPdgCode % 10000000) / 10000);
175 LOG(error) <<
"CbmMCTrack: Unknown PDG code " <<
fPdgCode;
180 LOG(fatal) <<
"CbmMCTrack: No TDatabasePDG";
202 return ((
fNPoints & (7 << 1)) >> 1);
204 return ((
fNPoints & (31 << 4)) >> 4);
206 return ((
fNPoints & (1 << 9)) >> 9);
212 return ((
fNPoints & (31 << 10)) >> 10);
214 return ((
fNPoints & (31 << 15)) >> 15);
216 return ((
fNPoints & (15 << 20)) >> 20);
218 return ((
fNPoints & (1 << 25)) >> 25);
220 return ((
fNPoints & (1 << 26)) >> 26);
222 LOG(error) <<
"GetNPoints: Unknown detector ID " << detId;
236 else if (nPoints > 1)
244 else if (nPoints > 7)
252 else if (nPoints > 31)
260 else if (nPoints > 1)
273 int32_t alreadyStoredPoints =
GetNPoints(iDet);
274 int32_t totalPoints = alreadyStoredPoints + nPoints;
277 else if (totalPoints > 31)
285 else if (nPoints > 31)
293 else if (nPoints > 15)
301 else if (nPoints > 1)
309 else if (nPoints > 1)
315 LOG(error) <<
"Unknown detector ID " << iDet;
325 <<
", momentum (" <<
fPx <<
", " <<
fPy <<
", " <<
fPz <<
") GeV" << std::endl;
ClassImp(CbmConverterManager)
ECbmModuleId
Enumerator for module Identifiers.
@ kMvd
Micro-Vertex Detector.
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kPsd
Projectile spectator detector.
@ kSts
Silicon Tracking System.
@ kMust
MuSt detection system.
@ kMuch
Muon detection system.
@ kFsd
Forward spectator detector.
@ kRich
Ring-Imaging Cherenkov Detector.
friend fvec log(const fvec &a)
std::string ToString() const
double GetCharge() const
Charge of the associated particle.
void SetNPoints(ECbmModuleId iDet, int32_t np)
double GetMass() const
Mass of the associated particle.
int32_t GetPdgCode() const
double GetRapidity() const
int32_t GetNPoints(ECbmModuleId detId) const