ATLAS Offline Software
Loading...
Searching...
No Matches
FastSimulationConstructorTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5// class header
7
8// G4 headers
9#include "G4FastSimulationManagerProcess.hh"
10#include "G4ParticleDefinition.hh"
11#include "G4ProcessManager.hh"
12
13//=============================================================================
14// Standard constructor, initializes variables
15//=============================================================================
17 const std::string& type, const std::string& name, const IInterface* parent)
18 : base_class(type, name, parent) {
19 m_physicsOptionType = G4AtlasPhysicsOption::Type::UnknownType;
20}
21
22//=============================================================================
23// Initialize
24//=============================================================================
26 ATH_MSG_VERBOSE("FastSimulationConstructorTool initialize( )");
27
28 return StatusCode::SUCCESS;
29}
30
32 return std::make_unique<FastSimulationConstructorTool::PhysicsConstructor>(
33 m_initializeFastSimulation, name(), this->msgLevel());
34}
35
36//=============================================================================
37// Physics Constructor implementation
38//=============================================================================
39
41 bool initializeFastSimulation, const std::string& name, MSG::Level level)
42 : IPhysicsContructor(name, level), m_initializeFastSimulation(initializeFastSimulation) {}
43
45
47
49 ATH_MSG_INFO("Fast simulation initialization flag is set to false. Skipping fast simulation setup.");
50 return;
51 }
52
53 ATH_MSG_INFO("ConstructProcess for FastSimulation being run");
54 // Enable fast simulation processes for all particle types
55 G4FastSimulationManagerProcess* fastSimManagerProcess =
56 new G4FastSimulationManagerProcess;
57 G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
58 G4ParticleTable::G4PTblDicIterator* theParticleIterator =
59 theParticleTable->GetIterator();
60
61 theParticleIterator->reset();
62 while ((*theParticleIterator)()) {
63 G4ParticleDefinition* particle = theParticleIterator->value();
64 G4ProcessManager* pmanager = particle->GetProcessManager();
65 // TOD: magic numbers?
66 pmanager->AddProcess(fastSimManagerProcess, -1, 1, 1);
67 }
68}
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
PhysicsConstructor(bool initializeFastSimulation, const std::string &name, MSG::Level level)
FastSimulationConstructorTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Gaudi::Property< bool > m_initializeFastSimulation
UPPhysicsConstructor GetPhysicsOption() override
virtual StatusCode initialize() override
Initialize method.
IPhysicsContructor(const std::string &name, MSG::Level level)
Standard constructor.