Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ImportanceConfigurator Class Reference

#include <G4ImportanceConfigurator.hh>

+ Inheritance diagram for G4ImportanceConfigurator:

Public Member Functions

 G4ImportanceConfigurator (const G4VPhysicalVolume *worldvolume, const G4String &particlename, G4VIStore &istore, const G4VImportanceAlgorithm *ialg, G4bool paraflag)
 
 G4ImportanceConfigurator (const G4String &worldvolumeName, const G4String &particlename, G4VIStore &istore, const G4VImportanceAlgorithm *ialg, G4bool paraflag)
 
virtual ~G4ImportanceConfigurator ()
 
virtual void Configure (G4VSamplerConfigurator *preConf)
 
virtual const G4VTrackTerminatorGetTrackTerminator () const
 
void SetWorldName (const G4String &Name)
 
- Public Member Functions inherited from G4VSamplerConfigurator
 G4VSamplerConfigurator ()
 
virtual ~G4VSamplerConfigurator ()
 
virtual void Configure (G4VSamplerConfigurator *preConf)=0
 
virtual const G4VTrackTerminatorGetTrackTerminator () const =0
 

Detailed Description

Definition at line 51 of file G4ImportanceConfigurator.hh.

Constructor & Destructor Documentation

◆ G4ImportanceConfigurator() [1/2]

G4ImportanceConfigurator::G4ImportanceConfigurator ( const G4VPhysicalVolume worldvolume,
const G4String particlename,
G4VIStore istore,
const G4VImportanceAlgorithm ialg,
G4bool  paraflag 
)

Definition at line 49 of file G4ImportanceConfigurator.cc.

54 : fWorld(worldvolume),
55 fWorldName(worldvolume->GetName()),
56 fPlacer(particlename),
57 fIStore(istore),
58 fDeleteIalg( ( ! ialg) ),
59 fIalgorithm(( (fDeleteIalg) ?
60 new G4ImportanceAlgorithm : ialg)),
61 fImportanceProcess(0),
62 paraflag(para)
63{;}
const G4String & GetName() const

◆ G4ImportanceConfigurator() [2/2]

G4ImportanceConfigurator::G4ImportanceConfigurator ( const G4String worldvolumeName,
const G4String particlename,
G4VIStore istore,
const G4VImportanceAlgorithm ialg,
G4bool  paraflag 
)

Definition at line 65 of file G4ImportanceConfigurator.cc.

70: fWorldName(worldvolumeName),
71 fPlacer(particlename),
72 fIStore(istore),
73 fDeleteIalg( ( ! ialg) ),
74 fIalgorithm(( (fDeleteIalg) ?
75 new G4ImportanceAlgorithm : ialg)),
76 fImportanceProcess(0),
77 paraflag(para)
78{
81}
G4VPhysicalVolume * GetWorldVolume() const
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() const

◆ ~G4ImportanceConfigurator()

G4ImportanceConfigurator::~G4ImportanceConfigurator ( )
virtual

Definition at line 83 of file G4ImportanceConfigurator.cc.

84{
85 if (fImportanceProcess)
86 {
87 fPlacer.RemoveProcess(fImportanceProcess);
88 delete fImportanceProcess;
89 }
90 if (fDeleteIalg)
91 {
92 delete fIalgorithm;
93 }
94}
virtual void RemoveProcess(G4VProcess *process)

Member Function Documentation

◆ Configure()

void G4ImportanceConfigurator::Configure ( G4VSamplerConfigurator preConf)
virtual

Implements G4VSamplerConfigurator.

Definition at line 97 of file G4ImportanceConfigurator.cc.

98{
99 G4cout << "G4ImportanceConfigurator:: entering importance configure, paraflag " << paraflag << G4endl;
100 const G4VTrackTerminator *terminator = 0;
101 if (preConf)
102 {
103 terminator = preConf->GetTrackTerminator();
104 };
105
106
107#ifdef G4MULTITHREADED
108 G4AutoLock l(&BiasConfigMutex);
109#endif
110 fImportanceProcess =
111 new G4ImportanceProcess(*fIalgorithm,
112 fIStore,
113 terminator,"ImportanceProcess",paraflag);
114
115 if (!fImportanceProcess)
116 {
117 G4Exception("G4ImportanceConfigurator::Configure()",
118 "FatalError", FatalException,
119 "Failed allocation of G4ImportanceProcess !");
120 }
121
122 // G4cout << "G4ImportanceConfigurator:: setting parallel World " << paraflag << G4endl;
123 if(paraflag) fImportanceProcess->SetParallelWorld(fWorld->GetName());
124#ifdef G4MULTITHREADED
125 l.unlock();
126// G4MUTEXUNLOCK(&G4ImportanceConfigurator::BiasConfigMutex);
127#endif
128 // if(paraflag) fImportanceProcess->SetParallelWorld(fWorldName);
129 // G4cout << "G4ImportanceConfigurator:: set " << paraflag << " name: " << fWorld->GetName() << G4endl;
130 // getchar();
131 fPlacer.AddProcessAsSecondDoIt(fImportanceProcess);
132}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void SetParallelWorld(const G4String &parallelWorldName)
virtual void AddProcessAsSecondDoIt(G4VProcess *process)
virtual const G4VTrackTerminator * GetTrackTerminator() const =0

◆ GetTrackTerminator()

const G4VTrackTerminator * G4ImportanceConfigurator::GetTrackTerminator ( ) const
virtual

Implements G4VSamplerConfigurator.

Definition at line 134 of file G4ImportanceConfigurator.cc.

136{
137 return fImportanceProcess;
138}

◆ SetWorldName()

void G4ImportanceConfigurator::SetWorldName ( const G4String Name)

Definition at line 140 of file G4ImportanceConfigurator.cc.

141{
142 G4cout << " G4ImportanceConfigurator:: setting world name: " << name << G4endl;
143 fWorldName = name;
144}
const char * name(G4int ptype)

Referenced by G4GeometrySampler::PrepareImportanceSampling().


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