19 #include "GeoModelRead/ReadGeoModel.h"
20 #include "GeoModelKernel/GeoVolumeCursor.h"
31 #define SYSTEM_OF_UNITS Gaudi::Units
35 , GeoModelIO::ReadGeoModel* sqliteReader
38 , m_detectorManager(nullptr)
40 , m_paramSvc(paramSvc)
41 , m_sqliteReader(sqliteReader)
42 , m_hvManager(hvManager)
43 , m_barrelSagging(false)
53 std::string errorMessage{
""};
56 errorMessage=
"Failed to build FCAL Channel Map";
58 throw std::runtime_error(errorMessage);
65 , m_barrelSagging) != StatusCode::SUCCESS) {
66 errorMessage=
"Failed to build LAr Barrel electrode sections";
68 throw std::runtime_error(errorMessage);
72 std::map<std::string, GeoAlignableTransform*> mapAXF = m_sqliteReader->getPublishedNodes<std::string, GeoAlignableTransform*>(
"LAr");
73 for(
auto& [
key,xf] : mapAXF) {
75 if(m_detStore->record(sAlignX,
key)!=StatusCode::SUCCESS) {
76 errorMessage=
"Failed to record StoredAlignX for the key: "+
key;
78 throw std::runtime_error(errorMessage);
82 std::map<std::string, GeoFullPhysVol*> mapFPV = m_sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>(
"LAr");
83 for(
auto& [
key,
pv] : mapFPV) {
85 if(m_detStore->record(sPhysVol,
key)!=StatusCode::SUCCESS) {
86 errorMessage=
"Failed to record StoredPhysVol for the key: " +
key;
88 throw std::runtime_error(errorMessage);
93 double projectivityDisplacement{0.};
95 projectivityDisplacement = (*emecGeometry)[0]->getDouble(
"ZSHIFT");
101 , projectivityDisplacement);
108 if(!embDetectorManager
109 || !emecDetectorManager
110 || !hecDetectorManager
111 || !fcalDetectorManager) {
112 errorMessage=
"Failed to build LAr Readout Geometry description";
114 throw std::runtime_error(errorMessage);
117 m_detectorManager =
new LArDetectorManager(embDetectorManager,emecDetectorManager,hecDetectorManager,fcalDetectorManager);
118 m_detectorManager->isTestBeam(
false);
130 if(mbtsPcons->size()==0) {
131 first = mbtsTubs->begin();
132 last = mbtsTubs->end();
134 if((*first)->getString(
"TUBE") ==
"MBTS_mother") {
141 double zStartCryoMother = 0.;
142 first = cryoPcons->begin();
143 last = cryoPcons->end();
145 if((*first)->getString(
"PCON")==
"Endcap::CryoMother"
146 && (*first)->getInt(
"PLANE_ID")==0) {
147 zStartCryoMother = (*first)->getDouble(
"ZPLANE");
152 double zStartMM = 0.;
153 first = mbtsPcons->begin();
154 last = mbtsPcons->end();
156 if((*first)->getString(
"PCON")==
"MBTS::Mother"
157 && (*first)->getInt(
"PLANE_ID")==0) {
158 zStartMM = (*first)->getDouble(
"ZPLANE");
163 zposMM = zStartCryoMother - zStartMM;
167 std::map<std::string,unsigned> trdMap;
168 for(
unsigned indTrd(0);indTrd<mbtsTrds->size();++indTrd) {
169 const std::string& keyTrd = (*mbtsTrds)[indTrd]->getString(
"TRD");
170 trdMap[keyTrd]=indTrd;
179 , std::string()).isFailure()) {
180 errorMessage=
"Failed to build MBTS Readout Geometry description";
182 throw std::runtime_error(errorMessage);
186 GeoVolumeCursor
cursor(world);
188 std::string volName =
cursor.getName();
189 if(volName.compare(0,3,
"LAr")==0) {
190 m_detectorManager->addTreeTop(
cursor.getVolume());