53#include <unordered_set>
58#define G4MT_theMessenger ((this->subInstanceManager.offset[this->g4vuplInstanceID])._theMessenger)
59#define G4MT_thePLHelper ((this->subInstanceManager.offset[this->g4vuplInstanceID])._thePLHelper)
60#define fIsPhysicsTableBuilt \
61 ((this->subInstanceManager.offset[this->g4vuplInstanceID])._fIsPhysicsTableBuilt)
62#define fDisplayThreshold \
63 ((this->subInstanceManager.offset[this->g4vuplInstanceID])._fDisplayThreshold)
64#define theParticleIterator \
65 ((this->subInstanceManager.offset[this->g4vuplInstanceID])._theParticleIterator)
140 : verboseLevel(right.verboseLevel),
141 defaultCutValue(right.defaultCutValue),
142 isSetDefaultCutValue(right.isSetDefaultCutValue),
143 fRetrievePhysicsTable(right.fRetrievePhysicsTable),
144 fStoredInAscii(right.fStoredInAscii),
145 fIsCheckedForRetrievePhysicsTable(right.fIsCheckedForRetrievePhysicsTable),
146 fIsRestoredCutValues(right.fIsRestoredCutValues),
147 directoryPhysicsTable(right.directoryPhysicsTable),
148 fDisableCheckParticleList(right.fDisableCheckParticleList)
173 if (
this != &right) {
194 if (newParticle ==
nullptr)
return;
196 "This method is obsolete");
204#ifdef G4MULTITHREADED
205 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
206 G4ParticleTable::lockCount()++;
216 if (pmanager ==
nullptr) {
224 G4cout <<
"G4VUserPhysicsList::InitializeProcessManager: creating "
232 if (gion !=
nullptr) {
242 G4cout <<
"G4VUserPhysicsList::InitializeProcessManager: copying "
252#ifdef G4MULTITHREADED
262#ifdef G4MULTITHREADED
263 G4MUTEXLOCK(&G4ParticleTable::particleTableMutex());
264 G4ParticleTable::lockCount()++;
280 G4cout <<
"G4VUserPhysicsList::RemoveProcessManager: ";
281 G4cout <<
"remove ProcessManager from ";
291#ifdef G4MULTITHREADED
301 std::unordered_set<G4VTrackingManager*> trackingManagers;
310 G4cout <<
"G4VUserPhysicsList::RemoveTrackingManager: ";
311 G4cout <<
"remove TrackingManager from ";
315 trackingManagers.insert(trackingManager);
354 G4cout <<
"G4VUserPhysicsList::SetDefaultCutValue: negative cut values"
355 <<
" :" << value / mm <<
"[mm]" <<
G4endl;
372 G4cout <<
"G4VUserPhysicsList::SetDefaultCutValue:"
385 G4cout <<
"G4VUserPhysicsList::GetCutValue "
386 <<
" : No Default Region " <<
G4endl;
406 if (region !=
nullptr) {
413 G4cout <<
"G4VUserPhysicsList::SetCutValue "
414 <<
" : No Region of " << rname <<
G4endl;
451 G4cout <<
"G4VUserPhysicsList::SetParticleCuts: negative cut values"
452 <<
" :" << cut / mm <<
"[mm]"
453 <<
" for " << particleName <<
G4endl;
461 if (region ==
nullptr) {
466 G4cout <<
"G4VUserPhysicsList::SetParticleCuts "
467 <<
" : No Default Region " <<
G4endl;
471 "No Default Region");
474 region = world_region;
482 if (region != world_region
493 G4cout <<
"G4VUserPhysicsList::SetParticleCuts: "
494 <<
" :" << cut / mm <<
"[mm]"
495 <<
" for " << particleName <<
G4endl;
517 G4cout <<
"G4VUserPhysicsList::BuildPhysicsTable"
518 <<
" Retrieve Cut Table failed !!" <<
G4endl;
522 "Fail to retrieve Production Cut Table");
527 G4cout <<
"G4VUserPhysicsList::BuildPhysicsTable"
528 <<
" Retrieve Cut Table successfully " <<
G4endl;
536 G4cout <<
"G4VUserPhysicsList::BuildPhysicsTable"
537 <<
" does not retrieve Cut Table but calculate " <<
G4endl;
557 if (particle != GammaP && particle != EMinusP && particle != EPlusP && particle != ProtonP) {
572 G4cout <<
"G4VUserPhysicsList::BuildPhysicsTable "
574 <<
" via custom TrackingManager" <<
G4endl;
577 trackingManager->BuildPhysicsTable(*particle);
586 G4cout <<
"#### G4VUserPhysicsList::BuildPhysicsTable() - BuildPhysicsTable("
597 G4cout <<
"G4VUserPhysicsList::BuildPhysicsTable "
598 <<
"Physics table can not be retrieved and will be calculated " <<
G4endl;
606 G4cout <<
"G4VUserPhysicsList::BuildPhysicsTable "
617 G4cout <<
"G4VUserPhysicsList::BuildPhysicsTable "
625 if (pManager ==
nullptr) {
628 G4cout <<
"G4VUserPhysicsList::BuildPhysicsTable "
634 "No process manager");
642 if (pVector ==
nullptr) {
645 G4cout <<
"G4VUserPhysicsList::BuildPhysicsTable "
650 "No process Vector");
657 G4cout <<
" ProcessManager : " << pManager <<
" ProcessManagerShadow : " << pManagerShadow
660 G4cout <<
" " << iv1 <<
" - " << (*pVector)[iv1]->GetProcessName() <<
G4endl;
662 G4cout <<
"--------------------------------------------------------------" <<
G4endl;
666 G4cout <<
" " << iv2 <<
" - " << (*pVectorShadow)[iv2]->GetProcessName() <<
G4endl;
675 if (pManagerShadow == pManager) {
676 (*pVector)[j]->BuildPhysicsTable(*particle);
679 (*pVector)[j]->BuildWorkerPhysicsTable(*particle);
690 trackingManager->PreparePhysicsTable(*particle);
701 if (pManager ==
nullptr) {
704 G4cout <<
"G4VUserPhysicsList::PreparePhysicsTable "
710 "No process manager");
718 if (pVector ==
nullptr) {
721 G4cout <<
"G4VUserPhysicsList::PreparePhysicsTable "
726 "No process Vector");
734 if (pManagerShadow == pManager) {
735 (*pVector)[j]->PreparePhysicsTable(*particle);
738 (*pVector)[j]->PrepareWorkerPhysicsTable(*particle);
760 G4cout <<
"G4VUserPhysicsList::BuildIntegralPhysicsTable "
761 <<
" BuildPhysicsTable is invoked for " << process->
GetProcessName() <<
"("
777 if ((idx++ % 4) == 3) {
814 "Fail to store Cut Table");
819 G4cout <<
"G4VUserPhysicsList::StorePhysicsTable "
820 <<
" Store material and cut values successfully" <<
G4endl;
834 G4String comment =
"Fail to store physics table for ";
835 comment += (*pVector)[j]->GetProcessName();
851 if (!directory.empty()) {
866 success[j] = (*pVector)[j]->RetrievePhysicsTable(particle, directory, ascii);
871 G4cout <<
"G4VUserPhysicsList::RetrievePhysicsTable "
872 <<
" Fail to retrieve Physics Table for " << (*pVector)[j]->GetProcessName()
877 (*pVector)[j]->BuildPhysicsTable(*particle);
891 G4cout <<
"G4VUserPhysicsList::SetApplyCuts for " << name <<
G4endl;
955 G4cout <<
"G4VUserPhysicsList::SetVerboseLevel :"
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
#define G4MT_theMessenger
#define theParticleIterator
#define fIsPhysicsTableBuilt
#define fDisplayThreshold
G4GLOB_DLL std::ostream G4cout
static G4PART_DLL G4int & slavetotalspace()
G4int GetInstanceID() const
G4ProcessManager * GetProcessManager() const
G4VTrackingManager * GetTrackingManager() const
void SetMasterProcessManager(G4ProcessManager *aNewPM)
G4bool IsGeneralIon() const
void SetTrackingManager(G4VTrackingManager *aTrackingManager)
G4bool IsShortLived() const
G4ProcessManager * GetMasterProcessManager() const
void SetApplyCutsFlag(G4bool)
G4bool GetApplyCutsFlag() const
const G4String & GetParticleName() const
void SetProcessManager(G4ProcessManager *aProcessManager)
const G4String & GetParticleSubType() const
G4PTblDicIterator * GetIterator() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
void DeleteAllParticles()
G4ParticleDefinition * GetGenericIon() const
static G4PhysicsListHelper * GetPhysicsListHelper()
G4ProcessVector * GetProcessList() const
G4bool RetrieveCutsTable(const G4String &directory, G4bool ascii=false)
void SetVerboseLevel(G4int value)
G4bool StoreCutsTable(const G4String &directory, G4bool ascii=false)
void SetEnergyRange(G4double lowedge, G4double highedge)
static G4ProductionCutsTable * GetProductionCutsTable()
void SetProductionCut(G4double cut, G4int index)
G4double GetProductionCut(G4int index) const
static G4RegionStore * GetInstance()
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
G4ProductionCuts * GetProductionCuts() const
void SetProductionCuts(G4ProductionCuts *cut)
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
const G4String & GetProcessName() const
G4bool _fIsPhysicsTableBuilt
G4ParticleTable::G4PTblDicIterator * _theParticleIterator
G4PhysicsListHelper * _thePLHelper
G4UserPhysicsListMessenger * _theMessenger
G4RUN_DLL G4ThreadLocalStatic T * offset
G4int CreateSubInstance()
G4double GetCutValue(const G4String &pname) const
void SetDefaultCutValue(G4double newCutValue)
void SetPhysicsTableRetrieved(const G4String &directory="")
G4VUserPhysicsList & operator=(const G4VUserPhysicsList &)
void PreparePhysicsTable(G4ParticleDefinition *)
virtual void TerminateWorker()
void SetCutValue(G4double aCut, const G4String &pname)
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
void UseCoupledTransportation(G4bool vl=true)
void SetCutsForRegion(G4double aCut, const G4String &rname)
G4bool fDisableCheckParticleList
G4ProductionCutsTable * fCutsTable
void AddProcessManager(G4ParticleDefinition *newParticle, G4ProcessManager *newManager=nullptr)
G4bool fIsRestoredCutValues
void RemoveTrackingManager()
void DumpCutValuesTableIfRequested()
G4bool StorePhysicsTable(const G4String &directory=".")
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
G4ParticleTable * theParticleTable
G4String directoryPhysicsTable
void SetVerboseLevel(G4int value)
G4bool fRetrievePhysicsTable
void SetApplyCuts(G4bool value, const G4String &name)
G4bool isSetDefaultCutValue
virtual void RetrievePhysicsTable(G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)
G4bool fIsCheckedForRetrievePhysicsTable
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=nullptr)
void DumpCutValuesTable(G4int flag=1)
G4bool GetApplyCuts(const G4String &name) const
static G4RUN_DLL G4VUPLManager subInstanceManager
virtual ~G4VUserPhysicsList()
void SetCutsWithDefault()
void BuildIntegralPhysicsTable(G4VProcess *, G4ParticleDefinition *)
G4int GetInstanceID() const
void RemoveProcessManager()
virtual void InitializeWorker()
static const G4VUPLManager & GetSubInstanceManager()
void InitializeProcessManager()