Geant4-11
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes
G4FastSimulationPhysics Class Reference

#include <G4FastSimulationPhysics.hh>

Inheritance diagram for G4FastSimulationPhysics:
G4VPhysicsConstructor

Public Member Functions

void ActivateFastSimulation (const G4String particleName, const G4String parallelGeometryName="")
 
void BeVerbose ()
 
virtual void ConstructParticle ()
 
virtual void ConstructProcess ()
 
 G4FastSimulationPhysics (const G4String &name="FastSimP")
 
G4int GetInstanceID () const
 
const G4StringGetPhysicsName () const
 
G4int GetPhysicsType () const
 
G4int GetVerboseLevel () const
 
void SetPhysicsName (const G4String &="")
 
void SetPhysicsType (G4int)
 
void SetVerboseLevel (G4int value)
 
virtual void TerminateWorker ()
 
virtual ~G4FastSimulationPhysics ()
 

Static Public Member Functions

static const G4VPCManagerGetSubInstanceManager ()
 

Protected Types

using PhysicsBuilder_V = G4VPCData::PhysicsBuilders_V
 

Protected Member Functions

void AddBuilder (G4PhysicsBuilderInterface *bld)
 
PhysicsBuilder_V GetBuilders () const
 
G4ParticleTable::G4PTblDicIteratorGetParticleIterator () const
 
G4bool RegisterProcess (G4VProcess *process, G4ParticleDefinition *particle)
 

Protected Attributes

G4int g4vpcInstanceID = 0
 
G4String namePhysics = ""
 
G4ParticleTabletheParticleTable = nullptr
 
G4int typePhysics = 0
 
G4int verboseLevel = 0
 

Static Protected Attributes

static G4RUN_DLL G4VPCManager subInstanceManager
 

Private Member Functions

 G4FastSimulationPhysics (const G4FastSimulationPhysics &)
 
G4FastSimulationPhysicsoperator= (const G4FastSimulationPhysics &right)
 

Private Attributes

std::vector< G4StringfGeometries
 
std::vector< G4StringfParticlesUnderFastSimulation
 
G4bool fVerbose
 

Detailed Description

Definition at line 41 of file G4FastSimulationPhysics.hh.

Member Typedef Documentation

◆ PhysicsBuilder_V

Definition at line 149 of file G4VPhysicsConstructor.hh.

Constructor & Destructor Documentation

◆ G4FastSimulationPhysics() [1/2]

G4FastSimulationPhysics::G4FastSimulationPhysics ( const G4String name = "FastSimP")

Definition at line 54 of file G4FastSimulationPhysics.cc.

56 fVerbose(false)
57{;}
G4VPhysicsConstructor(const G4String &="")
const char * name(G4int ptype)

◆ ~G4FastSimulationPhysics()

G4FastSimulationPhysics::~G4FastSimulationPhysics ( )
virtual

Definition at line 61 of file G4FastSimulationPhysics.cc.

62{;}

◆ G4FastSimulationPhysics() [2/2]

G4FastSimulationPhysics::G4FastSimulationPhysics ( const G4FastSimulationPhysics )
private

Member Function Documentation

◆ ActivateFastSimulation()

void G4FastSimulationPhysics::ActivateFastSimulation ( const G4String  particleName,
const G4String  parallelGeometryName = "" 
)

Definition at line 66 of file G4FastSimulationPhysics.cc.

67{
68 fParticlesUnderFastSimulation.push_back(particleName);
69 fGeometries .push_back(parallelGeometryName);
70}
std::vector< G4String > fGeometries
std::vector< G4String > fParticlesUnderFastSimulation

References fGeometries, and fParticlesUnderFastSimulation.

◆ AddBuilder()

void G4VPhysicsConstructor::AddBuilder ( G4PhysicsBuilderInterface bld)
protectedinherited

Definition at line 99 of file G4VPhysicsConstructor.cc.

100{
101 (subInstanceManager.offset[g4vpcInstanceID])._builders->push_back(bld);
102}
static G4RUN_DLL G4VPCManager subInstanceManager
G4RUN_DLL G4ThreadLocalStatic T * offset

References G4VPhysicsConstructor::g4vpcInstanceID, G4VUPLSplitter< T >::offset, and G4VPhysicsConstructor::subInstanceManager.

Referenced by G4HadronPhysicsFTFP_BERT::Kaon(), G4HadronPhysicsFTF_BIC::Kaon(), G4HadronPhysicsINCLXX::Kaon(), G4HadronPhysicsFTFP_BERT::Neutron(), G4HadronPhysicsQGSP_BERT::Neutron(), G4HadronPhysicsQGSP_BIC::Neutron(), G4HadronPhysicsFTF_BIC::Neutron(), G4HadronPhysicsFTFP_BERT_HP::Neutron(), G4HadronPhysicsINCLXX::Neutron(), G4HadronPhysicsQGS_BIC::Neutron(), G4HadronPhysicsQGSP_BERT_HP::Neutron(), G4HadronPhysicsQGSP_BIC_HP::Neutron(), G4HadronPhysicsShielding::Neutron(), G4HadronPhysicsFTFP_BERT::Pion(), G4HadronPhysicsQGSP_BERT::Pion(), G4HadronPhysicsQGSP_BIC::Pion(), G4HadronPhysicsFTF_BIC::Pion(), G4HadronPhysicsINCLXX::Pion(), G4HadronPhysicsQGS_BIC::Pion(), G4HadronPhysicsFTFP_BERT::Proton(), G4HadronPhysicsQGSP_BERT::Proton(), G4HadronPhysicsQGSP_BIC::Proton(), G4HadronPhysicsFTF_BIC::Proton(), G4HadronPhysicsINCLXX::Proton(), G4HadronPhysicsNuBeam::Proton(), G4HadronPhysicsQGS_BIC::Proton(), and G4HadronPhysicsQGSP_BIC_AllHP::Proton().

◆ BeVerbose()

void G4FastSimulationPhysics::BeVerbose ( )
inline

Definition at line 58 of file G4FastSimulationPhysics.hh.

58{ fVerbose = true; }

References fVerbose.

◆ ConstructParticle()

void G4FastSimulationPhysics::ConstructParticle ( )
virtual

Implements G4VPhysicsConstructor.

Definition at line 74 of file G4FastSimulationPhysics.cc.

75{;}

◆ ConstructProcess()

void G4FastSimulationPhysics::ConstructProcess ( )
virtual

Implements G4VPhysicsConstructor.

Definition at line 79 of file G4FastSimulationPhysics.cc.

80{
81
82 auto myParticleIterator = GetParticleIterator();
83 myParticleIterator->reset();
84
85 while ( (*myParticleIterator)() )
86 {
87 G4ParticleDefinition* particle = myParticleIterator->value();
88 G4String particleName = particle->GetParticleName();
89 G4ProcessManager* pmanager = particle->GetProcessManager();
90
91 // -- include fast simulation manager process interface:
92 auto itr = std::find( fParticlesUnderFastSimulation.begin(),
94 particleName );
95
96 if ( itr != fParticlesUnderFastSimulation.end() )
97 {
98 size_t ipos = itr - fParticlesUnderFastSimulation.begin();
99 G4String geometry = fGeometries[ipos];
100 if ( geometry == "" ) G4FastSimulationHelper::ActivateFastSimulation(pmanager);
101 else G4FastSimulationHelper::ActivateFastSimulation(pmanager, geometry);
102 }
103 }
104
105 // -- tells what is done:
106 if ( fVerbose )
107 {
108 // -- print:
109 myParticleIterator->reset();
110
111 while ( (*myParticleIterator)() )
112 {
113 G4ParticleDefinition* particle = myParticleIterator->value();
114 G4String particleName = particle->GetParticleName();
115 G4ProcessManager* pmanager = particle->GetProcessManager();
116
117 G4bool isUnderFastSimulation(false);
118 G4String processAndGeometryNames;
119 G4int icount(0);
120
121 G4ProcessVector* vprocess = pmanager->GetProcessList();
122 for (size_t ip = 0 ; ip < vprocess->size() ; ++ip)
123 {
124 G4VProcess* process = (*vprocess)[ip];
126 if ( pb != nullptr )
127 {
128 isUnderFastSimulation = true;
129 if ( icount < 3 )
130 {
131 processAndGeometryNames += pb->GetProcessName();
132 processAndGeometryNames += "[geom:";
133 processAndGeometryNames += pb->GetWorldVolume()->GetName();
134 processAndGeometryNames += "] ";
135 }
136 else
137 {
138 processAndGeometryNames += "\n ";
139 processAndGeometryNames += pb->GetProcessName();
140 processAndGeometryNames += "[geom:";
141 processAndGeometryNames += pb->GetWorldVolume()->GetName();
142 processAndGeometryNames += "] ";
143 icount = 0;
144 }
145 }
146 }
147 if ( isUnderFastSimulation ) G4cout << std::setw(14) << particleName << " : " << processAndGeometryNames << G4endl;
148 }
149 }
150}
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
static void ActivateFastSimulation(G4ProcessManager *pmanager, G4String parallelGeometryName="")
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4ProcessVector * GetProcessList() const
std::size_t size() const
const G4String & GetName() const
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:382

References G4FastSimulationHelper::ActivateFastSimulation(), fGeometries, fParticlesUnderFastSimulation, fVerbose, G4cout, G4endl, G4VPhysicalVolume::GetName(), G4VPhysicsConstructor::GetParticleIterator(), G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetProcessList(), G4ParticleDefinition::GetProcessManager(), G4VProcess::GetProcessName(), G4FastSimulationManagerProcess::GetWorldVolume(), and G4ProcessVector::size().

◆ GetBuilders()

G4VPhysicsConstructor::PhysicsBuilder_V G4VPhysicsConstructor::GetBuilders ( ) const
protectedinherited

Definition at line 86 of file G4VPhysicsConstructor.cc.

87{
88 const auto& tls = *((subInstanceManager.offset[g4vpcInstanceID])._builders);
89 PhysicsBuilder_V copy(tls.size());
90 G4int i = 0;
91 for(const auto& el : tls)
92 {
93 copy[i++] = el;
94 }
95 return copy;
96}
G4VPCData::PhysicsBuilders_V PhysicsBuilder_V
void copy(G4double dst[], const G4double src[], size_t size=G4FieldTrack::ncompSVEC)
Definition: G4FieldUtils.cc:98

References field_utils::copy(), G4VPhysicsConstructor::g4vpcInstanceID, G4VUPLSplitter< T >::offset, and G4VPhysicsConstructor::subInstanceManager.

◆ GetInstanceID()

G4int G4VPhysicsConstructor::GetInstanceID ( ) const
inlineinherited

◆ GetParticleIterator()

G4ParticleTable::G4PTblDicIterator * G4VPhysicsConstructor::GetParticleIterator ( ) const
protectedinherited

◆ GetPhysicsName()

const G4String & G4VPhysicsConstructor::GetPhysicsName ( ) const
inlineinherited

Definition at line 191 of file G4VPhysicsConstructor.hh.

192{
193 return namePhysics;
194}

References G4VPhysicsConstructor::namePhysics.

Referenced by G4EmDNAPhysics_option1::ConstructProcess(), G4EmDNAPhysics_option2::ConstructProcess(), G4EmDNAPhysics_option3::ConstructProcess(), G4EmDNAPhysics_option4::ConstructProcess(), G4EmDNAPhysics_option5::ConstructProcess(), G4EmDNAPhysics_option6::ConstructProcess(), G4EmDNAPhysics_option7::ConstructProcess(), G4EmDNAPhysics_option8::ConstructProcess(), G4EmDNAPhysics_stationary_option2::ConstructProcess(), G4EmDNAPhysics_stationary_option4::ConstructProcess(), G4EmDNAPhysics_stationary_option6::ConstructProcess(), G4EmDNAPhysics::ConstructProcess(), G4EmDNAPhysics_stationary::ConstructProcess(), G4EmLivermorePhysics::ConstructProcess(), G4EmLowEPPhysics::ConstructProcess(), G4EmPenelopePhysics::ConstructProcess(), G4EmStandardPhysics::ConstructProcess(), G4EmStandardPhysics_option1::ConstructProcess(), G4EmStandardPhysics_option2::ConstructProcess(), G4EmStandardPhysics_option3::ConstructProcess(), G4EmStandardPhysics_option4::ConstructProcess(), G4EmStandardPhysicsGS::ConstructProcess(), G4EmStandardPhysicsSS::ConstructProcess(), G4EmStandardPhysicsWVI::ConstructProcess(), G4ThermalNeutrons::ConstructProcess(), G4HadronPhysicsFTFP_BERT::DumpBanner(), G4HadronPhysicsQGSP_BERT::DumpBanner(), export_G4VPhysicsConstructor(), G4HadronDElasticPhysics::G4HadronDElasticPhysics(), G4HadronElasticPhysics::G4HadronElasticPhysics(), G4HadronElasticPhysicsHP::G4HadronElasticPhysicsHP(), G4HadronElasticPhysicsLEND::G4HadronElasticPhysicsLEND(), G4HadronElasticPhysicsPHP::G4HadronElasticPhysicsPHP(), G4HadronElasticPhysicsXS::G4HadronElasticPhysicsXS(), G4HadronHElasticPhysics::G4HadronHElasticPhysics(), G4IonElasticPhysics::G4IonElasticPhysics(), G4VModularPhysicsList::RegisterPhysics(), and G4VModularPhysicsList::ReplacePhysics().

◆ GetPhysicsType()

G4int G4VPhysicsConstructor::GetPhysicsType ( ) const
inlineinherited

◆ GetSubInstanceManager()

const G4VPCManager & G4VPhysicsConstructor::GetSubInstanceManager ( )
inlinestaticinherited

◆ GetVerboseLevel()

G4int G4VPhysicsConstructor::GetVerboseLevel ( ) const
inlineinherited

◆ operator=()

G4FastSimulationPhysics & G4FastSimulationPhysics::operator= ( const G4FastSimulationPhysics right)
private

◆ RegisterProcess()

G4bool G4VPhysicsConstructor::RegisterProcess ( G4VProcess process,
G4ParticleDefinition particle 
)
inlineprotectedinherited

◆ SetPhysicsName()

void G4VPhysicsConstructor::SetPhysicsName ( const G4String name = "")
inlineinherited

◆ SetPhysicsType()

void G4VPhysicsConstructor::SetPhysicsType ( G4int  val)
inlineinherited

Definition at line 196 of file G4VPhysicsConstructor.hh.

197{
198 if(val > 0) { typePhysics = val; }
199}

References G4VPhysicsConstructor::typePhysics.

Referenced by G4DecayPhysics::G4DecayPhysics(), G4EmDNAPhysics::G4EmDNAPhysics(), G4EmDNAPhysics_option1::G4EmDNAPhysics_option1(), G4EmDNAPhysics_option2::G4EmDNAPhysics_option2(), G4EmDNAPhysics_option3::G4EmDNAPhysics_option3(), G4EmDNAPhysics_option4::G4EmDNAPhysics_option4(), G4EmDNAPhysics_option5::G4EmDNAPhysics_option5(), G4EmDNAPhysics_option6::G4EmDNAPhysics_option6(), G4EmDNAPhysics_option7::G4EmDNAPhysics_option7(), G4EmDNAPhysics_option8::G4EmDNAPhysics_option8(), G4EmDNAPhysics_stationary_option2::G4EmDNAPhysics_stationary_option2(), G4EmDNAPhysics_stationary_option4::G4EmDNAPhysics_stationary_option4(), G4EmDNAPhysics_stationary_option6::G4EmDNAPhysics_stationary_option6(), G4EmExtraPhysics::G4EmExtraPhysics(), G4EmLivermorePhysics::G4EmLivermorePhysics(), G4EmLowEPPhysics::G4EmLowEPPhysics(), G4EmPenelopePhysics::G4EmPenelopePhysics(), G4EmStandardPhysics::G4EmStandardPhysics(), G4EmStandardPhysics_option1::G4EmStandardPhysics_option1(), G4EmStandardPhysics_option2::G4EmStandardPhysics_option2(), G4EmStandardPhysics_option3::G4EmStandardPhysics_option3(), G4EmStandardPhysics_option4::G4EmStandardPhysics_option4(), G4EmStandardPhysicsGS::G4EmStandardPhysicsGS(), G4EmStandardPhysicsSS::G4EmStandardPhysicsSS(), G4EmStandardPhysicsWVI::G4EmStandardPhysicsWVI(), G4HadronElasticPhysics::G4HadronElasticPhysics(), G4HadronInelasticQBBC::G4HadronInelasticQBBC(), G4HadronPhysicsFTFP_BERT::G4HadronPhysicsFTFP_BERT(), G4HadronPhysicsQGSP_BERT::G4HadronPhysicsQGSP_BERT(), G4HadronPhysicsQGSP_BIC::G4HadronPhysicsQGSP_BIC(), G4IonINCLXXPhysics::G4IonINCLXXPhysics(), G4IonPhysics::G4IonPhysics(), G4IonPhysicsPHP::G4IonPhysicsPHP(), G4IonQMDPhysics::G4IonQMDPhysics(), G4NeutronTrackingCut::G4NeutronTrackingCut(), G4StepLimiterPhysics::G4StepLimiterPhysics(), G4StoppingPhysics::G4StoppingPhysics(), and G4StoppingPhysicsFritiofWithBinaryCascade::G4StoppingPhysicsFritiofWithBinaryCascade().

◆ SetVerboseLevel()

void G4VPhysicsConstructor::SetVerboseLevel ( G4int  value)
inlineinherited

◆ TerminateWorker()

void G4VPhysicsConstructor::TerminateWorker ( )
virtualinherited

Definition at line 105 of file G4VPhysicsConstructor.cc.

106{
107 if(subInstanceManager.offset[g4vpcInstanceID]._builders != nullptr)
108 {
109 std::for_each(subInstanceManager.offset[g4vpcInstanceID]._builders->begin(),
110 subInstanceManager.offset[g4vpcInstanceID]._builders->end(),
111 [](PhysicsBuilder_V::value_type bld) { delete bld; });
112 subInstanceManager.offset[g4vpcInstanceID]._builders->clear();
113 }
114}

References G4VPhysicsConstructor::g4vpcInstanceID, G4VUPLSplitter< T >::offset, and G4VPhysicsConstructor::subInstanceManager.

Referenced by G4VPhysicsConstructor::~G4VPhysicsConstructor().

Field Documentation

◆ fGeometries

std::vector< G4String > G4FastSimulationPhysics::fGeometries
private

Definition at line 79 of file G4FastSimulationPhysics.hh.

Referenced by ActivateFastSimulation(), and ConstructProcess().

◆ fParticlesUnderFastSimulation

std::vector< G4String > G4FastSimulationPhysics::fParticlesUnderFastSimulation
private

Definition at line 77 of file G4FastSimulationPhysics.hh.

Referenced by ActivateFastSimulation(), and ConstructProcess().

◆ fVerbose

G4bool G4FastSimulationPhysics::fVerbose
private

Definition at line 82 of file G4FastSimulationPhysics.hh.

Referenced by BeVerbose(), and ConstructProcess().

◆ g4vpcInstanceID

G4int G4VPhysicsConstructor::g4vpcInstanceID = 0
protectedinherited

◆ namePhysics

G4String G4VPhysicsConstructor::namePhysics = ""
protectedinherited

◆ subInstanceManager

G4VPCManager G4VPhysicsConstructor::subInstanceManager
staticprotectedinherited

◆ theParticleTable

G4ParticleTable* G4VPhysicsConstructor::theParticleTable = nullptr
protectedinherited

◆ typePhysics

G4int G4VPhysicsConstructor::typePhysics = 0
protectedinherited

◆ verboseLevel

G4int G4VPhysicsConstructor::verboseLevel = 0
protectedinherited

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