45 LogDebug(
"ME0GeometryParsFromDD") <<
"Building the geometry service";
46 LogDebug(
"ME0GeometryParsFromDD") <<
"About to run through the ME0 structure\n"
49 edm::LogVerbatim(
"ME0GeometryParsFromDD") <<
"(0) ME0GeometryParsFromDD - DDD ";
54 LogDebug(
"ME0GeometryParsFromDD") <<
"doChamber = " << doChambers;
126 DDValue numbOfStrips(
"nStrips");
128 const std::vector<const DDsvalues_type*>& specs = fv.
specifics();
129 double nStrips = 0., nPads = 0.;
130 for (
auto const& is : specs) {
132 nStrips = numbOfStrips.
doubles()[0];
134 nPads = numbOfPads.
doubles()[0];
136 LogDebug(
"ME0GeometryParsFromDD") << ((nStrips == 0.) ? (
"No nStrips found!!")
137 : (
"Number of strips: " + std::to_string(nStrips)));
138 LogDebug(
"ME0GeometryParsFromDD") << ((nPads == 0.) ? (
"No nPads found!!")
139 : (
"Number of pads: " + std::to_string(nPads)));
142 pars.emplace_back(nStrips);
143 pars.emplace_back(nPads);
149 << nStrips <<
" nPads " << nPads;
160 LogDebug(
"ME0GeometryParsFromDD") <<
"dimension dx1 " << dpar[4] <<
", dx2 " << dpar[8] <<
", dy " << dpar[0]
161 <<
", dz " << dpar[3];
163 <<
"(1) DDD, dimension dx1 " << dpar[4] <<
", dx2 " << dpar[8] <<
", dy " << dpar[0] <<
", dz " << dpar[3];
164 return {dpar[4], dpar[8], dpar[0], dpar[3]};
170 <<
"(2) DDD, tran vector " << tran.x() <<
" " << tran.y() <<
" " << tran.z();
171 return {tran.x(), tran.y(), tran.z()};
177 rota.GetComponents(x, y, z);
179 <<
"(3) DDD, rot matrix " << x.X() <<
" " << x.Y() <<
" " << x.Z() <<
" " << y.X() <<
" " << y.Y() <<
" "
180 << y.Z() <<
" " << z.X() <<
" " << z.Y() <<
" " << z.Z();
181 return {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
199 edm::LogVerbatim(
"ME0GeometryParsFromDD") <<
"(0) ME0GeometryParsFromDD - DD4hep ";
204 static constexpr uint32_t levelChamber = 7;
205 static constexpr uint32_t levelLayer = 8;
206 uint32_t theLevelPart = muonConstants.
getValue(
"level");
207 uint32_t theSectorLevel = muonConstants.
getValue(
"m0_sector") / theLevelPart;
214 if (fv.
level() == levelChamber) {
216 }
else if (fv.
level() == levelLayer) {
218 }
else if (
history.tags.size() > theSectorLevel) {
249 auto nPads = fv.
get<
double>(
"nPads");
253 pars.emplace_back(nPads);
257 edm::LogVerbatim(
"ME0GeometryParsFromDD") <<
"(6) DD4hep, Eta Partion DetID " << detId.
rawId() <<
" Name "
267 <<
"(1) DD4hep, dimension dx1 " << dpar[0] / dd4hep::mm <<
", dx2 " << dpar[1] / dd4hep::mm <<
", dy "
268 << dpar[3] / dd4hep::mm <<
", dz " << dpar[2] / dd4hep::mm;
270 return {dpar[0] / dd4hep::mm, dpar[1] / dd4hep::mm, dpar[3] / dd4hep::mm, dpar[2] / dd4hep::mm};
274 std::vector<double> tran(3);
275 tran[0] =
static_cast<double>(fv.
translation().X()) / dd4hep::mm;
276 tran[1] =
static_cast<double>(fv.
translation().Y()) / dd4hep::mm;
277 tran[2] =
static_cast<double>(fv.
translation().Z()) / dd4hep::mm;
280 <<
"(2) DD4hep, tran vector " << tran[0] <<
" " << tran[1] <<
" " << tran[2];
281 return {tran[0], tran[1], tran[2]};
288 rota.GetComponents(x, y, z);
289 const std::vector<double>
rot = {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
291 <<
"(3) DD4hep, rot matrix " << rot[0] <<
" " << rot[1] <<
" " << rot[2] <<
" " << rot[3] <<
" " << rot[4]
292 <<
" " << rot[5] <<
" " << rot[6] <<
" " << rot[7] <<
" " << rot[8];
293 return {rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]};
Log< level::Info, true > LogVerbatim
void build(const DDCompactView *, const MuonGeometryConstants &, RecoIdealGeometry &)
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)
MuonBaseNumber geoHistoryToBaseNumber(const DDGeoHistory &history) 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
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> DD3Vector
void buildEtaPartition(DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
int getValue(const std::string &name) const
std::vector< double > getDimension(DDFilteredView &fv)
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.
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
constexpr uint32_t rawId() const
get the raw id
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
int baseNumberToUnitNumber(const MuonBaseNumber &) const override
Compact representation of the geometrical detector hierarchy.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
void buildChamber(DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
tuple nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
const Translation translation() const
std::vector< double > getRotation(DDFilteredView &fv)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const ExpandedNodes & history()
The numbering history of the current node.
const Double_t * rot() const
The absolute rotation of the current node.
std::string_view name() const
bool firstChild()
set the current node to the first child
T get(const std::string &)
extract attribute value
bool firstChild()
set the current node to the first child ...
const std::vector< double > parameters() const
extract shape parameters
const DDTranslation & translation() const
The absolute translation of the current node.
std::vector< const DDsvalues_type * > specifics() const
const int level() const
get Iterator level
void buildLayer(DDFilteredView &fv, ME0DetId detId, RecoIdealGeometry &rgeo)
std::vector< double > getTranslation(DDFilteredView &fv)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
const std::string & name() const
Returns the name.
void buildGeometry(DDFilteredView &, const MuonGeometryConstants &, RecoIdealGeometry &)