20 #include "CLHEP/Units/GlobalSystemOfUnits.h" 40 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Building the geometry service";
41 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"About to run through the GEM structure\n" 45 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"doSuperChamber = " << doSuper;
47 std::vector<GEMSuperChamber*> superChambers;
63 if (detIdCh.
layer() == 1) {
65 superChambers.push_back(gemSuperChamber);
72 bool loopExecuted =
false;
85 gemChamber->
add(etaPart);
86 theGeometry.
add(etaPart);
91 theGeometry.
add(gemChamber);
103 for (
int re = -1; re <= 1; re = re + 2) {
110 for (
int ri = 1; ri <= 1; ++ri) {
112 for (
auto superChamber : superChambers) {
113 const GEMDetId detId(superChamber->id());
114 if (detId.region() != re || detId.station() != st || detId.ring() != ri)
118 theGeometry.
chamber(
GEMDetId(detId.region(), detId.ring(), detId.station(), 1, detId.chamber(), 0)));
120 theGeometry.
chamber(
GEMDetId(detId.region(), detId.ring(), detId.station(), 2, detId.chamber(), 0)));
122 ring->
add(superChamber);
123 theGeometry.
add(superChamber);
124 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding super chamber " << detId <<
" to ring: " 125 <<
"re " << re <<
" st " << st <<
" ri " << ri << std::endl;
127 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding ring " << ri <<
" to station " 128 <<
"re " << re <<
" st " << st << std::endl;
130 theGeometry.
add(ring);
132 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding station " << st <<
" to region " << re << std::endl;
133 region->
add(station);
134 theGeometry.
add(station);
136 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding region " << re <<
" to the geometry " << std::endl;
137 theGeometry.
add(region);
148 double dy = dpar[0] / cm;
149 double dz = dpar[3] / cm;
150 double dx1 = dpar[4] / cm;
151 double dx2 = dpar[8] / cm;
157 bool isOdd = detId.
chamber() % 2;
160 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"size " << dx1 <<
" " << dx2 <<
" " << dy <<
" " << dz << std::endl;
173 double dy = dpar[0] / cm;
174 double dz = dpar[3] / cm;
175 double dx1 = dpar[4] / cm;
176 double dx2 = dpar[8] / cm;
180 bool isOdd = detId.
chamber() % 2;
183 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"size " << dx1 <<
" " << dx2 <<
" " << dy <<
" " << dz << std::endl;
194 DDValue numbOfStrips(
"nStrips");
197 std::vector<const DDsvalues_type*>::iterator is =
specs.begin();
198 double nStrips = 0., nPads = 0.;
199 for (; is !=
specs.end(); is++) {
200 if (
DDfetch(*is, numbOfStrips))
201 nStrips = numbOfStrips.
doubles()[0];
203 nPads = numbOfPads.
doubles()[0];
205 LogDebug(
"GEMGeometryBuilderFromDDD") << ((nStrips == 0.) ? (
"No nStrips found!!")
206 : (
"Number of strips: " + std::to_string(nStrips)));
207 LogDebug(
"GEMGeometryBuilderFromDDD") << ((nPads == 0.) ? (
"No nPads found!!")
208 : (
"Number of pads: " + std::to_string(nPads)));
213 double be = dpar[4] / cm;
214 double te = dpar[8] / cm;
215 double ap = dpar[0] / cm;
216 double ti = 0.4 / cm;
218 std::vector<float> pars;
219 pars.emplace_back(be);
220 pars.emplace_back(te);
221 pars.emplace_back(ap);
222 pars.emplace_back(nStrips);
223 pars.emplace_back(nPads);
225 bool isOdd = detId.
chamber() % 2;
230 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"size " << be <<
" " << te <<
" " << ap <<
" " << ti << std::endl;
237 bool isOddChamber)
const {
240 const Surface::PositionType posResult(
float(trans.x() / cm),
float(trans.y() / cm),
float(trans.z() / cm));
245 rotation.GetComponents(x, y, z);
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
bool parent()
set the current node to the parent node ...
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
bool nextSibling()
set the current node to the next sibling ...
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
static int32_t maxStationId
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
GEMDetId superChamberId() const
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 *.
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.
ReferenceCountingPointer< BoundPlane > RCPBoundPlane
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)
DDSolid solidB(void) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
GEMDetId chamberId() const
GEMSuperChamber * buildSuperChamber(DDFilteredView &fv, GEMDetId detId) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
void build(GEMGeometry &theGeometry, const DDCompactView *cview, const MuonDDDConstants &muonConstants)
RCPBoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
void add(GEMEtaPartition *roll)
Add EtaPartition to the chamber which takes ownership.
void setName(std::string name)
Set the station name.
GEMGeometryBuilderFromDDD()
DDSolid solidA(void) const
~GEMGeometryBuilderFromDDD()
GEMChamber * buildChamber(DDFilteredView &fv, GEMDetId detId) const
GEMEtaPartition * buildEtaPartition(DDFilteredView &fv, GEMDetId detId) const
const GEMChamber * chamber(GEMDetId id) const
bool firstChild()
set the current node to the first child ...
void add(GEMStation *st)
Add station to the region which takes ownership.
const DDTranslation & translation() const
The absolute translation of the current node.
std::vector< const DDsvalues_type * > specifics() const
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history)
int baseNumberToUnitNumber(const MuonBaseNumber &) override
const std::string & name() const
Returns the name.
void add(const GEMRegion *region)
Add a GEMRegion to the Geometry.