Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VUserPhysicsList Class Referenceabstract

#include <G4VUserPhysicsList.hh>

+ Inheritance diagram for G4VUserPhysicsList:

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

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
 
G4ParticleTable::G4PTblDicIteratortheParticleIterator
 
G4UserPhysicsListMessengertheMessenger
 
G4int verboseLevel
 
G4double defaultCutValue
 
G4bool isSetDefaultCutValue
 
G4ProductionCutsTablefCutsTable
 
G4bool fRetrievePhysicsTable
 
G4bool fStoredInAscii
 
G4bool fIsCheckedForRetrievePhysicsTable
 
G4bool fIsRestoredCutValues
 
G4String directoryPhysicsTable
 
G4int fDisplayThreshold
 
G4bool fIsPhysicsTableBuilt
 
G4bool fDisableCheckParticleList
 
G4PhysicsListHelperthePLHelper
 

Detailed Description

Definition at line 96 of file G4VUserPhysicsList.hh.

Constructor & Destructor Documentation

◆ G4VUserPhysicsList() [1/2]

G4VUserPhysicsList::G4VUserPhysicsList ( )

Definition at line 74 of file G4VUserPhysicsList.cc.

75 :verboseLevel(1),
76 defaultCutValue(1.0 * mm),
79 fStoredInAscii(true),
86{
87 // default cut value (1.0mm)
88 defaultCutValue = 1.0*mm;
89
90 // pointer to the particle table
93
94 // pointer to the cuts table
96
97 // set energy range for SetCut calcuration
98 fCutsTable->SetEnergyRange(0.99*keV, 100*TeV);
99
100 // UI Messenger
102
103 // PhysicsListHelper
106
107}
G4PTblDicIterator * GetIterator()
static G4ParticleTable * GetParticleTable()
static G4PhysicsListHelper * GetPhysicsListHelper()
void SetVerboseLevel(G4int value)
void SetEnergyRange(G4double lowedge, G4double highedge)
static G4ProductionCutsTable * GetProductionCutsTable()
G4UserPhysicsListMessenger * theMessenger
G4ProductionCutsTable * fCutsTable
G4ParticleTable * theParticleTable
G4bool fIsCheckedForRetrievePhysicsTable
G4ParticleTable::G4PTblDicIterator * theParticleIterator
G4PhysicsListHelper * thePLHelper

◆ ~G4VUserPhysicsList()

G4VUserPhysicsList::~G4VUserPhysicsList ( )
virtual

Definition at line 110 of file G4VUserPhysicsList.cc.

111{
112 if (theMessenger != 0) {
113 delete theMessenger;
114 theMessenger = 0;
115 }
117
118 // invoke DeleteAllParticle
120
121}

◆ G4VUserPhysicsList() [2/2]

Member Function Documentation

◆ AddProcessManager()

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

Definition at line 174 of file G4VUserPhysicsList.cc.

176{
177 if (newParticle == 0) return;
178 if (newParticle->GetProcessManager() != 0) {
179#ifdef G4VERBOSE
180 if (verboseLevel >1){
181 G4cout << "G4VUserPhysicsList::AddProcessManager: "
182 << newParticle->GetParticleName()
183 << " already has ProcessManager " << G4endl;
184 }
185#endif
186 return;
187 }
188
189 // create new process manager if newManager == 0
190 if (newManager == 0){
191 // Add ProcessManager
192 if (newParticle->GetParticleType() == "nucleus") {
193 // Create a copy of the process manager of "GenericIon" in case of "nucleus"
194 G4ParticleDefinition* genericIon =
195 (G4ParticleTable::GetParticleTable())->FindParticle("GenericIon");
196
197 if (genericIon != 0) {
198 G4ProcessManager* ionMan = genericIon->GetProcessManager();
199 if (ionMan != 0) {
200 newManager = new G4ProcessManager(*ionMan);
201 } else {
202 // no process manager has been registered yet
203 newManager = new G4ProcessManager(newParticle);
204 G4Exception("G4VUserPhysicsList::AddProcessManager",
205 "Run0251", RunMustBeAborted,
206 "GenericIon has no ProcessMamanger");
207 }
208 } else {
209 // "GenericIon" does not exist
210 newManager = new G4ProcessManager(newParticle);
211 G4Exception("G4VUserPhysicsList::AddProcessManager",
212 "Run0252", RunMustBeAborted,
213 "GenericIon does not exist");
214 }
215
216 } else {
217 // create process manager for particles other than "nucleus"
218 newManager = new G4ProcessManager(newParticle);
219 }
220 }
221
222 // set particle type
223 newManager->SetParticleType(newParticle);
224
225 // add the process manager
226 newParticle->SetProcessManager(newManager);
227
228#ifdef G4VERBOSE
229 if (verboseLevel >2){
230 G4cout << "G4VUserPhysicsList::AddProcessManager: "
231 << "adds ProcessManager to "
232 << newParticle->GetParticleName() << G4endl;
233 newManager->DumpInfo();
234 }
235#endif
237 && (newParticle->GetParticleType() == "nucleus")) {
238 PreparePhysicsTable(newParticle);
239 BuildPhysicsTable(newParticle);
240 }
241}
@ RunMustBeAborted
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleType() const
const G4String & GetParticleName() const
void SetProcessManager(G4ProcessManager *aProcessManager)
void SetParticleType(const G4ParticleDefinition *)
void PreparePhysicsTable(G4ParticleDefinition *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ AddTransportation()

void G4VUserPhysicsList::AddTransportation ( )
protected

◆ BuildIntegralPhysicsTable()

void G4VUserPhysicsList::BuildIntegralPhysicsTable ( G4VProcess process,
G4ParticleDefinition particle 
)
protected

Definition at line 644 of file G4VUserPhysicsList.cc.

646{
647 //*********************************************************************
648 // temporary addition to make the integral schema of electromagnetic
649 // processes work.
650 //
651
652 if ( (process->GetProcessName() == "Imsc") ||
653 (process->GetProcessName() == "IeIoni") ||
654 (process->GetProcessName() == "IeBrems") ||
655 (process->GetProcessName() == "Iannihil") ||
656 (process->GetProcessName() == "IhIoni") ||
657 (process->GetProcessName() == "IMuIoni") ||
658 (process->GetProcessName() == "IMuBrems") ||
659 (process->GetProcessName() == "IMuPairProd") ) {
660#ifdef G4VERBOSE
661 if (verboseLevel>2){
662 G4cout << "G4VUserPhysicsList::BuildIntegralPhysicsTable "
663 << " BuildPhysicsTable is invoked for "
664 << process->GetProcessName()
665 << "(" << particle->GetParticleName() << ")" << G4endl;
666 }
667#endif
668 process->BuildPhysicsTable(*particle);
669 }
670}
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:210
const G4String & GetProcessName() const
Definition: G4VProcess.hh:379

Referenced by RetrievePhysicsTable().

◆ BuildPhysicsTable() [1/2]

void G4VUserPhysicsList::BuildPhysicsTable ( )

Definition at line 458 of file G4VUserPhysicsList.cc.

459{
460 //Prepare Physics table for all particles
462 while( (*theParticleIterator)() ){
464 PreparePhysicsTable(particle);
465 }
466
467 // ask processes to prepare physics table
470 // check if retrieve Cut Table successfully
472#ifdef G4VERBOSE
473 if (verboseLevel>0){
474 G4cout << "G4VUserPhysicsList::BuildPhysicsTable"
475 << " Retrieve Cut Table failed !!" << G4endl;
476 }
477#endif
478 G4Exception("G4VUserPhysicsList::BuildPhysicsTable",
479 "Run0255", RunMustBeAborted,
480 "Fail to retrieve Production Cut Table");
481 } else {
482#ifdef G4VERBOSE
483 if (verboseLevel>2){
484 G4cout << "G4VUserPhysicsList::BuildPhysicsTable"
485 << " Retrieve Cut Table successfully " << G4endl;
486 }
487#endif
488 }
489 } else {
490#ifdef G4VERBOSE
491 if (verboseLevel>2){
492 G4cout << "G4VUserPhysicsList::BuildPhysicsTable"
493 << " does not retrieve Cut Table but calculate " << G4endl;
494 }
495#endif
496 }
497
498 // Sets a value to particle
499 // set cut values for gamma at first and for e- and e+
500 G4String particleName;
502 if(GammaP) BuildPhysicsTable(GammaP);
504 if(EMinusP) BuildPhysicsTable(EMinusP);
506 if(EPlusP) BuildPhysicsTable(EPlusP);
508 if(ProtonP) BuildPhysicsTable(ProtonP);
509
510
512 while( (*theParticleIterator)() ){
514 if( particle!=GammaP &&
515 particle!=EMinusP &&
516 particle!=EPlusP &&
517 particle!=ProtonP ){
518 BuildPhysicsTable(particle);
519 }
520 }
521
522 // Set flag
524
525}
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4bool RetrieveCutsTable(const G4String &directory, G4bool ascii=false)

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

◆ BuildPhysicsTable() [2/2]

void G4VUserPhysicsList::BuildPhysicsTable ( G4ParticleDefinition particle)

Definition at line 527 of file G4VUserPhysicsList.cc.

528{
531 // fail to retreive cut tables
532#ifdef G4VERBOSE
533 if (verboseLevel>0){
534 G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
535 << "Physics table can not be retreived and will be calculated "
536 << G4endl;
537 }
538#endif
539 fRetrievePhysicsTable = false;
540
541 } else {
542#ifdef G4VERBOSE
543 if (verboseLevel>2){
544 G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
545 << " Retrieve Physics Table for "
546 << particle->GetParticleName() << G4endl;
547 }
548#endif
549 // Retrieve PhysicsTable from files for proccesses
551 }
552 }
553
554#ifdef G4VERBOSE
555 if (verboseLevel>2){
556 G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
557 << "Calculate Physics Table for "
558 << particle->GetParticleName() << G4endl;
559 }
560#endif
561 // Rebuild the physics tables for every process for this particle type
562 // if particle is not ShortLived
563 if(!particle->IsShortLived()) {
564 G4ProcessManager* pManager = particle->GetProcessManager();
565 if (!pManager) {
566#ifdef G4VERBOSE
567 if (verboseLevel>0){
568 G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
569 <<" : No Process Manager for "
570 << particle->GetParticleName() << G4endl;
571 G4cout << particle->GetParticleName()
572 << " should be created in your PhysicsList" <<G4endl;
573 }
574#endif
575 G4Exception("G4VUserPhysicsList::BuildPhysicsTable",
576 "Run0271", FatalException,
577 "No process manager");
578 return;
579 }
580 G4ProcessVector* pVector = pManager->GetProcessList();
581 if (!pVector) {
582#ifdef G4VERBOSE
583 if (verboseLevel>0){
584 G4cout << "G4VUserPhysicsList::BuildPhysicsTable "
585 <<" : No Process Vector for "
586 << particle->GetParticleName() <<G4endl;
587 }
588#endif
589 G4Exception("G4VUserPhysicsList::BuildPhysicsTable",
590 "Run0272", FatalException,
591 "No process Vector");
592 return;
593 }
594 for (G4int j=0; j < pVector->size(); ++j) {
595 (*pVector)[j]->BuildPhysicsTable(*particle);
596 }
597 }
598}
@ FatalException
int G4int
Definition: G4Types.hh:66
G4ProcessVector * GetProcessList() const
G4int size() const
virtual void RetrievePhysicsTable(G4ParticleDefinition *, const G4String &directory, G4bool ascii=false)

◆ CheckParticleList()

void G4VUserPhysicsList::CheckParticleList ( )

Definition at line 825 of file G4VUserPhysicsList.cc.

826{
829 }
830}
void CheckParticleList() const

Referenced by G4RunManagerKernel::InitializePhysics().

◆ Construct()

void G4VUserPhysicsList::Construct ( )
inline

Definition at line 333 of file G4VUserPhysicsList.hh.

334{
335#ifdef G4VERBOSE
336 if (verboseLevel >1) G4cout << "G4VUserPhysicsList::Construct()" << G4endl;
337#endif
338
340
341#ifdef G4VERBOSE
342 if (verboseLevel >1) G4cout << "Construct processes " << G4endl;
343#endif
345
346}
virtual void ConstructProcess()=0

Referenced by G4RunManagerKernel::InitializePhysics().

◆ ConstructParticle()

virtual void G4VUserPhysicsList::ConstructParticle ( )
pure virtual

◆ ConstructProcess()

virtual void G4VUserPhysicsList::ConstructProcess ( )
pure virtual

Implemented in G4ErrorPhysicsList, and G4VModularPhysicsList.

Referenced by Construct().

◆ DisableCheckParticleList()

void G4VUserPhysicsList::DisableCheckParticleList ( )
inline

Definition at line 400 of file G4VUserPhysicsList.hh.

401{
403}

◆ DumpCutValuesTable()

void G4VUserPhysicsList::DumpCutValuesTable ( G4int  flag = 1)

Definition at line 691 of file G4VUserPhysicsList.cc.

692{
693 fDisplayThreshold = flag;
694}

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

◆ DumpCutValuesTableIfRequested()

void G4VUserPhysicsList::DumpCutValuesTableIfRequested ( )

Definition at line 697 of file G4VUserPhysicsList.cc.

◆ DumpList()

void G4VUserPhysicsList::DumpList ( ) const

Definition at line 673 of file G4VUserPhysicsList.cc.

674{
676 G4int idx = 0;
677 while( (*theParticleIterator)() ){
679 G4cout << particle->GetParticleName();
680 if ((idx++ % 4) == 3) {
681 G4cout << G4endl;
682 } else {
683 G4cout << ", ";
684 }
685 }
686 G4cout << G4endl;
687}

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ GetApplyCuts()

G4bool G4VUserPhysicsList::GetApplyCuts ( const G4String name) const

Definition at line 818 of file G4VUserPhysicsList.cc.

819{
821}
G4bool GetApplyCutsFlag() const

◆ GetCutValue()

G4double G4VUserPhysicsList::GetCutValue ( const G4String pname) const

Definition at line 342 of file G4VUserPhysicsList.cc.

343{
344 size_t nReg = (G4RegionStore::GetInstance())->size();
345 if (nReg==0) {
346#ifdef G4VERBOSE
347 if (verboseLevel>0){
348 G4cout << "G4VUserPhysicsList::GetCutValue "
349 <<" : No Default Region " <<G4endl;
350 }
351#endif
352 G4Exception("G4VUserPhysicsList::GetCutValue",
353 "Run0253", FatalException,
354 "No Default Region");
355 return -1.*mm;
356 }
357 G4Region* region = (*(G4RegionStore::GetInstance()))[0];
358 return region->GetProductionCuts()->GetProductionCut(name);
359}
G4double GetProductionCut(G4int index) const
static G4RegionStore * GetInstance()
G4ProductionCuts * GetProductionCuts() const

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

◆ GetDefaultCutValue()

G4double G4VUserPhysicsList::GetDefaultCutValue ( ) const
inline

Definition at line 348 of file G4VUserPhysicsList.hh.

349{
350 return defaultCutValue;
351}

Referenced by G4UserPhysicsListMessenger::GetCurrentValue().

◆ GetPhysicsTableDirectory()

const G4String & G4VUserPhysicsList::GetPhysicsTableDirectory ( ) const
inline

Definition at line 372 of file G4VUserPhysicsList.hh.

373{
374 return directoryPhysicsTable;
375}

Referenced by G4UserPhysicsListMessenger::GetCurrentValue().

◆ GetVerboseLevel()

G4int G4VUserPhysicsList::GetVerboseLevel ( ) const
inline

Definition at line 354 of file G4VUserPhysicsList.hh.

355{
356 return verboseLevel;
357}

Referenced by G4UserPhysicsListMessenger::GetCurrentValue().

◆ InitializeProcessManager()

void G4VUserPhysicsList::InitializeProcessManager ( )
protected

Definition at line 245 of file G4VUserPhysicsList.cc.

246{
247 // loop over all particles in G4ParticleTable
249 while( (*theParticleIterator)() ){
251 G4ProcessManager* pmanager = particle->GetProcessManager();
252 if (pmanager==0) {
253 // create process manager if the particle has no its one
254 pmanager = new G4ProcessManager(particle);
255 particle->SetProcessManager(pmanager);
256 }
257 }
258}

Referenced by Construct().

◆ IsPhysicsTableRetrieved()

G4bool G4VUserPhysicsList::IsPhysicsTableRetrieved ( ) const
inline

Definition at line 360 of file G4VUserPhysicsList.hh.

361{
362 return fRetrievePhysicsTable;
363}

Referenced by G4UserPhysicsListMessenger::GetCurrentValue().

◆ IsStoredInAscii()

G4bool G4VUserPhysicsList::IsStoredInAscii ( ) const
inline

Definition at line 366 of file G4VUserPhysicsList.hh.

367{
368 return fStoredInAscii;
369}

Referenced by G4UserPhysicsListMessenger::GetCurrentValue().

◆ operator=()

◆ PreparePhysicsTable()

void G4VUserPhysicsList::PreparePhysicsTable ( G4ParticleDefinition particle)

Definition at line 601 of file G4VUserPhysicsList.cc.

602{
603 // Prepare the physics tables for every process for this particle type
604 // if particle is not ShortLived
605 if(!particle->IsShortLived()) {
606 G4ProcessManager* pManager = particle->GetProcessManager();
607 if (!pManager) {
608#ifdef G4VERBOSE
609 if (verboseLevel>0) {
610 G4cout<< "G4VUserPhysicsList::PreparePhysicsTable "
611 << ": No Process Manager for "
612 << particle->GetParticleName() <<G4endl;
613 G4cout << particle->GetParticleName()
614 << " should be created in your PhysicsList" <<G4endl;
615 }
616#endif
617 G4Exception("G4VUserPhysicsList::PreparePhysicsTable",
618 "Run0273", FatalException,
619 "No process manager");
620 return;
621 }
622
623 G4ProcessVector* pVector = pManager->GetProcessList();
624 if (!pVector) {
625#ifdef G4VERBOSE
626 if (verboseLevel>0) {
627 G4cout << "G4VUserPhysicsList::PreparePhysicsTable "
628 << ": No Process Vector for "
629 << particle->GetParticleName() <<G4endl;
630 }
631#endif
632 G4Exception("G4VUserPhysicsList::PreparePhysicsTable",
633 "Run0274", FatalException,
634 "No process Vector");
635 return;
636 }
637 for (G4int j=0; j < pVector->size(); ++j) {
638 (*pVector)[j]->PreparePhysicsTable(*particle);
639 }
640 }
641}

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

◆ RegisterProcess()

G4bool G4VUserPhysicsList::RegisterProcess ( G4VProcess process,
G4ParticleDefinition particle 
)
protected

Definition at line 845 of file G4VUserPhysicsList.cc.

847{
848 return thePLHelper->RegisterProcess(process, particle);
849}
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)

◆ RemoveProcessManager()

void G4VUserPhysicsList::RemoveProcessManager ( )

Definition at line 261 of file G4VUserPhysicsList.cc.

262{
263 // loop over all particles in G4ParticleTable
265 while( (*theParticleIterator)() ){
267 G4ProcessManager* pmanager = particle->GetProcessManager();
268 if (pmanager!=0) delete pmanager;
269 particle->SetProcessManager(0);
270#ifdef G4VERBOSE
271 if (verboseLevel >2){
272 G4cout << "G4VUserPhysicsList::RemoveProcessManager: "
273 << "remove ProcessManager from "
274 << particle->GetParticleName() << G4endl;
275 }
276#endif
277 }
278}

Referenced by ~G4VUserPhysicsList().

◆ ResetCuts()

void G4VUserPhysicsList::ResetCuts ( )

obsolete methods

Definition at line 873 of file G4VUserPhysicsList.cc.

874{
875#ifdef G4VERBOSE
876 if (verboseLevel>0){
877 G4cout << "G4VUserPhysicsList::ResetCuts() is obsolete."
878 << " This method gives no effect and you can remove it. "<< G4endl;
879 }
880#endif
881}

◆ ResetPhysicsTableRetrieved()

void G4VUserPhysicsList::ResetPhysicsTableRetrieved ( )
inline

Definition at line 385 of file G4VUserPhysicsList.hh.

386{
387 fRetrievePhysicsTable = false;
388 fIsRestoredCutValues = false;
390}

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ ResetStoredInAscii()

void G4VUserPhysicsList::ResetStoredInAscii ( )
inline

Definition at line 394 of file G4VUserPhysicsList.hh.

395{
396 fStoredInAscii = false;
397}

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ RetrievePhysicsTable()

void G4VUserPhysicsList::RetrievePhysicsTable ( G4ParticleDefinition particle,
const G4String directory,
G4bool  ascii = false 
)
protectedvirtual

Definition at line 767 of file G4VUserPhysicsList.cc.

770{
771 G4int j;
772 G4bool success[100];
773 // Retrieve physics tables for every process for this particle type
774 G4ProcessVector* pVector = (particle->GetProcessManager())->GetProcessList();
775 for ( j=0; j < pVector->size(); ++j) {
776 success[j] =
777 (*pVector)[j]->RetrievePhysicsTable(particle,directory,ascii);
778
779 if (!success[j]) {
780#ifdef G4VERBOSE
781 if (verboseLevel>2){
782 G4cout << "G4VUserPhysicsList::RetrievePhysicsTable "
783 << " Fail to retrieve Physics Table for "
784 << (*pVector)[j]->GetProcessName() << G4endl;
785 G4cout << "Calculate Physics Table for "
786 << particle->GetParticleName() << G4endl;
787 }
788#endif
789 (*pVector)[j]->BuildPhysicsTable(*particle);
790 }
791 }
792 for ( j=0; j < pVector->size(); ++j) {
793 // temporary addition to make the integral schema
794 if (!success[j]) BuildIntegralPhysicsTable((*pVector)[j], particle);
795 }
796}
bool G4bool
Definition: G4Types.hh:67
void BuildIntegralPhysicsTable(G4VProcess *, G4ParticleDefinition *)

Referenced by BuildPhysicsTable().

◆ SetApplyCuts()

void G4VUserPhysicsList::SetApplyCuts ( G4bool  value,
const G4String name 
)

Definition at line 800 of file G4VUserPhysicsList.cc.

801{
802#ifdef G4VERBOSE
803 if (verboseLevel>2){
804 G4cout << "G4VUserPhysicsList::SetApplyCuts for " << name << G4endl;
805 }
806#endif
807 if(name=="all") {
812 } else {
814 }
815}

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ SetCuts()

void G4VUserPhysicsList::SetCuts ( )
virtual

Reimplemented in G4ErrorPhysicsList, and QBBC.

Definition at line 282 of file G4VUserPhysicsList.cc.

283{
284 if ( !isSetDefaultCutValue ){
286 }
287
288#ifdef G4VERBOSE
289 if (verboseLevel >1){
290 G4cout << "G4VUserPhysicsList::SetCuts: " << G4endl;
291 G4cout << "Cut for gamma: " << GetCutValue("gamma")/mm
292 << "[mm]" << G4endl;
293 G4cout << "Cut for e-: " << GetCutValue("e-")/mm
294 << "[mm]" << G4endl;
295 G4cout << "Cut for e+: " << GetCutValue("e+")/mm
296 << "[mm]" << G4endl;
297 G4cout << "Cut for proton: " << GetCutValue("proton")/mm
298 << "[mm]" << G4endl;
299 }
300#endif
301
302 // dump Cut values if verboseLevel==3
303 if (verboseLevel>2) {
305 }
306}
G4double GetCutValue(const G4String &pname) const
void SetDefaultCutValue(G4double newCutValue)
void DumpCutValuesTable(G4int flag=1)

Referenced by G4RunManagerKernel::InitializePhysics(), SetCutsWithDefault(), and G4UserPhysicsListMessenger::SetNewValue().

◆ SetCutsForRegion()

void G4VUserPhysicsList::SetCutsForRegion ( G4double  aCut,
const G4String rname 
)

Definition at line 394 of file G4VUserPhysicsList.cc.

395{
396 // set cut values for gamma at first and for e- and e+
397 SetCutValue(aCut, "gamma", rname);
398 SetCutValue(aCut, "e-", rname);
399 SetCutValue(aCut, "e+", rname);
400 SetCutValue(aCut, "proton", rname);
401}
void SetCutValue(G4double aCut, const G4String &pname)

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ SetCutsWithDefault()

void G4VUserPhysicsList::SetCutsWithDefault ( )

◆ SetCutValue() [1/2]

void G4VUserPhysicsList::SetCutValue ( G4double  aCut,
const G4String pname 
)

Definition at line 362 of file G4VUserPhysicsList.cc.

363{
364 SetParticleCuts( aCut ,name );
365}
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)

Referenced by SetCutsForRegion(), SetDefaultCutValue(), and G4UserPhysicsListMessenger::SetNewValue().

◆ SetCutValue() [2/2]

void G4VUserPhysicsList::SetCutValue ( G4double  aCut,
const G4String pname,
const G4String rname 
)

Definition at line 368 of file G4VUserPhysicsList.cc.

370{
372 if (region != 0){
373 //set cut value
374 SetParticleCuts( aCut ,pname, region );
375 } else {
376#ifdef G4VERBOSE
377 if (verboseLevel>0){
378 G4cout << "G4VUserPhysicsList::SetCutValue "
379 <<" : No Region of " << rname << G4endl;
380 }
381#endif
382 }
383}
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const

◆ SetDefaultCutValue()

void G4VUserPhysicsList::SetDefaultCutValue ( G4double  newCutValue)

Definition at line 310 of file G4VUserPhysicsList.cc.

311{
312 if (value<0.0) {
313#ifdef G4VERBOSE
314 if (verboseLevel >0){
315 G4cout << "G4VUserPhysicsList::SetDefaultCutValue: negative cut values"
316 << " :" << value/mm << "[mm]" << G4endl;
317 }
318#endif
319 return;
320 }
321
322 defaultCutValue = value;
324
325 // set cut values for gamma at first and for e- and e+
329 SetCutValue(defaultCutValue, "proton");
330
331#ifdef G4VERBOSE
332 if (verboseLevel >1){
333 G4cout << "G4VUserPhysicsList::SetDefaultCutValue:"
334 << "default cut value is changed to :"
335 << defaultCutValue/mm << "[mm]" << G4endl;
336 }
337#endif
338 }

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

◆ SetParticleCuts() [1/2]

void G4VUserPhysicsList::SetParticleCuts ( G4double  cut,
const G4String particleName,
G4Region region = 0 
)

Definition at line 412 of file G4VUserPhysicsList.cc.

413{
414 if (cut<0.0) {
415#ifdef G4VERBOSE
416 if (verboseLevel >0){
417 G4cout << "G4VUserPhysicsList::SetParticleCuts: negative cut values"
418 << " :" << cut/mm << "[mm]"
419 << " for "<< particleName << G4endl;
420 }
421#endif
422 return;
423 }
424
425 if(!region){
426 size_t nReg = (G4RegionStore::GetInstance())->size();
427 if (nReg==0) {
428#ifdef G4VERBOSE
429 if (verboseLevel>0){
430 G4cout << "G4VUserPhysicsList::SetParticleCuts "
431 <<" : No Default Region " <<G4endl;
432 }
433#endif
434 G4Exception("G4VUserPhysicsList::SetParticleCuts ",
435 "Run0254", FatalException,
436 "No Default Region");
437 return;
438 }
439 region = (*(G4RegionStore::GetInstance()))[0];
440 }
441
442 if ( !isSetDefaultCutValue ){
444 }
445
446 G4ProductionCuts* pcuts = region->GetProductionCuts();
447 pcuts->SetProductionCut(cut,particleName);
448#ifdef G4VERBOSE
449 if (verboseLevel>2){
450 G4cout << "G4VUserPhysicsList::SetParticleCuts: "
451 << " :" << cut/mm << "[mm]"
452 << " for "<< particleName << G4endl;
453 }
454#endif
455}
void SetProductionCut(G4double cut, G4int index=-1)

◆ SetParticleCuts() [2/2]

void G4VUserPhysicsList::SetParticleCuts ( G4double  cut,
G4ParticleDefinition particle,
G4Region region = 0 
)

Definition at line 406 of file G4VUserPhysicsList.cc.

407{
408 SetParticleCuts(cut, particle->GetParticleName(), region);
409}

Referenced by SetCutValue(), and SetParticleCuts().

◆ SetPhysicsTableRetrieved()

void G4VUserPhysicsList::SetPhysicsTableRetrieved ( const G4String directory = "")

Definition at line 756 of file G4VUserPhysicsList.cc.

757{
759 if(!directory.isNull()) {
760 directoryPhysicsTable = directory;
761 }
763 fIsRestoredCutValues = false;
764}
G4bool isNull() const

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ SetStoredInAscii()

void G4VUserPhysicsList::SetStoredInAscii ( )
inline

Definition at line 378 of file G4VUserPhysicsList.hh.

379{
380 fStoredInAscii = true;
381}

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ SetVerboseLevel()

void G4VUserPhysicsList::SetVerboseLevel ( G4int  value)

Definition at line 852 of file G4VUserPhysicsList.cc.

853{
854 verboseLevel = value;
855 // set verboseLevel for G4ProductionCutsTable same as one for G4VUserPhysicsList:
857
859
860#ifdef G4VERBOSE
861 if (verboseLevel >1){
862 G4cout << "G4VUserPhysicsList::SetVerboseLevel :"
863 << " Verbose level is set to " << verboseLevel << G4endl;
864 }
865#endif
866}
void SetVerboseLevel(G4int value)

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ StorePhysicsTable()

G4bool G4VUserPhysicsList::StorePhysicsTable ( const G4String directory = ".")

Definition at line 706 of file G4VUserPhysicsList.cc.

707{
708 G4bool ascii = fStoredInAscii;
709 G4String dir = directory;
710 if (dir.isNull()) dir = directoryPhysicsTable;
711 else directoryPhysicsTable = dir;
712
713 // store CutsTable info
714 if (!fCutsTable->StoreCutsTable(dir, ascii)) {
715 G4Exception("G4VUserPhysicsList::StorePhysicsTable",
716 "Run0281", JustWarning,
717 "Fail to store Cut Table");
718 return false;
719 }
720#ifdef G4VERBOSE
721 if (verboseLevel>2){
722 G4cout << "G4VUserPhysicsList::StorePhysicsTable "
723 << " Store material and cut values successfully" << G4endl;
724 }
725#endif
726
727 G4bool success= true;
728
729 // loop over all particles in G4ParticleTable
731 while( (*theParticleIterator)() ){
733 // Store physics tables for every process for this particle type
734 G4ProcessVector* pVector = (particle->GetProcessManager())->GetProcessList();
735 G4int j;
736 for ( j=0; j < pVector->size(); ++j) {
737 if (!(*pVector)[j]->StorePhysicsTable(particle,dir,ascii)){
738 G4String comment = "Fail to store physics table for ";
739 comment += (*pVector)[j]->GetProcessName();
740 comment += "(" + particle->GetParticleName() + ")";
741 G4Exception("G4VUserPhysicsList::StorePhysicsTable",
742 "Run0282", JustWarning,
743 comment);
744 success = false;
745 }
746 }
747 // end loop over processes
748 }
749 // end loop over particles
750 return success;
751}
@ JustWarning
G4bool StoreCutsTable(const G4String &directory, G4bool ascii=false)

Referenced by G4UserPhysicsListMessenger::SetNewValue().

◆ UseCoupledTransportation()

void G4VUserPhysicsList::UseCoupledTransportation ( G4bool  vl = true)

Definition at line 839 of file G4VUserPhysicsList.cc.

840{
842}
void UseCoupledTransportation(G4bool vl=true)

Referenced by G4RunManagerKernel::InitializePhysics().

Member Data Documentation

◆ defaultCutValue

◆ directoryPhysicsTable

G4String G4VUserPhysicsList::directoryPhysicsTable
protected

◆ fCutsTable

G4ProductionCutsTable* G4VUserPhysicsList::fCutsTable
protected

◆ fDisableCheckParticleList

G4bool G4VUserPhysicsList::fDisableCheckParticleList
protected

◆ fDisplayThreshold

G4int G4VUserPhysicsList::fDisplayThreshold
protected

◆ fIsCheckedForRetrievePhysicsTable

G4bool G4VUserPhysicsList::fIsCheckedForRetrievePhysicsTable
protected

◆ fIsPhysicsTableBuilt

G4bool G4VUserPhysicsList::fIsPhysicsTableBuilt
protected

◆ fIsRestoredCutValues

G4bool G4VUserPhysicsList::fIsRestoredCutValues
protected

◆ fRetrievePhysicsTable

◆ fStoredInAscii

◆ isSetDefaultCutValue

G4bool G4VUserPhysicsList::isSetDefaultCutValue
protected

◆ theMessenger

G4UserPhysicsListMessenger* G4VUserPhysicsList::theMessenger
protected

Definition at line 291 of file G4VUserPhysicsList.hh.

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

◆ theParticleIterator

◆ theParticleTable

G4ParticleTable* G4VUserPhysicsList::theParticleTable
protected

◆ thePLHelper

◆ verboseLevel


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