54 fFastTrack(anEnvelope,IsUnique),fTriggedFastSimulationModel(0),
55 fLastCrossedParticle(0)
63 AddFastSimulationManager(
this);
79 RemoveFastSimulationManager(
this);
92 for (iModel=0; iModel<ModelList.size(); iModel++)
93 if(ModelList[iModel]->GetName() == aName)
98 for (iModel=0; iModel<fInactivatedModels.size(); iModel++)
99 if(fInactivatedModels[iModel]->GetName() == aName) {
101 push_back (fInactivatedModels.
removeAt(iModel));
103 fLastCrossedParticle=0;
114 for (
size_t iModel=0; iModel<ModelList.size(); iModel++)
115 if(ModelList[iModel]->GetName() == aName) {
117 push_back (ModelList.
removeAt(iModel));
119 fLastCrossedParticle=0;
128 bool &foundPrevious)
const
131 for (
size_t iModel=0; iModel<ModelList.size(); iModel++)
133 if(ModelList[iModel]->GetName() == modelName)
135 if (previousFound == 0)
137 model = ModelList[iModel];
142 if (ModelList[iModel] == previousFound)
144 foundPrevious =
true;
149 model = ModelList[iModel];
191 fApplicableModelList.clear();
193 if(ModelList.size()==0)
return false;
194 for (iModel=0; iModel<ModelList.size(); iModel++)
195 if(ModelList[iModel]->IsApplicable(*(track.
GetDefinition())))
196 fApplicableModelList.push_back (ModelList[iModel]);
200 if(fApplicableModelList.size()==0)
return false;
210 for (iModel=0; iModel<fApplicableModelList.size(); iModel++)
216 if(fApplicableModelList[iModel]->ModelTrigger(fFastTrack)) {
227 fTriggedFastSimulationModel=fApplicableModelList[iModel];
240 fTriggedFastSimulationModel->
DoIt(fFastTrack,fFastStep);
256 fApplicableModelList.clear();
258 if(ModelList.size()==0)
return false;
259 for (iModel=0; iModel<ModelList.size(); iModel++)
260 if(ModelList[iModel]->IsApplicable(*(track.
GetDefinition())))
261 fApplicableModelList.push_back (ModelList[iModel]);
265 if(fApplicableModelList.size()==0)
return false;
275 for (iModel=0; iModel < fApplicableModelList.size(); iModel++)
276 if(fApplicableModelList[iModel]->AtRestModelTrigger(fFastTrack))
279 fTriggedFastSimulationModel=fApplicableModelList[iModel];
291 fTriggedFastSimulationModel->
AtRestDoIt(fFastTrack,fFastStep);
301 else G4cout <<
" (// geom.)";
310 G4cout <<
"Current Models for the ";
314 for (iModel=0; iModel<ModelList.size(); iModel++)
315 G4cout <<
" " << ModelList[iModel]->GetName() <<
"\n";
317 for (iModel=0; iModel<fInactivatedModels.size(); iModel++)
318 G4cout <<
" " << fInactivatedModels[iModel]->GetName()
319 <<
"(inactivated)\n";
329 for ( iModel=0; iModel<ModelList.size(); iModel++ )
330 if( ModelList[iModel]->GetName() == modelName || modelName ==
"all" )
334 G4cout <<
"In the envelope ";
338 G4cout <<
" the model " << ModelList[iModel]->GetName()
339 <<
" is applicable for :\n ";
341 G4int list_started=0;
342 for (
G4int iParticle = 0; iParticle<theParticleTable->
entries(); iParticle++)
343 if( ModelList[iModel] -> IsApplicable( *(theParticleTable->
GetParticle(iParticle))) )
345 if(list_started++)
G4cout <<
", ";
346 G4cout << theParticleTable->
353 for (iModel=0; iModel<fInactivatedModels.size(); iModel++)
354 if(fInactivatedModels[iModel]->GetName() == modelName || modelName ==
"all" )
358 G4cout <<
"In the envelope ";
362 G4cout <<
" the model " << fInactivatedModels[iModel]->GetName()
363 <<
" (inactivated) is applicable for :\n ";
365 G4int list_started=0;
366 for (
G4int iParticle=0; iParticle<theParticleTable->
entries(); iParticle++ )
367 if( fInactivatedModels[iModel] -> IsApplicable( *(theParticleTable->
GetParticle(iParticle))) )
369 if(list_started++)
G4cout <<
", ";
370 G4cout << theParticleTable->
383 for ( iModel=0; iModel<ModelList.size(); iModel++ )
384 if ( ModelList[iModel]->IsApplicable(*particleDefinition) )
389 << ModelList[iModel]->GetName()
392 for (
auto jModel = iModel + 1; jModel < ModelList.size(); jModel++ )
393 if ( ModelList[jModel]->IsApplicable(*particleDefinition) ) unique =
false;
397 for ( iModel=0; iModel<fInactivatedModels.size(); iModel++ )
398 if( fInactivatedModels[iModel]->IsApplicable(*particleDefinition) )
403 << fInactivatedModels[iModel]->GetName()
404 <<
" (inactivated)." <<
G4endl;
410 ed <<
"Two or more active Models are available for the same particle type, in the same envelope/region." <<
G4endl;
411 G4Exception(
"G4FastSimulationManager::ListModels(const G4ParticleDefinition* particleDefinition) const",
414 "Models risk to exclude each other.");
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
G4FastSimulationManager(G4Envelope *anEnvelope, G4bool IsUnique=FALSE)
G4VParticleChange * InvokePostStepDoIt()
G4VParticleChange * InvokeAtRestDoIt()
G4bool PostStepGetFastSimulationManagerTrigger(const G4Track &, const G4Navigator *a=0)
G4bool AtRestGetFastSimulationManagerTrigger(const G4Track &, const G4Navigator *a=0)
G4bool ActivateFastSimulationModel(const G4String &)
G4VFastSimulationModel * GetFastSimulationModel(const G4String &modelName, const G4VFastSimulationModel *previousFound, bool &foundPrevious) const
~G4FastSimulationManager()
G4bool InActivateFastSimulationModel(const G4String &)
void Initialize(const G4FastTrack &)
G4Envelope * GetEnvelope() const
G4bool OnTheBoundaryButExiting() const
void SetCurrentTrack(const G4Track &, const G4Navigator *a=0)
static G4GlobalFastSimulationManager * GetGlobalFastSimulationManager()
G4VPhysicalVolume * GetWorldVolume() const
G4ParticleDefinition * GetParticle(G4int index) const
static G4ParticleTable * GetParticleTable()
const G4String & GetParticleName(G4int index) const
G4FastSimulationManager * GetFastSimulationManager() const
G4VPhysicalVolume * GetWorldPhysical() const
const G4String & GetName() const
void SetFastSimulationManager(G4FastSimulationManager *fsm)
void ClearFastSimulationManager()
G4ParticleDefinition * GetDefinition() const
static G4TransportationManager * GetTransportationManager()
G4Navigator * GetNavigatorForTracking() const
virtual void DoIt(const G4FastTrack &, G4FastStep &)=0
virtual void AtRestDoIt(const G4FastTrack &, G4FastStep &)