CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions
GEMGeometryParsFromDD Class Reference

#include <GEMGeometryParsFromDD.h>

Public Member Functions

void build (const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
void build (const cms::DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
 GEMGeometryParsFromDD ()
 
 ~GEMGeometryParsFromDD ()
 

Private Member Functions

void buildChamber (DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
 
void buildChamber (cms::DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
 
void buildEtaPartition (DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
 
void buildEtaPartition (cms::DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
 
void buildGeometry (DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
void buildGeometry (cms::DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
void buildSuperChamber (DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
 
void buildSuperChamber (cms::DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
 
std::vector< double > getRotation (DDFilteredView &fv)
 
std::vector< double > getRotation (cms::DDFilteredView &fv)
 
std::vector< double > getTranslation (DDFilteredView &fv)
 
std::vector< double > getTranslation (cms::DDFilteredView &fv)
 

Detailed Description

Definition at line 28 of file GEMGeometryParsFromDD.h.

Constructor & Destructor Documentation

GEMGeometryParsFromDD::GEMGeometryParsFromDD ( )

Definition at line 31 of file GEMGeometryParsFromDD.cc.

31 {}
GEMGeometryParsFromDD::~GEMGeometryParsFromDD ( )

Definition at line 33 of file GEMGeometryParsFromDD.cc.

33 {}

Member Function Documentation

void GEMGeometryParsFromDD::build ( const DDCompactView cview,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rgeo 
)

Definition at line 37 of file GEMGeometryParsFromDD.cc.

References buildGeometry(), alcazmumu_cfi::filter, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

Referenced by GEMRecoIdealDBLoader::beginRun().

39  {
40  std::string attribute = "MuStructure";
41  std::string value = "MuonEndCapGEM";
42 
43  // Asking only for the MuonGEM's
44  DDSpecificsMatchesValueFilter filter{DDValue(attribute, value, 0.0)};
45  DDFilteredView fv(*cview, filter);
46 
47  this->buildGeometry(fv, muonConstants, rgeo);
48 }
void buildGeometry(DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
void GEMGeometryParsFromDD::build ( const cms::DDCompactView cview,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rgeo 
)

Definition at line 224 of file GEMGeometryParsFromDD.cc.

References buildGeometry(), alcazmumu_cfi::filter, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

226  {
227  std::string attribute = "MuStructure";
228  std::string value = "MuonEndCapGEM";
229 
230  const cms::DDFilter filter(attribute, value);
231  cms::DDFilteredView fv(*cview, filter);
232 
233  this->buildGeometry(fv, muonConstants, rgeo);
234 }
void buildGeometry(DDFilteredView &fview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
void GEMGeometryParsFromDD::buildChamber ( DDFilteredView fv,
GEMDetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 134 of file GEMGeometryParsFromDD.cc.

References GEMDetId::chamberId(), PVValHelper::dy, PVValHelper::dz, getRotation(), getTranslation(), RecoIdealGeometry::insert(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), DDSolid::parameters(), DetId::rawId(), DDLogicalPart::solid(), DDBooleanSolid::solidA(), and DDBooleanSolid::solidB().

Referenced by buildGeometry().

134  {
135  LogDebug("GEMGeometryParsFromDD") << "buildChamber " << fv.logicalPart().name().name() << " " << detId << std::endl;
136 
138  std::vector<double> dpar = solid.solidA().parameters();
139 
140  double dy = dpar[0]; //length is along local Y
141  double dz = dpar[3]; // thickness is long local Z
142  double dx1 = dpar[4]; // bottom width is along local X
143  double dx2 = dpar[8]; // top width is along local X
144  dpar = solid.solidB().parameters();
145  dz += dpar[3]; // chamber thickness
146 
147  GEMDetId gemid = detId.chamberId();
148 
149  std::vector<double> pars{dx1, dx2, dy, dz};
150  std::vector<double> vtra = getTranslation(fv);
151  std::vector<double> vrot = getRotation(fv);
152 
153  LogDebug("GEMGeometryParsFromDD") << "dimension dx1 " << dx1 << ", dx2 " << dx2 << ", dy " << dy << ", dz " << dz;
154  edm::LogVerbatim("GEMGeometryParsFromDD")
155  << "(4) DDD, Chamber DetID " << gemid.rawId() << " Name " << fv.logicalPart().name().name() << " dx1 " << dx1
156  << " dx2 " << dx2 << " dy " << dy << " dz " << dz;
157  rgeo.insert(gemid.rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
158 }
Log< level::Info, true > LogVerbatim
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:59
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
Definition: DetId.h:57
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
DDSolid solidB(void) const
Definition: DDSolid.cc:472
std::vector< double > getRotation(DDFilteredView &fv)
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:204
DDSolid solidA(void) const
Definition: DDSolid.cc:470
std::vector< double > getTranslation(DDFilteredView &fv)
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
#define LogDebug(id)
void GEMGeometryParsFromDD::buildChamber ( cms::DDFilteredView fv,
GEMDetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 313 of file GEMGeometryParsFromDD.cc.

References GEMDetId::chamberId(), PVValHelper::dy, PVValHelper::dz, getRotation(), getTranslation(), RecoIdealGeometry::insert(), mergeVDriftHistosByStation::name, cms::DDFilteredView::name(), DetId::rawId(), cms::DDFilteredView::solid(), cms::DDSolid::solidA(), and AlCaHLTBitMon_QueryRunRegistry::string.

313  {
314  cms::DDSolid solid(fv.solid());
315  auto solidA = solid.solidA();
316  std::vector<double> dpar = solidA.dimensions();
317 
318  double dy = dpar[3] / dd4hep::mm; //length is along local Y
319  double dz = dpar[2] / dd4hep::mm; // thickness is long local Z
320  double dx1 = dpar[0] / dd4hep::mm; // bottom width is along local X
321  double dx2 = dpar[1] / dd4hep::mm; // top width is along local X
322 
323  auto solidB = solid.solidB();
324  dpar = solidB.dimensions();
325 
326  dz += (dpar[2] / dd4hep::mm); // chamber thickness
327 
328  GEMDetId gemid = detId.chamberId();
329  std::string_view name = fv.name();
330 
331  std::vector<double> pars{dx1, dx2, dy, dz};
332  std::vector<double> vtra = getTranslation(fv);
333  std::vector<double> vrot = getRotation(fv);
334 
335  edm::LogVerbatim("GEMGeometryParsFromDD")
336  << "(4) DD4hep, Chamber DetID " << gemid.rawId() << " Name " << std::string(name) << " dx1 " << dx1 << " dx2 "
337  << dx2 << " dy " << dy << " dz " << dz;
338  rgeo.insert(gemid.rawId(), vtra, vrot, pars, {std::string(name)});
339 }
Log< level::Info, true > LogVerbatim
dd4hep::Solid solidA() const
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
Definition: DetId.h:57
std::vector< double > getRotation(DDFilteredView &fv)
constexpr GEMDetId chamberId() const
Definition: GEMDetId.h:204
std::string_view name() const
std::vector< double > getTranslation(DDFilteredView &fv)
dd4hep::Solid solid() const
void GEMGeometryParsFromDD::buildEtaPartition ( DDFilteredView fv,
GEMDetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 160 of file GEMGeometryParsFromDD.cc.

References DDfetch(), delPhi(), DDValue::doubles(), PVValHelper::dy, PVValHelper::dz, getRotation(), getTranslation(), RecoIdealGeometry::insert(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), me0TriggerPseudoDigis_cff::nStrips, DDSolid::parameters(), DetId::rawId(), DDLogicalPart::solid(), and DDFilteredView::specifics().

Referenced by buildGeometry().

160  {
161  LogDebug("GEMGeometryParsFromDD") << "buildEtaPartition " << fv.logicalPart().name().name() << " " << detId
162  << std::endl;
163 
164  // EtaPartition specific parameter (nstrips and npads)
165  DDValue numbOfStrips("nStrips");
166  DDValue numbOfPads("nPads");
167  DDValue delPhi("dPhi");
168  const std::vector<const DDsvalues_type*>& specs = fv.specifics();
169  double nStrips = 0., nPads = 0., dPhi = 0.;
170  for (auto const& is : specs) {
171  if (DDfetch(is, numbOfStrips))
172  nStrips = numbOfStrips.doubles()[0];
173  if (DDfetch(is, numbOfPads))
174  nPads = numbOfPads.doubles()[0];
175  if (DDfetch(is, delPhi))
176  dPhi = delPhi.doubles()[0];
177  }
178  LogDebug("GEMGeometryParsFromDD") << ((nStrips == 0.) ? ("No nStrips found!!")
179  : ("Number of strips: " + std::to_string(nStrips)));
180  LogDebug("GEMGeometryParsFromDD") << ((nPads == 0.) ? ("No nPads found!!")
181  : ("Number of pads: " + std::to_string(nPads)));
182 
183  // EtaPartition specific parameter (size)
184  std::vector<double> dpar = fv.logicalPart().solid().parameters();
185 
186  double dy = dpar[0]; //length is along local Y
187  double dz = dpar[3]; //0.4;// thickness is long local Z
188  double dx1 = dpar[4]; // bottom width is along local X
189  double dx2 = dpar[8]; // top width is along local X
190 
191  std::vector<double> pars{dx1, dx2, dy, dz, nStrips, nPads, dPhi};
192  std::vector<double> vtra = getTranslation(fv);
193  std::vector<double> vrot = getRotation(fv);
194 
195  LogDebug("GEMGeometryParsFromDD") << " dx1 " << dx1 << " dx2 " << dx2 << " dy " << dy << " dz " << dz << " nStrips "
196  << nStrips << " nPads " << nPads << " dPhi " << dPhi;
197 
198  edm::LogVerbatim("GEMGeometryParsFromDD")
199  << "(5) DDD, Eta Partion DetID " << detId.rawId() << " Name " << fv.logicalPart().name().name() << " dx1 " << dx1
200  << " dx2 " << dx2 << " dy " << dy << " dz " << dz << " nStrips " << nStrips << " nPads " << nPads << " dPhi "
201  << dPhi;
202  rgeo.insert(detId.rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
203 }
Log< level::Info, true > LogVerbatim
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:59
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
Definition: DetId.h:57
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
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...
std::vector< double > getRotation(DDFilteredView &fv)
static double delPhi(const double phi1, const double phi2)
std::vector< double > getTranslation(DDFilteredView &fv)
std::vector< const DDsvalues_type * > specifics() const
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
#define LogDebug(id)
void GEMGeometryParsFromDD::buildEtaPartition ( cms::DDFilteredView fv,
GEMDetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 341 of file GEMGeometryParsFromDD.cc.

References PVValHelper::dy, PVValHelper::dz, cms::DDFilteredView::get(), getRotation(), getTranslation(), RecoIdealGeometry::insert(), mergeVDriftHistosByStation::name, cms::DDFilteredView::name(), me0TriggerPseudoDigis_cff::nStrips, cms::DDFilteredView::parameters(), DetId::rawId(), and AlCaHLTBitMon_QueryRunRegistry::string.

341  {
342  auto nStrips = fv.get<double>("nStrips");
343  auto nPads = fv.get<double>("nPads");
344  auto dPhi = fv.get<double>("dPhi");
345 
346  std::vector<double> dpar = fv.parameters();
347  std::string_view name = fv.name();
348 
349  double dx1 = dpar[0] / dd4hep::mm;
350  double dx2 = dpar[1] / dd4hep::mm;
351  double dy = dpar[3] / dd4hep::mm;
352  double dz = dpar[2] / dd4hep::mm;
353 
354  std::vector<double> pars{dx1, dx2, dy, dz, nStrips, nPads, dPhi};
355  std::vector<double> vtra = getTranslation(fv);
356  std::vector<double> vrot = getRotation(fv);
357 
358  edm::LogVerbatim("GEMGeometryParsFromDD")
359  << "(5) DD4hep, Eta Partion DetID " << detId.rawId() << " Name " << std::string(name) << " dx1 " << dx1 << " dx2 "
360  << dx2 << " dy " << dy << " dz " << dz << " nStrips " << nStrips << " nPads " << nPads << " dPhi " << dPhi;
361  rgeo.insert(detId.rawId(), vtra, vrot, pars, {std::string(name)});
362 }
Log< level::Info, true > LogVerbatim
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
Definition: DetId.h:57
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...
std::vector< double > getRotation(DDFilteredView &fv)
std::string_view name() const
T get(const std::string &)
extract attribute value
std::vector< double > getTranslation(DDFilteredView &fv)
const std::vector< double > parameters() const
extract shape parameters
void GEMGeometryParsFromDD::buildGeometry ( DDFilteredView fview,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rgeo 
)
private

Definition at line 50 of file GEMGeometryParsFromDD.cc.

References GEMNumberingScheme::baseNumberToUnitNumber(), buildChamber(), buildEtaPartition(), buildSuperChamber(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonGeometryNumbering::geoHistoryToBaseNumber(), GEMDetId::layer(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), DDFilteredView::nextSibling(), and DDFilteredView::parent().

Referenced by build().

52  {
53  LogDebug("GEMGeometryParsFromDD") << "Building the geometry service";
54  LogDebug("GEMGeometryParsFromDD") << "About to run through the GEM structure\n"
55  << " First logical part " << fv.logicalPart().name().name();
56 
57  edm::LogVerbatim("GEMGeometryParsFromDD") << "(0) GEMGeometryParsFromDD - DDD ";
58  MuonGeometryNumbering muonDDDNumbering(muonConstants);
59  GEMNumberingScheme gemNumbering(muonConstants);
60 
61  bool doSuper = fv.firstChild();
62 
63  LogDebug("GEMGeometryParsFromDD") << "doSuperChamber = " << doSuper;
64  // loop over superchambers
65  while (doSuper) {
66  // getting chamber id from eta partitions
67  fv.firstChild();
68  fv.firstChild();
69  GEMDetId detIdCh =
70  GEMDetId(gemNumbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
71  // back to chambers
72  fv.parent();
73  fv.parent();
74 
75  // currently there is no superchamber in the geometry
76  // only 2 chambers are present separated by a gap.
77  // making superchamber out of the first chamber layer including the gap between chambers
78  if (detIdCh.layer() == 1) { // only make superChambers when doing layer 1
79  buildSuperChamber(fv, detIdCh, rgeo);
80  }
81  buildChamber(fv, detIdCh, rgeo);
82 
83  // loop over chambers
84  // only 1 chamber
85  bool doChambers = fv.firstChild();
86  while (doChambers) {
87  // loop over GEMEtaPartitions
88  bool doEtaPart = fv.firstChild();
89  while (doEtaPart) {
90  GEMDetId detId =
91  GEMDetId(gemNumbering.baseNumberToUnitNumber(muonDDDNumbering.geoHistoryToBaseNumber(fv.geoHistory())));
92  buildEtaPartition(fv, detId, rgeo);
93 
94  doEtaPart = fv.nextSibling();
95  }
96  fv.parent();
97  doChambers = fv.nextSibling();
98  }
99  fv.parent();
100  doSuper = fv.nextSibling();
101  }
102 }
Log< level::Info, true > LogVerbatim
void buildEtaPartition(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
void buildChamber(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
constexpr int layer() const
Definition: GEMDetId.h:190
void buildSuperChamber(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
#define LogDebug(id)
void GEMGeometryParsFromDD::buildGeometry ( cms::DDFilteredView fview,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rgeo 
)
private

Definition at line 236 of file GEMGeometryParsFromDD.cc.

References GEMNumberingScheme::baseNumberToUnitNumber(), buildChamber(), buildEtaPartition(), buildSuperChamber(), cms::DDFilteredView::firstChild(), MuonGeometryNumbering::geoHistoryToBaseNumber(), MuonGeometryConstants::getValue(), cms::DDFilteredView::history(), isotrackTrainRegressor::history, cms::DDFilteredView::level(), GEMDetId::minStationId0, pileupDistInMC::num, GEMDetId::region(), and HLT_FULL_cff::region.

238  {
239  edm::LogVerbatim("GEMGeometryParsFromDD") << "(0) GEMGeometryParsFromDD - DD4hep ";
240 
241  MuonGeometryNumbering mdddnum(muonConstants);
242  GEMNumberingScheme gemNum(muonConstants);
243  static constexpr uint32_t levelChamb = 7;
244  int chamb(0), region(0);
245  int theLevelPart = muonConstants.getValue("level");
246  int theRingLevel = muonConstants.getValue("mg_ring") / theLevelPart;
247  int theSectorLevel = muonConstants.getValue("mg_sector") / theLevelPart;
248 
249  while (fv.firstChild()) {
250  const auto& history = fv.history();
251  MuonBaseNumber num(mdddnum.geoHistoryToBaseNumber(history));
252  GEMDetId detId(gemNum.baseNumberToUnitNumber(num));
253 
254  if (detId.station() == GEMDetId::minStationId0) {
255  if (num.getLevels() == theRingLevel) {
256  if (detId.region() != region) {
257  region = detId.region();
258  chamb = 0;
259  }
260  ++chamb;
261  detId = GEMDetId(detId.region(), detId.ring(), detId.station(), detId.layer(), chamb, 0);
262  buildSuperChamber(fv, detId, rgeo);
263  } else if (num.getLevels() == theSectorLevel) {
264  buildChamber(fv, detId, rgeo);
265  } else {
266  buildEtaPartition(fv, detId, rgeo);
267  }
268  } else {
269  if (fv.level() == levelChamb) {
270  if (detId.layer() == 1) {
271  buildSuperChamber(fv, detId, rgeo);
272  }
273  buildChamber(fv, detId, rgeo);
274  } else if (num.getLevels() > theSectorLevel) {
275  buildEtaPartition(fv, detId, rgeo);
276  }
277  }
278  }
279 }
Log< level::Info, true > LogVerbatim
int getValue(const std::string &name) const
void buildEtaPartition(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
static constexpr int32_t minStationId0
Definition: GEMDetId.h:24
void buildChamber(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
void buildSuperChamber(DDFilteredView &fv, GEMDetId detId, RecoIdealGeometry &rgeo)
void GEMGeometryParsFromDD::buildSuperChamber ( DDFilteredView fv,
GEMDetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 104 of file GEMGeometryParsFromDD.cc.

References PVValHelper::dy, PVValHelper::dz, getRotation(), getTranslation(), RecoIdealGeometry::insert(), LogDebug, DDFilteredView::logicalPart(), DDName::name(), DDBase< N, C >::name(), DDSolid::parameters(), DetId::rawId(), DDLogicalPart::solid(), DDBooleanSolid::solidA(), DDBooleanSolid::solidB(), and GEMDetId::superChamberId().

Referenced by buildGeometry().

104  {
105  LogDebug("GEMGeometryParsFromDD") << "buildSuperChamber " << fv.logicalPart().name().name() << " " << detId
106  << std::endl;
107 
109  std::vector<double> dpar = solid.solidA().parameters();
110 
111  GEMDetId gemid = detId.superChamberId();
112 
113  double dy = dpar[0]; //length is along local Y
114  double dz = dpar[3]; // thickness is long local Z
115  double dx1 = dpar[4]; // bottom width is along local X
116  double dx2 = dpar[8]; // top width is along local X
117  dpar = solid.solidB().parameters();
118 
119  dz += dpar[3]; // chamber thickness
120  dz *= 2; // 2 chambers in superchamber
121  dz += 2.105; // gap between chambers
122 
123  std::vector<double> pars{dx1, dx2, dy, dz};
124  std::vector<double> vtra = getTranslation(fv);
125  std::vector<double> vrot = getRotation(fv);
126 
127  LogDebug("GEMGeometryParsFromDD") << "dimension dx1 " << dx1 << ", dx2 " << dx2 << ", dy " << dy << ", dz " << dz;
128  edm::LogVerbatim("GEMGeometryParsFromDD")
129  << "(3) DDD, SuperChamber DetID " << gemid.rawId() << " Name " << fv.logicalPart().name().name() << " dx1 " << dx1
130  << " dx2 " << dx2 << " dy " << dy << " dz " << dz;
131  rgeo.insert(gemid.rawId(), vtra, vrot, pars, {fv.logicalPart().name().name()});
132 }
Log< level::Info, true > LogVerbatim
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const N & name() const
Definition: DDBase.h:59
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
Definition: DetId.h:57
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
DDSolid solidB(void) const
Definition: DDSolid.cc:472
std::vector< double > getRotation(DDFilteredView &fv)
DDSolid solidA(void) const
Definition: DDSolid.cc:470
std::vector< double > getTranslation(DDFilteredView &fv)
constexpr GEMDetId superChamberId() const
Definition: GEMDetId.h:207
const std::string & name() const
Returns the name.
Definition: DDName.cc:41
#define LogDebug(id)
void GEMGeometryParsFromDD::buildSuperChamber ( cms::DDFilteredView fv,
GEMDetId  detId,
RecoIdealGeometry rgeo 
)
private

Definition at line 281 of file GEMGeometryParsFromDD.cc.

References PVValHelper::dy, PVValHelper::dz, getRotation(), getTranslation(), RecoIdealGeometry::insert(), mergeVDriftHistosByStation::name, cms::DDFilteredView::name(), DetId::rawId(), cms::DDFilteredView::solid(), cms::DDSolid::solidA(), AlCaHLTBitMon_QueryRunRegistry::string, and GEMDetId::superChamberId().

281  {
282  cms::DDSolid solid(fv.solid());
283  auto solidA = solid.solidA();
284  std::vector<double> dpar = solidA.dimensions();
285 
286  double dy = dpar[3] / dd4hep::mm; //length is along local Y
287  double dz = dpar[2] / dd4hep::mm; // thickness is long local Z
288  double dx1 = dpar[0] / dd4hep::mm; // bottom width is along local X
289  double dx2 = dpar[1] / dd4hep::mm; // top width is along loc
290 
291  auto solidB = solid.solidB();
292  dpar = solidB.dimensions();
293  const int nch = 2;
294  const double chgap = 2.105;
295 
296  GEMDetId gemid = detId.superChamberId();
297  std::string_view name = fv.name();
298 
299  dz += (dpar[2] / dd4hep::mm); // chamber thickness
300  dz *= nch; // 2 chambers in superchamber
301  dz += chgap; // gap between chambers
302 
303  std::vector<double> pars{dx1, dx2, dy, dz};
304  std::vector<double> vtra = getTranslation(fv);
305  std::vector<double> vrot = getRotation(fv);
306 
307  edm::LogVerbatim("GEMGeometryParsFromDD")
308  << "(3) DD4hep, SuperChamber DetID " << gemid.rawId() << " Name " << std::string(name) << " dx1 " << dx1
309  << " dx2 " << dx2 << " dy " << dy << " dz " << dz;
310  rgeo.insert(gemid.rawId(), vtra, vrot, pars, {std::string(name)});
311 }
Log< level::Info, true > LogVerbatim
dd4hep::Solid solidA() const
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
Definition: DetId.h:57
std::vector< double > getRotation(DDFilteredView &fv)
std::string_view name() const
std::vector< double > getTranslation(DDFilteredView &fv)
constexpr GEMDetId superChamberId() const
Definition: GEMDetId.h:207
dd4hep::Solid solid() const
std::vector< double > GEMGeometryParsFromDD::getRotation ( DDFilteredView fv)
private

Definition at line 212 of file GEMGeometryParsFromDD.cc.

References DDFilteredView::rotation(), x, y, and z.

Referenced by buildChamber(), buildEtaPartition(), and buildSuperChamber().

212  {
213  const DDRotationMatrix& rota = fv.rotation(); //.Inverse();
214  DD3Vector x, y, z;
215  rota.GetComponents(x, y, z);
216  edm::LogVerbatim("GEMGeometryParsFromDD")
217  << "(2) DDD, rot matrix " << x.X() << " " << x.Y() << " " << x.Z() << " " << y.X() << " " << y.Y() << " "
218  << y.Z() << " " << z.X() << " " << z.Y() << " " << z.Z();
219  return {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
220 }
Log< level::Info, true > LogVerbatim
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> DD3Vector
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
std::vector< double > GEMGeometryParsFromDD::getRotation ( cms::DDFilteredView fv)
private

Definition at line 375 of file GEMGeometryParsFromDD.cc.

References cms::DDFilteredView::rot(), makeMuonMisalignmentScenario::rot, x, y, and z.

375  {
376  DDRotationMatrix rota;
377  fv.rot(rota);
378  DD3Vector x, y, z;
379  rota.GetComponents(x, y, z);
380  const std::vector<double> rot = {x.X(), x.Y(), x.Z(), y.X(), y.Y(), y.Z(), z.X(), z.Y(), z.Z()};
381  edm::LogVerbatim("GEMGeometryParsFromDD")
382  << "(2) DD4hep, rot matrix " << rot[0] << " " << rot[1] << " " << rot[2] << " " << rot[3] << " " << rot[4]
383  << " " << rot[5] << " " << rot[6] << " " << rot[7] << " " << rot[8];
384  return {rot[0], rot[1], rot[2], rot[3], rot[4], rot[5], rot[6], rot[7], rot[8]};
385 }
Log< level::Info, true > LogVerbatim
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> DD3Vector
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const Double_t * rot() const
The absolute rotation of the current node.
std::vector< double > GEMGeometryParsFromDD::getTranslation ( DDFilteredView fv)
private

Definition at line 205 of file GEMGeometryParsFromDD.cc.

References DDFilteredView::translation().

Referenced by buildChamber(), buildEtaPartition(), and buildSuperChamber().

205  {
206  const DDTranslation& tran = fv.translation();
207  edm::LogVerbatim("GEMGeometryParsFromDD")
208  << "(1) DDD, tran vector " << tran.x() << " " << tran.y() << " " << tran.z();
209  return {tran.x(), tran.y(), tran.z()};
210 }
Log< level::Info, true > LogVerbatim
const DDTranslation & translation() const
The absolute translation of the current node.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
std::vector< double > GEMGeometryParsFromDD::getTranslation ( cms::DDFilteredView fv)
private

Definition at line 364 of file GEMGeometryParsFromDD.cc.

References cms::DDFilteredView::translation().

364  {
365  std::vector<double> tran(3);
366  tran[0] = static_cast<double>(fv.translation().X()) / dd4hep::mm;
367  tran[1] = static_cast<double>(fv.translation().Y()) / dd4hep::mm;
368  tran[2] = static_cast<double>(fv.translation().Z()) / dd4hep::mm;
369 
370  edm::LogVerbatim("GEMGeometryParsFromDD")
371  << "(1) DD4hep, tran vector " << tran[0] << " " << tran[1] << " " << tran[2];
372  return {tran[0], tran[1], tran[2]};
373 }
Log< level::Info, true > LogVerbatim
const Translation translation() const