53 LogDebug(
"GEMGeometryParsFromDD") <<
"Building the geometry service";
54 LogDebug(
"GEMGeometryParsFromDD") <<
"About to run through the GEM structure\n"
57 edm::LogVerbatim(
"GEMGeometryParsFromDD") <<
"(0) GEMGeometryParsFromDD - DDD ";
63 LogDebug(
"GEMGeometryParsFromDD") <<
"doSuperChamber = " << doSuper;
78 if (detIdCh.
layer() == 1) {
115 double dx1 = dpar[4];
116 double dx2 = dpar[8];
123 std::vector<double> pars{dx1, dx2,
dy,
dz};
127 LogDebug(
"GEMGeometryParsFromDD") <<
"dimension dx1 " << dx1 <<
", dx2 " << dx2 <<
", dy " <<
dy <<
", dz " <<
dz;
130 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz;
142 double dx1 = dpar[4];
143 double dx2 = dpar[8];
149 std::vector<double> pars{dx1, dx2,
dy,
dz};
153 LogDebug(
"GEMGeometryParsFromDD") <<
"dimension dx1 " << dx1 <<
", dx2 " << dx2 <<
", dy " <<
dy <<
", dz " <<
dz;
156 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz;
165 DDValue numbOfStrips(
"nStrips");
170 for (
auto const& is :
specs) {
174 nPads = numbOfPads.
doubles()[0];
178 LogDebug(
"GEMGeometryParsFromDD") << ((
nStrips == 0.) ? (
"No nStrips found!!")
179 : (
"Number of strips: " + std::to_string(
nStrips)));
180 LogDebug(
"GEMGeometryParsFromDD") << ((nPads == 0.) ? (
"No nPads found!!")
181 : (
"Number of pads: " + std::to_string(nPads)));
188 double dx1 = dpar[4];
189 double dx2 = dpar[8];
195 LogDebug(
"GEMGeometryParsFromDD") <<
" dx1 " << dx1 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz <<
" nStrips "
196 <<
nStrips <<
" nPads " << nPads <<
" dPhi " <<
dPhi;
200 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz <<
" nStrips " <<
nStrips <<
" nPads " << nPads <<
" dPhi "
208 <<
"(1) DDD, tran vector " << tran.x() <<
" " << tran.y() <<
" " << tran.z();
209 return {tran.x(), tran.y(), tran.z()};
215 rota.GetComponents(
x,
y,
z);
217 <<
"(2) DDD, rot matrix " <<
x.X() <<
" " <<
x.Y() <<
" " <<
x.Z() <<
" " <<
y.X() <<
" " <<
y.Y() <<
" "
218 <<
y.Z() <<
" " <<
z.X() <<
" " <<
z.Y() <<
" " <<
z.Z();
219 return {
x.X(),
x.Y(),
x.Z(),
y.X(),
y.Y(),
y.Z(),
z.X(),
z.Y(),
z.Z()};
239 edm::LogVerbatim(
"GEMGeometryParsFromDD") <<
"(0) GEMGeometryParsFromDD - DD4HEP ";
243 static constexpr uint32_t levelChamb = 7;
245 int theLevelPart = muonConstants.
getValue(
"level");
246 int theRingLevel = muonConstants.
getValue(
"mg_ring") / theLevelPart;
247 int theSectorLevel = muonConstants.
getValue(
"mg_sector") / theLevelPart;
250 const auto& history = fv.
history();
255 if (
num.getLevels() == theRingLevel) {
256 if (detId.region() !=
region) {
261 detId =
GEMDetId(detId.region(), detId.ring(), detId.station(), detId.layer(), chamb, 0);
263 }
else if (
num.getLevels() == theSectorLevel) {
269 if (fv.
level() == levelChamb) {
270 if (detId.layer() == 1) {
274 }
else if (
num.getLevels() > theSectorLevel) {
283 auto solidA = solid.
solidA();
284 std::vector<double> dpar = solidA.dimensions();
286 double dy = dpar[3] / dd4hep::mm;
287 double dz = dpar[2] / dd4hep::mm;
288 double dx1 = dpar[0] / dd4hep::mm;
289 double dx2 = dpar[1] / dd4hep::mm;
291 auto solidB = solid.solidB();
292 dpar = solidB.dimensions();
294 const double chgap = 2.105;
299 dz += (dpar[2] / dd4hep::mm);
303 std::vector<double> pars{dx1, dx2,
dy,
dz};
308 <<
"(3) DD4HEP, SuperChamber DetID " << gemid.
rawId() <<
" Name " <<
std::string(
name) <<
" dx1 " << dx1
309 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz;
315 auto solidA = solid.
solidA();
316 std::vector<double> dpar = solidA.dimensions();
318 double dy = dpar[3] / dd4hep::mm;
319 double dz = dpar[2] / dd4hep::mm;
320 double dx1 = dpar[0] / dd4hep::mm;
321 double dx2 = dpar[1] / dd4hep::mm;
323 auto solidB = solid.solidB();
324 dpar = solidB.dimensions();
326 dz += (dpar[2] / dd4hep::mm);
331 std::vector<double> pars{dx1, dx2,
dy,
dz};
336 <<
"(4) DD4HEP, Chamber DetID " << gemid.
rawId() <<
" Name " <<
std::string(
name) <<
" dx1 " << dx1 <<
" dx2 "
337 << dx2 <<
" dy " <<
dy <<
" dz " <<
dz;
343 auto nPads = fv.
get<
double>(
"nPads");
344 auto dPhi = fv.
get<
double>(
"dPhi");
349 double dx1 = dpar[0] / dd4hep::mm;
350 double dx2 = dpar[1] / dd4hep::mm;
351 double dy = dpar[3] / dd4hep::mm;
352 double dz = dpar[2] / dd4hep::mm;
359 <<
"(5) DD4HEP, Eta Partion DetID " << detId.
rawId() <<
" Name " <<
std::string(
name) <<
" dx1 " << dx1 <<
" dx2 "
360 << dx2 <<
" dy " <<
dy <<
" dz " <<
dz <<
" nStrips " <<
nStrips <<
" nPads " << nPads <<
" dPhi " <<
dPhi;
365 std::vector<double> tran(3);
366 tran[0] = static_cast<double>(fv.
translation().X()) / dd4hep::mm;
367 tran[1] = static_cast<double>(fv.
translation().Y()) / dd4hep::mm;
368 tran[2] = static_cast<double>(fv.
translation().Z()) / dd4hep::mm;
371 <<
"(1) DD4HEP, tran vector " << tran[0] <<
" " << tran[1] <<
" " << tran[2];
372 return {tran[0], tran[1], tran[2]};
379 rota.GetComponents(
x,
y,
z);
380 const std::vector<double>
rot = {
x.X(),
x.Y(),
x.Z(),
y.X(),
y.Y(),
y.Z(),
z.X(),
z.Y(),
z.Z()};
382 <<
"(2) DD4HEP, rot matrix " <<
rot[0] <<
" " <<
rot[1] <<
" " <<
rot[2] <<
" " <<
rot[3] <<
" " <<
rot[4]
383 <<
" " <<
rot[5] <<
" " <<
rot[6] <<
" " <<
rot[7] <<
" " <<
rot[8];