ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
Geo2G4
src
Geo2G4Svc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
Geo2G4Svc.h
"
6
#include "
Geo2G4AssemblyVolume.h
"
7
#include "
ExtParameterisedVolumeBuilder.h
"
8
9
Geo2G4Svc::Geo2G4Svc
(
const
std::string& name, ISvcLocator* svcLocator)
10
: base_class(name,svcLocator)
11
{
12
}
13
14
Geo2G4Svc::~Geo2G4Svc
()
15
{}
16
17
StatusCode Geo2G4Svc::initialize()
18
{
19
ATH_MSG_VERBOSE
(
"Initializing the Geo2G4Svc"
);
20
m_G4AssemblyFactory
= std::make_unique<Geo2G4AssemblyFactory>();
21
22
// Initialize builders
23
const
std::string nameBuilder =
"Extended_Parameterised_Volume_Builder"
;
//TODO Configurable property??
24
m_builders
.emplace(nameBuilder,
25
std::make_unique<ExtParameterisedVolumeBuilder>(nameBuilder,
m_G4AssemblyFactory
.get()));
26
27
this->
SetDefaultBuilder
(nameBuilder);
28
if
(msgLvl(MSG::VERBOSE)) {
29
ATH_MSG_VERBOSE
(nameBuilder <<
" --> set as default builder"
);
30
ATH_MSG_VERBOSE
(nameBuilder <<
" --> ParamOn flag = "
<<
GetDefaultBuilder
()->GetParam());
31
this->
ListVolumeBuilders
();
32
}
33
34
return
StatusCode::SUCCESS;
35
}
36
37
void
Geo2G4Svc::ListVolumeBuilders
()
const
38
{
39
ATH_MSG_INFO
(
"---- List of all Volume Builders registered with Geo2G4Svc ----"
);
40
ATH_MSG_INFO
(
"---------------------------------------------------------------"
);
41
for
(
const
auto
& builder :
m_builders
)
42
{
43
ATH_MSG_INFO
(
" Volume Builder: "
<<builder.second->GetKey());
44
}
45
ATH_MSG_INFO
(
"---------------------------------------------------------------"
);
46
ATH_MSG_INFO
(
" default builder is "
<<
GetDefaultBuilder
()->GetKey());
47
}
48
49
VolumeBuilder
*
Geo2G4Svc::GetVolumeBuilder
(std::string s)
const
50
{
51
const
auto
builderItr(
m_builders
.find(s));
52
if
(builderItr!=
m_builders
.end())
53
{
54
return
builderItr->second.get();
55
}
56
else
57
{
58
ATH_MSG_ERROR
(
"Trying to retrieve a not existing builder "
<<s);
59
ATH_MSG_ERROR
(
"\treturning Default Builder"
);
60
}
61
return
GetDefaultBuilder
();
62
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ExtParameterisedVolumeBuilder.h
Geo2G4AssemblyVolume.h
Geo2G4Svc.h
Geo2G4Svc::~Geo2G4Svc
virtual ~Geo2G4Svc()
Definition
Geo2G4Svc.cxx:14
Geo2G4Svc::SetDefaultBuilder
virtual void SetDefaultBuilder(std::string n) override final
Geo2G4SvcBase methods.
Definition
Geo2G4Svc.h:30
Geo2G4Svc::m_builders
BuilderMap m_builders
Definition
Geo2G4Svc.h:40
Geo2G4Svc::Geo2G4Svc
Geo2G4Svc(const std::string &, ISvcLocator *)
Definition
Geo2G4Svc.cxx:9
Geo2G4Svc::m_G4AssemblyFactory
std::unique_ptr< Geo2G4AssemblyFactory > m_G4AssemblyFactory
Definition
Geo2G4Svc.h:42
Geo2G4Svc::GetDefaultBuilder
virtual VolumeBuilder * GetDefaultBuilder() const override final
Definition
Geo2G4Svc.h:32
Geo2G4Svc::GetVolumeBuilder
virtual VolumeBuilder * GetVolumeBuilder(std::string s) const override final
Definition
Geo2G4Svc.cxx:49
Geo2G4Svc::ListVolumeBuilders
virtual void ListVolumeBuilders() const override final
Definition
Geo2G4Svc.cxx:37
VolumeBuilder
Definition
Simulation/G4Utilities/Geo2G4/src/VolumeBuilder.h:20
Generated on
for ATLAS Offline Software by
1.17.0