17 #include <TDatabasePDG.h>
18 #include <TMCParticleType.h>
19 #include <TParticle.h>
20 #include <TParticlePDG.h>
34 , fname(particle->GetName())
36 , fmass(particle->GetMass())
37 , fcharge(particle->GetPDG()->Charge())
38 , fDecayTime(particle->GetPDG()->Lifetime())
40 , fwidth(particle->GetPDG()->Width())
41 , fiSpin(static_cast<Int_t>(particle->GetPDG()->Spin()))
42 , fiParity(particle->GetPDG()->Parity())
44 , fiIsospin(static_cast<Int_t>(particle->GetPDG()->Isospin()))
49 , fstable(particle->GetPDG()->Stable())
61 , fpdg(1000000000 + 10000000 * s + 10000 * z + 10 * a)
69 , fDecayTime(decaytime)
83 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
84 if (!pdgDB->GetParticle(fpdg)) {
86 TParticlePDG* kProton = pdgDB->GetParticle(2212);
87 Double_t kProtonMass = kProton->Mass();
88 mass = a * kProtonMass;
90 pdgDB->AddParticle(name, name, mass, stable, 0, q,
"kPTHadron", fpdg);
93 fParticle =
new TParticle();
94 fParticle->SetPdgCode(fpdg);
98 fcharge = fParticle->GetPDG()->Charge();
99 fDecayTime = decaytime;
100 fwidth = fParticle->GetPDG()->Width();
101 fiSpin =
static_cast<Int_t
>(fParticle->GetPDG()->Spin());
102 fiParity = fParticle->GetPDG()->Parity();
104 fiIsospin =
static_cast<Int_t
>(fParticle->GetPDG()->Isospin());
109 fstable = fParticle->GetPDG()->Stable();
120 , fpdg(10000000 + 10000 * z + 10 * a)
128 , fDecayTime(decaytime)
144 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
146 if (!pdgDB->GetParticle(fpdg)) {
148 TParticlePDG* kProton = pdgDB->GetParticle(2212);
149 Double_t kProtonMass = kProton->Mass();
150 mass = a * kProtonMass;
152 pdgDB->AddParticle(name, name, mass, stable, 0, q,
"kPTHadron", fpdg);
155 fParticle =
new TParticle();
156 fParticle->SetPdgCode(fpdg);
160 fcharge = fParticle->GetPDG()->Charge();
161 fDecayTime = decaytime;
162 fwidth = fParticle->GetPDG()->Width();
163 fiSpin =
static_cast<Int_t
>(fParticle->GetPDG()->Spin());
164 fiParity = fParticle->GetPDG()->Parity();
166 fiIsospin =
static_cast<Int_t
>(fParticle->GetPDG()->Isospin());
171 fstable = fParticle->GetPDG()->Stable();
177 , fParticle(particle)
180 , fname(particle->GetName())
201 TMCParticleType mcType,
218 , fParticle(new TParticle())
225 , fDecayTime(lifetime)
230 , fiConjugation(iConjugation)
231 , fiIsospin(iIsospin)
232 , fiIsospinZ(iIsospinZ)
239 if (!TDatabasePDG::Instance()->
GetParticle(fpdg)) {
240 TDatabasePDG::Instance()->AddParticle(fname, fname, fmass, fstable, fwidth, fcharge, pType, fpdg);
243 fParticle->SetPdgCode(fpdg);
281 fMother.SetObject(particle);
289 fDaughters.Add(particle);
298 cout <<
"Particle: " << fParticle->GetName() <<
" with ID: " << fpdg << endl;
306 cout <<
"Primary " << endl;
319 cout << i <<
"th daughter: " << endl;
353 return fDaughters.GetEntriesFast();
362 Fatal(
"GetDaughter",
"Index out of range");
TParticle * GetParticle() const
ClassImp(FairEventBuilder)
FairParticle * GetDaughter(Int_t i) const
FairParticle * GetMother() const
void PrintDaughters() const
virtual void Print(Option_t *option="") const
void AddDaughter(FairParticle *particle)
Int_t GetNofDaughters() const
void SetMother(FairParticle *particle)