ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
G4AtlasDetectorConstructionTool Class Referencefinal

#include "G4AtlasTools/G4AtlasDetectorConstructionTool.h"

Inheritance diagram for G4AtlasDetectorConstructionTool:
Collaboration diagram for G4AtlasDetectorConstructionTool:

Public Member Functions

 G4AtlasDetectorConstructionTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard constructor. More...
 
 ~G4AtlasDetectorConstructionTool ()=default
 Destructor. More...
 
virtual StatusCode initialize () override final
 Initialize method. More...
 
virtual G4VUserDetectorConstruction * GetDetectorConstruction () override final
 implements the following IDetectorConstructionTool methods More...
 
virtual std::vector< std::string > & GetParallelWorldNames () override final
 
virtual G4VPhysicalVolume * Construct () override final
 Implements the following G4VUserDetectorConstruction methods. More...
 
virtual void ConstructSDandField () override final
 

Private Attributes

ToolHandle< IDetectorGeometryToolm_detTool {this, "World", "", "Tool handle of the top-of-the-tree detector geometry tool"}
 
ToolHandleArray< IRegionCreatorm_regionCreators {this, "RegionCreators", {}, "Tools to define G4 physics regions"}
 
ToolHandleArray< IParallelWorldToolm_parallelWorlds {this, "ParallelWorlds", {} , "Tools to define G4 parallel worlds"}
 
ToolHandleArray< IG4GeometryConfigurationToolm_configurationTools {this, "GeometryConfigurationTools", {}, "Tools for geometry configuration"}
 
PublicToolHandle< ISensitiveDetectorMasterToolm_senDetTool {this, "SenDetMasterTool", "SensitiveDetectorMasterTool", ""}
 
ToolHandleArray< IFieldManagerToolm_fieldManagers {this, "FieldManagers", {}, "field managers used"}
 
PublicToolHandle< IG4CaloTransportToolm_G4CaloTransportTool {this, "G4CaloTransportTool", "", "Tool handle of the Geant4 transport tool for the FastCaloSim in Geant4 implementation"}
 
Gaudi::Property< bool > m_activateParallelWorlds {this, "ActivateParallelWorlds", false, "Toggle on/off the G4 parallel geometry system"}
 
std::vector< std::string > m_parallelWorldNames {}
 

Detailed Description

Tool for the concrete implementation of a G4Atlas-based detector construction

Author
Andrea Dell'Acqua
Date
2015-03-06

Definition at line 33 of file G4AtlasDetectorConstructionTool.h.

Constructor & Destructor Documentation

◆ G4AtlasDetectorConstructionTool()

G4AtlasDetectorConstructionTool::G4AtlasDetectorConstructionTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Standard constructor.

Definition at line 20 of file G4AtlasDetectorConstructionTool.cxx.

22  : base_class( type, nam , parent )
23 {
24 }

◆ ~G4AtlasDetectorConstructionTool()

G4AtlasDetectorConstructionTool::~G4AtlasDetectorConstructionTool ( )
default

Destructor.

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * G4AtlasDetectorConstructionTool::Construct ( )
finaloverridevirtual

Implements the following G4VUserDetectorConstruction methods.

Definition at line 75 of file G4AtlasDetectorConstructionTool.cxx.

76 {
77  ATH_MSG_DEBUG( "Detectors " << m_detTool.name() <<" being set as World" );
78  m_detTool->SetAsWorld();
79  m_detTool->Build();
80 
81  ATH_MSG_DEBUG( "Setting up G4 physics regions" );
82  for (auto& it: m_regionCreators)
83  {
84  it->Construct();
85  }
86 
88  {
89  ATH_MSG_DEBUG( "Setting up G4 parallel worlds" );
90  for (auto& it: m_parallelWorlds)
91  {
92  m_parallelWorldNames.push_back(it.name());
93  this->RegisterParallelWorld(it->GetParallelWorld());
94  }
95  }
96 
97  ATH_MSG_DEBUG( "Running geometry post-configuration tools" );
98  for (auto it: m_configurationTools)
99  {
100  StatusCode sc = it->postGeometryConfigure();
101  if (!sc.isSuccess())
102  {
103  ATH_MSG_FATAL( "Unable to run post-geometry configuration for " << it->name() );
104  }
105  }
106 
107  return m_detTool->GetWorldVolume();
108 }

◆ ConstructSDandField()

void G4AtlasDetectorConstructionTool::ConstructSDandField ( )
finaloverridevirtual

Definition at line 110 of file G4AtlasDetectorConstructionTool.cxx.

111 {
112  ATH_MSG_DEBUG( "Setting up sensitive detectors" );
113  if (m_senDetTool->initializeSDs().isFailure())
114  {
115  ATH_MSG_FATAL("Failed to initialize SDs for worker thread");
116  }
117 
118  ATH_MSG_DEBUG( "Setting up field managers" );
119  for (auto& fm : m_fieldManagers)
120  {
121  StatusCode sc = fm->initializeField();
122  if (!sc.isSuccess())
123  {
124  ATH_MSG_FATAL( "Unable to initialise field with " << fm->name() );
125  return;
126  }
127  }
128 
129  if (m_G4CaloTransportTool.isEnabled()){
130  ATH_MSG_DEBUG("Setting up G4CaloTransportTool");
131  if (m_G4CaloTransportTool->initializePropagator().isFailure())
132  {
133  ATH_MSG_FATAL("Failed to initialize G4CaloTransportTool for worker thread.");
134  return;
135  }
136  }
137 
138  return;
139 }

◆ GetDetectorConstruction()

virtual G4VUserDetectorConstruction* G4AtlasDetectorConstructionTool::GetDetectorConstruction ( )
inlinefinaloverridevirtual

implements the following IDetectorConstructionTool methods

Definition at line 47 of file G4AtlasDetectorConstructionTool.h.

47 {return this;}

◆ GetParallelWorldNames()

std::vector< std::string > & G4AtlasDetectorConstructionTool::GetParallelWorldNames ( )
finaloverridevirtual

Definition at line 67 of file G4AtlasDetectorConstructionTool.cxx.

68 {
69  return m_parallelWorldNames;
70 }

◆ initialize()

StatusCode G4AtlasDetectorConstructionTool::initialize ( )
finaloverridevirtual

Initialize method.

Definition at line 29 of file G4AtlasDetectorConstructionTool.cxx.

30 {
31  ATH_MSG_DEBUG( "Initializing Geometry configuration tools " );
32  for (auto it: m_configurationTools)
33  {
34  ATH_CHECK( it.retrieve() );
35  ATH_CHECK( it->preGeometryConfigure() );
36  }
37 
38  ATH_MSG_DEBUG( "Initializing World detectors in " << name() );
39  ATH_CHECK( m_detTool.retrieve() );
40 
41  ATH_MSG_DEBUG( "Initializing sensitive detectors in " << name() );
42  ATH_CHECK( m_senDetTool.retrieve() );
43 
44  ATH_MSG_DEBUG( "Setting up G4 physics regions" );
45  for (auto& it: m_regionCreators)
46  {
47  ATH_CHECK( it.retrieve() );
48  }
49 
51  {
52  ATH_MSG_DEBUG( "Setting up G4 parallel worlds" );
53  for (auto& it: m_parallelWorlds)
54  {
55  ATH_CHECK( it.retrieve() );
56  }
57  }
58 
59  ATH_MSG_DEBUG( "Setting up field managers" );
60  ATH_CHECK( m_fieldManagers.retrieve() );
61 
62  ATH_CHECK( m_G4CaloTransportTool.retrieve( DisableTool{ m_G4CaloTransportTool.empty() } ) );
63 
64  return StatusCode::SUCCESS;
65 }

Member Data Documentation

◆ m_activateParallelWorlds

Gaudi::Property<bool> G4AtlasDetectorConstructionTool::m_activateParallelWorlds {this, "ActivateParallelWorlds", false, "Toggle on/off the G4 parallel geometry system"}
private

Definition at line 62 of file G4AtlasDetectorConstructionTool.h.

◆ m_configurationTools

ToolHandleArray<IG4GeometryConfigurationTool> G4AtlasDetectorConstructionTool::m_configurationTools {this, "GeometryConfigurationTools", {}, "Tools for geometry configuration"}
private

Definition at line 58 of file G4AtlasDetectorConstructionTool.h.

◆ m_detTool

ToolHandle<IDetectorGeometryTool> G4AtlasDetectorConstructionTool::m_detTool {this, "World", "", "Tool handle of the top-of-the-tree detector geometry tool"}
private

Definition at line 55 of file G4AtlasDetectorConstructionTool.h.

◆ m_fieldManagers

ToolHandleArray<IFieldManagerTool> G4AtlasDetectorConstructionTool::m_fieldManagers {this, "FieldManagers", {}, "field managers used"}
private

Definition at line 60 of file G4AtlasDetectorConstructionTool.h.

◆ m_G4CaloTransportTool

PublicToolHandle<IG4CaloTransportTool> G4AtlasDetectorConstructionTool::m_G4CaloTransportTool {this, "G4CaloTransportTool", "", "Tool handle of the Geant4 transport tool for the FastCaloSim in Geant4 implementation"}
private

Definition at line 61 of file G4AtlasDetectorConstructionTool.h.

◆ m_parallelWorldNames

std::vector<std::string> G4AtlasDetectorConstructionTool::m_parallelWorldNames {}
private

Definition at line 63 of file G4AtlasDetectorConstructionTool.h.

◆ m_parallelWorlds

ToolHandleArray<IParallelWorldTool> G4AtlasDetectorConstructionTool::m_parallelWorlds {this, "ParallelWorlds", {} , "Tools to define G4 parallel worlds"}
private

Definition at line 57 of file G4AtlasDetectorConstructionTool.h.

◆ m_regionCreators

ToolHandleArray<IRegionCreator> G4AtlasDetectorConstructionTool::m_regionCreators {this, "RegionCreators", {}, "Tools to define G4 physics regions"}
private

Definition at line 56 of file G4AtlasDetectorConstructionTool.h.

◆ m_senDetTool

PublicToolHandle<ISensitiveDetectorMasterTool> G4AtlasDetectorConstructionTool::m_senDetTool {this, "SenDetMasterTool", "SensitiveDetectorMasterTool", ""}
private

Definition at line 59 of file G4AtlasDetectorConstructionTool.h.


The documentation for this class was generated from the following files:
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
G4AtlasDetectorConstructionTool::m_fieldManagers
ToolHandleArray< IFieldManagerTool > m_fieldManagers
Definition: G4AtlasDetectorConstructionTool.h:60
G4AtlasDetectorConstructionTool::m_detTool
ToolHandle< IDetectorGeometryTool > m_detTool
Definition: G4AtlasDetectorConstructionTool.h:55
skel.it
it
Definition: skel.GENtoEVGEN.py:396
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
G4AtlasDetectorConstructionTool::m_senDetTool
PublicToolHandle< ISensitiveDetectorMasterTool > m_senDetTool
Definition: G4AtlasDetectorConstructionTool.h:59
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
G4AtlasDetectorConstructionTool::m_parallelWorlds
ToolHandleArray< IParallelWorldTool > m_parallelWorlds
Definition: G4AtlasDetectorConstructionTool.h:57
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
G4AtlasDetectorConstructionTool::m_activateParallelWorlds
Gaudi::Property< bool > m_activateParallelWorlds
Definition: G4AtlasDetectorConstructionTool.h:62
G4AtlasDetectorConstructionTool::m_regionCreators
ToolHandleArray< IRegionCreator > m_regionCreators
Definition: G4AtlasDetectorConstructionTool.h:56
G4AtlasDetectorConstructionTool::m_configurationTools
ToolHandleArray< IG4GeometryConfigurationTool > m_configurationTools
Definition: G4AtlasDetectorConstructionTool.h:58
G4AtlasDetectorConstructionTool::m_parallelWorldNames
std::vector< std::string > m_parallelWorldNames
Definition: G4AtlasDetectorConstructionTool.h:63
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
G4AtlasDetectorConstructionTool::m_G4CaloTransportTool
PublicToolHandle< IG4CaloTransportTool > m_G4CaloTransportTool
Definition: G4AtlasDetectorConstructionTool.h:61