Geant4 10.7.0
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
 
void UseCoupledTransportation (G4bool vl=true)
 
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 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=0)
 
void SetParticleCuts (G4double cut, const G4String &particleName, G4Region *region=0)
 
void SetCutsForRegion (G4double aCut, const G4String &rname)
 
void ResetCuts ()
 obsolete methods
 
void SetApplyCuts (G4bool value, const G4String &name)
 
G4bool GetApplyCuts (const G4String &name) const
 
void RemoveProcessManager ()
 
void AddProcessManager (G4ParticleDefinition *newParticle, G4ProcessManager *newManager=0)
 
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
 
G4int verboseLevel
 
G4double defaultCutValue
 
G4bool isSetDefaultCutValue
 
G4ProductionCutsTablefCutsTable
 
G4bool fRetrievePhysicsTable
 
G4bool fStoredInAscii
 
G4bool fIsCheckedForRetrievePhysicsTable
 
G4bool fIsRestoredCutValues
 
G4String directoryPhysicsTable
 
G4bool fDisableCheckParticleList
 
G4int g4vuplInstanceID
 
- 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.

72{
73 defaultCutValue = 1.0E+9*cm; // set big step so that AlongStep computes all the energy
74}

◆ ~G4ErrorPhysicsList()

G4ErrorPhysicsList::~G4ErrorPhysicsList ( )
virtual

Definition at line 78 of file G4ErrorPhysicsList.cc.

79{
80}

Member Function Documentation

◆ ConstructEM()

void G4ErrorPhysicsList::ConstructEM ( )
protectedvirtual

Definition at line 167 of file G4ErrorPhysicsList.cc.

168{
169
170 G4ErrorEnergyLoss* eLossProcess = new G4ErrorEnergyLoss;
173 new G4ErrorMessenger( stepLengthLimitProcess, magFieldLimitProcess, eLossProcess );
174
175 auto myParticleIterator=GetParticleIterator();
176 myParticleIterator->reset();
177 while( (*myParticleIterator)() ) { // Loop checking, 06.08.2015, G.Cosmo
178 G4ParticleDefinition* particle = myParticleIterator->value();
179 G4ProcessManager* pmanager = particle->GetProcessManager();
180 G4String particleName = particle->GetParticleName();
181
182 if (particleName == "gamma") {
183 // gamma
184 pmanager->AddDiscreteProcess(new G4GammaConversion());
185 pmanager->AddDiscreteProcess(new G4ComptonScattering());
187
188 // } else if (particleName == "e-" || particleName == "e+"
189 // || particleName == "mu+" || particleName == "mu-" ) {
190 }else if (!particle->IsShortLived() && particle->GetPDGCharge() != 0 ) {
191
192 pmanager->AddContinuousProcess(eLossProcess,1);
193 pmanager->AddDiscreteProcess( stepLengthLimitProcess, 2 );
194 pmanager->AddDiscreteProcess( magFieldLimitProcess, 3 );
195
196 /* } else if ((!particle->IsShortLived()) &&
197 (particle->GetPDGCharge() != 0.0) &&
198 (particle->GetParticleName() != "chargedgeantino")) {
199 // all others charged particles except geantino
200 // G4VProcess* aMultipleScattering = new G4MultipleScattering();
201 G4VProcess* anIonisation = new G4hIonisation();
202 ////G4VProcess* theUserCuts = new G4UserSpecialCuts();
203
204 //
205 // add processes
206 pmanager->AddProcess(anIonisation);
207 // pmanager->AddProcess(aMultipleScattering);
208 ////pmanager->AddProcess(theUserCuts);
209
210 //
211 // set ordering for AlongStepDoIt
212 // pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,1);
213 pmanager->SetProcessOrdering(anIonisation, idxAlongStep,1);
214
215 //
216 // set ordering for PostStepDoIt
217 // pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep,1);
218 pmanager->SetProcessOrdering(anIonisation, idxPostStep,1);
219 ////pmanager->SetProcessOrdering(theUserCuts, idxPostStep,2);
220 */
221 }
222 }
223}
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 84 of file G4ErrorPhysicsList.cc.

85{
86// In this method, static member functions should be called
87 // for all particles which you want to use.
88 // This ensures that objects of these particle types will be
89 // created in the program.
90 // gamma
92 // e+/-
95 // mu+/-
98
99 // pi+/-
102
103 // proton
105
106}
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 110 of file G4ErrorPhysicsList.cc.

111{
112 G4Transportation* theTransportationProcess= new G4Transportation();
113
114#ifdef G4VERBOSE
115 if (verboseLevel >= 4){
116 G4cout << "G4VUserPhysicsList::ConstructProcess() "<< G4endl;
117 }
118#endif
119
120 // loop over all particles in G4ParticleTable
121 auto myParticleIterator=GetParticleIterator();
122 myParticleIterator->reset();
123 while( (*myParticleIterator)() ) { // Loop checking, 06.08.2015, G.Cosmo
124 G4ParticleDefinition* particle = myParticleIterator->value();
125 G4ProcessManager* pmanager = particle->GetProcessManager();
126 if (!particle->IsShortLived()) {
127 G4cout << particle << "G4ErrorPhysicsList:: particle process manager " << particle->GetParticleName() << " = " << particle->GetProcessManager() << G4endl;
128 // Add transportation process for all particles other than "shortlived"
129 if ( pmanager == 0) {
130 // Error !! no process manager
131 G4String particleName = particle->GetParticleName();
132 G4Exception("G4ErrorPhysicsList::ConstructProcess","No process manager",
133 RunMustBeAborted, particleName );
134 } else {
135 // add transportation with ordering = ( -1, "first", "first" )
136 pmanager ->AddProcess(theTransportationProcess);
137 pmanager ->SetProcessOrderingToFirst(theTransportationProcess, idxAlongStep);
138 pmanager ->SetProcessOrderingToFirst(theTransportationProcess, idxPostStep);
139 }
140 } else {
141 // shortlived particle case
142 }
143 }
144
145 ConstructEM();
146}
@ RunMustBeAborted
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
@ 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 227 of file G4ErrorPhysicsList.cc.

228{
229 // " G4VUserPhysicsList::SetCutsWithDefault" method sets
230 // the default cut value or all particle types
232 // if (verboseLevel>0)
233 // DumpCutValuesTable();
234}

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