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 ";
83 edm::LogError(
"GEMGeometryParsFromDD") <<
"Failed to find next child volume. Cannot determine presence of GE 2/1";
86 bool demonstratorGeometry = nGE21 % 2 == 1;
89 edm::LogVerbatim(
"Geometry") <<
"Found " << nGE21 <<
" GE2/1 chambers. Demonstrator geometry on? " 90 << demonstratorGeometry;
95 LogDebug(
"GEMGeometryParsFromDD") <<
"doSuperChamber = " << doSuper;
116 if ((detIdCh.
layer() == 1) || (detIdCh.
layer() == 2 and detIdCh.
station() == 2 and demonstratorGeometry)) {
140 edm::LogError(
"GEMGeometryParsFromDD") <<
"Failed to find next child volume. Cannot build GEM chambers.";
156 double dx1 = dpar[4];
157 double dx2 = dpar[8];
164 std::vector<double> pars{dx1, dx2,
dy,
dz};
168 LogDebug(
"GEMGeometryParsFromDD") <<
"dimension dx1 " << dx1 <<
", dx2 " << dx2 <<
", dy " <<
dy <<
", dz " <<
dz;
171 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz;
183 double dx1 = dpar[4];
184 double dx2 = dpar[8];
190 std::vector<double> pars{dx1, dx2,
dy,
dz};
194 LogDebug(
"GEMGeometryParsFromDD") <<
"dimension dx1 " << dx1 <<
", dx2 " << dx2 <<
", dy " <<
dy <<
", dz " <<
dz;
197 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz;
206 DDValue numbOfStrips(
"nStrips");
211 for (
auto const& is :
specs) {
215 nPads = numbOfPads.
doubles()[0];
219 LogDebug(
"GEMGeometryParsFromDD") << ((
nStrips == 0.) ? (
"No nStrips found!!")
221 LogDebug(
"GEMGeometryParsFromDD") << ((nPads == 0.) ? (
"No nPads found!!")
229 double dx1 = dpar[4];
230 double dx2 = dpar[8];
236 LogDebug(
"GEMGeometryParsFromDD") <<
" dx1 " << dx1 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz <<
" nStrips " 237 <<
nStrips <<
" nPads " << nPads <<
" dPhi " <<
dPhi;
241 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz <<
" nStrips " <<
nStrips <<
" nPads " << nPads <<
" dPhi " 249 <<
"(1) DDD, tran vector " << tran.x() <<
" " << tran.y() <<
" " << tran.z();
250 return {tran.x(), tran.y(), tran.z()};
256 rota.GetComponents(
x,
y,
z);
258 <<
"(2) DDD, rot matrix " <<
x.X() <<
" " <<
x.Y() <<
" " <<
x.Z() <<
" " <<
y.X() <<
" " <<
y.Y() <<
" " 259 <<
y.Z() <<
" " <<
z.X() <<
" " <<
z.Y() <<
" " <<
z.Z();
260 return {
x.X(),
x.Y(),
x.Z(),
y.X(),
y.Y(),
y.Z(),
z.X(),
z.Y(),
z.Z()};
280 edm::LogVerbatim(
"GEMGeometryParsFromDD") <<
"(0) GEMGeometryParsFromDD - DD4hep ";
284 static constexpr uint32_t levelChamb = 7;
286 int theLevelPart = muonConstants.
getValue(
"level");
287 int theRingLevel = muonConstants.
getValue(
"mg_ring") / theLevelPart;
288 int theSectorLevel = muonConstants.
getValue(
"mg_sector") / theLevelPart;
294 const auto& history = fv.
history();
297 if (fv.
level() == levelChamb &&
detId.station() == 2) {
301 bool demonstratorGeometry = nGE21 % 2 == 1;
303 edm::LogVerbatim(
"Geometry") <<
"Found " << nGE21 <<
" GE2/1 chambers. Demonstrator geometry on? " 304 << demonstratorGeometry;
309 const auto& history = fv.
history();
314 if (
num.getLevels() == theRingLevel) {
322 }
else if (
num.getLevels() == theSectorLevel) {
328 if (fv.
level() == levelChamb) {
329 if ((
detId.layer() == 1) || (
detId.layer() == 2 and
detId.station() == 2 and demonstratorGeometry)) {
333 }
else if (
num.getLevels() > theSectorLevel) {
342 auto solidA = solid.
solidA();
343 std::vector<double> dpar = solidA.dimensions();
345 double dy = dpar[3] / dd4hep::mm;
346 double dz = dpar[2] / dd4hep::mm;
347 double dx1 = dpar[0] / dd4hep::mm;
348 double dx2 = dpar[1] / dd4hep::mm;
350 auto solidB = solid.solidB();
351 dpar = solidB.dimensions();
353 const double chgap = 2.105;
358 dz += (dpar[2] / dd4hep::mm);
362 std::vector<double> pars{dx1, dx2,
dy,
dz};
367 <<
"(3) DD4hep, SuperChamber DetID " << gemid.
rawId() <<
" Name " <<
std::string(
name) <<
" dx1 " << dx1
368 <<
" dx2 " << dx2 <<
" dy " <<
dy <<
" dz " <<
dz;
374 auto solidA = solid.
solidA();
375 std::vector<double> dpar = solidA.dimensions();
377 double dy = dpar[3] / dd4hep::mm;
378 double dz = dpar[2] / dd4hep::mm;
379 double dx1 = dpar[0] / dd4hep::mm;
380 double dx2 = dpar[1] / dd4hep::mm;
382 auto solidB = solid.solidB();
383 dpar = solidB.dimensions();
385 dz += (dpar[2] / dd4hep::mm);
390 std::vector<double> pars{dx1, dx2,
dy,
dz};
395 <<
"(4) DD4hep, Chamber DetID " << gemid.
rawId() <<
" Name " <<
std::string(
name) <<
" dx1 " << dx1 <<
" dx2 " 396 << dx2 <<
" dy " <<
dy <<
" dz " <<
dz;
402 auto nPads = fv.
get<
double>(
"nPads");
403 auto dPhi = fv.
get<
double>(
"dPhi");
408 double dx1 = dpar[0] / dd4hep::mm;
409 double dx2 = dpar[1] / dd4hep::mm;
410 double dy = dpar[3] / dd4hep::mm;
411 double dz = dpar[2] / dd4hep::mm;
418 <<
"(5) DD4hep, Eta Partion DetID " <<
detId.rawId() <<
" Name " <<
std::string(
name) <<
" dx1 " << dx1 <<
" dx2 " 419 << dx2 <<
" dy " <<
dy <<
" dz " <<
dz <<
" nStrips " <<
nStrips <<
" nPads " << nPads <<
" dPhi " <<
dPhi;
424 std::vector<double> tran(3);
425 tran[0] =
static_cast<double>(fv.
translation().X()) / dd4hep::mm;
426 tran[1] =
static_cast<double>(fv.
translation().Y()) / dd4hep::mm;
427 tran[2] =
static_cast<double>(fv.
translation().Z()) / dd4hep::mm;
430 <<
"(1) DD4hep, tran vector " << tran[0] <<
" " << tran[1] <<
" " << tran[2];
431 return {tran[0], tran[1], tran[2]};
438 rota.GetComponents(
x,
y,
z);
439 const std::vector<double>
rot = {
x.X(),
x.Y(),
x.Z(),
y.X(),
y.Y(),
y.Z(),
z.X(),
z.Y(),
z.Z()};
441 <<
"(2) DD4hep, rot matrix " <<
rot[0] <<
" " <<
rot[1] <<
" " <<
rot[2] <<
" " <<
rot[3] <<
" " <<
rot[4]
442 <<
" " <<
rot[5] <<
" " <<
rot[6] <<
" " <<
rot[7] <<
" " <<
rot[8];
int getValue(const std::string &name) const
Log< level::Info, true > LogVerbatim
DDSolid solidA(void) const
bool parent()
set the current node to the parent node ...
constexpr int station() const
const std::vector< int > copyNos() const
The list of the volume copy numbers.
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 ...
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
const Double_t * rot() const
The absolute rotation of the current node.
bool goTo(const nav_type &)
transversed the DDFilteredView according
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Log< level::Error, false > LogError
constexpr int layer() const
dd4hep::Solid solidA() const
void buildEtaPartition(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
Compact representation of the geometrical detector hierarchy.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
static std::string to_string(const XMLCh *ch)
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
std::vector< double > getRotation(DDFilteredView &fv)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
std::string_view name() const
static double delPhi(const double phi1, const double phi2)
const std::string & name() const
Returns the name.
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const ExpandedNodes & history()
The numbering history of the current node.
static constexpr int32_t minStationId0
void buildChamber(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
const int level() const
get Iterator level
void buildGeometry(DDFilteredView &fview, DDFilteredView &fview2, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
DDSolid solidB(void) const
bool firstChild()
set the current node to the first child
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
T get(const std::string &)
extract attribute value
std::vector< const DDsvalues_type * > specifics() const
std::vector< double > getTranslation(DDFilteredView &fv)
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.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
dd4hep::Solid solid() const
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
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 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
void build(const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
const Translation translation() const