17 #include "CLHEP/Units/GlobalSystemOfUnits.h" 21 #include <boost/lexical_cast.hpp> 49 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"Building the geometry service";
50 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"About to run through the ME0 structure\n" 51 <<
"Top level logical part: " 59 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doChamber = fv.firstChild() = " << testChambers;
61 while (testChambers) {
71 LogTrace(
"ME0GeometryBuilderFromDDD")<<
"back to layer "<<fv.
parent();
72 LogTrace(
"ME0GeometryBuilderFromDDD")<<
"back to chamb "<<fv.
parent();
74 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"In DoChambers Loop :: ME0DetId "<<detId<<
" = "<<detId.
rawId()<<
" (which belongs to ME0Chamber "<<detIdCh<<
" = "<<detIdCh.
rawId()<<
")";
77 std::vector<double> dpar2 = solid2.
parameters();
78 std::stringstream parameters2;
79 for(
unsigned int i=0;
i<dpar2.size(); ++
i) {
80 parameters2 <<
" dpar["<<
i<<
"]="<< dpar2[
i]/10 <<
"cm ";
82 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"Second level parameters: vector with size = "<<dpar2.size()<<
" and elements "<<parameters2.str();
106 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doLayer = fv.firstChild() = " << doLayers;
116 LogTrace(
"ME0GeometryBuilderFromDDD")<<
"back to layer "<<fv.
parent();
117 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"In DoLayers Loop :: ME0DetId "<<detId<<
" = "<<detId.
rawId()<<
" (which belongs to ME0Layer "<<detIdLa<<
" = "<<detIdLa.
rawId()<<
")";
120 std::vector<double> dpar3 = solid3.
parameters();
121 std::stringstream parameters3;
122 for(
unsigned int i=0;
i<dpar3.size(); ++
i) {
123 parameters3 <<
" dpar["<<
i<<
"]="<< dpar3[
i]/10 <<
"cm ";
125 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"Third level parameters: vector with size = "<<dpar3.size()<<
" and elements "<<parameters3.str();
128 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doEtaPart = fv.firstChild() = " << doEtaParts;
130 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"In DoEtaParts Loop :: ME0DetId "<<detId<<
" = "<<detId.
rawId();
133 std::vector<double> dpar4 = solid4.
parameters();
134 std::stringstream parameters4;
135 for(
unsigned int i=0;
i<dpar4.size(); ++
i) {
136 parameters4 <<
" dpar["<<
i<<
"]="<< dpar4[
i]/10 <<
"cm ";
138 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"Fourth level parameters: vector with size = "<<dpar4.size()<<
" and elements "<<parameters4.str();
141 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doEtaPart = fv.nextSibling() = " << doEtaParts;
144 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"went back to parent :: name = "<<fv.
logicalPart().
name().
name()<<
" will now ask for nextSibling";
146 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doLayer = fv.nextSibling() = " << doLayers;
149 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"went back to parent :: name = "<<fv.
logicalPart().
name().
name()<<
" will now ask for nextSibling";
151 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"doChamber = fv.nextSibling() = " << testChambers;
175 geometry->
add(me0Chamber);
191 me0Chamber->
add(me0Layer);
192 geometry->
add(me0Layer);
206 me0Layer->
add(etaPart);
207 geometry->
add(etaPart);
226 std::vector<double> dpar = solid.
parameters();
227 double L = dpar[0]/cm;
228 double T = dpar[3]/cm;
229 double b = dpar[4]/cm;
230 double B = dpar[8]/cm;
235 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar is vector with size = "<<dpar.size()<<std::endl;
236 for(
unsigned int i=0;
i<dpar.size(); ++
i) {
237 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar ["<<
i<<
"] = "<< dpar[
i]/10 <<
" cm "<<std::endl;
239 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"size b: "<< b <<
"cm, B: " << B <<
"cm, L: " << L <<
"cm, T: " << T <<
"cm "<<std::endl;
253 std::vector<double> dpar = solid.
parameters();
254 double L = dpar[0]/cm;
255 double t = dpar[3]/cm;
256 double b = dpar[4]/cm;
257 double B = dpar[8]/cm;
264 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar is vector with size = "<<dpar.size()<<std::endl;
265 for(
unsigned int i=0;
i<dpar.size(); ++
i) {
266 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar ["<<
i<<
"] = "<< dpar[
i]/10 <<
" cm "<<std::endl;
268 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"size b: "<< b <<
"cm, B: " << B <<
"cm, L: " << L <<
"cm, t: " << t <<
"cm "<<std::endl;
281 DDValue numbOfStrips(
"nStrips");
284 std::vector<const DDsvalues_type* >::iterator is =
specs.begin();
285 double nStrips = 0., nPads = 0.;
286 for (;is !=
specs.end(); is++){
287 if (
DDfetch( *is, numbOfStrips)) nStrips = numbOfStrips.
doubles()[0];
290 LogTrace(
"ME0GeometryBuilderFromDDD")
291 << ((nStrips == 0. ) ? (
"No nStrips found!!") : (
"Number of strips: " + boost::lexical_cast<
std::string>(nStrips)));
292 LogTrace(
"ME0GeometryBuilderFromDDD")
293 << ((nPads == 0. ) ? (
"No nPads found!!") : (
"Number of pads: " + boost::lexical_cast<
std::string>(nPads)));
297 double b = dpar[4]/cm;
298 double B = dpar[8]/cm;
299 double L = dpar[0]/cm;
300 double t = dpar[3]/cm;
304 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar is vector with size = "<<dpar.size()<<std::endl;
305 for(
unsigned int i=0;
i<dpar.size(); ++
i) {
306 LogTrace(
"ME0GeometryBuilderFromDDD") <<
" dpar ["<<
i<<
"] = "<< dpar[
i]/10 <<
" cm "<<std::endl;
308 LogTrace(
"ME0GeometryBuilderFromDDD") <<
"size b: "<< b <<
"cm, B: " << B <<
"cm, L: " << L <<
"cm, t: " << t <<
"cm "<<std::endl;
311 std::vector<float> pars;
312 pars.emplace_back(b);
313 pars.emplace_back(B);
314 pars.emplace_back(L);
315 pars.emplace_back(nStrips);
316 pars.emplace_back(nPads);
329 Bounds* bounds,
bool isOddChamber)
const {
334 float(trans.z()/cm));
344 rotation.GetComponents(x,y,z);
353 float(y.X()),
float(y.Y()),
float(y.Z()),
354 float(z.X()),
float(z.Y()),
float(z.Z()));
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)
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
int baseNumberToUnitNumber(const MuonBaseNumber &) override
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.
static const std::string B
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.