Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ErrorPhysicsList Class Reference

#include <G4ErrorPhysicsList.hh>

+ Inheritance diagram for G4ErrorPhysicsList:

Public Member Functions

 G4ErrorPhysicsList ()
 
virtual ~G4ErrorPhysicsList ()
 
- Public Member Functions inherited from G4VUserPhysicsList
 G4VUserPhysicsList ()
 
virtual ~G4VUserPhysicsList ()
 
 G4VUserPhysicsList (const G4VUserPhysicsList &)
 
G4VUserPhysicsListoperator= (const G4VUserPhysicsList &)
 
virtual void ConstructParticle ()=0
 
void Construct ()
 
virtual void ConstructProcess ()=0
 
virtual void SetCuts ()
 
void SetDefaultCutValue (G4double newCutValue)
 
G4double GetDefaultCutValue () const
 
void BuildPhysicsTable ()
 
void PreparePhysicsTable (G4ParticleDefinition *)
 
void BuildPhysicsTable (G4ParticleDefinition *)
 
G4bool StorePhysicsTable (const G4String &directory=".")
 
G4bool IsPhysicsTableRetrieved () const
 
G4bool IsStoredInAscii () const
 
const G4StringGetPhysicsTableDirectory () const
 
void SetPhysicsTableRetrieved (const G4String &directory="")
 
void SetStoredInAscii ()
 
void ResetPhysicsTableRetrieved ()
 
void ResetStoredInAscii ()
 
void DumpList () const
 
void DumpCutValuesTable (G4int flag=1)
 
void DumpCutValuesTableIfRequested ()
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
void UseCoupledTransportation (G4bool vl=true)
 
void SetCutsWithDefault ()
 
void SetCutValue (G4double aCut, const G4String &pname)
 
G4double GetCutValue (const G4String &pname) const
 
void SetCutValue (G4double aCut, const G4String &pname, const G4String &rname)
 
void SetParticleCuts (G4double cut, G4ParticleDefinition *particle, G4Region *region=nullptr)
 
void SetParticleCuts (G4double cut, const G4String &particleName, G4Region *region=nullptr)
 
void SetCutsForRegion (G4double aCut, const G4String &rname)
 
void SetApplyCuts (G4bool value, const G4String &name)
 
G4bool GetApplyCuts (const G4String &name) const
 
void RemoveProcessManager ()
 
void RemoveTrackingManager ()
 
void AddProcessManager (G4ParticleDefinition *newParticle, G4ProcessManager *newManager=nullptr)
 
void CheckParticleList ()
 
void DisableCheckParticleList ()
 
G4int GetInstanceID () const
 
virtual void InitializeWorker ()
 
virtual void TerminateWorker ()
 

Protected Member Functions

virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 
virtual void SetCuts ()
 
virtual void ConstructEM ()
 
- Protected Member Functions inherited from G4VUserPhysicsList
void AddTransportation ()
 
G4bool RegisterProcess (G4VProcess *process, G4ParticleDefinition *particle)
 
void BuildIntegralPhysicsTable (G4VProcess *, G4ParticleDefinition *)
 
virtual void RetrievePhysicsTable (G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)
 
void InitializeProcessManager ()
 
G4ParticleTable::G4PTblDicIteratorGetParticleIterator () const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VUserPhysicsList
static const G4VUPLManagerGetSubInstanceManager ()
 
- Protected Attributes inherited from G4VUserPhysicsList
G4ParticleTabletheParticleTable = nullptr
 
G4int verboseLevel = 1
 
G4double defaultCutValue = 1.0
 
G4bool isSetDefaultCutValue = false
 
G4ProductionCutsTablefCutsTable = nullptr
 
G4bool fRetrievePhysicsTable = false
 
G4bool fStoredInAscii = true
 
G4bool fIsCheckedForRetrievePhysicsTable = false
 
G4bool fIsRestoredCutValues = false
 
G4String directoryPhysicsTable = "."
 
G4bool fDisableCheckParticleList = false
 
G4int g4vuplInstanceID = 0
 
- Static Protected Attributes inherited from G4VUserPhysicsList
static G4RUN_DLL G4VUPLManager subInstanceManager
 

Detailed Description

Definition at line 48 of file G4ErrorPhysicsList.hh.

Constructor & Destructor Documentation

◆ G4ErrorPhysicsList()

G4ErrorPhysicsList::G4ErrorPhysicsList ( )

Definition at line 71 of file G4ErrorPhysicsList.cc.

73{
75 1.0E+9 * cm; // set big step so that AlongStep computes all the energy
76}

◆ ~G4ErrorPhysicsList()

G4ErrorPhysicsList::~G4ErrorPhysicsList ( )
virtual

Definition at line 79 of file G4ErrorPhysicsList.cc.

79{}

Member Function Documentation

◆ ConstructEM()

void G4ErrorPhysicsList::ConstructEM ( )
protectedvirtual

Definition at line 174 of file G4ErrorPhysicsList.cc.

175{
176 G4ErrorEnergyLoss* eLossProcess = new G4ErrorEnergyLoss;
177 G4ErrorStepLengthLimitProcess* stepLengthLimitProcess =
179 G4ErrorMagFieldLimitProcess* magFieldLimitProcess =
181 new G4ErrorMessenger(stepLengthLimitProcess, magFieldLimitProcess,
182 eLossProcess);
183
184 auto myParticleIterator = GetParticleIterator();
185 myParticleIterator->reset();
186 while((*myParticleIterator)())
187 { // Loop checking, 06.08.2015, G.Cosmo
188 G4ParticleDefinition* particle = myParticleIterator->value();
189 G4ProcessManager* pmanager = particle->GetProcessManager();
190 G4String particleName = particle->GetParticleName();
191
192 if(particleName == "gamma")
193 {
194 // gamma
195 pmanager->AddDiscreteProcess(new G4GammaConversion());
198
199 // } else if (particleName == "e-" || particleName == "e+"
200 // || particleName == "mu+" || particleName == "mu-" ) {
201 }
202 else if(!particle->IsShortLived() && particle->GetPDGCharge() != 0)
203 {
204 pmanager->AddContinuousProcess(eLossProcess, 1);
205 pmanager->AddDiscreteProcess(stepLengthLimitProcess, 2);
206 pmanager->AddDiscreteProcess(magFieldLimitProcess, 3);
207
208 /* } else if ((!particle->IsShortLived()) &&
209 (particle->GetPDGCharge() != 0.0) &&
210 (particle->GetParticleName() != "chargedgeantino")) {
211 // all others charged particles except geantino
212 // G4VProcess* aMultipleScattering = new G4MultipleScattering();
213 G4VProcess* anIonisation = new G4hIonisation();
214 ////G4VProcess* theUserCuts = new G4UserSpecialCuts();
215
216 //
217 // add processes
218 pmanager->AddProcess(anIonisation);
219 // pmanager->AddProcess(aMultipleScattering);
220 ////pmanager->AddProcess(theUserCuts);
221
222 //
223 // set ordering for AlongStepDoIt
224 // pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
225 pmanager->SetProcessOrdering(anIonisation, idxAlongStep,1);
226
227 //
228 // set ordering for PostStepDoIt
229 // pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
230 pmanager->SetProcessOrdering(anIonisation, idxPostStep,1);
231 ////pmanager->SetProcessOrdering(theUserCuts, idxPostStep,2);
232 */
233 }
234 }
235}
G4ProcessManager * GetProcessManager() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4int AddContinuousProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const

Referenced by ConstructProcess().

◆ ConstructParticle()

void G4ErrorPhysicsList::ConstructParticle ( )
protectedvirtual

Implements G4VUserPhysicsList.

Definition at line 82 of file G4ErrorPhysicsList.cc.

83{
84 // In this method, static member functions should be called
85 // for all particles which you want to use.
86 // This ensures that objects of these particle types will be
87 // created in the program.
88 // gamma
90 // e+/-
93 // mu+/-
96
97 // pi+/-
100
101 // proton
103}
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:88
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:80
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:94
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:93
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:92
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:92
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:88
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:87

◆ ConstructProcess()

void G4ErrorPhysicsList::ConstructProcess ( )
protectedvirtual

Implements G4VUserPhysicsList.

Definition at line 106 of file G4ErrorPhysicsList.cc.

107{
108 G4Transportation* theTransportationProcess = new G4Transportation();
109
110#ifdef G4VERBOSE
111 if(verboseLevel >= 4)
112 {
113 G4cout << "G4VUserPhysicsList::ConstructProcess() " << G4endl;
114 }
115#endif
116
117 // loop over all particles in G4ParticleTable
118 auto myParticleIterator = GetParticleIterator();
119 myParticleIterator->reset();
120 while((*myParticleIterator)())
121 { // Loop checking, 06.08.2015, G.Cosmo
122 G4ParticleDefinition* particle = myParticleIterator->value();
123 G4ProcessManager* pmanager = particle->GetProcessManager();
124 if(!particle->IsShortLived())
125 {
126 G4cout << particle << "G4ErrorPhysicsList:: particle process manager "
127 << particle->GetParticleName() << " = "
128 << particle->GetProcessManager() << G4endl;
129 // Add transportation process for all particles other than "shortlived"
130 if(pmanager == 0)
131 {
132 // Error !! no process manager
133 G4String particleName = particle->GetParticleName();
134 G4Exception("G4ErrorPhysicsList::ConstructProcess",
135 "No process manager", RunMustBeAborted, particleName);
136 }
137 else
138 {
139 // add transportation with ordering = ( -1, "first", "first" )
140 pmanager->AddProcess(theTransportationProcess);
141 pmanager->SetProcessOrderingToFirst(theTransportationProcess,
143 pmanager->SetProcessOrderingToFirst(theTransportationProcess,
145 }
146 }
147 else
148 {
149 // shortlived particle case
150 }
151 }
152
153 ConstructEM();
154}
@ RunMustBeAborted
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
@ idxPostStep
@ idxAlongStep
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
virtual void ConstructEM()
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
void SetProcessOrderingToFirst(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)

◆ SetCuts()

void G4ErrorPhysicsList::SetCuts ( )
protectedvirtual

Reimplemented from G4VUserPhysicsList.

Definition at line 238 of file G4ErrorPhysicsList.cc.

239{
240 // " G4VUserPhysicsList::SetCutsWithDefault" method sets
241 // the default cut value or all particle types
243 // if (verboseLevel>0)
244 // DumpCutValuesTable();
245}

The documentation for this class was generated from the following files: