51 {
52
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");
55
57
59
60
61
62
63
64
65 for (const auto& [key, pV] : mapFPV) {
66 if (
key.starts_with (
"sMD") ||
key.starts_with (
"sTG")) {
68
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);
77 }
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);
83 }
84 }
85 }
86
87
88
89
92
93 std::unique_ptr<RDBReaderAtlas>
dbr;
94 {
95
96 std::string oracleTag="";
97 std::string oracleNode="";
98 std::map<std::string, std::string>
ascii{};
100
101
102 }
103
104
105
106
107
108
111
112
114
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;
119 return;
120 }
121
122 GeoFullPhysVol *p4 = mapFPV["MuonTreeTop"];
124 log << MSG::INFO <<
" TreeTop added to the Manager" <<
endmsg;
125
126
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));
131 }
132
133
134
135
136 std::set<std::string> keyset;
137
138 for (const auto& i: mappedStations) {
141 throw std::runtime_error("Raw/readout geometry mismatch");
142 }
143
144 Station *station = (*it).second.get();
145 std::string stname(station->GetName(), 0, 3);
146
147 bool isAssembly = false;
148 if (station->GetNrOfCutouts() > 0 && stname.substr(0, 1) != "T")
149 isAssembly = true;
150
151
152 if (stname == "BIR")
153 isAssembly = true;
154
155 MuonChamberLite
l(*mysql, station,&mapFPV,&mapAXF);
156 l.setKeyset(&keyset);
157
160 for ( auto const& [key, position] : *station) {
161 int zi = position.zindex;
162 int fi = position.phiindex;
163
164
165 if (stname == "CSL") isAssembly = true;
166
167
169
170
171
172 GeoAlignableTransform *xf = mapAXF[station->GetName()+"_Station_"+std::to_string(zi)+"_"+std::to_string(fi)];
173
174 MuonStation *mst =
m_manager->getMuonStation(station->GetName(), zi, fi + 1);
175 if (!mst) {
176 log << MSG::WARNING <<
"For Station with nameTag=<" << station->GetName() <<
"> at zi/fi = " << zi <<
"/" << fi
177 <<
" no MuonStation found => no possibility to align" <<
endmsg;
178 continue;
179 }
180 mst->setTransform(xf);
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);
183 mst->setNativeToAmdbLRS(nativeToAmdbLRS);
184 mst->setNominalAmdbLRSToGlobal(station->tsz_to_global_frame(*mysql, position) * tsz_to_szt.inverse());
185
186 int nAlines = station->CountAlignPos(zi, fi);
187 if (nAlines == 0) {
188 ap.tras =
ap.traz =
ap.trat =
ap.rots =
ap.rotz =
ap.rott = 0.;
190 mst->setDelta_fromAline(
ap.tras,
ap.traz,
ap.trat,
ap.rots,
ap.rotz,
ap.rott);
191 } else if (nAlines > 0) {
194
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;
200 }
201 GeoTrf::Transform3D tsz_to_szt = GeoTrf::RotateZ3D(-90 * Gaudi::Units::degree) * GeoTrf::RotateY3D(-90 * Gaudi::Units::degree);
202
203
204 mst->setTransform(xf);
205 mst->setNativeToAmdbLRS(tsz_to_szt * station->native_to_tsz_frame(*mysql, position));
206 mst->setNominalAmdbLRSToGlobal(station->tsz_to_global_frame(*mysql, position) * tsz_to_szt.inverse());
207 mst->setDeltaAmdbLRS(GeoTrf::Transform3D::Identity());
208 }
209 }
210 }
211 }
213 }
const boost::regex re(r_e)
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
void set_amdb_from_RDB(bool)
const StationMap & stationMap() const
static LockedMYSQL GetPointer()
CxxUtils::LockedPointer< MYSQL > LockedMYSQL
IRDBAccessSvc * m_pRDBAccess
MuonDetectorManager * m_manager
virtual const MuonDetectorManager * getDetectorManager() const override
IMessageSvc * getMessageSvc(bool quiet=false)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::multimap< int, AlignPos, std::less< int > >::const_iterator AlignPosIterator
std::map< int, Position, std::less< int > >::const_iterator PositionIterator
l
Printing final latex table to .tex output file.