Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
G4VUserPhysicsList Class Referenceabstract

#include <G4VUserPhysicsList.hh>

Inheritance diagram for G4VUserPhysicsList:
B03PhysicsList DicomPhysicsList DMXPhysicsList eRositaPhysicsList ExG4PhysicsList00 ExGflashPhysicsList exGPSPhysicsList ExN01PhysicsList ExN02PhysicsList ExP01PhysicsList ExP02PhysicsList F01PhysicsList F02PhysicsList F03PhysicsList G01PhysicsList G04PhysicsList G4AdjointPhysicsList G4ErrorPhysicsList G4VModularPhysicsList OpNovicePhysicsList P6DPhysicsList Par01PhysicsList PhysicsList PhysicsList PhysicsList PhysicsList PhysicsList PhysicsList PhysicsList PhysicsList PhysicsList PhysicsList PhysicsList PhysicsList PhysicsListEMstd PurgMagPhysicsList pyG4VUserPhysicsList::CB_G4VUserPhysicsList RE06PhysicsList UltraPhysicsList XPhysicsList XrayTelPhysicsList

Public Member Functions

 G4VUserPhysicsList ()
 
virtual ~G4VUserPhysicsList ()
 
 G4VUserPhysicsList (const G4VUserPhysicsList &)
 
G4VUserPhysicsListoperator= (const G4VUserPhysicsList &)
 
virtual void ConstructParticle ()=0
 
void Construct ()
 
virtual void ConstructProcess ()=0
 
void UseCoupledTransportation (G4bool vl=true)
 
virtual void SetCuts ()
 
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 ()
 

Static Public Member Functions

static const G4VUPLManagerGetSubInstanceManager ()
 

Protected Member Functions

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

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

static G4RUN_DLL G4VUPLManager subInstanceManager
 

Detailed Description

Definition at line 159 of file G4VUserPhysicsList.hh.

Constructor & Destructor Documentation

G4VUserPhysicsList::G4VUserPhysicsList ( )

Definition at line 107 of file G4VUserPhysicsList.cc.

References G4VUPLSplitter< T >::CreateSubInstance(), defaultCutValue, fCutsTable, fDisplayThreshold, fIsPhysicsTableBuilt, G4MT_theMessenger, G4MT_thePLHelper, g4vuplInstanceID, G4ParticleTable::GetParticleTable(), G4ProductionCutsTable::GetProductionCutsTable(), python.hepunit::keV, python.hepunit::mm, G4ProductionCutsTable::SetEnergyRange(), subInstanceManager, python.hepunit::TeV, theParticleTable, and verboseLevel.

108  :verboseLevel(1),
109  defaultCutValue(1.0 * mm),
110  isSetDefaultCutValue(false),
111  fRetrievePhysicsTable(false),
112  fStoredInAscii(true),
114  fIsRestoredCutValues(false),
116  //fDisplayThreshold(0),
117  //fIsPhysicsTableBuilt(false),
119 {
121  // default cut value (1.0mm)
122  defaultCutValue = 1.0*mm;
123 
124  // pointer to the particle table
126  //theParticleIterator = theParticleTable->GetIterator();
127 
128  // pointer to the cuts table
130 
131  // set energy range for SetCut calcuration
132  fCutsTable->SetEnergyRange(0.99*keV, 100*TeV);
133 
134  // UI Messenger
135  //theMessenger = new G4UserPhysicsListMessenger(this);
137 
138  // PhysicsListHelper
139  //thePLHelper = G4PhysicsListHelper::GetPhysicsListHelper();
140  //thePLHelper->SetVerboseLevel(verboseLevel);
141  //G4MT_thePLHelper = G4PhysicsListHelper::GetPhysicsListHelper(); //AND
142  G4MT_thePLHelper->SetVerboseLevel(verboseLevel); //AND
143 
144  fIsPhysicsTableBuilt = false;
145  fDisplayThreshold = 0;
146 
147 }
#define G4MT_theMessenger
#define G4MT_thePLHelper
#define fDisplayThreshold
void SetEnergyRange(G4double lowedge, G4double highedge)
G4ProductionCutsTable * fCutsTable
#define fIsPhysicsTableBuilt
G4bool fIsCheckedForRetrievePhysicsTable
G4ParticleTable * theParticleTable
static G4ProductionCutsTable * GetProductionCutsTable()
static G4ParticleTable * GetParticleTable()
static G4RUN_DLL G4VUPLManager subInstanceManager
G4int CreateSubInstance()
G4VUserPhysicsList::~G4VUserPhysicsList ( )
virtual

Definition at line 157 of file G4VUserPhysicsList.cc.

References G4ParticleTable::DeleteAllParticles(), G4MT_theMessenger, RemoveProcessManager(), and theParticleTable.

158 {
159  if (G4MT_theMessenger != 0) {
160  delete G4MT_theMessenger;
161  G4MT_theMessenger = 0;
162  }
164 
165  // invoke DeleteAllParticle
167 
168 }
#define G4MT_theMessenger
G4ParticleTable * theParticleTable
G4VUserPhysicsList::G4VUserPhysicsList ( const G4VUserPhysicsList right)

Definition at line 171 of file G4VUserPhysicsList.cc.

References G4VUPLSplitter< T >::CreateSubInstance(), fCutsTable, fDisplayThreshold, fIsPhysicsTableBuilt, G4MT_theMessenger, G4MT_thePLHelper, g4vuplInstanceID, GetInstanceID(), G4ParticleTable::GetIterator(), G4ParticleTable::GetParticleTable(), G4PhysicsListHelper::GetPhysicsListHelper(), G4ProductionCutsTable::GetProductionCutsTable(), GetSubInstanceManager(), G4VUPLSplitter< T >::offset, subInstanceManager, theParticleIterator, theParticleTable, and verboseLevel.

172  :verboseLevel(right.verboseLevel),
180  //fDisplayThreshold(right.fDisplayThreshold),
181  //fIsPhysicsTableBuilt(right.fIsPhysicsTableBuilt),
183 {
185  // pointer to the particle table
188  // pointer to the cuts table
190 
191  // UI Messenger
192  //theMessenger = new G4UserPhysicsListMessenger(this);
194 
195  // PhysicsListHelper
196  //thePLHelper = G4PhysicsListHelper::GetPhysicsListHelper();
197  //thePLHelper->SetVerboseLevel(verboseLevel);
199  G4MT_thePLHelper->SetVerboseLevel(verboseLevel); //AND
200 
201  fIsPhysicsTableBuilt = right.GetSubInstanceManager().offset[right.GetInstanceID()]._fIsPhysicsTableBuilt;
202  fDisplayThreshold = right.GetSubInstanceManager().offset[right.GetInstanceID()]._fDisplayThreshold;
203 }
#define G4MT_theMessenger
#define G4MT_thePLHelper
#define fDisplayThreshold
G4ProductionCutsTable * fCutsTable
#define fIsPhysicsTableBuilt
G4bool fIsCheckedForRetrievePhysicsTable
G4ParticleTable * theParticleTable
G4int GetInstanceID() const
static G4ProductionCutsTable * GetProductionCutsTable()
static G4ParticleTable * GetParticleTable()
static G4RUN_DLL G4ThreadLocal T * offset
static G4PhysicsListHelper * GetPhysicsListHelper()
static G4RUN_DLL G4VUPLManager subInstanceManager
static const G4VUPLManager & GetSubInstanceManager()
G4int CreateSubInstance()
G4PTblDicIterator * GetIterator() const
#define theParticleIterator

Member Function Documentation

void G4VUserPhysicsList::AddProcessManager ( G4ParticleDefinition newParticle,
G4ProcessManager newManager = 0 
)

Definition at line 228 of file G4VUserPhysicsList.cc.

References G4Exception(), and JustWarning.

Referenced by G4UserPhysicsListMessenger::SetNewValue().

230 {
231  if (newParticle == 0) return;
232  G4Exception("G4VUserPhysicsList::AddProcessManager",
233  "Run0252", JustWarning,
234  "This method is obsolete");
235 }
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
void G4VUserPhysicsList::AddTransportation ( )
protected

Definition at line 947 of file G4VUserPhysicsList.cc.

References G4MT_thePLHelper.

Referenced by Par01PhysicsList::AddTransportation(), ExGflashPhysicsList::AddTransportation(), DMXPhysicsList::AddTransportation(), eRositaPhysicsList::ConstructProcess(), XPhysicsList::ConstructProcess(), RE06PhysicsList::ConstructProcess(), ExG4PhysicsList00::ConstructProcess(), P6DPhysicsList::ConstructProcess(), BrachyPhysicsList::ConstructProcess(), exGPSPhysicsList::ConstructProcess(), OpNovicePhysicsList::ConstructProcess(), GammaKnifePhysicsList::ConstructProcess(), G01PhysicsList::ConstructProcess(), G04PhysicsList::ConstructProcess(), G4HumanPhantomPhysicsList::ConstructProcess(), ExN01PhysicsList::ConstructProcess(), ExN02PhysicsList::ConstructProcess(), PhysicsListEMstd::ConstructProcess(), XrayFluoPhysicsList::ConstructProcess(), ExP02PhysicsList::ConstructProcess(), ExP01PhysicsList::ConstructProcess(), PhysicsList::ConstructProcess(), F02PhysicsList::ConstructProcess(), F01PhysicsList::ConstructProcess(), F03PhysicsList::ConstructProcess(), UltraPhysicsList::ConstructProcess(), Em10PhysicsList::ConstructProcess(), B03PhysicsList::ConstructProcess(), DicomPhysicsList::ConstructProcess(), HadrontherapyPhysicsList::ConstructProcess(), exrdmPhysicsList::ConstructProcess(), PurgMagPhysicsList::ConstructProcess(), XrayTelPhysicsList::ConstructProcess(), IORTPhysicsList::ConstructProcess(), ML2PhysicsList::ConstructProcess(), G4AdjointPhysicsList::ConstructProcess(), and G4VModularPhysicsList::ConstructProcess().

948 {
949  G4MT_thePLHelper->AddTransportation();
950 }
#define G4MT_thePLHelper
void G4VUserPhysicsList::BuildIntegralPhysicsTable ( G4VProcess process,
G4ParticleDefinition particle 
)
protected

Definition at line 758 of file G4VUserPhysicsList.cc.

References G4VProcess::BuildPhysicsTable(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4VProcess::GetProcessName(), and verboseLevel.

Referenced by RetrievePhysicsTable().

760 {
761  //*********************************************************************
762  // temporary addition to make the integral schema of electromagnetic
763  // processes work.
764  //
765 
766  if ( (process->GetProcessName() == "Imsc") ||
767  (process->GetProcessName() == "IeIoni") ||
768  (process->GetProcessName() == "IeBrems") ||
769  (process->GetProcessName() == "Iannihil") ||
770  (process->GetProcessName() == "IhIoni") ||
771  (process->GetProcessName() == "IMuIoni") ||
772  (process->GetProcessName() == "IMuBrems") ||
773  (process->GetProcessName() == "IMuPairProd") ) {
774 #ifdef G4VERBOSE
775  if (verboseLevel>2){
776  G4cout << "G4VUserPhysicsList::BuildIntegralPhysicsTable "
777  << " BuildPhysicsTable is invoked for "
778  << process->GetProcessName()
779  << "(" << particle->GetParticleName() << ")" << G4endl;
780  }
781 #endif
782  process->BuildPhysicsTable(*particle);
783  }
784 }
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:210
#define G4endl
Definition: G4ios.hh:61
void G4VUserPhysicsList::BuildPhysicsTable ( )

Definition at line 515 of file G4VUserPhysicsList.cc.

References directoryPhysicsTable, fCutsTable, G4ParticleTable::FindParticle(), fIsPhysicsTableBuilt, fIsRestoredCutValues, fRetrievePhysicsTable, fStoredInAscii, G4cout, G4endl, G4Exception(), PreparePhysicsTable(), G4ProductionCutsTable::RetrieveCutsTable(), RunMustBeAborted, theParticleIterator, theParticleTable, and verboseLevel.

Referenced by G4RunManagerKernel::BuildPhysicsTables(), and G4UserPhysicsListMessenger::SetNewValue().

516 {
517  //Prepare Physics table for all particles
518  theParticleIterator->reset();
519  while( (*theParticleIterator)() ){
520  G4ParticleDefinition* particle = theParticleIterator->value();
521  PreparePhysicsTable(particle);
522  }
523 
524  // ask processes to prepare physics table
525  if (fRetrievePhysicsTable) {
527  // check if retrieve Cut Table successfully
528  if (!fIsRestoredCutValues) {
529 #ifdef G4VERBOSE
530  if (verboseLevel>0){
531  G4cout << "G4VUserPhysicsList::BuildPhysicsTable"
532  << " Retrieve Cut Table failed !!" << G4endl;
533  }
534 #endif
535  G4Exception("G4VUserPhysicsList::BuildPhysicsTable",
536  "Run0255", RunMustBeAborted,
537  "Fail to retrieve Production Cut Table");
538  } else {
539 #ifdef G4VERBOSE
540  if (verboseLevel>2){
541  G4cout << "G4VUserPhysicsList::BuildPhysicsTable"
542  << " Retrieve Cut Table successfully " << G4endl;
543  }
544 #endif
545  }
546  } else {
547 #ifdef G4VERBOSE
548  if (verboseLevel>2){
549  G4cout << "G4VUserPhysicsList::BuildPhysicsTable"
550  << " does not retrieve Cut Table but calculate " << G4endl;
551  }
552 #endif
553  }
554 
555  // Sets a value to particle
556  // set cut values for gamma at first and for e- and e+
557  G4String particleName;
559  if(GammaP) BuildPhysicsTable(GammaP);
561  if(EMinusP) BuildPhysicsTable(EMinusP);
563  if(EPlusP) BuildPhysicsTable(EPlusP);
564  G4ParticleDefinition* ProtonP = theParticleTable->FindParticle("proton");
565  if(ProtonP) BuildPhysicsTable(ProtonP);
566 
567  theParticleIterator->reset();
568  while( (*theParticleIterator)() ){
569  G4ParticleDefinition* particle = theParticleIterator->value();
570  if( particle!=GammaP &&
571  particle!=EMinusP &&
572  particle!=EPlusP &&
573  particle!=ProtonP ){
574  BuildPhysicsTable(particle);
575  }
576  }
577 
578  // Set flag
579  fIsPhysicsTableBuilt = true;
580 
581 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void PreparePhysicsTable(G4ParticleDefinition *)
G4ProductionCutsTable * fCutsTable
#define fIsPhysicsTableBuilt
G4ParticleTable * theParticleTable
G4GLOB_DLL std::ostream G4cout
G4bool RetrieveCutsTable(const G4String &directory, G4bool ascii=false)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
#define theParticleIterator
void G4VUserPhysicsList::BuildPhysicsTable ( G4ParticleDefinition particle)

Definition at line 584 of file G4VUserPhysicsList.cc.

References directoryPhysicsTable, FatalException, fIsRestoredCutValues, fRetrievePhysicsTable, fStoredInAscii, G4cout, G4endl, G4Exception(), G4ParticleDefinition::GetMasterProcessManager(), G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetProcessList(), G4ParticleDefinition::GetProcessManager(), G4ParticleDefinition::IsShortLived(), RetrievePhysicsTable(), G4ProcessVector::size(), and verboseLevel.

585 {
586  if(!(particle->GetMasterProcessManager())) {
587  G4cout << "#### G4VUserPhysicsList::BuildPhysicsTable() - BuildPhysicsTable("
588  << particle->GetParticleName() << ") skipped..." << G4endl;
589  return;
590  }
591  if (fRetrievePhysicsTable) {
592  if ( !fIsRestoredCutValues){
593  // fail to retreive cut tables
594 #ifdef G4VERBOSE
595  if (verboseLevel>0){
596  G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
597  << "Physics table can not be retreived and will be calculated "
598  << G4endl;
599  }
600 #endif
601  fRetrievePhysicsTable = false;
602 
603  } else {
604 #ifdef G4VERBOSE
605  if (verboseLevel>2){
606  G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
607  << " Retrieve Physics Table for "
608  << particle->GetParticleName() << G4endl;
609  }
610 #endif
611  // Retrieve PhysicsTable from files for proccesses
613  }
614  }
615 
616 #ifdef G4VERBOSE
617  if (verboseLevel>2){
618  G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
619  << "Calculate Physics Table for "
620  << particle->GetParticleName() << G4endl;
621  }
622 #endif
623  // Rebuild the physics tables for every process for this particle type
624  // if particle is not ShortLived
625  if(!particle->IsShortLived()) {
626  G4ProcessManager* pManager = particle->GetProcessManager();
627  if (!pManager) {
628 #ifdef G4VERBOSE
629  if (verboseLevel>0){
630  G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
631  <<" : No Process Manager for "
632  << particle->GetParticleName() << G4endl;
633  G4cout << particle->GetParticleName()
634  << " should be created in your PhysicsList" <<G4endl;
635  }
636 #endif
637  G4Exception("G4VUserPhysicsList::BuildPhysicsTable",
638  "Run0271", FatalException,
639  "No process manager");
640  return;
641  }
642 
643  //Get processes from master thread;
644  G4ProcessManager* pManagerShadow = particle->GetMasterProcessManager();
645 
646  G4ProcessVector* pVector = pManager->GetProcessList();
647  if (!pVector) {
648 #ifdef G4VERBOSE
649  if (verboseLevel>0){
650  G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
651  <<" : No Process Vector for "
652  << particle->GetParticleName() <<G4endl;
653  }
654 #endif
655  G4Exception("G4VUserPhysicsList::BuildPhysicsTable",
656  "Run0272", FatalException,
657  "No process Vector");
658  return;
659  }
660 #ifdef G4VERBOSE
661  if (verboseLevel>2){
662  G4cout << "G4VUserPhysicsList::BuildPhysicsTable %%%%%% " << particle->GetParticleName() << G4endl;
663  G4cout << " ProcessManager : " << pManager << " ProcessManagerShadow : " << pManagerShadow << G4endl;
664  for(G4int iv1=0;iv1<pVector->size();iv1++)
665  { G4cout << " " << iv1 << " - " << (*pVector)[iv1]->GetProcessName() << G4endl; }
666  G4cout << "--------------------------------------------------------------" << G4endl;
667  G4ProcessVector* pVectorShadow = pManagerShadow->GetProcessList();
668 
669  for(G4int iv2=0;iv2<pVectorShadow->size();iv2++)
670  { G4cout << " " << iv2 << " - " << (*pVectorShadow)[iv2]->GetProcessName() << G4endl; }
671  }
672 #endif
673  for (G4int j=0; j < pVector->size(); ++j) {
674  //Andrea July 16th 2013 : migration to new interface...
675  //Infer if we are in a worker thread or master thread
676  //Master thread is the one in which the process manager
677  // and process manager shadow pointers are the same
678  if ( pManagerShadow == pManager )
679  {
680  (*pVector)[j]->BuildPhysicsTable(*particle);
681  }
682  else
683  {
684  (*pVector)[j]->BuildWorkerPhysicsTable(*particle);
685  }
686 
687  } //End loop on processes vector
688  } //End if short-lived
689 }
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4ProcessManager * GetMasterProcessManager() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4int size() const
#define G4endl
Definition: G4ios.hh:61
virtual void RetrievePhysicsTable(G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)
G4ProcessVector * GetProcessList() const
void G4VUserPhysicsList::CheckParticleList ( )

Definition at line 939 of file G4VUserPhysicsList.cc.

References fDisableCheckParticleList, and G4MT_thePLHelper.

Referenced by G4RunManagerKernel::InitializePhysics().

940 {
942  G4MT_thePLHelper->CheckParticleList();
943  }
944 }
#define G4MT_thePLHelper
void G4VUserPhysicsList::Construct ( void  )
inline

Definition at line 405 of file G4VUserPhysicsList.hh.

References ConstructProcess(), G4cout, G4endl, InitializeProcessManager(), and verboseLevel.

Referenced by G4RunManagerKernel::InitializePhysics().

406 {
407 #ifdef G4VERBOSE
408  if (verboseLevel >1) G4cout << "G4VUserPhysicsList::Construct()" << G4endl;
409 #endif
410 
412 
413 #ifdef G4VERBOSE
414  if (verboseLevel >1) G4cout << "Construct processes " << G4endl;
415 #endif
417 
418 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
virtual void ConstructProcess()=0
virtual void G4VUserPhysicsList::ConstructParticle ( )
pure virtual
virtual void G4VUserPhysicsList::ConstructProcess ( )
pure virtual
void G4VUserPhysicsList::DisableCheckParticleList ( )
inline

Definition at line 472 of file G4VUserPhysicsList.hh.

References fDisableCheckParticleList.

473 {
475 }
void G4VUserPhysicsList::DumpCutValuesTable ( G4int  flag = 1)
void G4VUserPhysicsList::DumpCutValuesTableIfRequested ( )
void G4VUserPhysicsList::DumpList ( ) const

Definition at line 787 of file G4VUserPhysicsList.cc.

References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), and theParticleIterator.

Referenced by export_G4VUserPhysicsList(), and G4UserPhysicsListMessenger::SetNewValue().

788 {
789  theParticleIterator->reset();
790  G4int idx = 0;
791  while( (*theParticleIterator)() ){
792  G4ParticleDefinition* particle = theParticleIterator->value();
793  G4cout << particle->GetParticleName();
794  if ((idx++ % 4) == 3) {
795  G4cout << G4endl;
796  } else {
797  G4cout << ", ";
798  }
799  }
800  G4cout << G4endl;
801 }
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
#define theParticleIterator
G4bool G4VUserPhysicsList::GetApplyCuts ( const G4String name) const

Definition at line 932 of file G4VUserPhysicsList.cc.

References G4ParticleTable::FindParticle(), G4ParticleDefinition::GetApplyCutsFlag(), and theParticleTable.

Referenced by export_G4VUserPhysicsList().

933 {
935 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4ParticleTable * theParticleTable
G4bool GetApplyCutsFlag() const
G4double G4VUserPhysicsList::GetCutValue ( const G4String pname) const

Definition at line 399 of file G4VUserPhysicsList.cc.

References FatalException, G4cout, G4endl, G4Exception(), G4RegionStore::GetInstance(), G4ProductionCuts::GetProductionCut(), G4Region::GetProductionCuts(), python.hepunit::mm, and verboseLevel.

Referenced by SetCuts(), and G4UserPhysicsListMessenger::SetNewValue().

400 {
401  size_t nReg = (G4RegionStore::GetInstance())->size();
402  if (nReg==0) {
403 #ifdef G4VERBOSE
404  if (verboseLevel>0){
405  G4cout << "G4VUserPhysicsList::GetCutValue "
406  <<" : No Default Region " <<G4endl;
407  }
408 #endif
409  G4Exception("G4VUserPhysicsList::GetCutValue",
410  "Run0253", FatalException,
411  "No Default Region");
412  return -1.*mm;
413  }
414  G4Region* region = (*(G4RegionStore::GetInstance()))[0];
415  return region->GetProductionCuts()->GetProductionCut(name);
416 }
G4ProductionCuts * GetProductionCuts() const
G4double GetProductionCut(G4int index) const
const XML_Char * name
static G4RegionStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
G4double G4VUserPhysicsList::GetDefaultCutValue ( ) const
inline

Definition at line 420 of file G4VUserPhysicsList.hh.

References defaultCutValue.

Referenced by export_G4VUserPhysicsList(), and G4UserPhysicsListMessenger::GetCurrentValue().

421 {
422  return defaultCutValue;
423 }
G4int G4VUserPhysicsList::GetInstanceID ( ) const
inline

Definition at line 478 of file G4VUserPhysicsList.hh.

References g4vuplInstanceID.

Referenced by G4VUserPhysicsList(), and operator=().

479 {
480  return g4vuplInstanceID;
481 }
const G4String & G4VUserPhysicsList::GetPhysicsTableDirectory ( ) const
inline

Definition at line 444 of file G4VUserPhysicsList.hh.

References directoryPhysicsTable.

Referenced by export_G4VUserPhysicsList(), and G4UserPhysicsListMessenger::GetCurrentValue().

445 {
446  return directoryPhysicsTable;
447 }
const G4VUPLManager & G4VUserPhysicsList::GetSubInstanceManager ( )
inlinestatic
G4int G4VUserPhysicsList::GetVerboseLevel ( ) const
inline
void G4VUserPhysicsList::InitializeProcessManager ( )
protected

Definition at line 239 of file G4VUserPhysicsList.cc.

References G4cout, G4endl, G4MUTEXLOCK, G4MUTEXUNLOCK, G4ParticleTable::GetGenericIon(), G4ParticleDefinition::GetMasterProcessManager(), G4ParticleDefinition::GetParticleName(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetProcessManager(), G4ParticleDefinition::IsGeneralIon(), G4ParticleDefinition::SetMasterProcessManager(), G4ParticleDefinition::SetProcessManager(), theParticleIterator, and verboseLevel.

Referenced by Construct().

240 {
241  //Request lock for particle table accesses. Some changes are inside
242  //this critical region.
243 #ifdef G4MULTITHREADED
244  G4MUTEXLOCK(&G4ParticleTable::particleTableMutex);
245  G4ParticleTable::lockCount++;
246 #endif
248 
249  // loop over all particles in G4ParticleTable
250  theParticleIterator->reset();
251  while( (*theParticleIterator)() ){
252  G4ParticleDefinition* particle = theParticleIterator->value();
253  G4ProcessManager* pmanager = particle->GetProcessManager();
254 
255  if (pmanager==0) {
256  // create process manager if the particle does not have its own.
257  pmanager = new G4ProcessManager(particle);
258  particle->SetProcessManager(pmanager);
259  if( particle->GetMasterProcessManager() == 0 ) particle->SetMasterProcessManager(pmanager);
260 #ifdef G4VERBOSE
261  if (verboseLevel >2){
262  G4cout << "G4VUserPhysicsList::InitializeProcessManager: creating ProcessManager to "
263  << particle->GetParticleName() << G4endl;
264  }
265 #endif
266  }
267  }
268 
269  if(gion)
270  {
271  G4ProcessManager* gionPM = gion->GetProcessManager();
272  // loop over all particles once again (this time, with all general ions)
273  theParticleIterator->reset(false);
274  while( (*theParticleIterator)() ){
275  G4ParticleDefinition* particle = theParticleIterator->value();
276  if(particle->IsGeneralIon())
277  {
278  particle->SetProcessManager(gionPM);
279 #ifdef G4VERBOSE
280  if (verboseLevel >2){
281  G4cout << "G4VUserPhysicsList::InitializeProcessManager: copying ProcessManager to "
282  << particle->GetParticleName() << G4endl;
283  }
284 #endif
285  }
286  }
287  }
288 
289  //release lock for particle table accesses.
290 #ifdef G4MULTITHREADED
291  G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex);
292 #endif
293 // G4cout << "Particle table is released by G4VUserPhysicsList::InitializeProcessManager" << G4endl;
294 
295 }
#define G4MUTEXUNLOCK
Definition: G4Threading.hh:162
void SetProcessManager(G4ProcessManager *aProcessManager)
G4ParticleDefinition * GetGenericIon() const
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4bool IsGeneralIon() const
G4GLOB_DLL std::ostream G4cout
G4ProcessManager * GetMasterProcessManager() const
#define G4MUTEXLOCK
Definition: G4Threading.hh:161
static G4ParticleTable * GetParticleTable()
#define G4endl
Definition: G4ios.hh:61
#define theParticleIterator
void SetMasterProcessManager(G4ProcessManager *aNewPM)
void G4VUserPhysicsList::InitializeWorker ( )

Definition at line 149 of file G4VUserPhysicsList.cc.

References G4MT_theMessenger.

Referenced by G4WorkerRunManager::SetUserInitialization().

150 {
151  //Remember messengers are per-thread, so this needs to be done by each worker
152  //and due to the presence of "this" cannot be done in G4VUPLData::initialize()
154 }
#define G4MT_theMessenger
G4bool G4VUserPhysicsList::IsPhysicsTableRetrieved ( ) const
inline

Definition at line 432 of file G4VUserPhysicsList.hh.

References fRetrievePhysicsTable.

Referenced by export_G4VUserPhysicsList(), and G4UserPhysicsListMessenger::GetCurrentValue().

433 {
434  return fRetrievePhysicsTable;
435 }
G4bool G4VUserPhysicsList::IsStoredInAscii ( ) const
inline

Definition at line 438 of file G4VUserPhysicsList.hh.

References fStoredInAscii.

Referenced by export_G4VUserPhysicsList(), and G4UserPhysicsListMessenger::GetCurrentValue().

439 {
440  return fStoredInAscii;
441 }
G4VUserPhysicsList & G4VUserPhysicsList::operator= ( const G4VUserPhysicsList right)

Definition at line 207 of file G4VUserPhysicsList.cc.

References defaultCutValue, directoryPhysicsTable, fDisableCheckParticleList, fDisplayThreshold, fIsCheckedForRetrievePhysicsTable, fIsPhysicsTableBuilt, fIsRestoredCutValues, fRetrievePhysicsTable, fStoredInAscii, GetInstanceID(), GetSubInstanceManager(), isSetDefaultCutValue, G4VUPLSplitter< T >::offset, and verboseLevel.

208 {
209  if (this != &right) {
210  verboseLevel = right.verboseLevel;
218  //fDisplayThreshold = right.fDisplayThreshold;
219  fIsPhysicsTableBuilt = right.GetSubInstanceManager().offset[right.GetInstanceID()]._fIsPhysicsTableBuilt;
220  fDisplayThreshold = right.GetSubInstanceManager().offset[right.GetInstanceID()]._fDisplayThreshold;
221  //fIsPhysicsTableBuilt = right.fIsPhysicsTableBuilt;
223  }
224  return *this;
225 }
#define fDisplayThreshold
#define fIsPhysicsTableBuilt
G4bool fIsCheckedForRetrievePhysicsTable
G4int GetInstanceID() const
static G4RUN_DLL G4ThreadLocal T * offset
static const G4VUPLManager & GetSubInstanceManager()
void G4VUserPhysicsList::PreparePhysicsTable ( G4ParticleDefinition particle)

Definition at line 692 of file G4VUserPhysicsList.cc.

References FatalException, G4cout, G4endl, G4Exception(), G4ParticleDefinition::GetMasterProcessManager(), G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetProcessList(), G4ParticleDefinition::GetProcessManager(), G4ParticleDefinition::IsShortLived(), G4ProcessVector::size(), and verboseLevel.

Referenced by BuildPhysicsTable(), and G4UserPhysicsListMessenger::SetNewValue().

693 {
694  if(!(particle->GetMasterProcessManager())) {
695 //// G4cout << "#### G4VUserPhysicsList::BuildPhysicsTable() - BuildPhysicsTable("
696 //// << particle->GetParticleName() << ") skipped..." << G4endl;
697  return;
698  }
699  // Prepare the physics tables for every process for this particle type
700  // if particle is not ShortLived
701  if(!particle->IsShortLived()) {
702  G4ProcessManager* pManager = particle->GetProcessManager();
703  if (!pManager) {
704 #ifdef G4VERBOSE
705  if (verboseLevel>0) {
706  G4cout<< "G4VUserPhysicsList::PreparePhysicsTable "
707  << ": No Process Manager for "
708  << particle->GetParticleName() <<G4endl;
709  G4cout << particle->GetParticleName()
710  << " should be created in your PhysicsList" <<G4endl;
711  }
712 #endif
713  G4Exception("G4VUserPhysicsList::PreparePhysicsTable",
714  "Run0273", FatalException,
715  "No process manager");
716  return;
717  }
718 
719  //Get processes from master thread
720  G4ProcessManager* pManagerShadow = particle->GetMasterProcessManager();
721  //Andrea Dotti 15 Jan 2013: Change of interface of MSC
722  //G4ProcessVector* pVectorShadow = pManagerShadow->GetProcessList();
723 
724  G4ProcessVector* pVector = pManager->GetProcessList();
725  if (!pVector) {
726 #ifdef G4VERBOSE
727  if (verboseLevel>0) {
728  G4cout << "G4VUserPhysicsList::PreparePhysicsTable "
729  << ": No Process Vector for "
730  << particle->GetParticleName() <<G4endl;
731  }
732 #endif
733  G4Exception("G4VUserPhysicsList::PreparePhysicsTable",
734  "Run0274", FatalException,
735  "No process Vector");
736  return;
737  }
738  for (G4int j=0; j < pVector->size(); ++j) {
739 
740  //Andrea July 16th 2013 : migration to new interface...
741  //Infer if we are in a worker thread or master thread
742  //Master thread is the one in which the process manager
743  // and process manager shadow pointers are the same
744  if ( pManagerShadow == pManager )
745  {
746  (*pVector)[j]->PreparePhysicsTable(*particle);
747  }
748  else
749  {
750  (*pVector)[j]->PrepareWorkerPhysicsTable(*particle);
751  }
752  } //End loop on processes vector
753  } //End if pn ShortLived
754 }
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4ProcessManager * GetMasterProcessManager() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4int size() const
#define G4endl
Definition: G4ios.hh:61
G4ProcessVector * GetProcessList() const
G4bool G4VUserPhysicsList::RegisterProcess ( G4VProcess process,
G4ParticleDefinition particle 
)
protected

Definition at line 959 of file G4VUserPhysicsList.cc.

References G4MT_thePLHelper.

961 {
962  return G4MT_thePLHelper->RegisterProcess(process, particle);
963 }
#define G4MT_thePLHelper
void G4VUserPhysicsList::RemoveProcessManager ( )

Definition at line 298 of file G4VUserPhysicsList.cc.

References G4cout, G4endl, G4MUTEXLOCK, G4MUTEXUNLOCK, G4ParticleDefinition::GetInstanceID(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetParticleSubType(), G4ParticleDefinition::GetProcessManager(), G4ParticleDefinition::SetProcessManager(), G4PDefSplitter< T >::slavetotalspace, theParticleIterator, and verboseLevel.

Referenced by ~G4VUserPhysicsList(), and G4WorkerRunManager::~G4WorkerRunManager().

299 {
300  //Request lock for particle table accesses. Some changes are inside
301  //this critical region.
302 #ifdef G4MULTITHREADED
303  G4MUTEXLOCK(&G4ParticleTable::particleTableMutex);
304  G4ParticleTable::lockCount++;
305 #endif
306 // G4cout << "Particle table is held by G4VUserPhysicsList::InitializeProcessManager" << G4endl;
307 
308  // loop over all particles in G4ParticleTable
309  theParticleIterator->reset();
310  while( (*theParticleIterator)() ){
311  G4ParticleDefinition* particle = theParticleIterator->value();
313  {
314  if(particle->GetParticleSubType()!="generic" || particle->GetParticleName()=="GenericIon")
315  {
316  G4ProcessManager* pmanager = particle->GetProcessManager();
317  if (pmanager!=0) delete pmanager;
318 #ifdef G4VERBOSE
319  if (verboseLevel >2){
320  G4cout << "G4VUserPhysicsList::RemoveProcessManager: ";
321  G4cout << "remove ProcessManager from ";
322  G4cout << particle->GetParticleName() << G4endl;
323  }
324 #endif
325  }
326  particle->SetProcessManager(0);
327  }
328  }
329 
330  //release lock for particle table accesses.
331 #ifdef G4MULTITHREADED
332  G4MUTEXUNLOCK(&G4ParticleTable::particleTableMutex);
333 #endif
334 // G4cout << "Particle table is released by G4VUserPhysicsList::InitializeProcessManager" << G4endl;
335 
336 }
#define G4MUTEXUNLOCK
Definition: G4Threading.hh:162
void SetProcessManager(G4ProcessManager *aProcessManager)
const G4String & GetParticleSubType() const
G4ProcessManager * GetProcessManager() const
G4int GetInstanceID() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
static G4PART_DLL G4ThreadLocal G4int slavetotalspace
#define G4MUTEXLOCK
Definition: G4Threading.hh:161
#define G4endl
Definition: G4ios.hh:61
#define theParticleIterator
void G4VUserPhysicsList::ResetCuts ( )

obsolete methods

Definition at line 987 of file G4VUserPhysicsList.cc.

References G4cout, G4endl, and verboseLevel.

Referenced by XrayTelPhysicsList::SetCutForElectron(), XrayTelPhysicsList::SetCutForGamma(), PhysicsList::SetGammaCut(), and PurgMagPhysicsList::SetGammaCut().

988 {
989 #ifdef G4VERBOSE
990  if (verboseLevel>0){
991  G4cout << "G4VUserPhysicsList::ResetCuts() is obsolete."
992  << " This method gives no effect and you can remove it. "<< G4endl;
993  }
994 #endif
995 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4VUserPhysicsList::ResetPhysicsTableRetrieved ( )
inline
void G4VUserPhysicsList::ResetStoredInAscii ( )
inline

Definition at line 466 of file G4VUserPhysicsList.hh.

References fStoredInAscii.

Referenced by export_G4VUserPhysicsList(), and G4UserPhysicsListMessenger::SetNewValue().

467 {
468  fStoredInAscii = false;
469 }
void G4VUserPhysicsList::RetrievePhysicsTable ( G4ParticleDefinition particle,
const G4String directory,
G4bool  ascii = false 
)
protectedvirtual

Definition at line 881 of file G4VUserPhysicsList.cc.

References BuildIntegralPhysicsTable(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetProcessManager(), G4ProcessVector::size(), and verboseLevel.

Referenced by BuildPhysicsTable().

884 {
885  G4int j;
886  G4bool success[100];
887  // Retrieve physics tables for every process for this particle type
888  G4ProcessVector* pVector = (particle->GetProcessManager())->GetProcessList();
889  for ( j=0; j < pVector->size(); ++j) {
890  success[j] =
891  (*pVector)[j]->RetrievePhysicsTable(particle,directory,ascii);
892 
893  if (!success[j]) {
894 #ifdef G4VERBOSE
895  if (verboseLevel>2){
896  G4cout << "G4VUserPhysicsList::RetrievePhysicsTable "
897  << " Fail to retrieve Physics Table for "
898  << (*pVector)[j]->GetProcessName() << G4endl;
899  G4cout << "Calculate Physics Table for "
900  << particle->GetParticleName() << G4endl;
901  }
902 #endif
903  (*pVector)[j]->BuildPhysicsTable(*particle);
904  }
905  }
906  for ( j=0; j < pVector->size(); ++j) {
907  // temporary addition to make the integral schema
908  if (!success[j]) BuildIntegralPhysicsTable((*pVector)[j], particle);
909  }
910 }
void BuildIntegralPhysicsTable(G4VProcess *, G4ParticleDefinition *)
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4int size() const
#define G4endl
Definition: G4ios.hh:61
void G4VUserPhysicsList::SetApplyCuts ( G4bool  value,
const G4String name 
)

Definition at line 914 of file G4VUserPhysicsList.cc.

References G4ParticleTable::FindParticle(), G4cout, G4endl, G4ParticleDefinition::SetApplyCutsFlag(), theParticleTable, and verboseLevel.

Referenced by G4UserPhysicsListMessenger::SetNewValue().

915 {
916 #ifdef G4VERBOSE
917  if (verboseLevel>2){
918  G4cout << "G4VUserPhysicsList::SetApplyCuts for " << name << G4endl;
919  }
920 #endif
921  if(name=="all") {
926  } else {
928  }
929 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4ParticleTable * theParticleTable
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
#define G4endl
Definition: G4ios.hh:61
void G4VUserPhysicsList::SetCuts ( )
virtual

Reimplemented in G4AdjointPhysicsList, PhysicsList, PhysicsList, PhysicsList, PurgMagPhysicsList, XrayTelPhysicsList, DMXPhysicsList, PhysicsList, PhysicsList, PhysicsList, G4ErrorPhysicsList, ML2PhysicsList, PhysicsList, DicomPhysicsList, PhysicsList, PhysicsList, PhysicsList, IORTPhysicsList, B03PhysicsList, PhysicsList, PhysicsList, UltraPhysicsList, PhysicsList, PhysicsList, PhysicsList, PhysicsList, PhysicsList, PhysicsList, Em10PhysicsList, PhysicsList, PhysicsList, PhysicsList, PhysicsList, XrayFluoPhysicsList, PhysicsList, PhysicsList, F01PhysicsList, F02PhysicsList, F03PhysicsList, PhysicsList, PhysicsList, ExP01PhysicsList, PhysicsList, PhysicsList, PhysicsList, PhysicsList, ExP02PhysicsList, exrdmPhysicsList, PhysicsList, HadrontherapyPhysicsList, WLSPhysicsList, ExN02PhysicsList, PhysicsListEMstd, ExN01PhysicsList, pyG4VUserPhysicsList::CB_G4VUserPhysicsList, PhysicsList, G4HumanPhantomPhysicsList, PhysicsList, F05PhysicsList, F06PhysicsList, PhysicsList, G01PhysicsList, G04PhysicsList, PhysicsList, PhysicsList, BrachyPhysicsList, PhysicsList, PhysicsList, QBBC, PhysicsList, OpNovicePhysicsList, exGPSPhysicsList, F04PhysicsList, ExGflashPhysicsList, QPhysicsList, B3PhysicsList, P6DPhysicsList, ExTGPhysicsList, RE06PhysicsList, PhysicsList, PhysicsList, PhysicsList, LXePhysicsList, Par01PhysicsList, eRositaPhysicsList, XPhysicsList, pyG4VModularPhysicsList::CB_G4VModularPhysicsList, GammaKnifePhysicsList, RE01PhysicsList, and GammaRayTelPhysicsList.

Definition at line 339 of file G4VUserPhysicsList.cc.

References defaultCutValue, DumpCutValuesTable(), G4cout, G4endl, GetCutValue(), isSetDefaultCutValue, python.hepunit::mm, SetDefaultCutValue(), and verboseLevel.

Referenced by export_G4VModularPhysicsList(), export_G4VUserPhysicsList(), G4RunManagerKernel::InitializePhysics(), main(), ExTGPhysicsList::SetCuts(), B3PhysicsList::SetCuts(), SetCutsWithDefault(), and G4UserPhysicsListMessenger::SetNewValue().

340 {
341  if ( !isSetDefaultCutValue ){
343  }
344 
345 #ifdef G4VERBOSE
346  if (verboseLevel >1){
347  G4cout << "G4VUserPhysicsList::SetCuts: " << G4endl;
348  G4cout << "Cut for gamma: " << GetCutValue("gamma")/mm
349  << "[mm]" << G4endl;
350  G4cout << "Cut for e-: " << GetCutValue("e-")/mm
351  << "[mm]" << G4endl;
352  G4cout << "Cut for e+: " << GetCutValue("e+")/mm
353  << "[mm]" << G4endl;
354  G4cout << "Cut for proton: " << GetCutValue("proton")/mm
355  << "[mm]" << G4endl;
356  }
357 #endif
358 
359  // dump Cut values if verboseLevel==3
360  if (verboseLevel>2) {
362  }
363 }
G4double GetCutValue(const G4String &pname) const
void SetDefaultCutValue(G4double newCutValue)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4VUserPhysicsList::SetCutsForRegion ( G4double  aCut,
const G4String rname 
)

Definition at line 451 of file G4VUserPhysicsList.cc.

References SetCutValue().

Referenced by export_G4VUserPhysicsList(), and G4UserPhysicsListMessenger::SetNewValue().

452 {
453  // set cut values for gamma at first and for e- and e+
454  SetCutValue(aCut, "gamma", rname);
455  SetCutValue(aCut, "e-", rname);
456  SetCutValue(aCut, "e+", rname);
457  SetCutValue(aCut, "proton", rname);
458 }
void SetCutValue(G4double aCut, const G4String &pname)
void G4VUserPhysicsList::SetCutsWithDefault ( )
void G4VUserPhysicsList::SetCutValue ( G4double  aCut,
const G4String pname 
)
void G4VUserPhysicsList::SetCutValue ( G4double  aCut,
const G4String pname,
const G4String rname 
)

Definition at line 426 of file G4VUserPhysicsList.cc.

References G4cout, G4endl, G4RegionStore::GetInstance(), G4RegionStore::GetRegion(), and pyG4VUserPhysicsList::SetParticleCuts.

427 {
428  G4Region* region = G4RegionStore::GetInstance()->GetRegion(rname);
429  if (region != 0){
430  //set cut value
431  SetParticleCuts( aCut ,pname, region );
432  } else {
433 #ifdef G4VERBOSE
434  if (verboseLevel>0){
435  G4cout << "G4VUserPhysicsList::SetCutValue "
436  <<" : No Region of " << rname << G4endl;
437  }
438 #endif
439  }
440 }
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
static G4RegionStore * GetInstance()
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4VUserPhysicsList::SetDefaultCutValue ( G4double  newCutValue)

Definition at line 367 of file G4VUserPhysicsList.cc.

References defaultCutValue, G4cout, G4endl, isSetDefaultCutValue, python.hepunit::mm, SetCutValue(), and verboseLevel.

Referenced by export_G4VUserPhysicsList(), SetCuts(), SetCutsWithDefault(), G4UserPhysicsListMessenger::SetNewValue(), SetParticleCuts(), and XPhysicsList::XPhysicsList().

368 {
369  if (value<0.0) {
370 #ifdef G4VERBOSE
371  if (verboseLevel >0){
372  G4cout << "G4VUserPhysicsList::SetDefaultCutValue: negative cut values"
373  << " :" << value/mm << "[mm]" << G4endl;
374  }
375 #endif
376  return;
377  }
378 
380  isSetDefaultCutValue = true;
381 
382  // set cut values for gamma at first and for e- and e+
383  SetCutValue(defaultCutValue, "gamma");
386  SetCutValue(defaultCutValue, "proton");
387 
388 #ifdef G4VERBOSE
389  if (verboseLevel >1){
390  G4cout << "G4VUserPhysicsList::SetDefaultCutValue:"
391  << "default cut value is changed to :"
392  << defaultCutValue/mm << "[mm]" << G4endl;
393  }
394 #endif
395  }
void SetCutValue(G4double aCut, const G4String &pname)
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
#define G4endl
Definition: G4ios.hh:61
void G4VUserPhysicsList::SetParticleCuts ( G4double  cut,
G4ParticleDefinition particle,
G4Region region = 0 
)

Definition at line 463 of file G4VUserPhysicsList.cc.

References G4ParticleDefinition::GetParticleName().

Referenced by GammaKnifePhysicsList::SetCutForElectron(), F04PhysicsList::SetCutForElectron(), HadrontherapyPhysicsList::SetCutForElectron(), WLSPhysicsList::SetCutForElectron(), exrdmPhysicsList::SetCutForElectron(), PhysicsList::SetCutForElectron(), XrayFluoPhysicsList::SetCutForElectron(), IORTPhysicsList::SetCutForElectron(), ML2PhysicsList::SetCutForElectron(), GammaKnifePhysicsList::SetCutForGamma(), F04PhysicsList::SetCutForGamma(), HadrontherapyPhysicsList::SetCutForGamma(), WLSPhysicsList::SetCutForGamma(), exrdmPhysicsList::SetCutForGamma(), PhysicsList::SetCutForGamma(), XrayFluoPhysicsList::SetCutForGamma(), IORTPhysicsList::SetCutForGamma(), ML2PhysicsList::SetCutForGamma(), GammaKnifePhysicsList::SetCutForPositron(), F04PhysicsList::SetCutForPositron(), HadrontherapyPhysicsList::SetCutForPositron(), WLSPhysicsList::SetCutForPositron(), exrdmPhysicsList::SetCutForPositron(), PhysicsList::SetCutForPositron(), XrayFluoPhysicsList::SetCutForPositron(), IORTPhysicsList::SetCutForPositron(), ML2PhysicsList::SetCutForPositron(), XrayFluoPhysicsList::SetCutForProton(), PhysicsList::SetCutForProton(), and SetCutValue().

464 {
465  SetParticleCuts(cut, particle->GetParticleName(), region);
466 }
const G4String & GetParticleName() const
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void G4VUserPhysicsList::SetParticleCuts ( G4double  cut,
const G4String particleName,
G4Region region = 0 
)

Definition at line 469 of file G4VUserPhysicsList.cc.

References defaultCutValue, FatalException, G4cout, G4endl, G4Exception(), G4RegionStore::GetInstance(), G4Region::GetProductionCuts(), isSetDefaultCutValue, python.hepunit::mm, SetDefaultCutValue(), G4ProductionCuts::SetProductionCut(), and verboseLevel.

470 {
471  if (cut<0.0) {
472 #ifdef G4VERBOSE
473  if (verboseLevel >0){
474  G4cout << "G4VUserPhysicsList::SetParticleCuts: negative cut values"
475  << " :" << cut/mm << "[mm]"
476  << " for "<< particleName << G4endl;
477  }
478 #endif
479  return;
480  }
481 
482  if(!region){
483  size_t nReg = (G4RegionStore::GetInstance())->size();
484  if (nReg==0) {
485 #ifdef G4VERBOSE
486  if (verboseLevel>0){
487  G4cout << "G4VUserPhysicsList::SetParticleCuts "
488  <<" : No Default Region " <<G4endl;
489  }
490 #endif
491  G4Exception("G4VUserPhysicsList::SetParticleCuts ",
492  "Run0254", FatalException,
493  "No Default Region");
494  return;
495  }
496  region = (*(G4RegionStore::GetInstance()))[0];
497  }
498 
499  if ( !isSetDefaultCutValue ){
501  }
502 
503  G4ProductionCuts* pcuts = region->GetProductionCuts();
504  pcuts->SetProductionCut(cut,particleName);
505 #ifdef G4VERBOSE
506  if (verboseLevel>2){
507  G4cout << "G4VUserPhysicsList::SetParticleCuts: "
508  << " :" << cut/mm << "[mm]"
509  << " for "<< particleName << G4endl;
510  }
511 #endif
512 }
void SetDefaultCutValue(G4double newCutValue)
G4ProductionCuts * GetProductionCuts() const
void SetProductionCut(G4double cut, G4int index=-1)
static G4RegionStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
void G4VUserPhysicsList::SetPhysicsTableRetrieved ( const G4String directory = "")

Definition at line 870 of file G4VUserPhysicsList.cc.

References directoryPhysicsTable, fIsCheckedForRetrievePhysicsTable, fIsRestoredCutValues, fRetrievePhysicsTable, and G4String::isNull().

Referenced by G4UserPhysicsListMessenger::SetNewValue().

871 {
872  fRetrievePhysicsTable = true;
873  if(!directory.isNull()) {
874  directoryPhysicsTable = directory;
875  }
877  fIsRestoredCutValues = false;
878 }
G4bool fIsCheckedForRetrievePhysicsTable
G4bool isNull() const
void G4VUserPhysicsList::SetStoredInAscii ( )
inline

Definition at line 450 of file G4VUserPhysicsList.hh.

References fStoredInAscii.

Referenced by export_G4VUserPhysicsList(), and G4UserPhysicsListMessenger::SetNewValue().

451 {
452  fStoredInAscii = true;
453 }
void G4VUserPhysicsList::SetVerboseLevel ( G4int  value)

Definition at line 966 of file G4VUserPhysicsList.cc.

References fCutsTable, G4cout, G4endl, G4MT_thePLHelper, G4ProductionCutsTable::SetVerboseLevel(), and verboseLevel.

Referenced by B03PhysicsList::B03PhysicsList(), UltraPhysicsList::ConstructOp(), DicomPhysicsList::DicomPhysicsList(), DMXPhysicsList::DMXPhysicsList(), eRositaPhysicsList::eRositaPhysicsList(), ExGflashPhysicsList::ExGflashPhysicsList(), exGPSPhysicsList::exGPSPhysicsList(), ExN02PhysicsList::ExN02PhysicsList(), ExP01PhysicsList::ExP01PhysicsList(), ExP02PhysicsList::ExP02PhysicsList(), export_G4VUserPhysicsList(), F01PhysicsList::F01PhysicsList(), F02PhysicsList::F02PhysicsList(), F03PhysicsList::F03PhysicsList(), G4AdjointPhysicsList::G4AdjointPhysicsList(), main(), P6DPhysicsList::P6DPhysicsList(), Par01PhysicsList::Par01PhysicsList(), PurgMagPhysicsList::PurgMagPhysicsList(), RE06PhysicsList::RE06PhysicsList(), exGPSPhysicsList::SetCuts(), ExN01PhysicsList::SetCuts(), G04PhysicsList::SetCuts(), G01PhysicsList::SetCuts(), G4UserPhysicsListMessenger::SetNewValue(), XPhysicsList::XPhysicsList(), and XrayTelPhysicsList::XrayTelPhysicsList().

967 {
969  // set verboseLevel for G4ProductionCutsTable same as one for G4VUserPhysicsList:
971 
972  G4MT_thePLHelper->SetVerboseLevel(verboseLevel);
973 
974 #ifdef G4VERBOSE
975  if (verboseLevel >1){
976  G4cout << "G4VUserPhysicsList::SetVerboseLevel :"
977  << " Verbose level is set to " << verboseLevel << G4endl;
978  }
979 #endif
980 }
#define G4MT_thePLHelper
G4ProductionCutsTable * fCutsTable
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
const XML_Char int const XML_Char * value
#define G4endl
Definition: G4ios.hh:61
G4bool G4VUserPhysicsList::StorePhysicsTable ( const G4String directory = ".")

Definition at line 820 of file G4VUserPhysicsList.cc.

References directoryPhysicsTable, fCutsTable, fStoredInAscii, G4cout, G4endl, G4Exception(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetProcessManager(), G4String::isNull(), JustWarning, G4ProcessVector::size(), G4ProductionCutsTable::StoreCutsTable(), theParticleIterator, and verboseLevel.

Referenced by export_G4VUserPhysicsList(), and G4UserPhysicsListMessenger::SetNewValue().

821 {
822  G4bool ascii = fStoredInAscii;
823  G4String dir = directory;
824  if (dir.isNull()) dir = directoryPhysicsTable;
825  else directoryPhysicsTable = dir;
826 
827  // store CutsTable info
828  if (!fCutsTable->StoreCutsTable(dir, ascii)) {
829  G4Exception("G4VUserPhysicsList::StorePhysicsTable",
830  "Run0281", JustWarning,
831  "Fail to store Cut Table");
832  return false;
833  }
834 #ifdef G4VERBOSE
835  if (verboseLevel>2){
836  G4cout << "G4VUserPhysicsList::StorePhysicsTable "
837  << " Store material and cut values successfully" << G4endl;
838  }
839 #endif
840 
841  G4bool success= true;
842 
843  // loop over all particles in G4ParticleTable
844  theParticleIterator->reset();
845  while( (*theParticleIterator)() ){
846  G4ParticleDefinition* particle = theParticleIterator->value();
847  // Store physics tables for every process for this particle type
848  G4ProcessVector* pVector = (particle->GetProcessManager())->GetProcessList();
849  G4int j;
850  for ( j=0; j < pVector->size(); ++j) {
851  if (!(*pVector)[j]->StorePhysicsTable(particle,dir,ascii)){
852  G4String comment = "Fail to store physics table for ";
853  comment += (*pVector)[j]->GetProcessName();
854  comment += "(" + particle->GetParticleName() + ")";
855  G4Exception("G4VUserPhysicsList::StorePhysicsTable",
856  "Run0282", JustWarning,
857  comment);
858  success = false;
859  }
860  }
861  // end loop over processes
862  }
863  // end loop over particles
864  return success;
865 }
G4ProductionCutsTable * fCutsTable
G4ProcessManager * GetProcessManager() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4int size() const
G4bool StoreCutsTable(const G4String &directory, G4bool ascii=false)
#define G4endl
Definition: G4ios.hh:61
G4bool isNull() const
#define theParticleIterator
void G4VUserPhysicsList::UseCoupledTransportation ( G4bool  vl = true)

Definition at line 953 of file G4VUserPhysicsList.cc.

References G4MT_thePLHelper.

Referenced by G4RunManagerKernel::InitializePhysics().

954 {
955  G4MT_thePLHelper->UseCoupledTransportation(vl);
956 }
#define G4MT_thePLHelper

Field Documentation

G4double G4VUserPhysicsList::defaultCutValue
protected

Definition at line 361 of file G4VUserPhysicsList.hh.

Referenced by DicomPhysicsList::DicomPhysicsList(), DMXPhysicsList::DMXPhysicsList(), Em10PhysicsList::Em10PhysicsList(), eRositaPhysicsList::eRositaPhysicsList(), ExN02PhysicsList::ExN02PhysicsList(), ExP01PhysicsList::ExP01PhysicsList(), ExP02PhysicsList::ExP02PhysicsList(), exrdmPhysicsList::exrdmPhysicsList(), F01PhysicsList::F01PhysicsList(), F02PhysicsList::F02PhysicsList(), F03PhysicsList::F03PhysicsList(), F04PhysicsList::F04PhysicsList(), G4AdjointPhysicsList::G4AdjointPhysicsList(), G4ErrorPhysicsList::G4ErrorPhysicsList(), G4VUserPhysicsList(), GammaKnifePhysicsList::GammaKnifePhysicsList(), GammaRayTelPhysicsList::GammaRayTelPhysicsList(), GetDefaultCutValue(), HadrontherapyPhysicsList::HadrontherapyPhysicsList(), IORTPhysicsList::IORTPhysicsList(), LXePhysicsList::LXePhysicsList(), ML2PhysicsList::ML2PhysicsList(), G4VModularPhysicsList::operator=(), operator=(), P6DPhysicsList::P6DPhysicsList(), PhysicsListEMstd::PhysicsListEMstd(), PurgMagPhysicsList::PurgMagPhysicsList(), QBBC::QBBC(), QPhysicsList::QPhysicsList(), RE01PhysicsList::RE01PhysicsList(), RE06PhysicsList::RE06PhysicsList(), GammaRayTelPhysicsList::SetCuts(), GammaKnifePhysicsList::SetCuts(), RE06PhysicsList::SetCuts(), P6DPhysicsList::SetCuts(), F04PhysicsList::SetCuts(), BrachyPhysicsList::SetCuts(), G4HumanPhantomPhysicsList::SetCuts(), WLSPhysicsList::SetCuts(), HadrontherapyPhysicsList::SetCuts(), XrayFluoPhysicsList::SetCuts(), F02PhysicsList::SetCuts(), F03PhysicsList::SetCuts(), F01PhysicsList::SetCuts(), Em10PhysicsList::SetCuts(), B03PhysicsList::SetCuts(), IORTPhysicsList::SetCuts(), DicomPhysicsList::SetCuts(), ML2PhysicsList::SetCuts(), DMXPhysicsList::SetCuts(), PurgMagPhysicsList::SetCuts(), G4AdjointPhysicsList::SetCuts(), SetCuts(), SetCutsWithDefault(), SetDefaultCutValue(), SetParticleCuts(), GammaRayTelPhysicsList::SetRegionCut(), WLSPhysicsList::WLSPhysicsList(), XrayFluoPhysicsList::XrayFluoPhysicsList(), and XrayTelPhysicsList::XrayTelPhysicsList().

G4String G4VUserPhysicsList::directoryPhysicsTable
protected
G4ProductionCutsTable* G4VUserPhysicsList::fCutsTable
protected
G4bool G4VUserPhysicsList::fDisableCheckParticleList
protected
G4bool G4VUserPhysicsList::fIsCheckedForRetrievePhysicsTable
protected
G4bool G4VUserPhysicsList::fIsRestoredCutValues
protected
G4bool G4VUserPhysicsList::fRetrievePhysicsTable
protected
G4bool G4VUserPhysicsList::fStoredInAscii
protected
G4int G4VUserPhysicsList::g4vuplInstanceID
protected

Definition at line 395 of file G4VUserPhysicsList.hh.

Referenced by G4VUserPhysicsList(), and GetInstanceID().

G4bool G4VUserPhysicsList::isSetDefaultCutValue
protected
G4VUPLManager G4VUserPhysicsList::subInstanceManager
staticprotected

Definition at line 396 of file G4VUserPhysicsList.hh.

Referenced by G4VUserPhysicsList(), and GetSubInstanceManager().

G4ParticleTable* G4VUserPhysicsList::theParticleTable
protected
G4int G4VUserPhysicsList::verboseLevel
protected

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