CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions
DTGeometryParsFromDD Class Reference

#include <DTGeometryParsFromDD.h>

Public Types

enum  DTDetTag { DTChamberTag, DTSuperLayerTag, DTLayerTag }
 

Public Member Functions

void build (const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig)
 
void build (const cms::DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rgeo)
 
 DTGeometryParsFromDD ()
 Constructor. More...
 
virtual ~DTGeometryParsFromDD ()
 Destructor. More...
 

Private Types

typedef std::pair< std::vector< double >, std::vector< double > > PosRotPair
 

Private Member Functions

void buildGeometry (DDFilteredView &fv, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
 
void buildGeometry (cms::DDFilteredView &fv, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
 
std::vector< double > extractParameters (DDFilteredView &fv) const
 get parameter also for boolean solid. More...
 
void insertChamber (DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
 create the chamber More...
 
void insertChamber (cms::DDFilteredView &fv, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
 create the chamber More...
 
void insertLayer (DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
 create the layer More...
 
void insertLayer (cms::DDFilteredView &fv, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
 create the layer More...
 
void insertSuperLayer (DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
 create the SL More...
 
void insertSuperLayer (cms::DDFilteredView &fv, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
 create the SL More...
 
PosRotPair plane (const DDFilteredView &fv) const
 
PosRotPair plane (const cms::DDFilteredView &fv) const
 

Detailed Description

Build the RPCGeometry from the DDD and DD4hep description

DD4hep part added to the original old file (DD version) made by Stefano Lacaprara (INFN LNL)

Author
: Sergio Lo Meo (sergi.nosp@m.o.lo.nosp@m..meo@.nosp@m.cern.nosp@m..ch) Created: Tue, 26 Jan 2021

Definition at line 29 of file DTGeometryParsFromDD.h.

Member Typedef Documentation

◆ PosRotPair

typedef std::pair<std::vector<double>, std::vector<double> > DTGeometryParsFromDD::PosRotPair
private

Definition at line 68 of file DTGeometryParsFromDD.h.

Member Enumeration Documentation

◆ DTDetTag

Constructor & Destructor Documentation

◆ DTGeometryParsFromDD()

DTGeometryParsFromDD::DTGeometryParsFromDD ( )

Constructor.

Definition at line 38 of file DTGeometryParsFromDD.cc.

38 {}

◆ ~DTGeometryParsFromDD()

DTGeometryParsFromDD::~DTGeometryParsFromDD ( )
virtual

Destructor.

Definition at line 40 of file DTGeometryParsFromDD.cc.

40 {}

Member Function Documentation

◆ build() [1/2]

void DTGeometryParsFromDD::build ( const DDCompactView cview,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig 
)

Definition at line 43 of file DTGeometryParsFromDD.cc.

References ALCARECOTkAlBeamHalo_cff::filter, RecoIdealGeometry::size(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by DTRecoIdealDBLoader::beginRun().

45  {
46 #ifdef EDM_ML_DEBUG
47  edm::LogVerbatim("DTGeometry") << "DTGeometryParsFromDD::build";
48 #endif
49 
50  std::string attribute = "MuStructure";
51  std::string value = "MuonBarrelDT";
52 
53  // Asking only for the Muon DTs
55  DDFilteredView fview(*cview, filter);
56  buildGeometry(fview, muonConstants, rig);
57 #ifdef EDM_ML_DEBUG
58  edm::LogVerbatim("DTGeometry") << "RecoIdealGeometry " << rig.size();
59 #endif
60 }
Log< level::Info, true > LogVerbatim
void buildGeometry(DDFilteredView &fv, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
Definition: value.py:1

◆ build() [2/2]

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

Definition at line 64 of file DTGeometryParsFromDD.cc.

References ALCARECOTkAlBeamHalo_cff::filter, and AlCaHLTBitMon_QueryRunRegistry::string.

66  {
67  const std::string attribute = "MuStructure";
68  const std::string value = "MuonBarrelDT";
69  const cms::DDFilter filter(attribute, value);
70  cms::DDFilteredView fview(*cview, filter);
71  buildGeometry(fview, muonConstants, rgeo);
72 }
void buildGeometry(DDFilteredView &fv, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
Definition: value.py:1

◆ buildGeometry() [1/2]

void DTGeometryParsFromDD::buildGeometry ( DDFilteredView fv,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig 
) const
private

Definition at line 75 of file DTGeometryParsFromDD.cc.

References DDfetch(), DDFilteredView::firstChild(), DDFilteredView::mergedSpecifics(), DDFilteredView::nextSibling(), submitPVValidationJobs::params, DDFilteredView::parent(), AlCaHLTBitMon_QueryRunRegistry::string, and heppy_batch::val.

77  {
78 #ifdef EDM_ML_DEBUG
79  edm::LogVerbatim("DTGeometryParsFromDD") << "(0) DTGeometryParsFromDD - DDD ";
80 #endif
81  bool doChamber = fv.firstChild();
82 
83  // Loop on chambers
84  while (doChamber) {
85  DDValue val("Type");
88  if (DDfetch(&params, val))
89  type = val.strings()[0];
90  // FIXME
91  val = DDValue("FEPos");
92  std::string FEPos;
93  if (DDfetch(&params, val))
94  FEPos = val.strings()[0];
95  insertChamber(fv, type, muonConstants, rig);
96 
97  // Loop on SLs
98  bool doSL = fv.firstChild();
99  while (doSL) {
100  insertSuperLayer(fv, type, muonConstants, rig);
101 
102  bool doL = fv.firstChild();
103  // Loop on SLs
104  while (doL) {
105  insertLayer(fv, type, muonConstants, rig);
106 
107  // fv.parent();
108  doL = fv.nextSibling(); // go to next layer
109  } // layers
110 
111  fv.parent();
112  doSL = fv.nextSibling(); // go to next SL
113  } // sls
114 
115  fv.parent();
116  doChamber = fv.nextSibling(); // go to next chamber
117  } // chambers
118 }
Log< level::Info, true > LogVerbatim
bool parent()
set the current node to the parent node ...
bool nextSibling()
set the current node to the next sibling ...
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
Definition: DDsvalues.cc:79
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
void insertLayer(DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
create the layer
DDsvalues_type mergedSpecifics() const
void insertChamber(DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
create the chamber
void insertSuperLayer(DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
create the SL
bool firstChild()
set the current node to the first child ...

◆ buildGeometry() [2/2]

void DTGeometryParsFromDD::buildGeometry ( cms::DDFilteredView fv,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig 
) const
private

Definition at line 272 of file DTGeometryParsFromDD.cc.

References cms::DDFilteredView::down(), cms::DDFilteredView::firstChild(), cms::DDFilteredView::nextSibling(), cms::DDFilteredView::parent(), and cms::DDFilteredView::sibling().

274  {
275 #ifdef EDM_ML_DEBUG
276  edm::LogVerbatim("DTGeometryParsFromDD") << "(0) DTGeometryParsFromDD - DD4hep ";
277 #endif
278  bool doChamber = fv.firstChild();
279 
280  while (doChamber) {
281  insertChamber(fv, muonConstants, rig);
282 
283  bool doSL = fv.nextSibling();
284  while (doSL) {
285  insertSuperLayer(fv, muonConstants, rig);
286 
287  fv.down();
288  bool doLayers = fv.sibling();
289  while (doLayers) {
290  insertLayer(fv, muonConstants, rig);
291 
292  doLayers = fv.sibling();
293  }
294 
295  doSL = fv.nextSibling();
296  }
297 
298  fv.parent();
299  doChamber = fv.firstChild();
300  }
301 }
Log< level::Info, true > LogVerbatim
bool sibling()
set the current node to the next sub sibling
void down()
set current node to the child node in the filtered tree
bool nextSibling()
set the current node to the next sibling
bool parent()
set the current node to the parent node ...
bool firstChild()
set the current node to the first child
void insertLayer(DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
create the layer
void insertChamber(DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
create the chamber
void insertSuperLayer(DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
create the SL

◆ extractParameters()

std::vector< double > DTGeometryParsFromDD::extractParameters ( DDFilteredView fv) const
private

get parameter also for boolean solid.

Definition at line 219 of file DTGeometryParsFromDD.cc.

References A, cms::cuda::bs, ddbox, DDFilteredView::logicalPart(), DDSolid::parameters(), DDSolid::shape(), and DDLogicalPart::solid().

219  {
220  std::vector<double> par;
221  if (fv.logicalPart().solid().shape() != DDSolidShape::ddbox) {
223  DDSolid A = bs.solidA();
224  while (A.shape() != DDSolidShape::ddbox) {
226  A = bs.solidA();
227  }
228  par = A.parameters();
229  } else {
230  par = fv.logicalPart().solid().parameters();
231  }
232  return par;
233 }
const std::vector< double > & parameters(void) const
Give the parameters of the solid.
Definition: DDSolid.cc:125
A DDSolid represents the shape of a part.
Definition: DDSolid.h:39
DDSolidShape shape(void) const
The type of the solid.
Definition: DDSolid.cc:123
const DDLogicalPart & logicalPart() const
The logical-part of the current node in the filtered-view.
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Definition: APVGainStruct.h:7

◆ insertChamber() [1/2]

void DTGeometryParsFromDD::insertChamber ( DDFilteredView fv,
const std::string &  type,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig 
) const
private

create the chamber

SL the definition of length, width, thickness depends on the local reference frame of the Det

Definition at line 120 of file DTGeometryParsFromDD.cc.

References hcalRecHitTable_cff::detId, DDFilteredView::geoHistory(), MuonGeometryNumbering::geoHistoryToBaseNumber(), DTNumberingScheme::getDetId(), and RecoIdealGeometry::insert().

123  {
124  MuonGeometryNumbering mdddnum(muonConstants);
125  DTNumberingScheme dtnum(muonConstants);
126  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
127  DTChamberId detId(rawid);
128 #ifdef EDM_ML_DEBUG
129  edm::LogVerbatim("DTGeometry") << "inserting Chamber " << detId;
130 #endif
131 
132  // Chamber specific parameter (size)
133  std::vector<double> par;
134  par.emplace_back(DTChamberTag);
135  std::vector<double> size = extractParameters(fv);
136  par.insert(par.end(), size.begin(), size.end());
137 #ifdef EDM_ML_DEBUG
138  edm::LogVerbatim("DTGeometryParsFromDD")
139  << "(1) DDD, Chamber DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3];
140 #endif
141  // width is along local X
143  // length is along local Y
144  // thickness is long local Z
145 
146  PosRotPair posRot(plane(fv));
147  rig.insert(rawid, posRot.first, posRot.second, par);
148 }
size
Write out results.
Log< level::Info, true > LogVerbatim
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
PosRotPair plane(const DDFilteredView &fv) const
std::vector< double > extractParameters(DDFilteredView &fv) const
get parameter also for boolean solid.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
std::pair< std::vector< double >, std::vector< double > > PosRotPair

◆ insertChamber() [2/2]

void DTGeometryParsFromDD::insertChamber ( cms::DDFilteredView fv,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig 
) const
private

create the chamber

Definition at line 337 of file DTGeometryParsFromDD.cc.

References DTNumberingScheme::baseNumberToUnitNumber(), hcalRecHitTable_cff::detId, MuonGeometryNumbering::geoHistoryToBaseNumber(), cms::DDFilteredView::history(), RecoIdealGeometry::insert(), and cms::DDFilteredView::parameters().

339  {
340  MuonGeometryNumbering mdddnum(muonConstants);
341  DTNumberingScheme dtnum(muonConstants);
342  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.history()));
343  DTChamberId detId(rawid);
344 
345  std::vector<double> par_temp = fv.parameters();
346  std::vector<double> par(4);
347  par[0] = DTChamberTag; //DTChamberTag is the ID of a Chamber
348  par[1] = par_temp[0] / dd4hep::mm;
349  par[2] = par_temp[1] / dd4hep::mm;
350  par[3] = par_temp[2] / dd4hep::mm;
351 
352 #ifdef EDM_ML_DEBUG
353  edm::LogVerbatim("DTGeometryParsFromDD")
354  << "(1) DD4hep, Chamber DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3];
355 #endif
356  PosRotPair posRot(plane(fv));
357  rig.insert(rawid, posRot.first, posRot.second, par);
358 }
Log< level::Info, true > LogVerbatim
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
PosRotPair plane(const DDFilteredView &fv) const
const ExpandedNodes & history()
The numbering history of the current node.
std::pair< std::vector< double >, std::vector< double > > PosRotPair
const std::vector< double > parameters() const
extract shape parameters

◆ insertLayer() [1/2]

void DTGeometryParsFromDD::insertLayer ( DDFilteredView fv,
const std::string &  type,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig 
) const
private

create the layer

Definition at line 176 of file DTGeometryParsFromDD.cc.

References DDFilteredView::copyno(), DDFilteredView::firstChild(), DDFilteredView::geoHistory(), MuonGeometryNumbering::geoHistoryToBaseNumber(), DTNumberingScheme::getDetId(), RecoIdealGeometry::insert(), DDFilteredView::nextSibling(), and DDFilteredView::parent().

179  {
180  MuonGeometryNumbering mdddnum(muonConstants);
181  DTNumberingScheme dtnum(muonConstants);
182  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
183  DTLayerId layId(rawid);
184 #ifdef EDM_ML_DEBUG
185  edm::LogVerbatim("DTGeometry") << "inserting Layer " << layId;
186 #endif
187  // Layer specific parameter (size)
188  std::vector<double> par;
189  par.emplace_back(DTLayerTag);
190  std::vector<double> size = extractParameters(fv);
191  par.insert(par.end(), size.begin(), size.end());
192 
193  // Loop on wires
194  bool doWire = fv.firstChild();
195  int WCounter = 0;
196  int firstWire = fv.copyno();
197  //float wireLength = par[1]/cm;
198  while (doWire) {
199  WCounter++;
200  doWire = fv.nextSibling(); // next wire
201  }
202  std::vector<double> sensSize = extractParameters(fv);
203  //int lastWire=fv.copyno();
204  par.emplace_back(firstWire);
205  par.emplace_back(WCounter);
206  par.emplace_back(sensSize[1]);
207  fv.parent();
208 
209  PosRotPair posRot(plane(fv));
210 
211 #ifdef EDM_ML_DEBUG
212  edm::LogVerbatim("DTGeometryParsFromDD")
213  << "(3) DDD, Layer DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3] << " "
214  << par[4] << " " << par[5] << " " << par[6];
215 #endif
216  rig.insert(layId, posRot.first, posRot.second, par);
217 }
size
Write out results.
Log< level::Info, true > LogVerbatim
bool parent()
set the current node to the parent node ...
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)
PosRotPair plane(const DDFilteredView &fv) const
std::vector< double > extractParameters(DDFilteredView &fv) const
get parameter also for boolean solid.
int copyno() const
Copy number associated with the current node.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
std::pair< std::vector< double >, std::vector< double > > PosRotPair
bool firstChild()
set the current node to the first child ...

◆ insertLayer() [2/2]

void DTGeometryParsFromDD::insertLayer ( cms::DDFilteredView fv,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig 
) const
private

create the layer

Definition at line 383 of file DTGeometryParsFromDD.cc.

References DTNumberingScheme::baseNumberToUnitNumber(), cms::DDFilteredView::checkChild(), cms::DDFilteredView::down(), MuonGeometryNumbering::geoHistoryToBaseNumber(), cms::DDFilteredView::history(), RecoIdealGeometry::insert(), cms::DDFilteredView::parameters(), cms::DDFilteredView::sibling(), cms::DDFilteredView::up(), and cms::DDFilteredView::volume().

385  {
386  MuonGeometryNumbering mdddnum(muonConstants);
387  DTNumberingScheme dtnum(muonConstants);
388  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.history()));
389  DTLayerId layId(rawid);
390 
391  std::vector<double> par_temp = fv.parameters();
392  std::vector<double> par(4);
393  par[0] = DTLayerTag; //DTLayerTag is the ID of a Layer
394  par[1] = par_temp[0] / dd4hep::mm;
395  par[2] = par_temp[1] / dd4hep::mm;
396  par[3] = par_temp[2] / dd4hep::mm;
397 
398  fv.down();
399  bool doWire = fv.sibling();
400  int firstWire = fv.volume()->GetNumber();
401  auto const& wpar = fv.parameters();
402  float wireLength = wpar[1] / dd4hep::mm;
403 
404  int WCounter = 0;
405  while (doWire) {
406  doWire = fv.checkChild();
407  WCounter++;
408  }
409 
410  par.emplace_back(firstWire);
411  par.emplace_back(WCounter);
412  par.emplace_back(wireLength);
413 
414  fv.up();
415 
416  PosRotPair posRot(plane(fv));
417 
418 #ifdef EDM_ML_DEBUG
419  edm::LogVerbatim("DTGeometryParsFromDD")
420  << "(3) DD4hep, Layer DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3] << " "
421  << par[4] << " " << par[5] << " " << par[6];
422 #endif
423  rig.insert(layId, posRot.first, posRot.second, par);
424 }
Log< level::Info, true > LogVerbatim
void up()
set current node to the parent node in the filtered tree
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
PosRotPair plane(const DDFilteredView &fv) const
bool sibling()
set the current node to the next sub sibling
void down()
set current node to the child node in the filtered tree
const ExpandedNodes & history()
The numbering history of the current node.
std::pair< std::vector< double >, std::vector< double > > PosRotPair
const PlacedVolume volume() const
The physical volume of the current node.
bool checkChild()
count the number of children matching selection
const std::vector< double > parameters() const
extract shape parameters

◆ insertSuperLayer() [1/2]

void DTGeometryParsFromDD::insertSuperLayer ( DDFilteredView fv,
const std::string &  type,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig 
) const
private

create the SL

Definition at line 150 of file DTGeometryParsFromDD.cc.

References DDFilteredView::geoHistory(), MuonGeometryNumbering::geoHistoryToBaseNumber(), DTNumberingScheme::getDetId(), and RecoIdealGeometry::insert().

153  {
154  MuonGeometryNumbering mdddnum(muonConstants);
155  DTNumberingScheme dtnum(muonConstants);
156  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
157  DTSuperLayerId slId(rawid);
158 #ifdef EDM_ML_DEBUG
159  edm::LogVerbatim("DTGeometry") << "inserting SuperLayer " << slId;
160 #endif
161 
162  // Slayer specific parameter (size)
163  std::vector<double> par;
164  par.emplace_back(DTSuperLayerTag);
165  std::vector<double> size = extractParameters(fv);
166  par.insert(par.end(), size.begin(), size.end());
167 #ifdef EDM_ML_DEBUG
168  edm::LogVerbatim("DTGeometryParsFromDD")
169  << "(2) DDD, Super Layer DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3];
170 #endif
171  // Ok this is the slayer position...
172  PosRotPair posRot(plane(fv));
173  rig.insert(slId, posRot.first, posRot.second, par);
174 }
size
Write out results.
Log< level::Info, true > LogVerbatim
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
PosRotPair plane(const DDFilteredView &fv) const
std::vector< double > extractParameters(DDFilteredView &fv) const
get parameter also for boolean solid.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
std::pair< std::vector< double >, std::vector< double > > PosRotPair

◆ insertSuperLayer() [2/2]

void DTGeometryParsFromDD::insertSuperLayer ( cms::DDFilteredView fv,
const MuonGeometryConstants muonConstants,
RecoIdealGeometry rig 
) const
private

create the SL

Definition at line 360 of file DTGeometryParsFromDD.cc.

References DTNumberingScheme::baseNumberToUnitNumber(), MuonGeometryNumbering::geoHistoryToBaseNumber(), cms::DDFilteredView::history(), RecoIdealGeometry::insert(), and cms::DDFilteredView::parameters().

362  {
363  MuonGeometryNumbering mdddnum(muonConstants);
364  DTNumberingScheme dtnum(muonConstants);
365  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.history()));
366  DTSuperLayerId slId(rawid);
367 
368  std::vector<double> par_temp = fv.parameters();
369  std::vector<double> par(4);
370  par[0] = DTSuperLayerTag; //DTSuperLayerTag is the ID of a SuperLayer
371  par[1] = par_temp[0] / dd4hep::mm;
372  par[2] = par_temp[1] / dd4hep::mm;
373  par[3] = par_temp[2] / dd4hep::mm;
374 
375 #ifdef EDM_ML_DEBUG
376  edm::LogVerbatim("DTGeometryParsFromDD")
377  << "(2) DD4hep, Super Layer DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3];
378 #endif
379  PosRotPair posRot(plane(fv));
380  rig.insert(slId, posRot.first, posRot.second, par);
381 }
Log< level::Info, true > LogVerbatim
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
PosRotPair plane(const DDFilteredView &fv) const
const ExpandedNodes & history()
The numbering history of the current node.
std::pair< std::vector< double >, std::vector< double > > PosRotPair
const std::vector< double > parameters() const
extract shape parameters

◆ plane() [1/2]

DTGeometryParsFromDD::PosRotPair DTGeometryParsFromDD::plane ( const DDFilteredView fv) const
private

Definition at line 235 of file DTGeometryParsFromDD.cc.

References angle_units::operators::convertMmToCm(), idealTransformation::rotation, DDFilteredView::rotation(), DDFilteredView::translation(), and x.

235  {
236  // extract the position
237  const DDTranslation& trans(fv.translation());
238 
239  std::vector<double> gtran(3);
240  gtran[0] = convertMmToCm(trans.x());
241  gtran[1] = convertMmToCm(trans.y());
242  gtran[2] = convertMmToCm(trans.z());
243 
244 #ifdef EDM_ML_DEBUG
245  edm::LogVerbatim("DTGeometryParsFromDD") << "(4) DDD, Position "
246  << " " << gtran[0] << " " << gtran[1] << " " << gtran[2];
247 #endif
248  // now the rotation
249  // 'active' and 'passive' rotations are inverse to each other
250  const DDRotationMatrix& rotation = fv.rotation(); //REMOVED .Inverse();
251  DD3Vector x, y, z;
252  rotation.GetComponents(x, y, z);
253 
254  std::vector<double> grmat(9);
255  grmat[0] = x.X();
256  grmat[1] = x.Y();
257  grmat[2] = x.Z();
258 
259  grmat[3] = y.X();
260  grmat[4] = y.Y();
261  grmat[5] = y.Z();
262 
263  grmat[6] = z.X();
264  grmat[7] = z.Y();
265  grmat[8] = z.Z();
266 
267  return std::pair<std::vector<double>, std::vector<double> >(gtran, grmat);
268 }
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.
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
const DDTranslation & translation() const
The absolute translation of the current node.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7

◆ plane() [2/2]

DTGeometryParsFromDD::PosRotPair DTGeometryParsFromDD::plane ( const cms::DDFilteredView fv) const
private

Definition at line 303 of file DTGeometryParsFromDD.cc.

References idealTransformation::rotation, cms::DDFilteredView::rotation(), cms::DDFilteredView::trans(), and x.

303  {
304  const Double_t* tr = fv.trans();
305 
306  std::vector<double> gtran(3);
307 
308  gtran[0] = tr[0] / dd4hep::cm;
309  gtran[1] = tr[1] / dd4hep::cm;
310  gtran[2] = tr[2] / dd4hep::cm;
311 
312 #ifdef EDM_ML_DEBUG
313  edm::LogVerbatim("DTGeometryParsFromDD") << "(4) DD4hep, Position "
314  << " " << gtran[0] << " " << gtran[1] << " " << gtran[2];
315 #endif
317  DD3Vector x, y, z;
318  rotation.GetComponents(x, y, z);
319 
320  std::vector<double> grmat(9);
321 
322  grmat[0] = x.X();
323  grmat[1] = x.Y();
324  grmat[2] = x.Z();
325 
326  grmat[3] = y.X();
327  grmat[4] = y.Y();
328  grmat[5] = y.Z();
329 
330  grmat[6] = z.X();
331  grmat[7] = z.Y();
332  grmat[8] = z.Z();
333 
334  return std::pair<std::vector<double>, std::vector<double> >(gtran, grmat);
335 }
Log< level::Info, true > LogVerbatim
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
const Double_t * trans() const
The absolute translation of the current node.
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const RotationMatrix rotation() const