ATLAS Offline Software
Loading...
Searching...
No Matches
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"
8
9Geo2G4Svc::Geo2G4Svc(const std::string& name, ISvcLocator* svcLocator)
10 : base_class(name,svcLocator)
11{
12}
13
16
17StatusCode 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
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
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}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
virtual ~Geo2G4Svc()
Definition Geo2G4Svc.cxx:14
virtual void SetDefaultBuilder(std::string n) override final
Geo2G4SvcBase methods.
Definition Geo2G4Svc.h:30
BuilderMap m_builders
Definition Geo2G4Svc.h:40
Geo2G4Svc(const std::string &, ISvcLocator *)
Definition Geo2G4Svc.cxx:9
std::unique_ptr< Geo2G4AssemblyFactory > m_G4AssemblyFactory
Definition Geo2G4Svc.h:42
virtual VolumeBuilder * GetDefaultBuilder() const override final
Definition Geo2G4Svc.h:32
virtual VolumeBuilder * GetVolumeBuilder(std::string s) const override final
Definition Geo2G4Svc.cxx:49
virtual void ListVolumeBuilders() const override final
Definition Geo2G4Svc.cxx:37