33 #include "CLHEP/Units/GlobalSystemOfUnits.h"
74 std::vector<GEMSuperChamber*> superChambers;
99 if (detIdCh.
layer() == 1) {
101 superChambers.push_back(gemSuperChamber);
108 bool loopExecuted =
false;
123 gemChamber = buildChamber(fv, detId);
137 gemChamber->
add(etaPart);
138 theGeometry.
add(etaPart);
144 theGeometry.
add(gemChamber);
157 buildRegions(theGeometry, superChambers);
175 const double chgap = 2.105;
184 bool isOdd = detId.
chamber() % 2;
228 DDValue numbOfStrips(
"nStrips");
232 std::vector<const DDsvalues_type*>::iterator is =
specs.begin();
234 for (; is !=
specs.end(); is++) {
235 if (
DDfetch(*is, numbOfStrips))
238 nPads = numbOfPads.
doubles()[0];
244 : (
"Number of strips: " + std::to_string(
nStrips)));
245 edm::LogVerbatim(
"Geometry") << ((nPads == 0.) ? (
"No nPads found!!") : (
"Number of pads: " + std::to_string(nPads)));
255 std::vector<float> pars;
256 pars.emplace_back(
be);
257 pars.emplace_back(te);
258 pars.emplace_back(ap);
260 pars.emplace_back(nPads);
261 pars.emplace_back(
dPhi);
263 bool isOdd = detId.
chamber() % 2;
277 bool isOddChamber)
const {
280 const Surface::PositionType posResult(
float(trans.x() / cm),
float(trans.y() / cm),
float(trans.z() / cm));
319 static constexpr uint32_t levelChamb = 7;
321 int theLevelPart = muonConstants.
getValue(
"level");
322 int theRingLevel = muonConstants.
getValue(
"mg_ring") / theLevelPart;
323 int theSectorLevel = muonConstants.
getValue(
"mg_sector") / theLevelPart;
324 std::vector<GEMSuperChamber*> superChambers;
328 const auto& history = fv.
history();
332 edm::LogVerbatim(
"Geometry") << fv.
name() <<
" with " << history.tags.size() <<
" Levels and ID " << detId
335 <<
":" << theSectorLevel <<
":" << history.tags.size() <<
":" << fv.
level();
336 for (
unsigned int k = 0;
k < history.tags.size(); ++
k)
337 edm::LogVerbatim(
"Geometry") <<
"[" <<
k <<
"] Tag " << history.tags[
k] <<
" Offset " << history.offsets[
k]
338 <<
" copy " << history.copyNos[
k];
342 if (
num.getLevels() == theRingLevel) {
343 if (detId.region() !=
region) {
348 detId =
GEMDetId(detId.region(), detId.ring(), detId.station(), detId.layer(), chamb, 0);
350 superChambers.emplace_back(gemSuperChamber);
351 }
else if (
num.getLevels() == theSectorLevel) {
352 GEMChamber* gemChamber = buildChamber(fv, detId);
356 theGeometry.
add(etaPart);
359 if (fv.
level() == levelChamb) {
360 if (detId.layer() == 1) {
362 superChambers.emplace_back(gemSuperChamber);
364 GEMChamber* gemChamber = buildChamber(fv, detId);
366 }
else if (
num.getLevels() > theSectorLevel) {
368 theGeometry.
add(etaPart);
378 gemChamber->add(etaPart);
381 theGeometry.
add(gemChamber);
384 buildRegions(theGeometry, superChambers);
389 auto solidA = solid.
solidA();
390 std::vector<double> dpar = solidA.dimensions();
394 double dx1 = dpar[0];
395 double dx2 = dpar[1];
397 auto solidB = solid.solidB();
398 dpar = solidB.dimensions();
400 const double chgap = 2.105;
406 bool isOdd = detId.
chamber() % 2;
415 auto solidA = solid.
solidA();
416 std::vector<double> dpar = solidA.dimensions();
420 double dx1 = dpar[0];
421 double dx2 = dpar[1];
423 auto solidB = solid.solidB();
424 dpar = solidB.dimensions();
428 bool isOdd = detId.
chamber() % 2;
439 auto nPads = fv.
get<
double>(
"nPads");
440 auto dPhi = fv.
get<
double>(
"dPhi");
447 const std::vector<float> pars{
450 bool isOdd = detId.
chamber() % 2;
463 bool isOddChamber)
const {
465 const Double_t* tran = fv.
trans();
472 rota.GetComponents(x, y, z);
495 for (
int re = -1; re <= 1; re = re + 2) {
504 bool foundSuperChamber =
false;
505 for (
int ri = 1; ri <= 1; ++ri) {
507 for (
auto superChamber : superChambers) {
508 const GEMDetId detId(superChamber->id());
509 if (detId.region() != re || detId.station() != st || detId.ring() != ri)
512 foundSuperChamber =
true;
517 GEMDetId chId(detId.region(), detId.ring(), detId.station(), la, detId.chamber(), 0);
524 ring->add(superChamber);
525 theGeometry.
add(superChamber);
527 edm::LogVerbatim(
"Geometry") <<
"Adding super chamber " << detId <<
" to ring: "
528 <<
"re " << re <<
" st " << st <<
" ri " << ri;
533 <<
"re " << re <<
" st " << st;
535 if (foundSuperChamber) {
540 if (!foundSuperChamber) {
542 edm::LogVerbatim(
"Geometry") <<
"No superchamber found: re:" << re <<
" st:" << st;
547 edm::LogVerbatim(
"Geometry") <<
"Adding station " << st <<
" to region " << re;
554 edm::LogVerbatim(
"Geometry") <<
"Adding region " << re <<
" to the geometry ";