Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
WLSPhysicsList Class Reference

#include <WLSPhysicsList.hh>

Inheritance diagram for WLSPhysicsList:
G4VModularPhysicsList G4VUserPhysicsList

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 ()
 

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 ()
 
- 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 ( G4String  physName)

Definition at line 69 of file WLSPhysicsList.cc.

References G4VUserPhysicsList::defaultCutValue, G4cout, G4endl, G4VModularPhysicsList::GetInstanceID(), G4VModularPhysicsList::GetPhysics(), G4VPhysicsConstructor::GetPhysicsName(), G4VModularPhysicsList::GetSubInstanceManager(), G4LossTableManager::Instance(), python.hepunit::mm, G4VUPLSplitter< T >::offset, and G4VModularPhysicsList::RegisterPhysics().

70 {
72 
73  defaultCutValue = 1.*mm;
74  fCutForGamma = defaultCutValue;
75  fCutForElectron = defaultCutValue;
76  fCutForPositron = defaultCutValue;
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");
89  fMessenger = new WLSPhysicsListMessenger(this);
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...
107  fPhysicsVector =
108  GetSubInstanceManager().offset[GetInstanceID()].physicsVector;
109 
110  fPhysicsVector->push_back(new WLSExtraPhysics());
111  fPhysicsVector->push_back(fOpticalPhysics =
112  new WLSOpticalPhysics(fAbsorptionOn));
113 
114  fPhysicsVector->push_back(new G4RadioactiveDecayPhysics());
115 
116  fStepMaxProcess = new WLSStepMax();
117 }
void RegisterPhysics(G4VPhysicsConstructor *)
static G4LossTableManager * Instance()
static const G4VMPLManager & GetSubInstanceManager()
Provide control of the physics list and cut parameters.
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
const G4VPhysicsConstructor * GetPhysics(G4int index) const
const G4String & GetPhysicsName() const
TFTFP_BERT< G4VModularPhysicsList > FTFP_BERT
Definition: FTFP_BERT.hh:63
static G4RUN_DLL G4ThreadLocal T * offset
#define G4endl
Definition: G4ios.hh:61
TQGSP_BERT_HP< G4VModularPhysicsList > QGSP_BERT_HP
Definition: QGSP_BERT_HP.hh:62
WLSPhysicsList::~WLSPhysicsList ( )
virtual

Definition at line 121 of file WLSPhysicsList.cc.

122 {
123  delete fMessenger;
124 
125  delete fStepMaxProcess;
126 }

Member Function Documentation

void WLSPhysicsList::AddStepMax ( )

Definition at line 321 of file WLSPhysicsList.cc.

References G4ProcessManager::AddDiscreteProcess(), G4ParticleDefinition::GetProcessManager(), WLSStepMax::IsApplicable(), G4ParticleDefinition::IsShortLived(), and theParticleIterator.

Referenced by ConstructProcess().

322 {
323  // Step limitation seen as a process
324 
325  theParticleIterator->reset();
326  while ((*theParticleIterator)()){
327  G4ParticleDefinition* particle = theParticleIterator->value();
328  G4ProcessManager* pmanager = particle->GetProcessManager();
329 
330  if (fStepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
331  {
332  if (pmanager) pmanager ->AddDiscreteProcess(fStepMaxProcess);
333  }
334  }
335 }
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4ProcessManager * GetProcessManager() const
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: WLSStepMax.cc:57
#define theParticleIterator
void WLSPhysicsList::ClearPhysics ( )

Make sure that the physics list is empty.

Definition at line 130 of file WLSPhysicsList.cc.

Referenced by WLSPhysicsListMessenger::SetNewValue().

131 {
132  for (G4PhysConstVector::iterator p = fPhysicsVector->begin();
133  p != fPhysicsVector->end(); ++p) {
134  delete (*p);
135  }
136  fPhysicsVector->clear();
137 }
const char * p
Definition: xmltok.h:285
void WLSPhysicsList::ConstructParticle ( void  )
virtual

Reimplemented from G4VModularPhysicsList.

Definition at line 141 of file WLSPhysicsList.cc.

References G4VModularPhysicsList::ConstructParticle(), JA::Insert(), G4MuonMinus::MuonMinusDefinition(), and G4MuonPlus::MuonPlusDefinition().

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
void WLSPhysicsList::ConstructProcess ( void  )
virtual

Reimplemented from G4VModularPhysicsList.

Definition at line 163 of file WLSPhysicsList.cc.

References G4ProcessManager::AddProcess(), AddStepMax(), G4VModularPhysicsList::ConstructProcess(), G4INCL::ClusterDecay::decay(), G4ProcessTable::FindProcess(), G4ParticleDefinition::GetProcessManager(), G4ProcessTable::GetProcessTable(), idxAtRest, idxPostStep, G4MuonMinus::MuonMinus(), G4MuonPlus::MuonPlus(), G4PionMinus::PionMinus(), G4PionPlus::PionPlus(), G4ProcessManager::RemoveProcess(), G4ProcessManager::SetProcessOrdering(), and SetVerbose().

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
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)
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
WLSStepMax * WLSPhysicsList::GetStepMaxProcess ( )

Definition at line 314 of file WLSPhysicsList.cc.

315 {
316  return fStepMaxProcess;
317 }
void WLSPhysicsList::RemoveFromPhysicsList ( const G4String name)

Remove specific physics from physics list.

Definition at line 231 of file WLSPhysicsList.cc.

References FatalException, G4Exception(), and G4VPhysicsConstructor::GetPhysicsName().

Referenced by SetAbsorption(), and WLSPhysicsListMessenger::SetNewValue().

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
const char * p
Definition: xmltok.h:285
const XML_Char * name
bool G4bool
Definition: G4Types.hh:79
const G4String & GetPhysicsName() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void WLSPhysicsList::SetAbsorption ( G4bool  toggle)

Definition at line 253 of file WLSPhysicsList.cc.

References WLSOpticalPhysics::ConstructProcess(), and RemoveFromPhysicsList().

Referenced by WLSPhysicsListMessenger::SetNewValue().

254 {
255  fAbsorptionOn = toggle;
256  RemoveFromPhysicsList("Optical");
257  fPhysicsVector->
258  push_back(fOpticalPhysics = new WLSOpticalPhysics(toggle));
259  fOpticalPhysics->ConstructProcess();
260 }
virtual void ConstructProcess()
void RemoveFromPhysicsList(const G4String &)
Remove specific physics from physics list.
void WLSPhysicsList::SetCutForElectron ( G4double  cut)

Definition at line 291 of file WLSPhysicsList.cc.

References G4Electron::Electron(), and G4VUserPhysicsList::SetParticleCuts().

Referenced by WLSPhysicsListMessenger::SetNewValue().

292 {
293  fCutForElectron = cut;
294  SetParticleCuts(fCutForElectron, G4Electron::Electron());
295 }
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
static G4Electron * Electron()
Definition: G4Electron.cc:94
void WLSPhysicsList::SetCutForGamma ( G4double  cut)

Definition at line 283 of file WLSPhysicsList.cc.

References G4Gamma::Gamma(), and G4VUserPhysicsList::SetParticleCuts().

Referenced by WLSPhysicsListMessenger::SetNewValue().

284 {
285  fCutForGamma = cut;
286  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
287 }
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void WLSPhysicsList::SetCutForPositron ( G4double  cut)

Definition at line 299 of file WLSPhysicsList.cc.

References G4Positron::Positron(), and G4VUserPhysicsList::SetParticleCuts().

Referenced by WLSPhysicsListMessenger::SetNewValue().

300 {
301  fCutForPositron = cut;
302  SetParticleCuts(fCutForPositron, G4Positron::Positron());
303 }
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
static G4Positron * Positron()
Definition: G4Positron.cc:94
void WLSPhysicsList::SetCuts ( )
virtual

Reimplemented from G4VUserPhysicsList.

Definition at line 264 of file WLSPhysicsList.cc.

References G4VUserPhysicsList::defaultCutValue, G4VUserPhysicsList::DumpCutValuesTable(), G4BestUnit, G4cout, G4endl, G4VUserPhysicsList::SetCutValue(), and G4VModularPhysicsList::verboseLevel.

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");
275  SetCutValue(fCutForElectron, "e-");
276  SetCutValue(fCutForPositron, "e+");
277 
279 }
void SetCutValue(G4double aCut, const G4String &pname)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void WLSPhysicsList::SetNbOfPhotonsCerenkov ( G4int  maxNumber)

Definition at line 339 of file WLSPhysicsList.cc.

References WLSOpticalPhysics::SetNbOfPhotonsCerenkov().

340 {
341  fOpticalPhysics->SetNbOfPhotonsCerenkov(maxNumber);
342 }
void SetNbOfPhotonsCerenkov(G4int)
void WLSPhysicsList::SetStepMax ( G4double  step)

Definition at line 307 of file WLSPhysicsList.cc.

References WLSStepMax::SetStepMax().

Referenced by WLSPhysicsListMessenger::SetNewValue().

308 {
309  fStepMaxProcess->SetStepMax(step);
310 }
void SetStepMax(G4double)
Definition: WLSStepMax.cc:64
void WLSPhysicsList::SetVerbose ( G4int  verbose)

Definition at line 346 of file WLSPhysicsList.cc.

References WLSOpticalPhysics::GetAbsorptionProcess(), WLSOpticalPhysics::GetBoundaryProcess(), WLSOpticalPhysics::GetCerenkovProcess(), WLSOpticalPhysics::GetMieHGScatteringProcess(), WLSOpticalPhysics::GetRayleighScatteringProcess(), WLSOpticalPhysics::GetScintillationProcess(), and G4VProcess::SetVerboseLevel().

Referenced by ConstructProcess(), and WLSPhysicsListMessenger::SetNewValue().

347 {
348  fOpticalPhysics->GetCerenkovProcess()->SetVerboseLevel(verbose);
349  fOpticalPhysics->GetScintillationProcess()->SetVerboseLevel(verbose);
350  fOpticalPhysics->GetAbsorptionProcess()->SetVerboseLevel(verbose);
351  fOpticalPhysics->GetRayleighScatteringProcess()->SetVerboseLevel(verbose);
352  fOpticalPhysics->GetMieHGScatteringProcess()->SetVerboseLevel(verbose);
353  fOpticalPhysics->GetBoundaryProcess()->SetVerboseLevel(verbose);
354 }
G4Scintillation * GetScintillationProcess()
G4OpMieHG * GetMieHGScatteringProcess()
G4Cerenkov * GetCerenkovProcess()
G4OpAbsorption * GetAbsorptionProcess()
G4OpBoundaryProcess * GetBoundaryProcess()
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
G4OpRayleigh * GetRayleighScatteringProcess()

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