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

#include <ML2PhysicsList.hh>

Inheritance diagram for ML2PhysicsList:
G4VModularPhysicsList G4VUserPhysicsList

Public Member Functions

 ML2PhysicsList ()
 
virtual ~ML2PhysicsList ()
 
void ConstructParticle ()
 
void SetCuts ()
 
void SetCutForGamma (G4double)
 
void SetCutForElectron (G4double)
 
void SetCutForPositron (G4double)
 
void AddPhysicsList (const G4String &name)
 
void ConstructProcess ()
 
void AddStepMax ()
 
ML2StepMaxGetStepMaxProcess ()
 
void AddPackage (const G4String &name)
 
- 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 54 of file ML2PhysicsList.hh.

Constructor & Destructor Documentation

ML2PhysicsList::ML2PhysicsList ( )

Definition at line 101 of file ML2PhysicsList.cc.

References G4VUserPhysicsList::defaultCutValue, G4LossTableManager::Instance(), python.hepunit::mm, and G4VModularPhysicsList::SetVerboseLevel().

102 {
104  defaultCutValue = 1.*mm;
105  cutForGamma = defaultCutValue;
106  cutForElectron = defaultCutValue;
107  cutForPositron = defaultCutValue;
108 
109  helIsRegisted = false;
110  bicIsRegisted = false;
111  biciIsRegisted = false;
112  locIonIonInelasticIsRegistered = false;
113 
114  stepMaxProcess = 0;
115 
116  pMessenger = new ML2PhysicsListMessenger(this);
117 
118  SetVerboseLevel(1);
119 
120  // EM physics
121  emPhysicsList = new G4EmStandardPhysics_option3(1);
122  emName = G4String("emstandard_opt3");
123 
124 // emPhysicsList = new G4EmLivermorePhysics();
125 // emName = G4String("LowE_Livermore");
126 
127  // Deacy physics and all particles
128  decPhysicsList = new G4DecayPhysics();
129 }
static G4LossTableManager * Instance()
void SetVerboseLevel(G4int value)
ML2PhysicsList::~ML2PhysicsList ( )
virtual

Definition at line 132 of file ML2PhysicsList.cc.

133 {
134  delete pMessenger;
135  delete emPhysicsList;
136  delete decPhysicsList;
137  for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
138 }

Member Function Documentation

void ML2PhysicsList::AddPackage ( const G4String name)

Definition at line 141 of file ML2PhysicsList.cc.

References G4cout, G4endl, G4VModularPhysicsList::GetPhysics(), G4PhysListFactory::GetReferencePhysList(), and G4VModularPhysicsList::RegisterPhysics().

Referenced by ML2PhysicsListMessenger::SetNewValue().

142 {
143  G4PhysListFactory factory;
144  G4VModularPhysicsList* phys =factory.GetReferencePhysList(name);
145  G4int i=0;
146  const G4VPhysicsConstructor* elem= phys->GetPhysics(i);
147  G4VPhysicsConstructor* tmp = const_cast<G4VPhysicsConstructor*> (elem);
148  while (elem !=0)
149  {
150  RegisterPhysics(tmp);
151  elem= phys->GetPhysics(++i) ;
152  tmp = const_cast<G4VPhysicsConstructor*> (elem);
153  }
154  G4cout << "THE FOLLOWING PHYSICS PACKEGE LIST HAS BEEN ACTIVATED: "<<name<< G4endl;
155 }
void RegisterPhysics(G4VPhysicsConstructor *)
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
const G4VPhysicsConstructor * GetPhysics(G4int index) const
G4VModularPhysicsList * GetReferencePhysList(const G4String &)
#define G4endl
Definition: G4ios.hh:61
void ML2PhysicsList::AddPhysicsList ( const G4String name)

Definition at line 190 of file ML2PhysicsList.cc.

References G4cout, G4endl, and G4VModularPhysicsList::verboseLevel.

Referenced by ML2PhysicsListMessenger::SetNewValue().

191 {
192 
193  if (verboseLevel>1) {
194  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
195  }
196  if (name == emName) return;
197 
198  /////////////////////////////////////////////////////////////////////////////
199  // ELECTROMAGNETIC MODELS
200  /////////////////////////////////////////////////////////////////////////////
201 
202  if (name == "standard_opt3") {
203  emName = name;
204  delete emPhysicsList;
205  emPhysicsList = new G4EmStandardPhysics_option3();
206  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
207 
208  } else if (name == "LowE_Livermore") {
209  emName = name;
210  delete emPhysicsList;
211  emPhysicsList = new G4EmLivermorePhysics();
212  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
213 
214  } else if (name == "LowE_Penelope") {
215  emName = name;
216  delete emPhysicsList;
217  emPhysicsList = new G4EmPenelopePhysics();
218  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
219 
220  /////////////////////////////////////////////////////////////////////////////
221  // HADRONIC MODELS
222  /////////////////////////////////////////////////////////////////////////////
223  } else if (name == "elastic" && !helIsRegisted) {
224  G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()" << G4endl;
225  hadronPhys.push_back( new G4HadronElasticPhysics());
226  helIsRegisted = true;
227 
228  } else if (name == "binary" && !bicIsRegisted) {
229  hadronPhys.push_back(new G4HadronInelasticQBBC());
230  bicIsRegisted = true;
231  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronInelasticQBBC()" << G4endl;
232 
233  } else if (name == "binary_ion" && !biciIsRegisted) {
234  hadronPhys.push_back(new G4IonBinaryCascadePhysics());
235  biciIsRegisted = true;
236 
237  } else {
238 
239  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
240  << " is not defined"
241  << G4endl;
242  }
243 }
const XML_Char * name
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void ML2PhysicsList::AddStepMax ( )

Definition at line 246 of file ML2PhysicsList.cc.

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

Referenced by ConstructProcess().

247 {
248  // Step limitation seen as a process
249  stepMaxProcess = new ML2StepMax();
250 
251  theParticleIterator->reset();
252  while ((*theParticleIterator)()){
253  G4ParticleDefinition* particle = theParticleIterator->value();
254  G4ProcessManager* pmanager = particle->GetProcessManager();
255 
256  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
257  {
258  pmanager ->AddDiscreteProcess(stepMaxProcess);
259  }
260  }
261 }
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4ProcessManager * GetProcessManager() const
G4bool IsApplicable(const G4ParticleDefinition &)
Definition: ML2StepMax.cc:72
#define theParticleIterator
void ML2PhysicsList::ConstructParticle ( void  )
virtual

Reimplemented from G4VModularPhysicsList.

Definition at line 158 of file ML2PhysicsList.cc.

References G4VPhysicsConstructor::ConstructParticle().

159 {
160  decPhysicsList->ConstructParticle();
161 }
virtual void ConstructParticle()=0
void ML2PhysicsList::ConstructProcess ( void  )
virtual

Reimplemented from G4VModularPhysicsList.

Definition at line 164 of file ML2PhysicsList.cc.

References G4EmConfigurator::AddModels(), AddStepMax(), G4VUserPhysicsList::AddTransportation(), and G4VPhysicsConstructor::ConstructProcess().

165 {
166  // transportation
167  //
169 
170  // electromagnetic physics list
171  //
172  emPhysicsList->ConstructProcess();
173  em_config.AddModels();
174 
175  // decay physics list
176  //
177  decPhysicsList->ConstructProcess();
178 
179  // hadronic physics lists
180  for(size_t i=0; i<hadronPhys.size(); i++) {
181  hadronPhys[i]->ConstructProcess();
182  }
183 
184  // step limitation (as a full process)
185  //
186  AddStepMax();
187 }
virtual void ConstructProcess()=0
ML2StepMax* ML2PhysicsList::GetStepMaxProcess ( )
inline

Definition at line 72 of file ML2PhysicsList.hh.

72 {return stepMaxProcess;}
void ML2PhysicsList::SetCutForElectron ( G4double  cut)

Definition at line 289 of file ML2PhysicsList.cc.

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

Referenced by ML2PhysicsListMessenger::SetNewValue().

290 {
291  cutForElectron = cut;
292  SetParticleCuts(cutForElectron, G4Electron::Electron());
293 }
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
static G4Electron * Electron()
Definition: G4Electron.cc:94
void ML2PhysicsList::SetCutForGamma ( G4double  cut)

Definition at line 282 of file ML2PhysicsList.cc.

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

Referenced by ML2PhysicsListMessenger::SetNewValue().

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

Definition at line 296 of file ML2PhysicsList.cc.

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

Referenced by ML2PhysicsListMessenger::SetNewValue().

297 {
298  cutForPositron = cut;
299  SetParticleCuts(cutForPositron, G4Positron::Positron());
300 }
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
static G4Positron * Positron()
Definition: G4Positron.cc:94
void ML2PhysicsList::SetCuts ( )
virtual

Reimplemented from G4VUserPhysicsList.

Definition at line 264 of file ML2PhysicsList.cc.

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

265 {
266 
267  if (verboseLevel >0){
268  G4cout << "PhysicsList::SetCuts:";
269  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << 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(cutForGamma, "gamma");
275  SetCutValue(cutForElectron, "e-");
276  SetCutValue(cutForPositron, "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

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