53 : fFastTrack(anEnvelope, IsUnique)
88 for (iModel = 0; iModel < (
G4int)ModelList.size(); ++iModel)
89 if (ModelList[iModel]->GetName() == aName)
return true;
93 for (iModel = 0; iModel < (
G4int)fInactivatedModels.size(); ++iModel)
94 if (fInactivatedModels[iModel]->GetName() == aName) {
95 ModelList.push_back(fInactivatedModels.
removeAt(iModel));
97 fLastCrossedParticle =
nullptr;
107 for (
G4int iModel = 0; iModel < (
G4int)ModelList.size(); ++iModel)
108 if (ModelList[iModel]->GetName() == aName) {
109 fInactivatedModels.push_back(ModelList.
removeAt(iModel));
111 fLastCrossedParticle =
nullptr;
120 G4bool& foundPrevious)
const
123 for (
auto iModel : ModelList) {
124 if (iModel->GetName() == modelName) {
125 if (previousFound ==
nullptr) {
129 if (iModel == previousFound) {
130 foundPrevious =
true;
144 for (
auto& iModel : ModelList) {
178 fApplicableModelList.clear();
180 if (ModelList.empty())
return false;
182 for (
auto iModel : ModelList) {
184 fApplicableModelList.push_back(iModel);
190 if (fApplicableModelList.empty())
return false;
200 for (
auto iModel : fApplicableModelList)
205 if (iModel->ModelTrigger(fFastTrack)) {
216 fTriggedFastSimulationModel = iModel;
228 fTriggedFastSimulationModel->
DoIt(fFastTrack, fFastStep);
242 fApplicableModelList.clear();
244 if (ModelList.empty())
return false;
246 for (
auto iModel : ModelList) {
248 fApplicableModelList.push_back(iModel);
254 if (fApplicableModelList.empty())
return false;
264 for (
auto iModel : fApplicableModelList) {
265 if (iModel->AtRestModelTrigger(fFastTrack)) {
267 fTriggedFastSimulationModel = iModel;
279 fTriggedFastSimulationModel->
AtRestDoIt(fFastTrack, fFastStep);
290 G4cout <<
" (mass geom.)";
297 G4cout <<
"Current Models for the ";
301 for (
auto iModel : ModelList)
302 G4cout <<
" " << iModel->GetName() <<
"\n";
304 for (
auto iModel : fInactivatedModels)
305 G4cout <<
" " << iModel->GetName() <<
"(inactivated)\n";
315 for (iModel = 0; iModel < ModelList.size(); ++iModel)
316 if (ModelList[iModel]->GetName() == modelName || modelName ==
"all") {
317 if ((titled++) == 0) {
318 G4cout <<
"In the envelope ";
322 G4cout <<
" the model " << ModelList[iModel]->GetName() <<
" is applicable for :\n ";
324 G4int list_started = 0;
325 for (
G4int iParticle = 0; iParticle < theParticleTable->
entries(); iParticle++)
326 if (ModelList[iModel]->IsApplicable(*(theParticleTable->
GetParticle(iParticle)))) {
327 if ((list_started++) != 0)
G4cout <<
", ";
334 for (iModel = 0; iModel < fInactivatedModels.size(); ++iModel)
335 if (fInactivatedModels[iModel]->GetName() == modelName || modelName ==
"all") {
336 if ((titled++) == 0) {
337 G4cout <<
"In the envelope ";
341 G4cout <<
" the model " << fInactivatedModels[iModel]->GetName()
342 <<
" (inactivated) is applicable for :\n ";
344 G4int list_started = 0;
345 for (
G4int iParticle = 0; iParticle < theParticleTable->
entries(); iParticle++)
346 if (fInactivatedModels[iModel]->IsApplicable(*(theParticleTable->
GetParticle(iParticle)))) {
347 if ((list_started++) != 0)
G4cout <<
", ";
360 for (iModel = 0; iModel < ModelList.size(); ++iModel)
361 if (ModelList[iModel]->IsApplicable(*particleDefinition)) {
364 G4cout <<
", Model " << ModelList[iModel]->GetName() <<
"." <<
G4endl;
366 for (
auto jModel = iModel + 1; jModel < ModelList.size(); jModel++)
367 if (ModelList[jModel]->IsApplicable(*particleDefinition)) unique =
false;
371 for (iModel = 0; iModel < fInactivatedModels.size(); ++iModel)
372 if (fInactivatedModels[iModel]->IsApplicable(*particleDefinition)) {
375 G4cout <<
", Model " << fInactivatedModels[iModel]->GetName() <<
" (inactivated)." <<
G4endl;
380 ed <<
"Two or more active Models are available for the same particle type, in the same "
384 "G4FastSimulationManager::ListModels(const G4ParticleDefinition* particleDefinition) const",
385 "FastSim001",
JustWarning, ed,
"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=nullptr)
G4bool ActivateFastSimulationModel(const G4String &)
G4bool AtRestGetFastSimulationManagerTrigger(const G4Track &, const G4Navigator *a=nullptr)
~G4FastSimulationManager()
G4bool InActivateFastSimulationModel(const G4String &)
G4VFastSimulationModel * GetFastSimulationModel(const G4String &modelName, const G4VFastSimulationModel *previousFound, G4bool &foundPrevious) const
void Initialize(const G4FastTrack &)
G4Envelope * GetEnvelope() const
void SetCurrentTrack(const G4Track &, const G4Navigator *a=nullptr)
G4bool OnTheBoundaryButExiting() const
void RemoveFastSimulationManager(G4FastSimulationManager *)
static G4GlobalFastSimulationManager * GetGlobalFastSimulationManager()
void AddFastSimulationManager(G4FastSimulationManager *)
G4VPhysicalVolume * GetWorldVolume() const
const G4String & GetParticleName() const
G4ParticleDefinition * GetParticle(G4int index) const
static G4ParticleTable * GetParticleTable()
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 &)