46 return this->buildGeometry(fview, muonConstants);
55 return this->buildGeometry(fview, muonConstants);
63 LogTrace(
"ME0Geometry") <<
"Building the geometry service";
64 LogTrace(
"ME0Geometry") <<
"About to run through the ME0 structure\n" 72 LogTrace(
"ME0Geometry") <<
"doChamber = fv.firstChild() = " << testChambers;
74 while (testChambers) {
85 LogTrace(
"ME0Geometry") <<
"In DoChambers Loop :: ME0DetId " << detId <<
" = " << detId.
rawId()
86 <<
" (which belongs to ME0Chamber " << detIdCh <<
" = " << detIdCh.
rawId() <<
")";
89 std::vector<double> dpar2 = solid2.
parameters();
90 std::stringstream parameters2;
91 for (
unsigned int i = 0;
i < dpar2.size(); ++
i) {
92 parameters2 <<
" dpar[" <<
i <<
"]=" <<
convertMmToCm(dpar2[
i]) <<
"cm ";
94 LogTrace(
"ME0Geometry") <<
"Second level parameters: vector with size = " << dpar2.size() <<
" and elements " 99 LogTrace(
"ME0Geometry") <<
"doLayer = fv.firstChild() = " << doLayers;
108 LogTrace(
"ME0Geometry") <<
"In DoLayers Loop :: ME0DetId " << detId <<
" = " << detId.
rawId()
109 <<
" (which belongs to ME0Layer " << detIdLa <<
" = " << detIdLa.
rawId() <<
")";
112 std::vector<double> dpar3 = solid3.
parameters();
113 std::stringstream parameters3;
114 for (
unsigned int i = 0;
i < dpar3.size(); ++
i) {
115 parameters3 <<
" dpar[" <<
i <<
"]=" <<
convertMmToCm(dpar3[
i]) <<
"cm ";
117 LogTrace(
"ME0Geometry") <<
"Third level parameters: vector with size = " << dpar3.size() <<
" and elements " 118 << parameters3.str();
121 LogTrace(
"ME0Geometry") <<
"doEtaPart = fv.firstChild() = " << doEtaParts;
123 LogTrace(
"ME0Geometry") <<
"In DoEtaParts Loop :: ME0DetId " << detId <<
" = " << detId.
rawId();
126 std::vector<double> dpar4 = solid4.
parameters();
127 std::stringstream parameters4;
128 for (
unsigned int i = 0;
i < dpar4.size(); ++
i) {
129 parameters4 <<
" dpar[" <<
i <<
"]=" <<
convertMmToCm(dpar4[
i]) <<
"cm ";
131 LogTrace(
"ME0Geometry") <<
"Fourth level parameters: vector with size = " << dpar4.size() <<
" and elements " 132 << parameters4.str();
135 LogTrace(
"ME0Geometry") <<
"doEtaPart = fv.nextSibling() = " << doEtaParts;
139 <<
" will now ask for nextSibling";
141 LogTrace(
"ME0Geometry") <<
"doLayer = fv.nextSibling() = " << doLayers;
145 <<
" will now ask for nextSibling";
147 LogTrace(
"ME0Geometry") <<
"doChamber = fv.nextSibling() = " << testChambers;
177 ME0Chamber* me0Chamber = buildChamber(fv, detIdCh);
195 ME0Layer* me0Layer = buildLayer(fv, detIdLa);
196 me0Chamber->
add(me0Layer);
213 me0Layer->
add(etaPart);
233 std::vector<double> dpar = solid.
parameters();
242 LogTrace(
"ME0Geometry") <<
" dpar is vector with size = " << dpar.size() << std::endl;
243 for (
unsigned int i = 0;
i < dpar.size(); ++
i) {
246 LogTrace(
"ME0Geometry") <<
"size b: " <<
b <<
"cm, B: " <<
B <<
"cm, L: " <<
L <<
"cm, T: " <<
T <<
"cm " 261 std::vector<double> dpar = solid.
parameters();
269 LogTrace(
"ME0Geometry") <<
" dpar is vector with size = " << dpar.size() << std::endl;
270 for (
unsigned int i = 0;
i < dpar.size(); ++
i) {
273 LogTrace(
"ME0Geometry") <<
"size b: " <<
b <<
"cm, B: " <<
B <<
"cm, L: " <<
L <<
"cm, t: " <<
t <<
"cm " 287 DDValue numbOfStrips(
"nStrips");
290 double nStrips = 0., nPads = 0.;
291 for (
const auto& is :
specs) {
295 nPads = numbOfPads.
doubles()[0];
300 LogTrace(
"ME0Geometry") << ((nPads == 0.) ? (
"No nPads found!!") : (
"Number of pads: " +
std::to_string(nPads)));
311 LogTrace(
"ME0Geometry") <<
" dpar is vector with size = " << dpar.size() << std::endl;
312 for (
unsigned int i = 0;
i < dpar.size(); ++
i) {
315 LogTrace(
"ME0Geometry") <<
"size b: " <<
b <<
"cm, B: " <<
B <<
"cm, L: " <<
L <<
"cm, t: " <<
t <<
"cm " 319 std::vector<float> pars;
320 pars.emplace_back(
b);
321 pars.emplace_back(
B);
322 pars.emplace_back(
L);
324 pars.emplace_back(nPads);
337 bool isOddChamber)
const {
375 static constexpr uint32_t levelChamber = 7;
376 static constexpr uint32_t levelLayer = 8;
377 uint32_t theLevelPart = muonConstants.
getValue(
"level");
378 uint32_t theSectorLevel = muonConstants.
getValue(
"m0_sector") / theLevelPart;
380 std::vector<ME0Layer*>
layers;
383 const auto& history = fv.
history();
387 edm::LogVerbatim(
"ME0Geometry") << fv.
name() <<
" with " << history.tags.size() <<
" Levels and ID " << detId
391 << theSectorLevel <<
":" << history.tags.size() <<
":" << fv.
level();
392 for (
unsigned int k = 0;
k < history.tags.size(); ++
k)
393 edm::LogVerbatim(
"ME0Geometry") <<
"[" <<
k <<
"] Tag " << history.tags[
k] <<
" Offset " << history.offsets[
k]
394 <<
" copy " << history.copyNos[
k];
397 if (fv.
level() == levelChamber) {
399 ME0Chamber* me0Chamber = buildChamber(fv, detId);
401 }
else if (fv.
level() == levelLayer) {
403 ME0Layer* me0Layer = buildLayer(fv, detId);
404 layers.emplace_back(me0Layer);
405 }
else if (history.tags.size() > theSectorLevel) {
413 for (
auto& layer :
layers) {
424 for (
auto& layer :
layers) {
437 double L = k_ScaleFromDD4hep * dpar[3];
438 double T = k_ScaleFromDD4hep * dpar[2];
439 double b = k_ScaleFromDD4hep * dpar[0];
440 double B = k_ScaleFromDD4hep * dpar[1];
451 double L = k_ScaleFromDD4hep * dpar[3];
452 double t = k_ScaleFromDD4hep * dpar[2];
453 double b = k_ScaleFromDD4hep * dpar[0];
454 double B = k_ScaleFromDD4hep * dpar[1];
471 double b = k_ScaleFromDD4hep * dpar[0];
472 double B = k_ScaleFromDD4hep * dpar[1];
473 double L = k_ScaleFromDD4hep * dpar[3];
474 double t = k_ScaleFromDD4hep * dpar[2];
492 bool isOddChamber)
const {
494 const Double_t* trans = fv.
trans();
496 k_ScaleFromDD4hep * trans[0], k_ScaleFromDD4hep * trans[1], k_ScaleFromDD4hep * trans[2]);
int getValue(const std::string &name) const
Log< level::Info, true > LogVerbatim
bool parent()
set the current node to the parent node ...
ME0Geometry * build(const DDCompactView *cview, const MuonGeometryConstants &muonConstants)
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 Double_t * rot() const
The absolute rotation of the current node.
std::string to_string(const V &value)
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
int baseNumberToUnitNumber(const MuonBaseNumber &) const override
Compact representation of the geometrical detector hierarchy.
static constexpr uint32_t chamberIdMask_
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 *.
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)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
std::string_view name() const
const Double_t * trans() const
The absolute translation of the current node.
ME0DetId chamberId() const
Return the corresponding ChamberId (mask layers)
const std::string & name() const
Returns the name.
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
ME0Layer * buildLayer(DDFilteredView &fv, ME0DetId detId) const
const ExpandedNodes & history()
The numbering history of the current node.
ME0BoundPlane boundPlane(const DDFilteredView &fv, Bounds *bounds, bool isOddChamber) const
const int level() const
get Iterator level
void add(const ME0EtaPartition *roll)
Add EtaPartition to the layer which takes ownership.
bool firstChild()
set the current node to the first child
ME0DetId layerId() const
Return the corresponding LayerId (mask eta partition)
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
static constexpr uint32_t layerIdMask_
std::vector< const DDsvalues_type * > specifics() const
constexpr NumType convertMmToCm(NumType millimeters)
constexpr uint32_t rawId() const
get the raw id
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
ME0Geometry * buildGeometry(DDFilteredView &fview, const MuonGeometryConstants &muonConstants)
ME0Chamber * buildChamber(DDFilteredView &fv, ME0DetId detId) const
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
bool firstChild()
set the current node to the first child ...
static char chambers[264][20]
const DDTranslation & translation() const
The absolute translation of the current node.
const std::vector< double > parameters() const
extract shape parameters
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history) const
ME0EtaPartition * buildEtaPartition(DDFilteredView &fv, ME0DetId detId) const