12 #include <top/modules/TOPGeometryParInitializer/TOPGeometryParInitializerModule.h>
13 #include <top/geometry/TOPGeometryPar.h>
16 #include <framework/logging/Logger.h>
17 #include <framework/gearbox/GearDir.h>
43 setDescription(
"Class for initializing TOPGeometryPar. "
44 "This class is by default initialized when Geant geometry is created. "
45 "Useful if Geant geometry is not needed. Be carefull when using!");
46 setPropertyFlags(c_ParallelProcessingCertified);
49 addParam(
"useDB", m_useDB,
50 "If true load the Geometry from the database instead of the gearbox",
true);
53 void TOPGeometryParInitializerModule::initialize()
55 auto* gp = TOPGeometryPar::Instance();
57 B2WARNING(
"TOPGeometryPar has already been initialized");
65 GearDir detectorDir(
"/Detector");
66 for (
const GearDir& component : detectorDir.
getNodes(
"DetectorComponent")) {
67 if (component.getString(
"@name") ==
"TOP") {
68 gp->Initialize(
GearDir(component,
"Content"));
73 if (not found) B2ERROR(
"Component TOP does not exist or is empty");