|
|
Go to the documentation of this file.
32 #include "CLHEP/Units/GlobalSystemOfUnits.h"
55 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Building the geometry service";
56 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"About to run through the GEM structure\n"
61 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"doSuperChamber = " << doSuper;
63 std::vector<GEMSuperChamber*> superChambers;
83 if (detIdCh.
layer() == 1) {
85 superChambers.push_back(gemSuperChamber);
92 bool loopExecuted =
false;
105 gemChamber = buildChamber(fv, detId);
117 gemChamber->
add(etaPart);
118 theGeometry.
add(etaPart);
124 theGeometry.
add(gemChamber);
138 for (
int re = -1; re <= 1; re = re + 2) {
147 bool foundSuperChamber =
false;
148 for (
int ri = 1; ri <= 1; ++ri) {
150 for (
auto superChamber : superChambers) {
151 const GEMDetId detId(superChamber->id());
152 if (detId.region() != re || detId.station() != st || detId.ring() != ri)
155 foundSuperChamber =
true;
160 GEMDetId chId(detId.region(), detId.ring(), detId.station(), la, detId.chamber(), 0);
163 edm::LogWarning(
"GEMGeometryBuilderFromDDD") <<
"Missing chamber " << chId << std::endl;
167 ring->add(superChamber);
168 theGeometry.
add(superChamber);
169 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding super chamber " << detId <<
" to ring: "
170 <<
"re " << re <<
" st " << st <<
" ri " << ri << std::endl;
172 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding ring " << ri <<
" to station "
173 <<
"re " << re <<
" st " << st << std::endl;
174 if (!foundSuperChamber) {
181 if (!foundSuperChamber) {
182 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"No superchamber found: re:" << re <<
" st:" << st << std::endl;
185 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding station " << st <<
" to region " << re << std::endl;
190 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding region " << re <<
" to the geometry " << std::endl;
211 const double chgap = 2.105;
220 bool isOdd = detId.
chamber() % 2;
223 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"size " << dx1 <<
" " << dx2 <<
" " <<
dy <<
" " <<
dz << std::endl;
251 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"size " << dx1 <<
" " << dx2 <<
" " <<
dy <<
" " <<
dz << std::endl;
262 DDValue numbOfStrips(
"nStrips");
265 std::vector<const DDsvalues_type*>::iterator is =
specs.begin();
266 double nStrips = 0., nPads = 0.;
267 for (; is !=
specs.end(); is++) {
268 if (
DDfetch(*is, numbOfStrips))
271 nPads = numbOfPads.
doubles()[0];
273 LogDebug(
"GEMGeometryBuilderFromDDD") << ((
nStrips == 0.) ? (
"No nStrips found!!")
274 : (
"Number of strips: " + std::to_string(
nStrips)));
275 LogDebug(
"GEMGeometryBuilderFromDDD") << ((nPads == 0.) ? (
"No nPads found!!")
276 : (
"Number of pads: " + std::to_string(nPads)));
286 std::vector<float> pars;
287 pars.emplace_back(
be);
288 pars.emplace_back(te);
289 pars.emplace_back(ap);
291 pars.emplace_back(nPads);
293 bool isOdd = detId.
chamber() % 2;
298 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"size " <<
be <<
" " << te <<
" " << ap <<
" " << ti << std::endl;
306 bool isOddChamber)
const {
309 const Surface::PositionType posResult(
float(trans.x() / cm),
float(trans.y() / cm),
float(trans.z() / cm));
347 fv.mergedSpecifics(refs);
349 bool doChambers = fv.firstChild();
352 std::vector<GEMSuperChamber*> superChambers;
360 if (detIdCh.
layer() == 1) {
362 superChambers.push_back(gemSuperChamber);
366 GEMChamber* gemChamber = buildChamber(fv, detIdCh);
370 bool doEtaPart = fv.nextSibling();
376 gemChamber->
add(etaPart);
378 theGeometry.
add(etaPart);
379 doEtaPart = fv.sibling();
381 theGeometry.
add(gemChamber);
386 doChambers = fv.firstChild();
391 for (
int re = -1; re <= 1; re = re + 2) {
398 for (
int ri = 1; ri <= 1; ++ri) {
400 for (
auto superChamber : superChambers) {
401 const GEMDetId detId(superChamber->id());
402 if (detId.region() != re || detId.station() != st || detId.ring() != ri)
406 theGeometry.
chamber(
GEMDetId(detId.region(), detId.ring(), detId.station(), 1, detId.chamber(), 0)));
408 theGeometry.
chamber(
GEMDetId(detId.region(), detId.ring(), detId.station(), 2, detId.chamber(), 0)));
410 ring->add(superChamber);
411 theGeometry.
add(superChamber);
413 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding super chamber " << detId <<
" to ring: "
414 <<
"re " << re <<
" st " << st <<
" ri " << ri << std::endl;
416 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding ring " << ri <<
" to station "
417 <<
"re " << re <<
" st " << st << std::endl;
422 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding station " << st <<
" to region " << re << std::endl;
427 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding region " << re <<
" to the geometry " << std::endl;
435 auto solidA = solid.
solidA();
436 std::vector<double> dpar = solidA.dimensions();
440 double dx1 = dpar[0];
441 double dx2 = dpar[1];
443 auto solidB = solid.solidB();
444 dpar = solidB.dimensions();
446 const double chgap = 2.105;
452 bool isOdd = detId.
chamber() % 2;
461 auto solidA = solid.
solidA();
462 std::vector<double> dpar = solidA.dimensions();
466 double dx1 = dpar[0];
467 double dx2 = dpar[1];
469 auto solidB = solid.solidB();
470 dpar = solidB.dimensions();
474 bool isOdd = detId.
chamber() % 2;
485 auto nPads = fv.
get<
double>(
"nPads");
495 bool isOdd = detId.
chamber() % 2;
508 bool isOddChamber)
const {
510 const Double_t* tran = fv.
trans();
517 rota.GetComponents(x, y, z);
const Double_t * rot() const
The absolute rotation of the current node.
DDSolid solidB(void) const
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.
RCPBoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
const std::vector< double > parameters() const
extract shape parameters
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history) const
constexpr int layer() const
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
constexpr GEMDetId superChamberId() const
static constexpr int32_t maxStationId
static constexpr int32_t minLayerId
bool parent()
set the current node to the parent node ...
GEMGeometryBuilderFromDDD()
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
dd4hep::Solid solidA() const
void build(GEMGeometry &theGeometry, const DDCompactView *cview, const MuonGeometryConstants &muonConstants)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
std::string_view name() const
dd4hep::Solid solid() const
const Double_t * trans() const
The absolute translation of the current node.
bool firstChild()
set the current node to the first child ...
int baseNumberToUnitNumber(const MuonBaseNumber &) override
GEMEtaPartition * buildEtaPartition(DDFilteredView &fv, GEMDetId detId) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
T get(const std::string &) const
extract attribute value
static constexpr int32_t minStationId0
Compact representation of the geometrical detector hierarchy.
bool nextSibling()
set the current node to the next sibling ...
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
GEMSuperChamber * buildSuperChamber(DDFilteredView &fv, GEMDetId detId) const
std::vector< const DDSpecPar * > DDSpecParRefs
constexpr int chamber() const
static constexpr int32_t maxLayerId0
const std::string & name() const
Returns the name.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
DDSpecParRegistry const & specpars() const
std::vector< const DDsvalues_type * > specifics() const
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)
const DDTranslation & translation() const
The absolute translation of the current node.
static constexpr int32_t maxLayerId
void filter(DDSpecParRefs &, const std::string &, const std::string &="") const
constexpr GEMDetId chamberId() const
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
DDSolid solidA(void) const
const std::vector< double > & doubles() const
a reference to the double-valued values stored in the given instance of DDValue
GEMChamber * buildChamber(DDFilteredView &fv, GEMDetId detId) const
constexpr NumType convertMmToCm(NumType millimeters)
constexpr int station() const
const GEMChamber * chamber(GEMDetId id) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Volume worldVolume() const
Handle to the world volume containing everything.
const cms::DDDetector * detector() const
~GEMGeometryBuilderFromDDD()
void add(GEMEtaPartition *roll)
Add EtaPartition to the chamber which takes ownership.