17 #include "CLHEP/Units/GlobalSystemOfUnits.h"
21 #include <boost/lexical_cast.hpp>
58 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"Building the geometry service";
59 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"About to run through the ME0 structure\n"
60 <<
"Top level logical part: "
68 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doChamber = fv.firstChild() = " << testChambers;
70 while (testChambers) {
80 LogTrace(
"ME0GeometryBuilderFromDDD")<<
"back to layer "<<fv.
parent();
81 LogTrace(
"ME0GeometryBuilderFromDDD")<<
"back to chamb "<<fv.
parent();
83 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"In DoChambers Loop :: ME0DetId "<<detId<<
" = "<<detId.
rawId()<<
" (which belongs to ME0Chamber "<<detIdCh<<
" = "<<detIdCh.
rawId()<<
")";
86 std::vector<double> dpar2 = solid2.
parameters();
87 std::stringstream parameters2;
88 for(
unsigned int i=0;
i<dpar2.size(); ++
i) {
89 parameters2 <<
" dpar["<<
i<<
"]="<< dpar2[
i]/10 <<
"cm ";
91 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"Second level parameters: vector with size = "<<dpar2.size()<<
" and elements "<<parameters2.str();
115 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doLayer = fv.firstChild() = " << doLayers;
125 LogTrace(
"ME0GeometryBuilderFromDDD")<<
"back to layer "<<fv.
parent();
126 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"In DoLayers Loop :: ME0DetId "<<detId<<
" = "<<detId.
rawId()<<
" (which belongs to ME0Layer "<<detIdLa<<
" = "<<detIdLa.
rawId()<<
")";
129 std::vector<double> dpar3 = solid3.
parameters();
130 std::stringstream parameters3;
131 for(
unsigned int i=0;
i<dpar3.size(); ++
i) {
132 parameters3 <<
" dpar["<<
i<<
"]="<< dpar3[
i]/10 <<
"cm ";
134 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"Third level parameters: vector with size = "<<dpar3.size()<<
" and elements "<<parameters3.str();
137 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doEtaPart = fv.firstChild() = " << doEtaParts;
139 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"In DoEtaParts Loop :: ME0DetId "<<detId<<
" = "<<detId.
rawId();
142 std::vector<double> dpar4 = solid4.
parameters();
143 std::stringstream parameters4;
144 for(
unsigned int i=0;
i<dpar4.size(); ++
i) {
145 parameters4 <<
" dpar["<<
i<<
"]="<< dpar4[
i]/10 <<
"cm ";
147 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"Fourth level parameters: vector with size = "<<dpar4.size()<<
" and elements "<<parameters4.str();
150 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doEtaPart = fv.nextSibling() = " << doEtaParts;
153 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"went back to parent :: name = "<<fv.
logicalPart().
name().
name()<<
" will now ask for nextSibling";
155 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doLayer = fv.nextSibling() = " << doLayers;
158 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"went back to parent :: name = "<<fv.
logicalPart().
name().
name()<<
" will now ask for nextSibling";
160 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doChamber = fv.nextSibling() = " << testChambers;
184 geometry->
add(me0Chamber);
200 me0Chamber->
add(me0Layer);
201 geometry->
add(me0Layer);
215 me0Layer->
add(etaPart);
216 geometry->
add(etaPart);
235 std::vector<double> dpar = solid.
parameters();
236 double L = dpar[0]/cm;
237 double T = dpar[3]/cm;
238 double b = dpar[4]/cm;
239 double B = dpar[8]/cm;
244 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar is vector with size = "<<dpar.size()<<std::endl;
245 for(
unsigned int i=0;
i<dpar.size(); ++
i) {
246 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar ["<<
i<<
"] = "<< dpar[
i]/10 <<
" cm "<<std::endl;
248 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"size b: "<< b <<
"cm, B: " << B <<
"cm, L: " << L <<
"cm, T: " << T <<
"cm "<<std::endl;
262 std::vector<double> dpar = solid.
parameters();
263 double L = dpar[0]/cm;
264 double t = dpar[3]/cm;
265 double b = dpar[4]/cm;
266 double B = dpar[8]/cm;
273 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar is vector with size = "<<dpar.size()<<std::endl;
274 for(
unsigned int i=0;
i<dpar.size(); ++
i) {
275 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar ["<<
i<<
"] = "<< dpar[
i]/10 <<
" cm "<<std::endl;
277 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"size b: "<< b <<
"cm, B: " << B <<
"cm, L: " << L <<
"cm, t: " << t <<
"cm "<<std::endl;
290 DDValue numbOfStrips(
"nStrips");
292 std::vector<const DDsvalues_type* > specs(fv.
specifics());
293 std::vector<const DDsvalues_type* >::iterator is = specs.begin();
294 double nStrips = 0., nPads = 0.;
295 for (;is != specs.end(); is++){
296 if (
DDfetch( *is, numbOfStrips)) nStrips = numbOfStrips.
doubles()[0];
299 LogTrace(
"ME0GeometryBuilderFromDDD")
300 << ((nStrips == 0. ) ? (
"No nStrips found!!") : (
"Number of strips: " + boost::lexical_cast<
std::string>(nStrips)));
301 LogTrace(
"ME0GeometryBuilderFromDDD")
302 << ((nPads == 0. ) ? (
"No nPads found!!") : (
"Number of pads: " + boost::lexical_cast<
std::string>(nPads)));
306 double b = dpar[4]/cm;
307 double B = dpar[8]/cm;
308 double L = dpar[0]/cm;
309 double t = dpar[3]/cm;
313 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar is vector with size = "<<dpar.size()<<std::endl;
314 for(
unsigned int i=0;
i<dpar.size(); ++
i) {
315 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar ["<<
i<<
"] = "<< dpar[
i]/10 <<
" cm "<<std::endl;
317 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"size b: "<< b <<
"cm, B: " << B <<
"cm, L: " << L <<
"cm, t: " << t <<
"cm "<<std::endl;
320 std::vector<float> pars;
324 pars.push_back(nStrips);
325 pars.push_back(nPads);
338 Bounds* bounds,
bool isOddChamber)
const {
343 float(trans.z()/cm));
353 rotation.GetComponents(x,y,z);
362 float(y.X()),
float(y.Y()),
float(y.Z()),
363 float(z.X()),
float(z.Y()),
float(z.Z()));
370 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 ...
ME0DetId layerId() const
Return the corresponding LayerId (mask eta partition)
ME0Chamber * buildChamber(DDFilteredView &fv, ME0DetId detId) 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
ME0Geometry * buildGeometry(DDFilteredView &fview, const MuonDDDConstants &muonConstants)
void addFilter(const DDFilter &, DDLogOp op=DDLogOp::AND)
ME0DetId chamberId() const
Return the corresponding ChamberId (mask layers)
bool nextSibling()
set the current node to the next sibling ...
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
type of data representation of DDCompactView
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
void add(ME0Layer *layer)
Add Layer to the chamber which takes ownership.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
TkRotation & rotateAxes(const Basic3DVector< T > &newX, const Basic3DVector< T > &newY, const Basic3DVector< T > &newZ)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
uint32_t rawId() const
get the raw id
ReferenceCountingPointer< BoundPlane > ME0BoundPlane
ME0BoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
void add(const ME0EtaPartition *roll)
Add EtaPartition to the layer which takes ownership.
virtual int baseNumberToUnitNumber(const MuonBaseNumber &)
ME0EtaPartition * buildEtaPartition(DDFilteredView &fv, ME0DetId detId) const
void add(ME0EtaPartition *etaPartition)
Add a ME0 etaPartition to the Geometry.
ESHandle< TrackerGeometry > geometry
bool firstChild()
set the current node to the first child ...
ME0Geometry * build(const DDCompactView *cview, const MuonDDDConstants &muonConstants)
ME0Layer * buildLayer(DDFilteredView &fv, ME0DetId detId) const
const DDTranslation & translation() const
The absolute translation of the current node.
std::vector< const DDsvalues_type * > specifics() const
~ME0GeometryBuilderFromDDD10EtaPart()
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
ME0GeometryBuilderFromDDD10EtaPart()
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.