55 LogDebug(
"GEMGeometryParsFromDD") <<
"Building the geometry service";
56 LogDebug(
"GEMGeometryParsFromDD") <<
"About to run through the GEM structure\n"
59 edm::LogVerbatim(
"GEMGeometryParsFromDD") <<
"(0) GEMGeometryParsFromDD - DDD ";
81 edm::LogError(
"GEMGeometryParsFromDD") <<
"Failed to find next child volume. Cannot determine presence of GE 2/1";
84 bool demonstratorGeometry = nGE21 == 1;
87 edm::LogVerbatim(
"Geometry") <<
"Found " << nGE21 <<
" GE2/1 chambers. Demonstrator geometry on? "
88 << demonstratorGeometry;
93 LogDebug(
"GEMGeometryParsFromDD") <<
"doSuperChamber = " << doSuper;
114 if ((detIdCh.
layer() == 1) || (detIdCh.
layer() == 2 and detIdCh.
station() == 2 and demonstratorGeometry)) {
138 edm::LogError(
"GEMGeometryParsFromDD") <<
"Failed to find next child volume. Cannot build GEM chambers.";
154 double dx1 = dpar[4];
155 double dx2 = dpar[8];
162 std::vector<double> pars{dx1, dx2,
dy, dz};
166 LogDebug(
"GEMGeometryParsFromDD") <<
"dimension dx1 " << dx1 <<
", dx2 " << dx2 <<
", dy " << dy <<
", dz " <<
dz;
169 <<
" dx2 " << dx2 <<
" dy " << dy <<
" dz " <<
dz;
181 double dx1 = dpar[4];
182 double dx2 = dpar[8];
188 std::vector<double> pars{dx1, dx2,
dy, dz};
192 LogDebug(
"GEMGeometryParsFromDD") <<
"dimension dx1 " << dx1 <<
", dx2 " << dx2 <<
", dy " << dy <<
", dz " <<
dz;
195 <<
" dx2 " << dx2 <<
" dy " << dy <<
" dz " <<
dz;
204 DDValue numbOfStrips(
"nStrips");
207 const std::vector<const DDsvalues_type*>& specs = fv.
specifics();
208 double nStrips = 0., nPads = 0., dPhi = 0.;
209 for (
auto const& is : specs) {
211 nStrips = numbOfStrips.
doubles()[0];
213 nPads = numbOfPads.
doubles()[0];
217 LogDebug(
"GEMGeometryParsFromDD") << ((nStrips == 0.) ? (
"No nStrips found!!")
219 LogDebug(
"GEMGeometryParsFromDD") << ((nPads == 0.) ? (
"No nPads found!!")
227 double dx1 = dpar[4];
228 double dx2 = dpar[8];
230 std::vector<double> pars{dx1, dx2,
dy,
dz,
nStrips, nPads, dPhi};
234 LogDebug(
"GEMGeometryParsFromDD") <<
" dx1 " << dx1 <<
" dx2 " << dx2 <<
" dy " << dy <<
" dz " << dz <<
" nStrips "
235 << nStrips <<
" nPads " << nPads <<
" dPhi " << dPhi;
239 <<
" dx2 " << dx2 <<
" dy " << dy <<
" dz " << dz <<
" nStrips " << nStrips <<
" nPads " << nPads <<
" dPhi "
247 <<
"(1) DDD, tran vector " << tran.x() <<
" " << tran.y() <<
" " << tran.z();
248 return {tran.x(), tran.y(), tran.z()};
254 rota.GetComponents(x, y, z);
256 <<
"(2) DDD, rot matrix " << x.X() <<
" " << x.Y() <<
" " << x.Z() <<
" " << y.X() <<
" " << y.Y() <<
" "
257 << y.Z() <<
" " << z.X() <<
" " << z.Y() <<
" " << z.Z();
258 return {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
278 edm::LogVerbatim(
"GEMGeometryParsFromDD") <<
"(0) GEMGeometryParsFromDD - DD4hep ";
282 static constexpr uint32_t levelChamb = 7;
284 int theLevelPart = muonConstants.
getValue(
"level");
285 int theRingLevel = muonConstants.
getValue(
"mg_ring") / theLevelPart;
286 int theSectorLevel = muonConstants.
getValue(
"mg_sector") / theLevelPart;
295 if (fv.
level() == levelChamb && detId.station() == 2) {
299 bool demonstratorGeometry = nGE21 == 1;
301 edm::LogVerbatim(
"Geometry") <<
"Found " << nGE21 <<
" GE2/1 chambers. Demonstrator geometry on? "
302 << demonstratorGeometry;
312 if (
num.getLevels() == theRingLevel) {
313 if (detId.region() !=
region) {
318 detId =
GEMDetId(detId.region(), detId.ring(), detId.station(), detId.layer(), chamb, 0);
320 }
else if (
num.getLevels() == theSectorLevel) {
326 if (fv.
level() == levelChamb) {
327 if ((detId.layer() == 1) || (detId.layer() == 2 and detId.station() == 2 and demonstratorGeometry)) {
331 }
else if (
num.getLevels() > theSectorLevel) {
340 auto solidA = solid.
solidA();
341 std::vector<double> dpar = solidA.dimensions();
343 double dy = dpar[3] / dd4hep::mm;
344 double dz = dpar[2] / dd4hep::mm;
345 double dx1 = dpar[0] / dd4hep::mm;
346 double dx2 = dpar[1] / dd4hep::mm;
348 auto solidB = solid.solidB();
349 dpar = solidB.dimensions();
351 const double chgap = 2.105;
356 dz += (dpar[2] / dd4hep::mm);
360 std::vector<double> pars{dx1, dx2,
dy, dz};
365 <<
"(3) DD4hep, SuperChamber DetID " << gemid.
rawId() <<
" Name " <<
std::string(name) <<
" dx1 " << dx1
366 <<
" dx2 " << dx2 <<
" dy " << dy <<
" dz " <<
dz;
372 auto solidA = solid.
solidA();
373 std::vector<double> dpar = solidA.dimensions();
375 double dy = dpar[3] / dd4hep::mm;
376 double dz = dpar[2] / dd4hep::mm;
377 double dx1 = dpar[0] / dd4hep::mm;
378 double dx2 = dpar[1] / dd4hep::mm;
380 auto solidB = solid.solidB();
381 dpar = solidB.dimensions();
383 dz += (dpar[2] / dd4hep::mm);
388 std::vector<double> pars{dx1, dx2,
dy, dz};
393 <<
"(4) DD4hep, Chamber DetID " << gemid.
rawId() <<
" Name " <<
std::string(name) <<
" dx1 " << dx1 <<
" dx2 "
394 << dx2 <<
" dy " << dy <<
" dz " <<
dz;
400 auto nPads = fv.
get<
double>(
"nPads");
401 auto dPhi = fv.
get<
double>(
"dPhi");
406 double dx1 = dpar[0] / dd4hep::mm;
407 double dx2 = dpar[1] / dd4hep::mm;
408 double dy = dpar[3] / dd4hep::mm;
409 double dz = dpar[2] / dd4hep::mm;
411 std::vector<double> pars{dx1, dx2,
dy,
dz,
nStrips, nPads, dPhi};
416 <<
"(5) DD4hep, Eta Partion DetID " << detId.
rawId() <<
" Name " <<
std::string(name) <<
" dx1 " << dx1 <<
" dx2 "
417 << dx2 <<
" dy " << dy <<
" dz " << dz <<
" nStrips " <<
nStrips <<
" nPads " << nPads <<
" dPhi " << dPhi;
422 std::vector<double> tran(3);
423 tran[0] =
static_cast<double>(fv.
translation().X()) / dd4hep::mm;
424 tran[1] =
static_cast<double>(fv.
translation().Y()) / dd4hep::mm;
425 tran[2] =
static_cast<double>(fv.
translation().Z()) / dd4hep::mm;
428 <<
"(1) DD4hep, tran vector " << tran[0] <<
" " << tran[1] <<
" " << tran[2];
429 return {tran[0], tran[1], tran[2]};
436 rota.GetComponents(x, y, z);
437 const std::vector<double>
rot = {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
439 <<
"(2) DD4hep, rot matrix " << rot[0] <<
" " << rot[1] <<
" " << rot[2] <<
" " << rot[3] <<
" " << rot[4]
440 <<
" " << rot[5] <<
" " << rot[6] <<
" " << rot[7] <<
" " << rot[8];
441 return {rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]};
Log< level::Info, true > LogVerbatim
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
bool parent()
set the current node to the parent node ...
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
int getValue(const std::string &name) const
bool nextSibling()
set the current node to the next sibling ...
dd4hep::Solid solidA() const
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
bool goTo(const nav_type &)
transversed the DDFilteredView according
std::string to_string(const V &value)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Log< level::Error, false > LogError
void buildEtaPartition(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
Compact representation of the geometrical detector hierarchy.
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 *.
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...
DDSolid solidB(void) const
const Translation translation() const
std::vector< double > getRotation(DDFilteredView &fv)
static double delPhi(const double phi1, const double phi2)
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const ExpandedNodes & history()
The numbering history of the current node.
constexpr int region() const
static constexpr int32_t minStationId0
const Double_t * rot() const
The absolute rotation of the current node.
void buildChamber(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
void buildGeometry(DDFilteredView &fview, DDFilteredView &fview2, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
constexpr GEMDetId chamberId() const
std::string_view name() const
bool firstChild()
set the current node to the first child
DDSolid solidA(void) const
const std::vector< int > copyNos() const
The list of the volume copy numbers.
T get(const std::string &)
extract attribute value
std::vector< double > getTranslation(DDFilteredView &fv)
constexpr int layer() const
constexpr int station() const
void buildSuperChamber(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
bool firstChild()
set the current node to the first child ...
int baseNumberToUnitNumber(const MuonBaseNumber &) const override
const std::vector< double > parameters() const
extract shape parameters
const DDTranslation & translation() const
The absolute translation of the current node.
constexpr GEMDetId superChamberId() const
std::vector< const DDsvalues_type * > specifics() const
const int level() const
get Iterator level
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
const std::string & name() const
Returns the name.
dd4hep::Solid solid() const
void build(const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)