22 #include "CLHEP/Units/GlobalSystemOfUnits.h" 26 #include <boost/lexical_cast.hpp> 56 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Building the geometry service";
58 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"About to run through the GEM structure\n" 59 <<
" First logical part " 65 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"doSuperChamber = " << doSuper;
81 if (detIdCh.
layer() == 1){
83 geometry->
add(gemSuperChamber);
102 gemChamber->
add(etaPart);
103 geometry->
add(etaPart);
108 geometry->
add(gemChamber);
119 for (
int re = -1; re <= 1; re = re+2) {
126 for (
int ri=1; ri<=1; ++ri) {
128 for (
unsigned sch=0; sch<superChambers.size(); ++sch){
131 if (detId.region() != re || detId.station() != st || detId.ring() != ri)
continue;
133 auto ch1 = geometry->
chamber(
GEMDetId(detId.region(),detId.ring(),detId.station(),1,detId.chamber(),0));
134 auto ch2 = geometry->
chamber(
GEMDetId(detId.region(),detId.ring(),detId.station(),2,detId.chamber(),0));
135 superChamber->
add(const_cast<GEMChamber*>(ch1));
136 superChamber->
add(const_cast<GEMChamber*>(ch2));
138 ring->
add(superChamber);
139 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding super chamber " << detId <<
" to ring: " 140 <<
"re " << re <<
" st " << st <<
" ri " << ri << std::endl;
142 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding ring " << ri <<
" to station " <<
"re " << re <<
" st " << st << std::endl;
143 station->
add(const_cast<GEMRing*>(ring));
144 geometry->
add(const_cast<GEMRing*>(ring));
146 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding station " << st <<
" to region " << re << std::endl;
147 region->
add(const_cast<GEMStation*>(station));
148 geometry->
add(const_cast<GEMStation*>(station));
150 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"Adding region " << re <<
" to the geometry " << std::endl;
151 geometry->
add(const_cast<GEMRegion*>(region));
163 double dy = dpar[0]/cm;
164 double dz = dpar[3]/cm;
165 double dx1= dpar[4]/cm;
166 double dx2= dpar[8]/cm;
172 bool isOdd = detId.
chamber()%2;
174 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"size "<< dx1 <<
" " << dx2 <<
" " << dy <<
" " << dz <<std::endl;
186 double dy = dpar[0]/cm;
187 double dz = dpar[3]/cm;
188 double dx1= dpar[4]/cm;
189 double dx2= dpar[8]/cm;
193 bool isOdd = detId.
chamber()%2;
195 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"size "<< dx1 <<
" " << dx2 <<
" " << dy <<
" " << dz <<std::endl;
205 DDValue numbOfStrips(
"nStrips");
207 std::vector<const DDsvalues_type* > specs(fv.
specifics());
208 std::vector<const DDsvalues_type* >::iterator is = specs.begin();
209 double nStrips = 0., nPads = 0.;
210 for (;is != specs.end(); is++){
211 if (
DDfetch( *is, numbOfStrips)) nStrips = numbOfStrips.
doubles()[0];
214 LogDebug(
"GEMGeometryBuilderFromDDD")
215 << ((nStrips == 0. ) ? (
"No nStrips found!!") : (
"Number of strips: " + boost::lexical_cast<
std::string>(nStrips)));
216 LogDebug(
"GEMGeometryBuilderFromDDD")
217 << ((nPads == 0. ) ? (
"No nPads found!!") : (
"Number of pads: " + boost::lexical_cast<
std::string>(nPads)));
222 double be = dpar[4]/cm;
223 double te = dpar[8]/cm;
224 double ap = dpar[0]/cm;
227 std::vector<float> pars;
231 pars.push_back(nStrips);
232 pars.push_back(nPads);
234 bool isOdd = detId.
chamber()%2;
239 LogDebug(
"GEMGeometryBuilderFromDDD") <<
"size "<< be <<
" " << te <<
" " << ap <<
" " << ti <<std::endl;
246 Bounds* bounds,
bool isOddChamber)
const {
251 float(trans.z()/cm));
261 rotation.GetComponents(x,y,z);
270 float(y.X()),
float(y.Y()),
float(y.Z()),
271 float(z.X()),
float(z.Y()),
float(z.Z()));
278 if (isOddChamber) newY *= -1;
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
GEMGeometry * buildGeometry(DDFilteredView &fview, const MuonDDDConstants &muonConstants)
void addFilter(const DDFilter &, DDLogOp op=DDLogOp::AND)
bool nextSibling()
set the current node to the next sibling ...
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
void add(GEMChamber *ch)
Add chamber to the super chamber which takes ownership.
int chamber() const
Chamber id: it identifies a chamber in a ring it goes from 1 to 36.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
GEMDetId superChamberId() const
Return the corresponding superChamberId.
type of data representation of DDCompactView
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
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
Return the corresponding ChamberId.
GEMSuperChamber * buildSuperChamber(DDFilteredView &fv, GEMDetId detId) const
GEMGeometry * build(const DDCompactView *cview, const MuonDDDConstants &muonConstants)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
int layer() const
Layer id: each station have two layers of chambers: layer 1 is the inner chamber and layer 2 is the o...
RCPBoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
void add(GEMEtaPartition *roll)
Add EtaPartition to the chamber which takes ownership.
static const int maxStationId
void setName(std::string name)
Set the station name.
GEMGeometryBuilderFromDDD()
virtual int baseNumberToUnitNumber(const MuonBaseNumber &)
DDSolid solidA(void) const
const std::vector< const GEMSuperChamber * > & superChambers() const
Return a vector of all GEM super chambers.
~GEMGeometryBuilderFromDDD()
void add(GEMRegion *region)
Add a GEMRegion to the Geometry.
GEMChamber * buildChamber(DDFilteredView &fv, GEMDetId detId) const
GEMEtaPartition * buildEtaPartition(DDFilteredView &fv, GEMDetId detId) const
const GEMChamber * chamber(GEMDetId id) const
GEMDetId id() const
Return the GEMDetId of this super chamber.
ESHandle< TrackerGeometry > geometry
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)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const std::string & name() const
Returns the name.
void setCriteria(const DDValue &nameVal, DDCompOp, DDLogOp l=DDLogOp::AND, bool asString=true, bool merged=true)
The DDGenericFilter is a runtime-parametrized Filter looking on DDSpecifcs.