38 using namespace geant_units::operators;
77 bool demonstratorGeometry = nGE21 == 1;
80 edm::LogVerbatim(
"Geometry") <<
"Found " << nGE21 <<
" GE2/1 chambers. Demonstrator geometry on? "
81 << demonstratorGeometry;
101 std::vector<GEMSuperChamber*> superChambers;
131 if ((detIdCh.
layer() == 1) || (detIdCh.
layer() == 2 and detIdCh.
station() == 2 and demonstratorGeometry)) {
133 superChambers.push_back(gemSuperChamber);
140 bool loopExecuted =
false;
155 gemChamber = buildChamber(fv, detId);
169 gemChamber->
add(etaPart);
170 theGeometry.
add(etaPart);
176 theGeometry.
add(gemChamber);
189 buildRegions(theGeometry, superChambers, demonstratorGeometry);
207 const double chgap = 2.105;
216 bool isOdd = detId.
chamber() % 2;
220 edm::LogVerbatim(
"Geometry") <<
"size " << dx1 <<
" " << dx2 <<
" " << dy <<
" " <<
dz;
244 bool isOdd = ge0Station ?
false : detId.
chamber() % 2;
249 edm::LogVerbatim(
"Geometry") <<
"size " << dx1 <<
" " << dx2 <<
" " << dy <<
" " <<
dz;
260 DDValue numbOfStrips(
"nStrips");
263 std::vector<const DDsvalues_type*> specs(fv.
specifics());
264 std::vector<const DDsvalues_type*>::iterator is = specs.begin();
265 double nStrips = 0., nPads = 0., dPhi = 0.;
266 for (; is != specs.end(); is++) {
267 if (
DDfetch(*is, numbOfStrips))
268 nStrips = numbOfStrips.
doubles()[0];
270 nPads = numbOfPads.
doubles()[0];
287 std::vector<float> pars;
288 pars.emplace_back(be);
289 pars.emplace_back(te);
290 pars.emplace_back(ap);
291 pars.emplace_back(nStrips);
292 pars.emplace_back(nPads);
293 pars.emplace_back(dPhi);
295 bool isOdd = detId.
chamber() % 2;
301 edm::LogVerbatim(
"Geometry") <<
"size " << be <<
" " << te <<
" " << ap <<
" " << ti;
309 bool isOddChamber)
const {
317 rotation.GetComponents(x, y, z);
351 static constexpr uint32_t levelChamb = 7;
353 int theLevelPart = muonConstants.
getValue(
"level");
354 int theRingLevel = muonConstants.
getValue(
"mg_ring") / theLevelPart;
355 int theSectorLevel = muonConstants.
getValue(
"mg_sector") / theLevelPart;
365 if (fvGE2.
level() == levelChamb) {
366 if (detId.station() == 2)
372 bool demonstratorGeometry = nGE21 == 1;
374 edm::LogVerbatim(
"Geometry") <<
"Found " << nGE21 <<
" GE2/1 chambers. Demonstrator geometry on? "
375 << demonstratorGeometry;
380 std::vector<GEMSuperChamber*> superChambers;
391 <<
":" << theSectorLevel <<
":" <<
history.tags.size() <<
":" << fv.
level();
392 for (
unsigned int k = 0;
k <
history.tags.size(); ++
k)
398 if (
num.getLevels() == theRingLevel) {
399 if (detId.region() !=
region) {
400 region = detId.region();
404 detId =
GEMDetId(detId.region(), detId.ring(), detId.station(), detId.layer(), chamb, 0);
406 superChambers.emplace_back(gemSuperChamber);
407 }
else if (
num.getLevels() == theSectorLevel) {
408 GEMChamber* gemChamber = buildChamber(fv, detId);
409 chambers.emplace_back(gemChamber);
412 theGeometry.
add(etaPart);
415 if (fv.
level() == levelChamb) {
416 if ((detId.layer() == 1) || (detId.layer() == 2 and detId.station() == 2 and demonstratorGeometry)) {
418 superChambers.emplace_back(gemSuperChamber);
420 GEMChamber* gemChamber = buildChamber(fv, detId);
421 chambers.emplace_back(gemChamber);
422 }
else if (
num.getLevels() > theSectorLevel) {
424 theGeometry.
add(etaPart);
430 for (
auto& gemChamber : chambers) {
434 gemChamber->add(etaPart);
437 theGeometry.
add(gemChamber);
440 buildRegions(theGeometry, superChambers, demonstratorGeometry);
445 auto solidA = solid.
solidA();
446 std::vector<double> dpar = solidA.dimensions();
448 double dy = k_ScaleFromDD4hep * dpar[3];
449 double dz = k_ScaleFromDD4hep * dpar[2];
450 double dx1 = k_ScaleFromDD4hep * dpar[0];
451 double dx2 = k_ScaleFromDD4hep * dpar[1];
453 auto solidB = solid.solidB();
454 dpar = solidB.dimensions();
456 const double chgap = 2.105;
458 dz += (k_ScaleFromDD4hep * dpar[2]);
462 bool isOdd = detId.
chamber() % 2;
471 auto solidA = solid.
solidA();
472 std::vector<double> dpar = solidA.dimensions();
474 double dy = k_ScaleFromDD4hep * dpar[3];
475 double dz = k_ScaleFromDD4hep * dpar[2];
476 double dx1 = k_ScaleFromDD4hep * dpar[0];
477 double dx2 = k_ScaleFromDD4hep * dpar[1];
479 auto solidB = solid.solidB();
480 dpar = solidB.dimensions();
482 dz += (k_ScaleFromDD4hep * dpar[2]);
484 bool isOdd = detId.
chamber() % 2;
495 auto nPads = fv.
get<
double>(
"nPads");
496 auto dPhi = fv.
get<
double>(
"dPhi");
503 const std::vector<float> pars{float(k_ScaleFromDD4hep * dpar[0]),
504 float(k_ScaleFromDD4hep * dpar[1]),
505 float(k_ScaleFromDD4hep * dpar[3]),
510 bool isOdd = detId.
chamber() % 2;
514 k_ScaleFromDD4hep * dpar[0], k_ScaleFromDD4hep * dpar[1], k_ScaleFromDD4hep * dpar[3], ti),
527 bool isOddChamber)
const {
529 const Double_t* tran = fv.
trans();
531 k_ScaleFromDD4hep * tran[0], k_ScaleFromDD4hep * tran[1], k_ScaleFromDD4hep * tran[2]);
537 rota.GetComponents(x, y, z);
559 const std::vector<GEMSuperChamber*>& superChambers,
560 bool demonstratorGeometry) {
562 for (
int re = -1; re <= 1; re = re + 2) {
571 bool foundSuperChamber =
false;
572 for (
int ri = 1; ri <= 1; ++ri) {
574 for (
auto superChamber : superChambers) {
575 const GEMDetId detId(superChamber->id());
576 if (detId.region() != re || detId.station() != st || detId.ring() != ri)
579 foundSuperChamber =
true;
584 GEMDetId chId(detId.region(), detId.ring(), detId.station(), la, detId.chamber(), 0);
585 auto chamber = theGeometry.
chamber(chId);
588 if (!demonstratorGeometry
or
589 not(chId.region() == 1 and chId.station() == 2 and chId.chamber() == 16 and chId.layer() == 1)) {
593 superChamber->add(chamber);
596 ring->
add(superChamber);
597 theGeometry.
add(superChamber);
599 edm::LogVerbatim(
"Geometry") <<
"Adding super chamber " << detId <<
" to ring: "
600 <<
"re " << re <<
" st " << st <<
" ri " << ri;
605 <<
"re " << re <<
" st " << st;
607 if (foundSuperChamber) {
609 theGeometry.
add(ring);
612 if (!foundSuperChamber) {
614 edm::LogVerbatim(
"Geometry") <<
"No superchamber found: re:" << re <<
" st:" << st;
619 edm::LogVerbatim(
"Geometry") <<
"Adding station " << st <<
" to region " << re;
621 region->
add(station);
622 theGeometry.
add(station);
626 edm::LogVerbatim(
"Geometry") <<
"Adding region " << re <<
" to the geometry ";
628 theGeometry.
add(region);
Log< level::Info, true > LogVerbatim
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
bool parent()
set the current node to the parent node ...
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history) const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> DD3Vector
int getValue(const std::string &name) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool nextSibling()
set the current node to the next sibling ...
dd4hep::Solid solidA() const
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
GEMEtaPartition * buildEtaPartition(DDFilteredView &fv, GEMDetId detId) const
std::string to_string(const V &value)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Compact representation of the geometrical detector hierarchy.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
tuple nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
void add(GEMRing *ring)
Add ring to the station which takes ownership.
void add(GEMSuperChamber *ch)
Add super chamber to the ring which takes ownership.
static constexpr int32_t maxLayerId0
TkRotation & rotateAxes(const Basic3DVector< T > &newX, const Basic3DVector< T > &newY, const Basic3DVector< T > &newZ)
DDSolid solidB(void) const
static double delPhi(const double phi1, const double phi2)
RCPBoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const ExpandedNodes & history()
The numbering history of the current node.
static constexpr uint32_t chamberIdMask
static constexpr int32_t minStationId0
void build(GEMGeometry &theGeometry, const DDCompactView *cview, const MuonGeometryConstants &muonConstants)
static constexpr int32_t maxStationId
const Double_t * rot() const
The absolute rotation of the current node.
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
constexpr GEMDetId chamberId() const
void setName(std::string name)
Set the station name.
std::string_view name() const
bool firstChild()
set the current node to the first child
DDSolid solidA(void) const
T get(const std::string &)
extract attribute value
constexpr NumType convertMmToCm(NumType millimeters)
const Double_t * trans() const
The absolute translation of the current node.
GEMChamber * buildChamber(DDFilteredView &fv, GEMDetId detId) const
constexpr int chamber() const
constexpr int layer() const
const GEMChamber * chamber(GEMDetId id) const
constexpr int station() const
static constexpr int32_t maxLayerId
void buildRegions(GEMGeometry &, const std::vector< GEMSuperChamber * > &, bool demonstratorGeometry)
bool firstChild()
set the current node to the first child ...
int baseNumberToUnitNumber(const MuonBaseNumber &) const override
void add(GEMStation *st)
Add station to the region which takes ownership.
GEMSuperChamber * buildSuperChamber(DDFilteredView &fv, GEMDetId detId) const
const std::vector< double > parameters() const
extract shape parameters
const DDTranslation & translation() const
The absolute translation of the current node.
constexpr GEMDetId superChamberId() const
std::vector< const DDsvalues_type * > specifics() const
Log< level::Warning, false > LogWarning
const int level() const
get Iterator level
static char chambers[264][20]
void add(const GEMEtaPartition *roll)
Add EtaPartition to the chamber which takes ownership.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
static constexpr int32_t minLayerId
const std::string & name() const
Returns the name.
dd4hep::Solid solid() const
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.