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)
56 std::string errorMessage{
""};
59 errorMessage=
"Failed to build FCAL Channel Map";
61 throw std::runtime_error(errorMessage);
68 , m_barrelSagging) != StatusCode::SUCCESS) {
69 errorMessage=
"Failed to build LAr Barrel electrode sections";
71 throw std::runtime_error(errorMessage);
75 std::map<std::string, GeoAlignableTransform*> mapAXF = m_sqliteReader->getPublishedNodes<std::string, GeoAlignableTransform*>(
"LAr");
76 for(
auto& [
key,xf] : mapAXF) {
78 if(m_detStore->record(sAlignX,
key)!=StatusCode::SUCCESS) {
79 errorMessage=
"Failed to record StoredAlignX for the key: "+
key;
81 throw std::runtime_error(errorMessage);
85 std::map<std::string, GeoFullPhysVol*> mapFPV = m_sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>(
"LAr");
86 for(
auto& [
key,
pv] : mapFPV) {
88 if(m_detStore->record(sPhysVol,
key)!=StatusCode::SUCCESS) {
89 errorMessage=
"Failed to record StoredPhysVol for the key: " +
key;
91 throw std::runtime_error(errorMessage);
96 double projectivityDisplacement{0.};
98 projectivityDisplacement = (*emecGeometry)[0]->getDouble(
"ZSHIFT");
104 , projectivityDisplacement);
111 if(!embDetectorManager
112 || !emecDetectorManager
113 || !hecDetectorManager
114 || !fcalDetectorManager) {
115 errorMessage=
"Failed to build LAr Readout Geometry description";
117 throw std::runtime_error(errorMessage);
120 m_detectorManager =
new LArDetectorManager(embDetectorManager,emecDetectorManager,hecDetectorManager,fcalDetectorManager);
121 m_detectorManager->isTestBeam(
false);
133 if(mbtsPcons->size()==0) {
134 first = mbtsTubs->begin();
135 last = mbtsTubs->end();
137 if((*first)->getString(
"TUBE") ==
"MBTS_mother") {
144 double zStartCryoMother = 0.;
145 first = cryoPcons->begin();
146 last = cryoPcons->end();
148 if((*first)->getString(
"PCON")==
"Endcap::CryoMother"
149 && (*first)->getInt(
"PLANE_ID")==0) {
150 zStartCryoMother = (*first)->getDouble(
"ZPLANE");
155 double zStartMM = 0.;
156 first = mbtsPcons->begin();
157 last = mbtsPcons->end();
159 if((*first)->getString(
"PCON")==
"MBTS::Mother"
160 && (*first)->getInt(
"PLANE_ID")==0) {
161 zStartMM = (*first)->getDouble(
"ZPLANE");
166 zposMM = zStartCryoMother - zStartMM;
170 std::map<std::string,unsigned> trdMap;
171 for(
unsigned indTrd(0);indTrd<mbtsTrds->size();++indTrd) {
172 const std::string& keyTrd = (*mbtsTrds)[indTrd]->getString(
"TRD");
173 trdMap[keyTrd]=indTrd;
182 , std::string()).isFailure()) {
183 errorMessage=
"Failed to build MBTS Readout Geometry description";
185 throw std::runtime_error(errorMessage);
189 GeoVolumeCursor
cursor(world);
191 std::string volName =
cursor.getName();
192 if(volName.compare(0,3,
"LAr")==0) {
193 m_detectorManager->addTreeTop(
cursor.getVolume());