Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4PhysicsManager.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 "TG4PhysicsManager.h"
16#include "TG4G3Control.h"
17#include "TG4G3Cut.h"
18#include "TG4G3PhysicsManager.h"
19#include "TG4G3Units.h"
20#include "TG4GeometryServices.h"
21#include "TG4Limits.h"
22#include "TG4Medium.h"
23#include "TG4MediumMap.h"
24#include "TG4ParticlesManager.h"
25#include "TG4ProcessMap.h"
27#include "TG4StateManager.h"
28
29#include <G4EmProcessSubType.hh>
30#include <G4GammaGeneralProcess.hh>
31#include <G4OpBoundaryProcess.hh>
32#include <G4OpProcessSubType.hh>
33#include <G4OpticalPhoton.hh>
34#include <G4ParticleDefinition.hh>
35#include <G4ParticleTable.hh>
36#include <G4ProcessManager.hh>
37#include <G4ProcessTable.hh>
38#include <G4TransportationProcessType.hh>
39#include <G4VProcess.hh>
40#include <G4VUserPhysicsList.hh>
41#include <G4Version.hh>
42
43#if G4VERSION_NUMBER == 1100
44// Temporary work-around for bug in Cerenkov
45#include <G4Cerenkov.hh>
46#include <G4Electron.hh>
47#include <G4OpticalParameters.hh>
48#endif
49
50#include <TDatabasePDG.h>
51#include <TVirtualMCApplication.h>
52
53// Moved after Root includes to avoid shadowed variables
54// generated from short units names
55#include <G4SystemOfUnits.hh>
56
58const G4double TG4PhysicsManager::fgkDefautCut = 1. * mm;
60
61//_____________________________________________________________________________
63 : TG4Verbose("physicsManager"),
64 fParticlesManager(0),
65 fG3PhysicsManager(0),
66 fNotImplParNames(),
67 fCutForGamma(fgkDefautCut),
68 fCutForElectron(fgkDefautCut),
69 fCutForPositron(fgkDefautCut),
70 fCutForProton(fgkDefautCut),
71 fOpBoundaryProcess(0)
72{
74
75 if (fgInstance) {
76 TG4Globals::Exception("TG4PhysicsManager", "TG4PhysicsManager",
77 "Cannot create two instances of singleton.");
78 }
79
80 fgInstance = this;
81
82 G4bool isMaster = !G4Threading::IsWorkerThread();
83 if (isMaster) {
85 }
86
87 // create particles manager
89
90 // create G3 physics manager
92
93 // fill process name map
94 // FillProcessMap();
95}
96
97//_____________________________________________________________________________
99{
101
102 fgInstance = 0;
103 G4bool isMaster = !G4Threading::IsWorkerThread();
104 if (isMaster) {
105 delete fgProcessMap;
106 fgProcessMap = 0;
107 }
108 delete fParticlesManager;
109 delete fG3PhysicsManager;
110}
111
112//
113// private methods
114//
115
116//_____________________________________________________________________________
117void TG4PhysicsManager::GstparCut(G4int itmed, TG4G3Cut par, G4double parval)
118{
122
123 // get medium from the map
124 TG4Medium* medium =
126 if (!medium) {
127 // TG4GeometryServices::Instance()->GetMediumMap()->Print();
128 TString text = "mediumId=";
129 text += itmed;
131 "TG4PhysicsManager", "GstparCut", "Medium with " + text + " not found.");
132 return;
133 }
134
135 // get/create user limits
139
140 if (!limits) {
143 if (VerboseLevel() > 1) {
144 G4cout << "TG4PhysicsManager::GstparCut: new TG4Limits() for medium "
145 << itmed << " has been created." << G4endl;
146 }
147 }
148
149 // set new limits object to medium
150 medium->SetLimits(limits);
151
152 // add units
153 if (par == kTOFMAX)
154 parval *= TG4G3Units::Time();
155 else
156 parval *= TG4G3Units::Energy();
157
158 // set parameter
159 limits->SetG3Cut(par, parval);
160}
161
162//_____________________________________________________________________________
164 G4int itmed, TG4G3Control par, TG4G3ControlValue parval)
165{
169
170 // get medium from the map
171 TG4Medium* medium =
173 if (!medium) {
174 // TG4GeometryServices::Instance()->GetMediumMap()->Print();
175 TString text = "mediumId=";
176 text += itmed;
177 TG4Globals::Warning("TG4PhysicsManager", "GstparControl",
178 "Medium with " + text + " not found.");
179 return;
180 }
181
182 // get/create user limits
186
187 if (!limits) {
190
191 if (VerboseLevel() > 1) {
192 G4cout << "TG4PhysicsManager::GstparControl: new TG4Limits() for medium"
193 << itmed << " has been created." << G4endl;
194 }
195 }
196
197 // set new limits object to medium
198 medium->SetLimits(limits);
199
200 // set parameter
201 limits->SetG3Control(par, parval);
202}
203
204//_____________________________________________________________________________
206 G4int pdgEncoding) const
207{
209
210 G4ParticleDefinition* particleDefinition =
211 G4ParticleTable::GetParticleTable()->FindParticle(pdgEncoding);
212
213 if (!particleDefinition) {
214 TString text = "PDG=";
215 text += pdgEncoding;
216 TG4Globals::Warning("TG4ParticlesManager", "GetParticleDefinition",
217 "Particle with " + text + " not found.");
218 }
219
220 return particleDefinition;
221}
222
223//_____________________________________________________________________________
225 G4ProcessManager* processManager, G4int subType) const
226{
229
230 auto processVector = processManager->GetProcessList();
231 for (size_t i = 0; i < processVector->length(); ++i) {
232 if ((*processVector)[i]->GetProcessSubType() == subType) {
233 return (*processVector)[i];
234 }
235 }
236 return nullptr;
237}
238
239//_____________________________________________________________________________
241 G4ProcessManager* processManager, G4int processId, G4bool activation)
242{
244
245 G4String strActivation = "Activate ";
246 if (!activation) strActivation = "Inactivate ";
247
248 if (TG4Verbose::VerboseLevel() > 1) {
249 G4cout << strActivation << " process "
250 << (*processManager->GetProcessList())[processId]->GetProcessName()
251 << " for " << processManager->GetParticleType()->GetParticleName()
252 << G4endl;
253 }
254
255 processManager->SetProcessActivation(processId, activation);
256}
257
258//_____________________________________________________________________________
260{
263
265
266 TG4G3ControlVector* controlVector = g3PhysicsManager->GetControlVector();
267 if (!controlVector) {
268 TG4Globals::Exception("TG4PhysicsManager", "SetSpecialControlsActivation",
269 "Vectors of processes controls is not set.");
270 return;
271 }
272
273 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
274 for (G4int i = 0; i < G4int(particleTable->size()); ++i) {
275
276 G4ParticleDefinition* particle = particleTable->GetParticle(i);
277 if (!particle) continue;
278
279 G4ProcessManager* processManager = particle->GetProcessManager();
280 if (!processManager) continue;
281
282 G4ProcessVector* processVector = processManager->GetProcessList();
283
284 // activate or inactivate processes according to
285 // global setting in the control vector in G3 physics manager
286 //
287 for (size_t j = 0; j < processVector->length(); j++) {
288
289 // Special treatment of gamma processes if G4GeneralGammaProcess is in use
290 if ((*processVector)[j]->GetProcessSubType() == fGammaGeneralProcess) {
291
292 // PFIS can be inactivated via G4GeneralGammaProcess
293 auto gammaGeneralProcess = static_cast<G4GammaGeneralProcess*>((*processVector)[j]);
294 auto gammaNuclear = gammaGeneralProcess->GetGammaNuclear();
295 auto pfisControl = (*controlVector)[kPFIS];
296 if (pfisControl == kInActivate && gammaNuclear != nullptr ) {
297 // GammaNuclear process was already created, overwrite it with nullptr
298 // G4UImanager::GetUIpointer()->ApplyCommand("/physics_lists/em/GammaNuclear false");
299 // // the command has no effect at this stage
300 gammaGeneralProcess->AddHadProcess(nullptr);
301 }
302 if (pfisControl == kActivate && gammaNuclear == nullptr ) {
303 TG4Globals::Warning("TG4PhysicsManager", "SetSpecialControlsActivation",
304 "Cannot activate PFIS control, the process is not built.");
305 }
306
307 // check other controls that cannot be applied via G4GeneralGammaProcess
308 if ((*controlVector)[kPAIR] == kInActivate || (*controlVector)[kCOMP] == kInActivate ||
309 (*controlVector)[kPHOT] == kInActivate ) {
310 // Issue a warning
311 TG4Globals::Warning("TG4PhysicsManager", "SetSpecialControlsActivation",
312 "Cannot apply PAIR, COMP, PHOT controls when using G4GammaGeneralProcess.\n"
313 "Usage of G4GammaGeneralProcess can be inactivated with: \n"
314 "/process/em/UseGeneralProcess false");
315 }
316
317 continue;
318 }
319
320 TG4G3ControlValue control =
321 controlVector->GetControlValue((*processVector)[j]);
322 G4bool activation = processManager->GetProcessActivation(j);
323
324 if (control != kUnsetControlValue) {
325 if (!TG4Globals::Compare(activation, control)) {
326
327 // set new process activation
328 G4bool activate;
329 if (control == kInActivate)
330 activate = false;
331 else
332 activate = true;
333
334 SetProcessActivation(processManager, j, activate);
335 }
336 }
337 }
338 }
339}
340
341//_____________________________________________________________________________
343{
346
348 TG4boolVector* isCutVector = g3PhysicsManager->GetIsCutVector();
349
350 if (!isCutVector) {
351 TG4Globals::Exception("TG4PhysicsManager", "SetSpecialCutsActivation",
352 "Vector of isCut booleans is not set.");
353 return;
354 }
355
356 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
357 for (G4int i = 0; i < G4int(particleTable->size()); ++i) {
358
359 G4ParticleDefinition* particle = particleTable->GetParticle(i);
360 if (!particle) continue;
361
362 TG4G3ParticleWSP particleWSP = g3PhysicsManager->GetG3ParticleWSP(particle);
363 if ((particleWSP != kNofParticlesWSP) && (particleWSP != kEplus) &&
364 (particleWSP != kAny)) {
365 // special process is activated in case
366 // cutVector (vector of kinetic energy cuts) is set
367 // or the special cut is set by TG4Limits
368
369 G4ProcessManager* processManager = particle->GetProcessManager();
370
371 // get the special cut process (if it was instantiated)
372 // G4VProcess* process = GetProcess(processManager, "specialCut");
373 G4VProcess* process = GetProcess(processManager, USER_SPECIAL_CUTS);
374 if (process) {
375 processManager->SetProcessActivation(
376 process, (*isCutVector)[particleWSP]);
377 }
378 else {
379 TG4Globals::Warning("TG4PhysicsManager", "SetSpecialCutsActivation",
380 "The special cut process for " +
381 TString(particle->GetParticleName()) + " is not defined");
382 }
383 }
384 }
385}
386
387//
388// public methods
389//
390
391//_____________________________________________________________________________
392void TG4PhysicsManager::Gstpar(Int_t itmed, const char* param, Float_t parval)
393{
412
413 if (VerboseLevel() > 1) {
414 G4cout << "TG4PhysicsManager::Gstpar " << param << " " << parval << G4endl;
415 }
416
417 G4String name = TG4GeometryServices::Instance()->CutName(param);
418 TG4G3Cut cut;
419 if (fG3PhysicsManager->CheckCutWithTheVector(name, parval, cut)) {
420 GstparCut(itmed, cut, parval);
422 }
423 else {
424 TG4G3Control control;
425 TG4G3ControlValue controlValue;
427 name, parval, control, controlValue)) {
428 GstparControl(itmed, control, controlValue);
430 }
431 else if (cut == kNoG3Cuts && control == kNoG3Controls &&
432 fNotImplParNames.find(TString(param)) == fNotImplParNames.end()) {
433
434 if (TString(param) == "STRA") {
435 TString text = name;
436 text += " parameter is supported via /mcPhysics/emModel commands.\n";
437 text += " Setting via Gstpar is ignored.";
438 TG4Globals::Warning("TG4PhysicsManager", "Gstpar", text);
439 }
440 else {
441 TG4Globals::Warning("TG4PhysicsManager", "Gstpar",
442 TString(name) + " parameter is not yet implemented.");
443 }
444
445 fNotImplParNames.insert(TString(param));
446 }
447 }
448}
449
450//_____________________________________________________________________________
451Bool_t TG4PhysicsManager::SetCut(const char* cutName, Float_t cutValue)
452{
454
456 TG4G3Cut g3Cut = TG4G3CutVector::GetCut(cutName);
457
458 if (g3Cut == kNoG3Cuts) {
459 if (fNotImplParNames.find(TString(cutName)) == fNotImplParNames.end()) {
460 TG4Globals::Warning("TG4PhysicsManager", "SetCut",
461 "Parameter " + TString(cutName) + " is not implemented.");
462
463 fNotImplParNames.insert(TString(cutName));
464 }
465 return false;
466 }
467
468 // add units
469 if (g3Cut == kTOFMAX)
470 cutValue *= TG4G3Units::Time();
471 else
472 cutValue *= TG4G3Units::Energy();
473
474 fG3PhysicsManager->SetCut(g3Cut, cutValue);
475
476 return true;
477}
478
479//_____________________________________________________________________________
480Bool_t TG4PhysicsManager::SetProcess(const char* controlName, Int_t value)
481{
483
485 TG4G3Control control = TG4G3ControlVector::GetControl(controlName);
486
487 if (control != kNoG3Controls) {
488 TG4G3ControlValue controlValue =
490 fG3PhysicsManager->SetProcess(control, controlValue);
491
492 return true;
493 }
494 else {
495 if (fNotImplParNames.find(TString(controlName)) == fNotImplParNames.end()) {
496 TG4Globals::Warning("TG4PhysicsManager", "SetProcess",
497 "Parameter " + TString(controlName) + " is not implemented.");
498 fNotImplParNames.insert(TString(controlName));
499 }
500 return false;
501 }
502}
503
504//_____________________________________________________________________________
505Bool_t TG4PhysicsManager::DefineParticle(Int_t pdg, const char* name,
506 TMCParticleType mcType, Double_t mass, Double_t charge, Double_t lifetime,
507 const TString& pType, Double_t width, Int_t iSpin, Int_t iParity,
508 Int_t iConjugation, Int_t iIsospin, Int_t iIsospinZ, Int_t gParity,
509 Int_t lepton, Int_t baryon, Bool_t stable, Bool_t shortlived,
510 const TString& subType, Int_t antiEncoding, Double_t magMoment,
511 Double_t excitation)
512{
515
516 // Check if particle is available in Geant4
517 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
518 G4ParticleDefinition* particleDefinition = 0;
519 if (pdg != 0)
520 particleDefinition = particleTable->FindParticle(pdg);
521 else {
522 G4String particleName(name);
523 if (particleName == "Rootino")
524 particleDefinition = particleTable->FindParticle("geantino");
525 }
526
527 if (particleDefinition) {
528 TString text = "Particle with PDG=";
529 text += pdg;
530 text += ", name=" + TString(name) + TG4Globals::Endl();
531 text += "is defined in Geant4 as \"";
532 text += particleDefinition->GetParticleName().c_str();
533 text += "\"." + TG4Globals::Endl();
534 text += "User definition will be ignored.";
535
536 TG4Globals::Warning("TG4PhysicsManager", "DefineParticle", text);
537
538 return false;
539 }
540 else {
541 fParticlesManager->AddParticle(pdg, name, mcType, mass, charge, lifetime,
542 pType, width, iSpin, iParity, iConjugation, iIsospin, iIsospinZ, gParity,
543 lepton, baryon, stable, shortlived, subType, antiEncoding, magMoment,
544 excitation);
545 return true;
546 }
547}
548
549//_____________________________________________________________________________
551{
554
556}
557
558//_____________________________________________________________________________
560 Int_t pdg, Float_t bratio[6], Int_t mode[6][3])
561{
563
564 fParticlesManager->SetDecayMode(pdg, bratio, mode);
565
566 return true;
567}
568
569//_____________________________________________________________________________
570Bool_t TG4PhysicsManager::DefineIon(const char* name, Int_t Z, Int_t A, Int_t Q,
571 Double_t excEnergy, Double_t /*mass*/)
572{
575
576 // add unit
577 excEnergy *= TG4G3Units::Energy();
578
579 fParticlesManager->AddIon(name, Z, A, Q, excEnergy);
580
581 return true;
582}
583
584//_____________________________________________________________________________
586 char* /*ch*/, Float_t /*p1*/, Int_t /*i1*/, Int_t /*i2*/)
587{
589
590 TG4Globals::Exception("TG4PhysicsManager", "Xsec", "Not yet implemented.");
591
592 return 0.;
593}
594
595//_____________________________________________________________________________
596Int_t TG4PhysicsManager::IdFromPDG(Int_t pdgID) const
597{
600
601 return pdgID;
602}
603
604//_____________________________________________________________________________
605Int_t TG4PhysicsManager::PDGFromId(Int_t mcID) const
606{
609
610 return mcID;
611}
612
613//_____________________________________________________________________________
614TString TG4PhysicsManager::ParticleName(Int_t pdg) const
615{
617
619
620 if (particle)
621 return TString(particle->GetParticleName());
622 else
623 return TString();
624}
625
626//_____________________________________________________________________________
627Double_t TG4PhysicsManager::ParticleMass(Int_t pdg) const
628{
630
632
633 if (particle)
634 return particle->GetPDGMass() * TG4G3Units::InverseEnergy();
635 else
636 return 0.;
637}
638
639//_____________________________________________________________________________
640Double_t TG4PhysicsManager::ParticleCharge(Int_t pdg) const
641{
643
645
646 if (particle)
647 return particle->GetPDGCharge() * TG4G3Units::InverseCharge();
648 else
649 return 0.;
650}
651
652//_____________________________________________________________________________
653Double_t TG4PhysicsManager::ParticleLifeTime(Int_t pdg) const
654{
656
658
659 if (particle)
660 return particle->GetPDGLifeTime();
661 else
662 return 0.;
663}
664
665//_____________________________________________________________________________
666TMCParticleType TG4PhysicsManager::ParticleMCType(Int_t pdg) const
667{
669
671
672 if (particle) {
674 "TG4PhysicsManager", "ParticleMCType", "Not yet implemented.");
675 return kPTUndefined;
676 }
677 else
678 return kPTUndefined;
679}
680
681//_____________________________________________________________________________
693
694//_____________________________________________________________________________
696{
699
701 TG4G3PhysicsManager::Instance()->IsGlobalSpecialControls()) {
702
704 }
705
707 TG4SpecialPhysicsList::Instance()->IsSpecialCuts()) {
708
710 }
711}
712
713//_____________________________________________________________________________
715{
717
718 G4ParticleDefinition* photon = G4OpticalPhoton::Definition();
719 G4ProcessManager* processManager = photon->GetProcessManager();
720
721 G4int nofProcesses = processManager->GetProcessListLength();
722 G4ProcessVector* processList = processManager->GetProcessList();
723 for (G4int i = 0; i < nofProcesses; i++) {
724 if ((*processList)[i]->GetProcessSubType() == fOpBoundary) {
726 dynamic_cast<G4OpBoundaryProcess*>((*processList)[i]);
727 break;
728 }
729 }
730}
731
732//_____________________________________________________________________________
734{
736
737 if (!process) return kPNoProcess;
738
739 return fgProcessMap->GetMCProcess(process);
740}
741
742//_____________________________________________________________________________
744{
747
748 if (!fOpBoundaryProcess) {
749 TG4Globals::Exception("TG4PhysicsManager", "GetOpBoundaryStatus",
750 "OpBoundary process is not defined.");
751 return kPNoProcess;
752 }
753
754 switch (fOpBoundaryProcess->GetStatus()) {
755 // reflection
756 case FresnelReflection:
757 case TotalInternalReflection:
758 case LambertianReflection:
759 case LobeReflection:
760 case SpikeReflection:
761 case BackScattering:
762 case PolishedLumirrorAirReflection:
763 case PolishedLumirrorGlueReflection:
764 case PolishedAirReflection:
765 case PolishedTeflonAirReflection:
766 case PolishedTiOAirReflection:
767 case PolishedTyvekAirReflection:
768 case PolishedVM2000AirReflection:
769 case PolishedVM2000GlueReflection:
770 case EtchedLumirrorAirReflection:
771 case EtchedLumirrorGlueReflection:
772 case EtchedAirReflection:
773 case EtchedTeflonAirReflection:
774 case EtchedTiOAirReflection:
775 case EtchedTyvekAirReflection:
776 case EtchedVM2000AirReflection:
777 case EtchedVM2000GlueReflection:
778 case GroundLumirrorAirReflection:
779 case GroundLumirrorGlueReflection:
780 case GroundAirReflection:
781 case GroundTeflonAirReflection:
782 case GroundTiOAirReflection:
783 case GroundTyvekAirReflection:
784 case GroundVM2000AirReflection:
785 case GroundVM2000GlueReflection:
786#if G4VERSION_NUMBER >= 1110
787 case CoatedDielectricReflection:
788#endif
789 return kPLightReflection;
790 ;
791 ;
792
793 // refraction
794 case FresnelRefraction:
795#if G4VERSION_NUMBER >= 1000
796 case Dichroic:
797#endif
798#if G4VERSION_NUMBER >= 1010
799 case Transmission:
800#endif
801#if G4VERSION_NUMBER >= 1110
802 case CoatedDielectricRefraction:
803#endif
804#if G4VERSION_NUMBER >= 1110
805 case CoatedDielectricFrustratedTransmission:
806#endif
807 return kPLightRefraction;
808 ;
809 ;
810
811 // absorption
812 case Absorption:
813 return kPLightAbsorption;
814 ;
815 ;
816 // detection
817 case Detection:
818 return kPLightDetection;
819 ;
820 ;
821
822 case NotAtBoundary:
823 case SameMaterial:
824 case StepTooSmall:
825 case NoRINDEX:
826 case Undefined:
827 return kPNoProcess;
828 ;
829 ;
830 }
831
832 // should not happen
833 return kPNoProcess;
834}
835
836#if G4VERSION_NUMBER == 1100
837//_____________________________________________________________________________
838void TG4PhysicsManager::StoreCerenkovMaxBetaChangeValue()
839{
840 // Temporary work-around for bug in Cerenkov in Geant4 11.0
841 fCerenkovMaxBetaChange =
842 G4OpticalParameters::Instance()->GetCerenkovMaxBetaChange();
843 G4cout << "Saved fCerenkovMaxBetaChange " << fCerenkovMaxBetaChange << G4endl;
844}
845
846//_____________________________________________________________________________
847void TG4PhysicsManager::ApplyCerenkovMaxBetaChangeValue()
848{
849 // Temporary work-around for bug in Cerenkov in Geant4 11.0
850 // Apply the initial (not corrupted) value to Cerenkov process, if defined
851
852 if (fCerenkovMaxBetaChange == 0.) return;
853
854 auto cerenkov =
855 G4Electron::Definition()->GetProcessManager()->GetProcess("Cerenkov");
856 if (cerenkov != nullptr) {
857 auto maxBetaChangeAfter =
858 G4OpticalParameters::Instance()->GetCerenkovMaxBetaChange();
859 G4cout << "Applying correction to CerenkovMaxBetaChange "
860 << "from " << maxBetaChangeAfter << " to " << fCerenkovMaxBetaChange
861 << G4endl;
862 static_cast<G4Cerenkov*>(cerenkov)->SetMaxBetaChangePerStep(
863 fCerenkovMaxBetaChange);
864 G4cout << "New value: "
865 << static_cast<G4Cerenkov*>(cerenkov)->GetMaxBetaChangePerStep()
866 << G4endl;
867 }
868}
869#endif
Definition of the enumerations TG4G3Control, TG4G3ControlValue.
Definition of the enumeration TG4G3Cut.
Definition of the TG4G3PhysicsManager class.
Definition of the TG4G3Units class.
Definition of the TG4GeometryServices class.
Definition of the TG4Limits class.
Definition of the TG4MediumMap class.
Definition of the TG4Medium class.
Definition of the TG4ParticlesManager class.
Definition of the TG4PhysicsManager class.
Definition of the TG4ProcessMap class.
Definition of the TG4SpecialPhysicsList class.
Definition of the TG4StateManager class.
Vector of control process values with convenient set/get methods.
static TG4G3Control GetControl(const G4String &controlName)
static TG4G3ControlValue GetControlValue(G4int value, TG4G3Control control)
static TG4G3Cut GetCut(const G4String &cutName)
Provides a Geant3 way control to Geant4 physics.
TG4G3ControlVector * GetControlVector() const
G4bool CheckControlWithTheVector(G4String name, G4double value, TG4G3Control &control, TG4G3ControlValue &controlValue)
void SetCut(TG4G3Cut cut, G4double cutValue)
static TG4G3PhysicsManager * Instance()
TG4G3ParticleWSP GetG3ParticleWSP(G4ParticleDefinition *particle) const
void SetProcess(TG4G3Control control, TG4G3ControlValue controlValue)
TG4boolVector * GetIsCutVector() const
TG4G3CutVector * GetCutVector() const
G4bool CheckCutWithTheVector(G4String name, G4double value, TG4G3Cut &cut)
static G4double Energy()
Definition TG4G3Units.h:105
static G4double InverseCharge()
Definition TG4G3Units.h:151
static G4double InverseEnergy()
Definition TG4G3Units.h:157
static G4double Time()
Definition TG4G3Units.h:93
G4String CutName(const char *name) const
static TG4GeometryServices * Instance()
TG4Limits * GetLimits(G4UserLimits *limits) const
TG4MediumMap * GetMediumMap() const
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 G4bool Compare(G4bool activation, TG4G3ControlValue controlValue)
static TString Endl()
Definition TG4Globals.h:100
Extended G4UserLimits class.
Definition TG4Limits.h:38
void SetG3Cut(TG4G3Cut cut, G4double cutValue)
void SetG3Control(TG4G3Control control, TG4G3ControlValue controlValue)
TG4Medium * GetMedium(G4int mediumID, G4bool warn=true) const
Helper class to keep medium data.
Definition TG4Medium.h:29
G4UserLimits * GetLimits() const
Definition TG4Medium.h:99
void SetLimits(G4UserLimits *limits)
Definition TG4Medium.cxx:83
Provides mapping between TDatabasePDG and Geant4 particles.
void AddIon(const G4String &name, G4int Z, G4int A, G4int Q, G4double excEnergy)
Bool_t SetDecayMode(Int_t pdg, Float_t bratio[6], Int_t mode[6][3])
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)
Geant4 implementation of the TVirtualMC interface methods for building Geant4 physics and access to i...
TG4ParticlesManager * fParticlesManager
particles manager
Bool_t SetDecayMode(Int_t pdg, Float_t bratio[6], Int_t mode[6][3])
Double_t ParticleCharge(Int_t pdg) const
TMCParticleType ParticleMCType(Int_t pdg) const
Int_t PDGFromId(Int_t mcID) const
Double_t ParticleMass(Int_t pdg) const
void GstparControl(G4int itmed, TG4G3Control control, TG4G3ControlValue parval)
static const G4double fgkDefautCut
the default range cut value
Double_t ParticleLifeTime(Int_t pdg) const
Bool_t SetCut(const char *cutName, Float_t cutValue)
void SetUserDecay(Int_t pdg)
TString ParticleName(Int_t pdg) const
TG4G3PhysicsManager * fG3PhysicsManager
G3 physics manager.
std::set< TString > fNotImplParNames
set of not implemented Gstpar parameters
Bool_t DefineIon(const char *name, Int_t Z, Int_t A, Int_t Q, Double_t excEnergy, Double_t mass)
void GstparCut(G4int itmed, TG4G3Cut par, G4double parval)
Bool_t SetProcess(const char *controlName, Int_t controlValue)
TMCProcess GetMCProcess(const G4VProcess *process)
Int_t IdFromPDG(Int_t pdgID) const
G4ParticleDefinition * GetParticleDefinition(G4int pdgEncoding) const
TMCProcess GetOpBoundaryStatus()
G4VProcess * GetProcess(G4ProcessManager *processManager, G4int subType) const
Bool_t DefineParticle(Int_t pdg, const char *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)
G4OpBoundaryProcess * fOpBoundaryProcess
optical boundary process
Float_t Xsec(char *reac, Float_t energy, Int_t part, Int_t mate)
static TG4ProcessMap * fgProcessMap
the mapping between G4 processes and G3 process controls
void Gstpar(Int_t itmed, const char *param, Float_t parval)
static TG4PhysicsManager * fgInstance
this instance
Maps G4 process sub types to TMCProcess and TG4G3Control codes.
TMCProcess GetMCProcess(const G4VProcess *process) const
static TG4SpecialPhysicsList * Instance()
void SetNewState(TG4ApplicationState state)
static TG4StateManager * Instance()
Base class for defining the verbose level and a common messenger.
Definition TG4Verbose.h:36
virtual G4int VerboseLevel() const
Definition TG4Verbose.h:78
TG4G3ControlValue
Enumeration for G3 processes control values.
TG4G3Cut
Enumeration for G3 types of kinetic energy cuts.
Definition TG4G3Cut.h:22
std::vector< G4bool > TG4boolVector
Definition TG4Globals.h:37
TG4G3Control
Enumeration for G3 types of physics processes controls.
@ kInActivate
process is not activated
@ kActivate
process is activated WITH generation of secondaries
@ kUnsetControlValue
value not set
@ kNoG3Cuts
Invalid value.
Definition TG4G3Cut.h:80
@ kTOFMAX
Definition TG4G3Cut.h:77
@ kAddIons
in AddIons
@ kNotInApplication
not in VMC application
@ kPAIR
@ kPFIS
@ kNoG3Controls
No process control.
@ kCOMP
@ kPHOT
TG4G3ParticleWSP
The particles types which a special process (cuts, controls) is applicable for.
@ kNofParticlesWSP
not a particle with a special control
@ kEplus
kDRAY, kBREM, kMULS, kG3LOSS, kANNI
@ kAny
kDCAY