Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
PhysicsList Class Reference

#include <PhysicsList.hh>

Inheritance diagram for PhysicsList:
G4VModularPhysicsList G4VUserPhysicsList

Public Member Functions

 PhysicsList (DetectorConstruction *)
 
 ~PhysicsList () override
 
void ConstructParticle () override
 
void ConstructProcess () override
 
void AddPhysicsList (const G4String &name)
 
void AddDecay ()
 
void AddRadioactiveDecay ()
 
void AddStepMax ()
 
void GetRange (G4double)
 
G4VProcessGetProcess (const G4String &) const
 

Private Attributes

G4VPhysicsConstructorfEmPhysicsList = nullptr
 
G4String fEmName = " "
 
DetectorConstructionfDet = nullptr
 
PhysicsListMessengerfMessenger = nullptr
 

Detailed Description

Definition at line 50 of file PhysicsList.hh.

Constructor & Destructor Documentation

◆ PhysicsList()

PhysicsList::PhysicsList ( DetectorConstruction det)

Definition at line 84 of file PhysicsList.cc.

85 : fDet(det)
86{
88 SetVerboseLevel(1);
89
90 // EM physics
91 AddPhysicsList("emstandard_opt3");
92
93 // fix lower limit for cut
94 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(10*eV, 1*GeV);
95 SetDefaultCutValue(1*mm);
96}
PhysicsListMessenger * fMessenger
DetectorConstruction * fDet
void AddPhysicsList(const G4String &name)

◆ ~PhysicsList()

PhysicsList::~PhysicsList ( )
override

Definition at line 100 of file PhysicsList.cc.

101{
102 delete fMessenger;
103}

Member Function Documentation

◆ ConstructParticle()

void PhysicsList::ConstructParticle ( )
override

Definition at line 107 of file PhysicsList.cc.

108{
109 G4BosonConstructor pBosonConstructor;
110 pBosonConstructor.ConstructParticle();
111
112 G4LeptonConstructor pLeptonConstructor;
113 pLeptonConstructor.ConstructParticle();
114
115 G4MesonConstructor pMesonConstructor;
116 pMesonConstructor.ConstructParticle();
117
118 G4BaryonConstructor pBaryonConstructor;
119 pBaryonConstructor.ConstructParticle();
120
121 G4IonConstructor pIonConstructor;
122 pIonConstructor.ConstructParticle();
123
124 G4ShortLivedConstructor pShortLivedConstructor;
125 pShortLivedConstructor.ConstructParticle();
126}

◆ ConstructProcess()

void PhysicsList::ConstructProcess ( )
override

Definition at line 130 of file PhysicsList.cc.

131{
132 // Transportation
133 //
134 AddTransportation();
135
136 // Electromagnetic physics list
137 //
138 fEmPhysicsList->ConstructProcess();
139
140 // Decay Process
141 //
142 AddDecay();
143
144 // Decay Process
145 //
147
148 // step limitation (as a full process)
149 //
150 AddStepMax();
151
152 // example of Get process
153 auto process = GetProcess("RadioactiveDecay");
154 if (process != nullptr) {
155 G4cout << "\n GetProcess : " << process->GetProcessName() << G4endl;
156 }
157}
void AddStepMax()
void AddRadioactiveDecay()
G4VPhysicsConstructor * fEmPhysicsList
G4VProcess * GetProcess(const G4String &) const
void AddDecay()

◆ AddPhysicsList()

void PhysicsList::AddPhysicsList ( const G4String name)

Definition at line 161 of file PhysicsList.cc.

162{
163 if (verboseLevel>0) {
164 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
165 }
166
167 if (name == fEmName) return;
168
169 if (name == "local") {
170 fEmName = name;
171 delete fEmPhysicsList;
173
174 } else if (name == "emstandard_opt0") {
175 fEmName = name;
176 delete fEmPhysicsList;
178
179 } else if (name == "emstandard_opt1") {
180 fEmName = name;
181 delete fEmPhysicsList;
183
184 } else if (name == "emstandard_opt2") {
185 fEmName = name;
186 delete fEmPhysicsList;
188
189 } else if (name == "emstandard_opt3") {
190 fEmName = name;
191 delete fEmPhysicsList;
193
194 } else if (name == "emstandard_opt4") {
195 fEmName = name;
196 delete fEmPhysicsList;
198
199 } else if (name == "emstandardSS") {
200 fEmName = name;
201 delete fEmPhysicsList;
203
204 } else if (name == "emstandardGS") {
205 fEmName = name;
206 delete fEmPhysicsList;
208
209 } else if (name == "emstandardWVI") {
210 fEmName = name;
211 delete fEmPhysicsList;
213
214 } else if (name == "emlivermore") {
215 fEmName = name;
216 delete fEmPhysicsList;
218
219 } else if (name == "empenelope") {
220 fEmName = name;
221 delete fEmPhysicsList;
223
224 } else if (name == "emlowenergy") {
225 fEmName = name;
226 delete fEmPhysicsList;
228
229 } else {
230
231 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
232 << " is not defined"
233 << G4endl;
234 }
235
236 // Em options
237 //
238 G4EmParameters::Instance()->SetBuildCSDARange(true);
239 G4EmParameters::Instance()->SetGeneralProcessActive(false);
240}
G4String fEmName

◆ AddDecay()

void PhysicsList::AddDecay ( )

Definition at line 244 of file PhysicsList.cc.

245{
246 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
247
248 // Decay Process
249 //
250 G4Decay* fDecayProcess = new G4Decay();
251
252 auto particleIterator=GetParticleIterator();
253 particleIterator->reset();
254 while( (*particleIterator)() ){
255 G4ParticleDefinition* particle = particleIterator->value();
256 if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived())
257 ph->RegisterProcess(fDecayProcess, particle);
258 }
259}

◆ AddRadioactiveDecay()

void PhysicsList::AddRadioactiveDecay ( )

Definition at line 263 of file PhysicsList.cc.

264{
265 G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay();
266
267 G4bool armFlag = false;
268 radioactiveDecay->SetARM(armFlag); //Atomic Rearangement
269
270 // atomic de-excitation module
271 if (armFlag) {
272 G4EmParameters::Instance()->SetAuger(true);
273 G4EmParameters::Instance()->SetDeexcitationIgnoreCut(true);
274 }
275
276 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
277 ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
278
279 // mandatory for G4NuclideTable
280 //
281 const G4double meanLife = 1*picosecond, halfLife = meanLife*std::log(2);
282 G4NuclideTable::GetInstance()->SetThresholdOfHalfLife(halfLife);
283}

◆ AddStepMax()

void PhysicsList::AddStepMax ( )

Definition at line 287 of file PhysicsList.cc.

288{
289 // Step limitation seen as a process
290 StepMax* stepMaxProcess = new StepMax();
291
292 auto particleIterator=GetParticleIterator();
293 particleIterator->reset();
294 while ((*particleIterator)()){
295 G4ParticleDefinition* particle = particleIterator->value();
296 G4ProcessManager* pmanager = particle->GetProcessManager();
297
298 if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
299 pmanager->AddDiscreteProcess(stepMaxProcess);
300 }
301}
G4bool IsApplicable(const G4ParticleDefinition &) override
Definition StepMax.cc:50

◆ GetRange()

void PhysicsList::GetRange ( G4double  val)

Definition at line 305 of file PhysicsList.cc.

306{
307 G4LogicalVolume* lBox = fDet->GetWorld()->GetLogicalVolume();
308 const G4MaterialCutsCouple* couple = lBox->GetMaterialCutsCouple();
309 const G4Material* currMat = lBox->GetMaterial();
310
312 G4double cut;
313 part = G4Electron::Electron();
314 cut = G4LossTableManager::Instance()->GetRange(part,val,couple);
315 G4cout << "material : " << currMat->GetName() << G4endl;
316 G4cout << "particle : " << part->GetParticleName() << G4endl;
317 G4cout << "energy : " << G4BestUnit(val,"Energy") << G4endl;
318 G4cout << "range : " << G4BestUnit(cut,"Length") << G4endl;
319}
const G4VPhysicalVolume * GetWorld() const

◆ GetProcess()

G4VProcess * PhysicsList::GetProcess ( const G4String processName) const

Definition at line 323 of file PhysicsList.cc.

324{
325 G4ParticleDefinition* particle = G4GenericIon::GenericIon();
326 G4ProcessVector* procList = particle->GetProcessManager()->GetProcessList();
327 G4int nbProc = particle->GetProcessManager()->GetProcessListLength();
328 for (G4int k=0; k<nbProc; k++) {
329 G4VProcess* process = (*procList)[k];
330 if (process->GetProcessName() == processName) return process;
331 }
332 return nullptr;
333}

Member Data Documentation

◆ fEmPhysicsList

G4VPhysicsConstructor* PhysicsList::fEmPhysicsList = nullptr
private

Definition at line 68 of file PhysicsList.hh.

◆ fEmName

G4String PhysicsList::fEmName = " "
private

Definition at line 69 of file PhysicsList.hh.

◆ fDet

DetectorConstruction* PhysicsList::fDet = nullptr
private

Definition at line 70 of file PhysicsList.hh.

◆ fMessenger

PhysicsListMessenger* PhysicsList::fMessenger = nullptr
private

Definition at line 71 of file PhysicsList.hh.


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