79 bool demonstratorGeometry = nGE21 % 2 == 1;
82 edm::LogVerbatim(
"Geometry") <<
"Found " << nGE21 <<
" GE2/1 chambers. Demonstrator geometry on? " 83 << demonstratorGeometry;
103 std::vector<GEMSuperChamber*> superChambers;
133 if ((detIdCh.
layer() == 1) || (detIdCh.
layer() == 2 and detIdCh.
station() == 2 and demonstratorGeometry)) {
135 superChambers.push_back(gemSuperChamber);
142 bool loopExecuted =
false;
157 gemChamber = buildChamber(fv,
detId);
171 gemChamber->
add(etaPart);
172 theGeometry.
add(etaPart);
178 theGeometry.
add(gemChamber);
191 buildRegions(theGeometry, superChambers, demonstratorGeometry);
209 const double chgap = 2.105;
218 bool isOdd =
detId.chamber() % 2;
246 bool isOdd = ge0Station ?
false :
detId.chamber() % 2;
262 DDValue numbOfStrips(
"nStrips");
266 std::vector<const DDsvalues_type*>::iterator is =
specs.begin();
267 double nStrips = 0., nPads = 0., dPhi = 0.;
268 for (; is !=
specs.end(); is++) {
269 if (
DDfetch(*is, numbOfStrips))
272 nPads = numbOfPads.
doubles()[0];
274 dPhi =
delPhi.doubles()[0];
289 std::vector<float> pars;
290 pars.emplace_back(
be);
291 pars.emplace_back(te);
292 pars.emplace_back(ap);
294 pars.emplace_back(nPads);
295 pars.emplace_back(dPhi);
297 bool isOdd =
detId.chamber() % 2;
311 bool isOddChamber)
const {
353 static constexpr uint32_t levelChamb = 7;
355 int theLevelPart = muonConstants.
getValue(
"level");
356 int theRingLevel = muonConstants.
getValue(
"mg_ring") / theLevelPart;
357 int theSectorLevel = muonConstants.
getValue(
"mg_sector") / theLevelPart;
362 const auto& history = fvGE2.
history();
367 if (fvGE2.
level() == levelChamb) {
368 if (
detId.station() == 2)
374 bool demonstratorGeometry = nGE21 % 2 == 1;
376 edm::LogVerbatim(
"Geometry") <<
"Found " << nGE21 <<
" GE2/1 chambers. Demonstrator geometry on? " 377 << demonstratorGeometry;
382 std::vector<GEMSuperChamber*> superChambers;
386 const auto& history = fv.
history();
393 <<
":" << theSectorLevel <<
":" << history.tags.size() <<
":" << fv.
level();
394 for (
unsigned int k = 0;
k < history.tags.size(); ++
k)
395 edm::LogVerbatim(
"Geometry") <<
"[" <<
k <<
"] Tag " << history.tags[
k] <<
" Offset " << history.offsets[
k]
396 <<
" copy " << history.copyNos[
k];
400 if (
num.getLevels() == theRingLevel) {
408 superChambers.emplace_back(gemSuperChamber);
409 }
else if (
num.getLevels() == theSectorLevel) {
414 theGeometry.
add(etaPart);
417 if (fv.
level() == levelChamb) {
418 if ((
detId.layer() == 1) || (
detId.layer() == 2 and
detId.station() == 2 and demonstratorGeometry)) {
420 superChambers.emplace_back(gemSuperChamber);
424 }
else if (
num.getLevels() > theSectorLevel) {
426 theGeometry.
add(etaPart);
436 gemChamber->add(etaPart);
439 theGeometry.
add(gemChamber);
442 buildRegions(theGeometry, superChambers, demonstratorGeometry);
447 auto solidA = solid.
solidA();
448 std::vector<double> dpar = solidA.dimensions();
450 double dy = k_ScaleFromDD4hep * dpar[3];
451 double dz = k_ScaleFromDD4hep * dpar[2];
452 double dx1 = k_ScaleFromDD4hep * dpar[0];
453 double dx2 = k_ScaleFromDD4hep * dpar[1];
455 auto solidB = solid.solidB();
456 dpar = solidB.dimensions();
458 const double chgap = 2.105;
460 dz += (k_ScaleFromDD4hep * dpar[2]);
464 bool isOdd =
detId.chamber() % 2;
473 auto solidA = solid.
solidA();
474 std::vector<double> dpar = solidA.dimensions();
476 double dy = k_ScaleFromDD4hep * dpar[3];
477 double dz = k_ScaleFromDD4hep * dpar[2];
478 double dx1 = k_ScaleFromDD4hep * dpar[0];
479 double dx2 = k_ScaleFromDD4hep * dpar[1];
481 auto solidB = solid.solidB();
482 dpar = solidB.dimensions();
484 dz += (k_ScaleFromDD4hep * dpar[2]);
486 bool isOdd =
detId.chamber() % 2;
497 auto nPads = fv.
get<
double>(
"nPads");
498 auto dPhi = fv.
get<
double>(
"dPhi");
505 const std::vector<float> pars{
float(k_ScaleFromDD4hep * dpar[0]),
506 float(k_ScaleFromDD4hep * dpar[1]),
507 float(k_ScaleFromDD4hep * dpar[3]),
512 bool isOdd =
detId.chamber() % 2;
516 k_ScaleFromDD4hep * dpar[0], k_ScaleFromDD4hep * dpar[1], k_ScaleFromDD4hep * dpar[3], ti),
529 bool isOddChamber)
const {
531 const Double_t* tran = fv.
trans();
533 k_ScaleFromDD4hep * tran[0], k_ScaleFromDD4hep * tran[1], k_ScaleFromDD4hep * tran[2]);
539 rota.GetComponents(
x, y, z);
561 const std::vector<GEMSuperChamber*>& superChambers,
562 bool demonstratorGeometry) {
564 for (
int re = -1; re <= 1; re = re + 2) {
573 bool foundSuperChamber =
false;
574 for (
int ri = 1; ri <= 1; ++ri) {
576 for (
auto superChamber : superChambers) {
578 if (
detId.region() != re ||
detId.station() != st ||
detId.ring() != ri)
581 foundSuperChamber =
true;
590 if (!demonstratorGeometry
or not(chId.station() == 2)) {
597 ring->add(superChamber);
598 theGeometry.
add(superChamber);
601 <<
"re " << re <<
" st " << st <<
" ri " << ri;
606 <<
"re " << re <<
" st " << st;
608 if (foundSuperChamber) {
614 if (!foundSuperChamber) {
616 edm::LogVerbatim(
"Geometry") <<
"No superchamber found: re:" << re <<
" st:" << st;
621 edm::LogVerbatim(
"Geometry") <<
"Adding station " << st <<
" to region " << re;
628 edm::LogVerbatim(
"Geometry") <<
"Adding region " << re <<
" to the geometry ";
int getValue(const std::string &name) const
Log< level::Info, true > LogVerbatim
DDSolid solidA(void) const
bool parent()
set the current node to the parent node ...
constexpr int station() const
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
bool nextSibling()
set the current node to the next sibling ...
GEMChamber * buildChamber(DDFilteredView &fv, GEMDetId detId) const
const Double_t * rot() const
The absolute rotation of the current node.
void buildRegions(GEMGeometry &, const std::vector< GEMSuperChamber *> &, bool demonstratorGeometry)
RCPBoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
GEMEtaPartition * buildEtaPartition(DDFilteredView &fv, GEMDetId detId) const
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
constexpr int layer() const
dd4hep::Solid solidA() const
Compact representation of the geometrical detector hierarchy.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
static constexpr int32_t maxLayerId0
static std::string to_string(const XMLCh *ch)
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
TkRotation & rotateAxes(const Basic3DVector< T > &newX, const Basic3DVector< T > &newY, const Basic3DVector< T > &newZ)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
std::string_view name() const
const Double_t * trans() const
The absolute translation of the current node.
static double delPhi(const double phi1, const double phi2)
const std::string & name() const
Returns the name.
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
GEMSuperChamber * buildSuperChamber(DDFilteredView &fv, GEMDetId detId) 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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
static constexpr int32_t minStationId0
void build(GEMGeometry &theGeometry, const DDCompactView *cview, const MuonGeometryConstants &muonConstants)
static constexpr int32_t maxStationId
const int level() const
get Iterator level
DDSolid solidB(void) const
bool firstChild()
set the current node to the first child
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
T get(const std::string &)
extract attribute value
std::vector< const DDsvalues_type * > specifics() const
constexpr NumType convertMmToCm(NumType millimeters)
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
static constexpr int32_t maxLayerId
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
dd4hep::Solid solid() const
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
bool firstChild()
set the current node to the first child ...
int baseNumberToUnitNumber(const MuonBaseNumber &) const override
Log< level::Warning, false > LogWarning
static char chambers[264][20]
const DDTranslation & translation() const
The absolute translation of the current node.
void add(const GEMEtaPartition *roll)
Add EtaPartition to the chamber which takes ownership.
const std::vector< double > parameters() const
extract shape parameters
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
static constexpr int32_t minLayerId
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history) const
const GEMChamber * chamber(GEMDetId id) const
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.