53 std::map<std::string, GeoAlignableTransform*> mapAXF =
m_sqliteReader->getPublishedNodes<std::string, GeoAlignableTransform*>(
"MuonSys");
54 std::map<std::string, GeoFullPhysVol*> mapFPV =
m_sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>(
"MuonSys");
65 for (
const auto& [key, pV] : mapFPV) {
66 if (key.starts_with (
"sMD") || key.starts_with (
"sTG")) {
67 int eta=key[5]-
'0', ml=key[7]-
'0',
phi=key[12]-
'0';
70 int ec = AC==
'C' ? -1 : 1;
71 std::string vName = pV->getLogVol()->getName();
72 if (key.starts_with(
"sMD")) {
73 std::string sName = vName.substr(4,4);
74 std::unique_ptr<MuonGM::MMReadoutElement>
re = std::make_unique<MuonGM::MMReadoutElement>(pV, sName, ec*
eta,
phi,ml,
m_manager);
78 else if (key.starts_with(
"sTG")) {
79 std::string sName = vName.substr(7,4);
80 std::unique_ptr<sTgcReadoutElement>
re = std::make_unique<sTgcReadoutElement>(pV, sName, ec*
eta,
phi, ml,
m_manager);
93 std::unique_ptr<RDBReaderAtlas> dbr;
96 std::string oracleTag=
"";
97 std::string oracleNode=
"";
98 std::map<std::string, std::string> ascii{};
113 StatusCode
sc = StatusCode::SUCCESS;
116 sc = dbr->ProcessDB(*mysql);
117 if (
sc != StatusCode::SUCCESS) {
118 log << MSG::ERROR <<
" FAILURE in DB access; Muon node will not be built" <<
endmsg;
122 GeoFullPhysVol *p4 = mapFPV[
"MuonTreeTop"];
124 log << MSG::INFO <<
" TreeTop added to the Manager" <<
endmsg;
127 std::set<std::string> mappedStations;
128 for (
const auto& i: mapFPV) {
129 size_t pos=i.first.find(
"_Station");
130 if (pos!=std::string::npos) mappedStations.insert(i.first.substr(0,pos));
136 std::set<std::string> keyset;
138 for (
const auto& i: mappedStations) {
141 throw std::runtime_error(
"Raw/readout geometry mismatch");
144 Station *station = (*it).second.get();
145 std::string stname(station->
GetName(), 0, 3);
147 bool isAssembly =
false;
156 l.setKeyset(&keyset);
160 for (
auto const& [key, position] : *station) {
161 int zi = position.zindex;
162 int fi = position.phiindex;
165 if (stname ==
"CSL") isAssembly =
true;
168 l.addReadoutLayers(*mysql,
getDetectorManager(), zi, fi, position.isMirrored, isAssembly);
172 GeoAlignableTransform *xf = mapAXF[station->
GetName()+
"_Station_"+std::to_string(zi)+
"_"+std::to_string(fi)];
176 log << MSG::WARNING <<
"For Station with nameTag=<" << station->
GetName() <<
"> at zi/fi = " << zi <<
"/" << fi
177 <<
" no MuonStation found => no possibility to align" <<
endmsg;
181 GeoTrf::Transform3D tsz_to_szt = GeoTrf::RotateZ3D(-90 * Gaudi::Units::degree) * GeoTrf::RotateY3D(-90 * Gaudi::Units::degree);
182 GeoTrf::Transform3D nativeToAmdbLRS=tsz_to_szt * station->
native_to_tsz_frame(*mysql, position);
188 ap.tras = ap.traz = ap.trat = ap.rots = ap.rotz = ap.rott = 0.;
191 }
else if (nAlines > 0) {
196 ap = acurrent->second;
197 if (ap.phiindex != fi || ap.zindex != zi) {
198 log << MSG::ERROR <<
"Inconsistent AlignedPosition found in the static Geometry DB: aligPos.fi, zi = " << ap.phiindex <<
", " << ap.zindex
199 <<
" for station " << station->
GetName() <<
" at fi/zi = " << fi <<
"/" << zi <<
" AlignPos indices fi/zi " << fi <<
"/" << zi <<
endmsg;
201 GeoTrf::Transform3D tsz_to_szt = GeoTrf::RotateZ3D(-90 * Gaudi::Units::degree) * GeoTrf::RotateY3D(-90 * Gaudi::Units::degree);