Geant4  10.02.p03
WLSPhysicsList Class Reference

#include <WLSPhysicsList.hh>

Inheritance diagram for WLSPhysicsList:
Collaboration diagram for WLSPhysicsList:

Public Member Functions

 WLSPhysicsList (G4String)
 
virtual ~WLSPhysicsList ()
 
void SetCuts ()
 
void SetCutForGamma (G4double)
 
void SetCutForElectron (G4double)
 
void SetCutForPositron (G4double)
 
void SetStepMax (G4double)
 
WLSStepMaxGetStepMaxProcess ()
 
void AddStepMax ()
 
void RemoveFromPhysicsList (const G4String &)
 Remove specific physics from physics list. More...
 
void ClearPhysics ()
 Make sure that the physics list is empty. More...
 
virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 
void SetAbsorption (G4bool)
 
void SetNbOfPhotonsCerenkov (G4int)
 
void SetVerbose (G4int)
 
- Public Member Functions inherited from G4VModularPhysicsList
 G4VModularPhysicsList ()
 
virtual ~G4VModularPhysicsList ()
 
void RegisterPhysics (G4VPhysicsConstructor *)
 
const G4VPhysicsConstructorGetPhysics (G4int index) const
 
const G4VPhysicsConstructorGetPhysics (const G4String &name) const
 
const G4VPhysicsConstructorGetPhysicsWithType (G4int physics_type) const
 
void ReplacePhysics (G4VPhysicsConstructor *)
 
void RemovePhysics (G4VPhysicsConstructor *)
 
void RemovePhysics (G4int type)
 
void RemovePhysics (const G4String &name)
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
G4int GetInstanceID () const
 
- Public Member Functions inherited from G4VUserPhysicsList
 G4VUserPhysicsList ()
 
virtual ~G4VUserPhysicsList ()
 
 G4VUserPhysicsList (const G4VUserPhysicsList &)
 
G4VUserPhysicsListoperator= (const G4VUserPhysicsList &)
 
void Construct ()
 
void UseCoupledTransportation (G4bool vl=true)
 
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 More...
 
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
 
void InitializeWorker ()
 

Private Attributes

G4double fCutForGamma
 
G4double fCutForElectron
 
G4double fCutForPositron
 
WLSStepMaxfStepMaxProcess
 
WLSOpticalPhysicsfOpticalPhysics
 
WLSPhysicsListMessengerfMessenger
 
G4bool fAbsorptionOn
 
G4VMPLData::G4PhysConstVectorDatafPhysicsVector
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VModularPhysicsList
static const G4VMPLManagerGetSubInstanceManager ()
 
- Static Public Member Functions inherited from G4VUserPhysicsList
static const G4VUPLManagerGetSubInstanceManager ()
 
- Protected Types inherited from G4VModularPhysicsList
typedef G4VMPLData::G4PhysConstVectorData G4PhysConstVector
 
- Protected Member Functions inherited from G4VModularPhysicsList
 G4VModularPhysicsList (const G4VModularPhysicsList &)
 
G4VModularPhysicsListoperator= (const G4VModularPhysicsList &)
 
- 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
 
- Protected Attributes inherited from G4VModularPhysicsList
G4int verboseLevel
 
G4int g4vmplInstanceID
 
- 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 G4VModularPhysicsList
static G4RUN_DLL G4VMPLManager G4VMPLsubInstanceManager
 
- Static Protected Attributes inherited from G4VUserPhysicsList
static G4RUN_DLL G4VUPLManager subInstanceManager
 

Detailed Description

Definition at line 47 of file WLSPhysicsList.hh.

Constructor & Destructor Documentation

◆ WLSPhysicsList()

WLSPhysicsList::WLSPhysicsList ( G4String  physName)

Definition at line 69 of file WLSPhysicsList.cc.

70 {
72 
73  defaultCutValue = 1.*mm;
77 
78 // G4PhysListFactory factory;
79  G4VModularPhysicsList* phys = NULL;
80  if (physName == "QGSP_BERT_HP") {
81  phys = new QGSP_BERT_HP;
82  } else {
83  phys = new FTFP_BERT;
84  }
85 // if (factory.IsReferencePhysList(physName)) {
86 // phys = factory.GetReferencePhysList(physName);
87 // if(!phys)G4Exception("WLSPhysicsList::WLSPhysicsList","InvalidSetup",
88 // FatalException,"PhysicsList does not exist");
90 // }
91 
92  for (G4int i = 0; ; ++i) {
93  G4VPhysicsConstructor* elem =
94  const_cast<G4VPhysicsConstructor*> (phys->GetPhysics(i));
95  if (elem == NULL) break;
96  G4cout << "RegisterPhysics: " << elem->GetPhysicsName() << G4endl;
97  RegisterPhysics(elem);
98  }
99 
100  fAbsorptionOn = true;
101 
102  //This looks complex, but it is not:
103  //Get from base-class the pointer of the phsyicsVector
104  //to be used. Remember: G4VModularPhysicsList is now a split class.
105  //Why G4VModularPhysicsList::RegisterPhysics method is not used instead?
106  //If possible we can remove this...
108  GetSubInstanceManager().offset[GetInstanceID()].physicsVector;
109 
110  fPhysicsVector->push_back(new WLSExtraPhysics());
111  fPhysicsVector->push_back(fOpticalPhysics =
113 
114  fPhysicsVector->push_back(new G4RadioactiveDecayPhysics());
115 
116  fStepMaxProcess = new WLSStepMax();
117 }
WLSPhysicsListMessenger * fMessenger
void RegisterPhysics(G4VPhysicsConstructor *)
static G4LossTableManager * Instance()
WLSOpticalPhysics * fOpticalPhysics
static const G4VMPLManager & GetSubInstanceManager()
Provide control of the physics list and cut parameters.
G4double fCutForElectron
int G4int
Definition: G4Types.hh:78
G4RUN_DLL G4ThreadLocalStatic T * offset
const G4VPhysicsConstructor * GetPhysics(G4int index) const
const G4String & GetPhysicsName() const
G4GLOB_DLL std::ostream G4cout
G4VMPLData::G4PhysConstVectorData * fPhysicsVector
G4double fCutForPositron
G4double fCutForGamma
TFTFP_BERT< G4VModularPhysicsList > FTFP_BERT
Definition: FTFP_BERT.hh:63
WLSStepMax * fStepMaxProcess
#define G4endl
Definition: G4ios.hh:61
TQGSP_BERT_HP< G4VModularPhysicsList > QGSP_BERT_HP
Definition: QGSP_BERT_HP.hh:62
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:

◆ ~WLSPhysicsList()

WLSPhysicsList::~WLSPhysicsList ( )
virtual

Definition at line 121 of file WLSPhysicsList.cc.

122 {
123  delete fMessenger;
124 
125  delete fStepMaxProcess;
126 }
WLSPhysicsListMessenger * fMessenger
WLSStepMax * fStepMaxProcess

Member Function Documentation

◆ AddStepMax()

void WLSPhysicsList::AddStepMax ( )

Definition at line 321 of file WLSPhysicsList.cc.

322 {
323  // Step limitation seen as a process
324 
326  particleIterator->reset();
327  while ((*particleIterator)()){
328  G4ParticleDefinition* particle = particleIterator->value();
329  G4ProcessManager* pmanager = particle->GetProcessManager();
330 
331  if (fStepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
332  {
333  if (pmanager) pmanager ->AddDiscreteProcess(fStepMaxProcess);
334  }
335  }
336 }
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4ProcessManager * GetProcessManager() const
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: WLSStepMax.cc:57
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
WLSStepMax * fStepMaxProcess
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearPhysics()

void WLSPhysicsList::ClearPhysics ( )

Make sure that the physics list is empty.

Definition at line 130 of file WLSPhysicsList.cc.

131 {
132  for (G4PhysConstVector::iterator p = fPhysicsVector->begin();
133  p != fPhysicsVector->end(); ++p) {
134  delete (*p);
135  }
136  fPhysicsVector->clear();
137 }
G4VMPLData::G4PhysConstVectorData * fPhysicsVector
Here is the caller graph for this function:

◆ ConstructParticle()

void WLSPhysicsList::ConstructParticle ( void  )
virtual

Reimplemented from G4VModularPhysicsList.

Definition at line 141 of file WLSPhysicsList.cc.

142 {
144 
145  G4DecayTable* MuonPlusDecayTable = new G4DecayTable();
146  MuonPlusDecayTable -> Insert(new
147  G4MuonDecayChannelWithSpin("mu+",0.986));
148  MuonPlusDecayTable -> Insert(new
150  G4MuonPlus::MuonPlusDefinition() -> SetDecayTable(MuonPlusDecayTable);
151 
152  G4DecayTable* MuonMinusDecayTable = new G4DecayTable();
153  MuonMinusDecayTable -> Insert(new
154  G4MuonDecayChannelWithSpin("mu-",0.986));
155  MuonMinusDecayTable -> Insert(new
157  G4MuonMinus::MuonMinusDefinition() -> SetDecayTable(MuonMinusDecayTable);
158 
159 }
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
void Insert(const PVNodeID *pvPath, size_t pathLength, G4int index, Node *node)
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
Here is the call graph for this function:

◆ ConstructProcess()

void WLSPhysicsList::ConstructProcess ( void  )
virtual

Reimplemented from G4VModularPhysicsList.

Definition at line 163 of file WLSPhysicsList.cc.

164 {
166 
167  SetVerbose(0);
168 
169  G4DecayWithSpin* decayWithSpin = new G4DecayWithSpin();
170 
172 
173  G4VProcess* decay;
174  decay = processTable->FindProcess("Decay",G4MuonPlus::MuonPlus());
175 
176  G4ProcessManager* pManager;
177  pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
178 
179  if (pManager) {
180  if (decay) pManager->RemoveProcess(decay);
181  pManager->AddProcess(decayWithSpin);
182  // set ordering for PostStepDoIt and AtRestDoIt
183  pManager ->SetProcessOrdering(decayWithSpin, idxPostStep);
184  pManager ->SetProcessOrdering(decayWithSpin, idxAtRest);
185  }
186 
187  decay = processTable->FindProcess("Decay",G4MuonMinus::MuonMinus());
188 
190 
191  if (pManager) {
192  if (decay) pManager->RemoveProcess(decay);
193  pManager->AddProcess(decayWithSpin);
194  // set ordering for PostStepDoIt and AtRestDoIt
195  pManager ->SetProcessOrdering(decayWithSpin, idxPostStep);
196  pManager ->SetProcessOrdering(decayWithSpin, idxAtRest);
197  }
198 
199  G4PionDecayMakeSpin* poldecay = new G4PionDecayMakeSpin();
200 
201  decay = processTable->FindProcess("Decay",G4PionPlus::PionPlus());
202 
203  pManager = G4PionPlus::PionPlus()->GetProcessManager();
204 
205  if (pManager) {
206  if (decay) pManager->RemoveProcess(decay);
207  pManager->AddProcess(poldecay);
208  // set ordering for PostStepDoIt and AtRestDoIt
209  pManager ->SetProcessOrdering(poldecay, idxPostStep);
210  pManager ->SetProcessOrdering(poldecay, idxAtRest);
211  }
212 
213  decay = processTable->FindProcess("Decay",G4PionMinus::PionMinus());
214 
216 
217  if (pManager) {
218  if (decay) pManager->RemoveProcess(decay);
219  pManager->AddProcess(poldecay);
220  // set ordering for PostStepDoIt and AtRestDoIt
221  pManager ->SetProcessOrdering(poldecay, idxPostStep);
222  pManager ->SetProcessOrdering(poldecay, idxAtRest);
223  }
224 
225  AddStepMax();
226 
227 }
static G4MuonPlus * MuonPlus()
Definition: G4MuonPlus.cc:99
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
G4ProcessManager * GetProcessManager() const
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
static G4MuonMinus * MuonMinus()
Definition: G4MuonMinus.cc:100
G4VProcess * RemoveProcess(G4VProcess *aProcess)
static G4ProcessTable * GetProcessTable()
void SetVerbose(G4int)
Here is the call graph for this function:

◆ GetStepMaxProcess()

WLSStepMax * WLSPhysicsList::GetStepMaxProcess ( )

Definition at line 314 of file WLSPhysicsList.cc.

315 {
316  return fStepMaxProcess;
317 }
WLSStepMax * fStepMaxProcess

◆ RemoveFromPhysicsList()

void WLSPhysicsList::RemoveFromPhysicsList ( const G4String name)

Remove specific physics from physics list.

Definition at line 231 of file WLSPhysicsList.cc.

232 {
233  G4bool success = false;
234  for (G4PhysConstVector::iterator p = fPhysicsVector->begin();
235  p != fPhysicsVector->end(); ++p) {
236  G4VPhysicsConstructor* e = (*p);
237  if (e->GetPhysicsName() == name) {
238  fPhysicsVector->erase(p);
239  success = true;
240  break;
241  }
242  }
243  if (!success) {
244  G4ExceptionDescription message;
245  message << "PhysicsList::RemoveFromEMPhysicsList "<< name << "not found";
246  G4Exception("example WLSPhysicsList::RemoveFromPhysicsList()",
247  "ExamWLSPhysicsList01",FatalException,message);
248  }
249 }
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
G4String name
Definition: TRTMaterials.hh:40
const G4String & GetPhysicsName() const
bool G4bool
Definition: G4Types.hh:79
G4VMPLData::G4PhysConstVectorData * fPhysicsVector
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAbsorption()

void WLSPhysicsList::SetAbsorption ( G4bool  toggle)

Definition at line 253 of file WLSPhysicsList.cc.

254 {
255  fAbsorptionOn = toggle;
256  RemoveFromPhysicsList("Optical");
258  push_back(fOpticalPhysics = new WLSOpticalPhysics(toggle));
260 }
WLSOpticalPhysics * fOpticalPhysics
virtual void ConstructProcess()
G4VMPLData::G4PhysConstVectorData * fPhysicsVector
void RemoveFromPhysicsList(const G4String &)
Remove specific physics from physics list.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCutForElectron()

void WLSPhysicsList::SetCutForElectron ( G4double  cut)

Definition at line 291 of file WLSPhysicsList.cc.

292 {
293  fCutForElectron = cut;
295 }
G4double fCutForElectron
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
static G4Electron * Electron()
Definition: G4Electron.cc:94
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCutForGamma()

void WLSPhysicsList::SetCutForGamma ( G4double  cut)

Definition at line 283 of file WLSPhysicsList.cc.

284 {
285  fCutForGamma = cut;
287 }
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
G4double fCutForGamma
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCutForPositron()

void WLSPhysicsList::SetCutForPositron ( G4double  cut)

Definition at line 299 of file WLSPhysicsList.cc.

300 {
301  fCutForPositron = cut;
303 }
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
G4double fCutForPositron
static G4Positron * Positron()
Definition: G4Positron.cc:94
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCuts()

void WLSPhysicsList::SetCuts ( )
virtual

Reimplemented from G4VUserPhysicsList.

Definition at line 264 of file WLSPhysicsList.cc.

265 {
266  if (verboseLevel >0) {
267  G4cout << "WLSPhysicsList::SetCuts:";
268  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length")
269  << G4endl;
270  }
271 
272  // set cut values for gamma at first and for e- second and next for e+,
273  // because some processes for e+/e- need cut values for gamma
274  SetCutValue(fCutForGamma, "gamma");
277 
279 }
void SetCutValue(G4double aCut, const G4String &pname)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4double fCutForElectron
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
G4double fCutForPositron
G4double fCutForGamma
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ SetNbOfPhotonsCerenkov()

void WLSPhysicsList::SetNbOfPhotonsCerenkov ( G4int  maxNumber)

Definition at line 340 of file WLSPhysicsList.cc.

341 {
343 }
WLSOpticalPhysics * fOpticalPhysics
void SetNbOfPhotonsCerenkov(G4int)
Here is the call graph for this function:

◆ SetStepMax()

void WLSPhysicsList::SetStepMax ( G4double  step)

Definition at line 307 of file WLSPhysicsList.cc.

308 {
310 }
WLSStepMax * fStepMaxProcess
void SetStepMax(G4double)
Definition: WLSStepMax.cc:64
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVerbose()

void WLSPhysicsList::SetVerbose ( G4int  verbose)

Definition at line 347 of file WLSPhysicsList.cc.

348 {
355 }
WLSOpticalPhysics * fOpticalPhysics
G4Scintillation * GetScintillationProcess()
G4OpMieHG * GetMieHGScatteringProcess()
G4Cerenkov * GetCerenkovProcess()
G4OpAbsorption * GetAbsorptionProcess()
G4OpBoundaryProcess * GetBoundaryProcess()
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
G4OpRayleigh * GetRayleighScatteringProcess()
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fAbsorptionOn

G4bool WLSPhysicsList::fAbsorptionOn
private

Definition at line 91 of file WLSPhysicsList.hh.

◆ fCutForElectron

G4double WLSPhysicsList::fCutForElectron
private

Definition at line 82 of file WLSPhysicsList.hh.

◆ fCutForGamma

G4double WLSPhysicsList::fCutForGamma
private

Definition at line 81 of file WLSPhysicsList.hh.

◆ fCutForPositron

G4double WLSPhysicsList::fCutForPositron
private

Definition at line 83 of file WLSPhysicsList.hh.

◆ fMessenger

WLSPhysicsListMessenger* WLSPhysicsList::fMessenger
private

Definition at line 89 of file WLSPhysicsList.hh.

◆ fOpticalPhysics

WLSOpticalPhysics* WLSPhysicsList::fOpticalPhysics
private

Definition at line 87 of file WLSPhysicsList.hh.

◆ fPhysicsVector

G4VMPLData::G4PhysConstVectorData* WLSPhysicsList::fPhysicsVector
private

Definition at line 93 of file WLSPhysicsList.hh.

◆ fStepMaxProcess

WLSStepMax* WLSPhysicsList::fStepMaxProcess
private

Definition at line 85 of file WLSPhysicsList.hh.


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