Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4ParticlesManager.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
14
15#include "TG4ParticlesManager.h"
16#include "TG4G3Units.h"
17#include "TG4UserIon.h"
18#include "TG4UserParticle.h"
19
20#include <G4AutoLock.hh>
21#include <G4DynamicParticle.hh>
22#include <G4IonTable.hh>
23#include <G4Monopole.hh>
24#include <G4ParticleDefinition.hh>
25#include <G4ParticleTable.hh>
26#include <G4Threading.hh>
27#include <G4Types.hh>
28#include <G4Version.hh>
29
30#include <TClonesArray.h>
31#include <TDatabasePDG.h>
32#include <TParticle.h>
33
34#include "TG4StateManager.h"
35#include <G4DecayTable.hh>
36#include <G4PhaseSpaceDecayChannel.hh>
37#include <G4VDecayChannel.hh>
38#include <TParticle.h>
39#include <TVirtualMCApplication.h>
40
41// Moved after Root includes to avoid shadowed variables
42// generated from short units names
43#include <G4SystemOfUnits.hh>
44
45#ifdef G4MULTITHREADED
46namespace
47{
48// Mutex to lock master application when merging data
49G4Mutex addParticleMutex = G4MUTEX_INITIALIZER;
50} // namespace
51#endif
52
54
55//_____________________________________________________________________________
57 : TG4Verbose("particlesManager"),
58 fParticleNameMap(),
59 fUserIonMap(),
60 fUserParticles(),
61 fParticlesChecker()
62
63{
65
66 if (fgInstance) {
67 TG4Globals::Exception("TG4ParticlesManager", "TG4ParticlesManager",
68 "Cannot create two instances of singleton.");
69 }
70
71 fgInstance = this;
72}
73
74//_____________________________________________________________________________
81
82//
83// private methods
84//
85
86/*
87//_____________________________________________________________________________
88G4int TG4ParticlesManager::GetPDGIonEncoding(G4int Z, G4int A, G4int iso) const
89{
92
93 return 10000000 + 10000*Z + 10*A + iso;
94}
95*/
96//_____________________________________________________________________________
98 const G4String& name, G4ParticleDefinition* particleDefinition)
99{
101
102 // Return if particle was already added
103 G4int pdgEncoding = particleDefinition->GetPDGEncoding();
104 TParticlePDG* particlePDG =
105 TDatabasePDG::Instance()->GetParticle(pdgEncoding);
106 if (particlePDG) return;
107
108 // Get particle data
109 G4String g4Name = particleDefinition->GetParticleName();
110 G4int pdgQ = G4int(particleDefinition->GetPDGCharge() / eplus);
111 // !! here we do not save dynamic charge but the static one
112 G4String g4Type = particleDefinition->GetParticleType();
113 G4String rootType = g4Type;
114 if (g4Type == "nucleus" || g4Type == "anti_nucleus") rootType = "Ion";
115
116 if (VerboseLevel() > 1) {
117 G4cout << "Adding particle to TDatabasePDG " << G4endl;
118 G4cout << " name: " << g4Name << G4endl;
119 G4cout << " g4name: " << name << G4endl;
120 G4cout << " PDG: " << pdgEncoding << G4endl;
121 G4cout << " pdgQ: " << pdgQ << G4endl;
122 G4cout << " type: " << rootType << G4endl;
123 }
124
125 // Add particle to TDatabasePDG
126#ifdef G4MULTITHREADED
127 G4AutoLock lm(&addParticleMutex);
128#endif
129 TDatabasePDG::Instance()->AddParticle(name, g4Name,
130 particleDefinition->GetPDGMass() * TG4G3Units::InverseEnergy(),
131 particleDefinition->GetPDGStable(),
132 particleDefinition->GetPDGWidth() * TG4G3Units::InverseEnergy(), pdgQ * 3,
133 rootType, pdgEncoding);
134#ifdef G4MULTITHREADED
135 lm.unlock();
136#endif
137}
138
139//
140// public methods
141//
142
143//_____________________________________________________________________________
145{
148
149 const Int_t kspe = 50000000;
150 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
151
152 // optical phothon
153 if (!pdgDB->GetParticle(kspe + 50))
154 pdgDB->AddParticle(
155 "Cherenkov", "Cherenkov", 0, kFALSE, 0, 0, "Special", kspe + 50);
156 fParticleNameMap.Add("opticalphoton", "Cherenkov");
157
158 // feedback phothon
159 if (!pdgDB->GetParticle(kspe + 51))
160 pdgDB->AddParticle("FeedbackPhoton", "FeedbackPhoton", 0, kFALSE, 0, 0,
161 "Special", kspe + 51);
162 fParticleNameMap.AddInverse("opticalphoton", "FeedbackPhoton");
163
164 // generic ion
165 // This particle should not appear in tracking (as it is commented
166 // in class G4GenericIon), but as it does, we map it anyway
167 if (!pdgDB->GetParticle(kspe + 60))
168 pdgDB->AddParticle(
169 "GenericIon", "GenericIon", 0.938272, kTRUE, 0, 1, "Special", kspe + 60);
170 fParticleNameMap.Add("GenericIon", "GenericIon");
171
172 // Light ions
173 // Get PDG codes from Geant4 the rest as in TGeant3
174 const Double_t kGeV = 0.9314943228;
175 const Double_t kHslash = 1.0545726663e-27;
176 const Double_t kErgGeV = 1 / 1.6021773349e-3;
177 const Double_t kHshGeV = kHslash * kErgGeV;
178 const Double_t kYearsToSec = 3600 * 24 * 365.25;
179
180 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
181 G4ParticleDefinition* particle;
182
183 particle = particleTable->FindParticle("deuteron");
184 if (particle && !pdgDB->GetParticle(particle->GetPDGEncoding())) {
185 pdgDB->AddParticle("Deuteron", "Deuteron", 2 * kGeV + 8.071e-3, kTRUE, 0, 3,
186 "Ion", particle->GetPDGEncoding());
187 }
188
189 particle = particleTable->FindParticle("triton");
190 if (particle && !pdgDB->GetParticle(particle->GetPDGEncoding())) {
191 pdgDB->AddParticle("Triton", "Triton", 3 * kGeV + 14.931e-3, kFALSE,
192 kHshGeV / (12.33 * kYearsToSec), 3, "Ion", particle->GetPDGEncoding());
193 }
194
195 particle = particleTable->FindParticle("alpha");
196 if (particle && !pdgDB->GetParticle(particle->GetPDGEncoding())) {
197 pdgDB->AddParticle("Alpha", "Alpha", 4 * kGeV + 2.424e-3, kTRUE,
198 kHshGeV / (12.33 * kYearsToSec), 6, "Ion", particle->GetPDGEncoding());
199 }
200
201 particle = particleTable->FindParticle("He3");
202 if (particle && !pdgDB->GetParticle(particle->GetPDGEncoding())) {
203 pdgDB->AddParticle("HE3", "HE3", 3 * kGeV + 14.931e-3, kFALSE, 0, 6, "Ion",
204 particle->GetPDGEncoding());
205 }
206
207 // Light anti-ions
208 // Get parameters from Geant4
209
210 particle = particleTable->FindParticle("anti_deuteron");
211 if (particle && !pdgDB->GetParticle(particle->GetPDGEncoding())) {
212 pdgDB->AddParticle("AntiDeuteron", "AntiDeuteron", 1.875613, kTRUE, 0, -3,
213 "Ion", particle->GetPDGEncoding());
214 }
215
216 particle = particleTable->FindParticle("anti_triton");
217 if (particle && !pdgDB->GetParticle(particle->GetPDGEncoding())) {
218 pdgDB->AddParticle("AntiTriton", "AntiTriton", 2.808921, kTRUE, 0, -3,
219 "Ion", particle->GetPDGEncoding());
220 }
221
222 particle = particleTable->FindParticle("anti_alpha");
223 if (particle && !pdgDB->GetParticle(particle->GetPDGEncoding())) {
224 pdgDB->AddParticle("AntiAlpha", "AntiAlpha", 3.727379, kTRUE, 0, -6, "Ion",
225 particle->GetPDGEncoding());
226 }
227
228 particle = particleTable->FindParticle("anti_He3");
229 if (particle && !pdgDB->GetParticle(particle->GetPDGEncoding())) {
230 pdgDB->AddParticle("AntiHE3", "AntiHE3", 2.808391, kTRUE, 0, -6, "Ion",
231 particle->GetPDGEncoding());
232 }
233
234 // monopole
235 particle = particleTable->FindParticle("monopole");
236 if (particle) {
237 if (!pdgDB->GetParticle(60000000)) {
238 G4cout << "Adding monnopole in TDatabase with mass "
239 << particle->GetPDGMass() / GeV << G4endl;
240 pdgDB->AddParticle("Monopole", "Monopole", particle->GetPDGMass() / GeV,
241 kTRUE, particle->GetPDGCharge() / eplus * 3.,
242 static_cast<G4Monopole*>(particle)->MagneticCharge() / eplus * 3.,
243 "Special", 60000000);
244 fParticleNameMap.Add("monopole", "monopole");
245 }
246 else {
247 TG4Globals::Warning("TG4ParticlesManager", "DefineParticles",
248 "Cannot add monopole with PDG=60000000 in TDatabasePDG.");
249 }
250 }
251
252 // geantino
253 fParticleNameMap.Add("geantino", "Rootino");
254 fParticleNameMap.Add("chargedgeantino", "ChargedRootino");
255 // ChargedRootino does not exist in Root particle database
256 // but the user can just change the title of Rootino to ChargedRootino
257 // to get it interpreted as chargedgeantino:
258 // TParticlePDG* rootino = pdgTable->GetParticle("Rootino");
259 // if (rootino) rootino->SetTitle("ChargedRootino");
260
261 if (VerboseLevel() > 1) {
263 }
264}
265
266//_____________________________________________________________________________
267void TG4ParticlesManager::AddParticle(Int_t pdg, const TString& name,
268 TMCParticleType mcType, Double_t mass, Double_t charge, Double_t lifetime,
269 const TString& pType, Double_t width, Int_t iSpin, Int_t iParity,
270 Int_t iConjugation, Int_t iIsospin, Int_t iIsospinZ, Int_t gParity,
271 Int_t lepton, Int_t baryon, Bool_t stable, Bool_t shortlived,
272 const TString& subType, Int_t antiEncoding, Double_t magMoment,
273 Double_t excitation)
274{
276
277 if (VerboseLevel() > 1) {
278 G4cout << "Adding particle with: " << G4endl << " pdg = " << pdg
279 << G4endl << " name = " << name << G4endl
280 << " mcType = " << mcType << G4endl
281 << " mass [GeV} = " << mass << G4endl
282 << " charge [e] = " << charge << G4endl
283 << " lifetime [s] = " << lifetime << G4endl
284 << " pType = " << pType.Data() << G4endl
285 << " width = " << width << G4endl
286 << " iSpin = " << iSpin << G4endl
287 << " iParity = " << iParity << G4endl
288 << " iConjugation= " << iConjugation << G4endl
289 << " iIsospin = " << iIsospin << G4endl
290 << " iIsospinZ = " << iIsospinZ << G4endl
291 << " gParity = " << gParity << G4endl
292 << " lepton = " << lepton << G4endl
293 << " baryon = " << baryon << G4endl
294 << " stable = " << stable << G4endl
295 << " shortlived = " << shortlived << G4endl
296 << " subType = " << subType.Data() << G4endl
297 << " antiEncoding = " << antiEncoding << G4endl
298 << " magMoment = " << magMoment << G4endl
299 << " excitation [GeV] = " << excitation << G4endl;
300 }
301
302 // Instantiate a new user particle
303 // with the first available user type
304 //
305 fUserParticles.push_back(new TG4UserParticle(name.Data(), mcType,
306 mass * TG4G3Units::Energy(), width * TG4G3Units::Energy(),
307 charge * TG4G3Units::Charge(), iSpin, iParity, iConjugation, iIsospin,
308 iIsospinZ, gParity, pType.Data(), lepton, baryon, pdg, stable,
309 lifetime * TG4G3Units::Time(), 0, shortlived, subType.Data(), antiEncoding,
310 magMoment, excitation * TG4G3Units::Energy()));
311
312 // Add particle to TDatabasePDG
313 Int_t anti = -1;
314 if (antiEncoding != 0) anti = antiEncoding;
315
316 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
317 if (!pdgDB->GetParticle(pdg)) {
318 pdgDB->AddParticle(name.Data(), name.Data(), mass, stable, width,
319 charge * 3, pType.Data(), pdg, anti);
320 }
321}
322
323//_____________________________________________________________________________
325 const G4String& name, G4int Z, G4int A, G4int Q, G4double excEnergy)
326{
328
329 if (VerboseLevel() > 1) {
330 G4cout << "Adding ion with Z, A, Q, excEnergy [keV]: " << Z << " " << A
331 << " " << Q << " " << excEnergy / keV << G4endl;
332 }
333
334 // Get G4 ion particle definition
335 // (Ion is created if it does not yet exist)
336#if G4VERSION_NUMBER >= 1000
337 G4ParticleDefinition* particleDefinition =
338 G4IonTable::GetIonTable()->GetIon(Z, A, excEnergy);
339#else
340 G4ParticleDefinition* particleDefinition =
341 G4ParticleTable::GetParticleTable()->GetIon(Z, A, excEnergy);
342#endif
343
344 if (!particleDefinition) {
345 TString text = "Z, A, excEnergy [keV]: ";
346 text += Z;
347 text += " ";
348 text += A;
349 text += " ";
350 text += excEnergy / keV;
351 text += ".";
352 TG4Globals::Exception("TG4ParticlesManager", "AddIon",
353 text + TG4Globals::Endl() +
354#if G4VERSION_NUMBER >= 1000
355 "G4IonTable::GetIon() failed.");
356#else
357 "G4ParticleTable::GetIon() failed.");
358#endif
359 }
360
361 // Add ion to TDatabasePDG
362 AddParticleToPdgDatabase(name, particleDefinition);
363
364 // Add ion to the map to be able to retrieve later its charge
365 fUserIonMap[name] =
366 new TG4UserIon(name, particleDefinition->GetPDGEncoding(), Q);
367}
368
369//_____________________________________________________________________________
371 Int_t pdg, Float_t bratio[6], Int_t mode[6][3])
372{
374
375 // Check input pdg
376 if (pdg == 0) {
377 TG4Globals::Exception("TG4ParticlesManager", "SetDecayMode",
378 "Cannot define decay mode for particle with PDG=0");
379 }
380
381 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
382 G4ParticleDefinition* particleDefinition = particleTable->FindParticle(pdg);
383
384 if (!particleDefinition) {
385 TString pdgs;
386 pdgs += pdg;
387 TG4Globals::Exception("TG4ParticlesManager", "SetDecayMode",
388 "Particle PDG=" + pdgs + " was not found in G4ParticleTable.");
389 }
390
391 G4String particleName = particleDefinition->GetParticleName();
392 G4DecayTable* decayTable = new G4DecayTable();
393
394 // Loop over decay channels
395 //
396 for (Int_t kz = 0; kz < 6; ++kz) {
397
398 // Do not fill empty channels
399 if (bratio[kz] == 0.) break;
400
401 // Fill names of daughters
402 G4int nofDaughters = 0;
403 std::vector<G4String> daughtersNames(3);
404 for (G4int i = 0; i < 3; i++) {
405 daughtersNames[i] = "";
406 if (mode[kz][i] != 0) {
407 G4ParticleDefinition* daughter =
408 particleTable->FindParticle(mode[kz][i]);
409 if (!daughter) {
410 TString pdgs;
411 pdgs += mode[kz][i];
412 TG4Globals::Exception("TG4ParticlesManager", "SetDecayMode",
413 "Daughter particle PDG=" + pdgs +
414 " was not found in G4ParticleTable.");
415 }
416 daughtersNames[i] = daughter->GetParticleName();
417 ++nofDaughters;
418 }
419 }
420
421 // Define decay channel
422 G4VDecayChannel* decayChannel =
423 new G4PhaseSpaceDecayChannel(particleName, bratio[kz] / 100.0,
424 nofDaughters, daughtersNames[0], daughtersNames[1], daughtersNames[2]);
425 decayTable->Insert(decayChannel);
426 }
427
428 particleDefinition->SetDecayTable(decayTable);
429
430 if (VerboseLevel() > 1) particleDefinition->DumpTable();
431
432 return true;
433}
434
435//_____________________________________________________________________________
437{
442
443 // Check input pdg
444 if (pdg == 0) {
445 TG4Globals::Exception("TG4ParticlesManager", "SetUserDecay",
446 "Cannot set user decay mode for particle with PDG=0");
447 }
448
449 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
450 G4ParticleDefinition* particleDefinition = particleTable->FindParticle(pdg);
451
452 if (!particleDefinition) {
453 TString pdgs;
454 pdgs += pdg;
455 TG4Globals::Exception("TG4ParticlesManager", "SetUserDecay",
456 "Particle PDG=" + pdgs + " was not found in G4ParticleTable.");
457 }
458
459 particleDefinition->SetDecayTable(0);
460}
461
462//_____________________________________________________________________________
464{
468
469 // Get PDG encoding from G4 particle definition
470 G4int pdgEncoding = particle->GetPDGEncoding();
471 if (pdgEncoding && (pdgEncoding != -22)) {
472 // Add particle to TDatabasePDG
473 if (!TDatabasePDG::Instance()->GetParticle(pdgEncoding))
474 AddParticleToPdgDatabase(particle->GetParticleName(), particle);
475 return pdgEncoding;
476 }
477
478 // Get PDG encoding from TDatabasePDG if not defined in Geant4
479
480 // get particle name from the name map
481 G4String g4name = particle->GetParticleName();
482 G4String tname = fParticleNameMap.GetSecond(g4name);
483 if (tname == "ChargedRootino") tname = "Rootino";
484 // special treatment for Rootino
485 // user can reset the particle title to ChargedRootino to interpret
486 // Rootino as chargedgeantino
487
488 if (tname == "Undefined") {
489 particle->DumpTable();
490 TG4Globals::Exception("TG4ParticlesManager", "GetPDGEncoding",
491 "Particle " + TString(g4name) + " was not found in the name map.");
492 }
493
494 // get particle from TDatabasePDG
495 TDatabasePDG* pdgDB = TDatabasePDG::Instance();
496 TParticlePDG* tparticle = pdgDB->GetParticle(tname);
497 if (!tparticle) {
498 TG4Globals::Exception("TG4ParticlesManager", "GetPDGEncoding",
499 "Particle " + TString(tname) + " was not found in TDatabasePDG.");
500 }
501
502 // get PDG encoding
503 return tparticle->PdgCode();
504}
505
506//_____________________________________________________________________________
508 const TClonesArray* particles, G4int index) const
509{
512
513#ifdef MCDEBUG
514 TObject* particleTObject = particles->UncheckedAt(index);
515 TParticle* particle = dynamic_cast<TParticle*>(particleTObject);
516
517 // check particle type
518 if (!particle) {
520 "TG4ParticlesManager", "GetParticle", "Unknown particle type");
521 }
522
523 return particle;
524#else
525 return (TParticle*)particles->UncheckedAt(index);
526#endif
527}
528
529//_____________________________________________________________________________
531 const TParticle* particle, G4bool warn) const
532{
534
535 // get particle definition from G4ParticleTable
536 G4int pdgEncoding = particle->GetPdgCode();
537 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
538 G4ParticleDefinition* particleDefinition = 0;
539 if (pdgEncoding != 0)
540 particleDefinition = particleTable->FindParticle(pdgEncoding);
541
542 if (!particleDefinition) {
543 G4String rootName = particle->GetName();
544 if (rootName == "Rootino") rootName = particle->GetTitle();
545 // special treatment for Rootino
546 // user can reset the particle title to ChargedRootino to interpret
547 // Rootino as chargedgeantino
548 G4String g4Name = fParticleNameMap.GetFirst(rootName);
549 particleDefinition = particleTable->FindParticle(g4Name);
550 }
551
552 if (particleDefinition == 0 && warn) {
553 TString text = "pdgEncoding= ";
554 text += pdgEncoding;
555 TG4Globals::Warning("TG4ParticlesManager", "GetParticleDefinition",
556 "G4ParticleTable::FindParticle() for particle with " + text + " failed.");
557 }
558
559 return particleDefinition;
560}
561
562//_____________________________________________________________________________
564 const TParticle* particle) const
565{
567
568 // get particle properties
569 G4ParticleDefinition* particleDefinition = GetParticleDefinition(particle);
570 if (!particleDefinition) return 0;
571
572 G4ThreeVector momentum = GetParticleMomentum(particle);
573
574 // create G4DynamicParticle
575 G4DynamicParticle* dynamicParticle =
576 new G4DynamicParticle(particleDefinition, momentum);
577
578 // set polarization
579 G4ThreeVector polarization = GetParticlePolarization(particle);
580 dynamicParticle->SetPolarization(
581 polarization.x(), polarization.y(), polarization.z());
582
583 return dynamicParticle;
584}
585
586//_____________________________________________________________________________
588 const TParticle* particle) const
589{
591
592 G4ThreeVector position = G4ThreeVector(particle->Vx() * TG4G3Units::Length(),
593 particle->Vy() * TG4G3Units::Length(),
594 particle->Vz() * TG4G3Units::Length());
595 return position;
596}
597
598//_____________________________________________________________________________
600 const TParticle* particle) const
601{
603 G4ThreeVector momentum = G4ThreeVector(particle->Px() * TG4G3Units::Energy(),
604 particle->Py() * TG4G3Units::Energy(),
605 particle->Pz() * TG4G3Units::Energy());
606 return momentum;
607}
608
609//_____________________________________________________________________________
611 const TParticle* particle) const
612{
614
615 TVector3 polarization;
616 particle->GetPolarisation(polarization);
617
618 return G4ThreeVector(polarization.X(), polarization.Y(), polarization.Z());
619}
620
621//_____________________________________________________________________________
623 const G4String& ionName, G4bool warn) const
624{
626
627 UserIonMap::const_iterator it = fUserIonMap.find(ionName);
628 if (it != fUserIonMap.end()) return it->second;
629
630 if (warn) {
631 TG4Globals::Warning("TG4ParticlesManager", "GetUserIon",
632 "User ion with name=" + ionName + " not defined.");
633 }
634 return 0;
635}
636
637//_____________________________________________________________________________
639{
641
642 return G4int(fUserParticles.size());
643}
644
645//_____________________________________________________________________________
647{
649
650 if (index < 0 || index >= G4int(fUserParticles.size())) {
652 "TG4ParticlesManager", "GetUserParticle", "Index out of limits");
653 }
654
655 return fUserParticles[index];
656}
Definition of the G4Monopole class.
Definition of the TG4G3Units class.
Definition of the TG4ParticlesManager class.
Definition of the TG4StateManager class.
Definition of the TG4UserIon class.
Definition of the TG4UserParticle class.
G4double MagneticCharge() const
static G4double Charge()
Definition TG4G3Units.h:99
static G4double Energy()
Definition TG4G3Units.h:105
static G4double Length()
Definition TG4G3Units.h:81
static G4double InverseEnergy()
Definition TG4G3Units.h:157
static G4double Time()
Definition TG4G3Units.h:93
static void Warning(const TString &className, const TString &methodName, const TString &text)
static void Exception(const TString &className, const TString &methodName, const TString &text)
static TString Endl()
Definition TG4Globals.h:100
G4bool Add(const G4String &first, const G4String &second)
const G4String & GetSecond(const G4String &first) const
void PrintAll() const
const G4String & GetFirst(const G4String &second) const
G4bool AddInverse(const G4String &first, const G4String &second)
Provides mapping between TDatabasePDG and Geant4 particles.
TG4UserParticle * GetUserParticle(G4int index) const
void AddIon(const G4String &name, G4int Z, G4int A, G4int Q, G4double excEnergy)
UserIonMap fUserIonMap
user defined ions mappped by their names
G4DynamicParticle * CreateDynamicParticle(const TParticle *particle) const
G4ThreeVector GetParticlePolarization(const TParticle *particle) const
UserParticleVector fUserParticles
vector of user defined particles
G4ParticleDefinition * GetParticleDefinition(const TParticle *particle, G4bool warn=true) const
Bool_t SetDecayMode(Int_t pdg, Float_t bratio[6], Int_t mode[6][3])
G4ThreeVector GetParticlePosition(const TParticle *particle) const
G4int GetPDGEncoding(G4ParticleDefinition *particle)
TG4NameMap fParticleNameMap
the mapping between G4 particle names and TDatabasePDG names for special particles
TG4UserIon * GetUserIon(const G4String &ionName, G4bool warn=true) const
TParticle * GetParticle(const TClonesArray *particles, G4int index) const
void AddParticle(Int_t pdg, const TString &name, TMCParticleType mcType, Double_t mass, Double_t charge, Double_t lifetime, const TString &pType, Double_t width, Int_t iSpin, Int_t iParity, Int_t iConjugation, Int_t iIsospin, Int_t iIsospinZ, Int_t gParity, Int_t lepton, Int_t baryon, Bool_t stable, Bool_t shortlived=kFALSE, const TString &subType="", Int_t antiEncoding=0, Double_t magMoment=0.0, Double_t excitation=0.0)
G4ThreeVector GetParticleMomentum(const TParticle *particle) const
static TG4ParticlesManager * fgInstance
this instance
void AddParticleToPdgDatabase(const G4String &name, G4ParticleDefinition *particleDefinition)
The class for user ion definition.
Definition TG4UserIon.h:31
The class for user particle definition.
Base class for defining the verbose level and a common messenger.
Definition TG4Verbose.h:36
virtual G4int VerboseLevel() const
Definition TG4Verbose.h:78