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  int ChamCounter = 0;
85  while (doChamber) {
86  ChamCounter++;
87  DDValue val("Type");
90  if (DDfetch(&params, val))
91  type = val.strings()[0];
92  // FIXME
93  val = DDValue("FEPos");
94  std::string FEPos;
95  if (DDfetch(&params, val))
96  FEPos = val.strings()[0];
97  insertChamber(fv, type, muonConstants, rig);
98 
99  // Loop on SLs
100  bool doSL = fv.firstChild();
101  int SLCounter = 0;
102  while (doSL) {
103  SLCounter++;
104  insertSuperLayer(fv, type, muonConstants, rig);
105 
106  bool doL = fv.firstChild();
107  int LCounter = 0;
108  // Loop on SLs
109  while (doL) {
110  LCounter++;
111  insertLayer(fv, type, muonConstants, rig);
112 
113  // fv.parent();
114  doL = fv.nextSibling(); // go to next layer
115  } // layers
116 
117  fv.parent();
118  doSL = fv.nextSibling(); // go to next SL
119  } // sls
120 
121  fv.parent();
122  doChamber = fv.nextSibling(); // go to next chamber
123  } // chambers
124 }
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 278 of file DTGeometryParsFromDD.cc.

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

280  {
281 #ifdef EDM_ML_DEBUG
282  edm::LogVerbatim("DTGeometryParsFromDD") << "(0) DTGeometryParsFromDD - DD4hep ";
283 #endif
284  bool doChamber = fv.firstChild();
285 
286  while (doChamber) {
287  insertChamber(fv, muonConstants, rig);
288 
289  bool doSL = fv.nextSibling();
290  while (doSL) {
291  insertSuperLayer(fv, muonConstants, rig);
292 
293  fv.down();
294  bool doLayers = fv.sibling();
295  while (doLayers) {
296  insertLayer(fv, muonConstants, rig);
297 
298  doLayers = fv.sibling();
299  }
300 
301  doSL = fv.nextSibling();
302  }
303 
304  fv.parent();
305  doChamber = fv.firstChild();
306  }
307 }
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 225 of file DTGeometryParsFromDD.cc.

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

225  {
226  std::vector<double> par;
227  if (fv.logicalPart().solid().shape() != DDSolidShape::ddbox) {
229  DDSolid A = bs.solidA();
230  while (A.shape() != DDSolidShape::ddbox) {
232  A = bs.solidA();
233  }
234  par = A.parameters();
235  } else {
236  par = fv.logicalPart().solid().parameters();
237  }
238  return par;
239 }
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 126 of file DTGeometryParsFromDD.cc.

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

129  {
130  MuonGeometryNumbering mdddnum(muonConstants);
131  DTNumberingScheme dtnum(muonConstants);
132  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
133  DTChamberId detId(rawid);
134 #ifdef EDM_ML_DEBUG
135  edm::LogVerbatim("DTGeometry") << "inserting Chamber " << detId;
136 #endif
137 
138  // Chamber specific parameter (size)
139  std::vector<double> par;
140  par.emplace_back(DTChamberTag);
141  std::vector<double> size = extractParameters(fv);
142  par.insert(par.end(), size.begin(), size.end());
143 #ifdef EDM_ML_DEBUG
144  edm::LogVerbatim("DTGeometryParsFromDD")
145  << "(1) DDD, Chamber DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3];
146 #endif
147  // width is along local X
149  // length is along local Y
150  // thickness is long local Z
151 
152  PosRotPair posRot(plane(fv));
153  rig.insert(rawid, posRot.first, posRot.second, par);
154 }
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 343 of file DTGeometryParsFromDD.cc.

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

345  {
346  MuonGeometryNumbering mdddnum(muonConstants);
347  DTNumberingScheme dtnum(muonConstants);
348  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.history()));
349  DTChamberId detId(rawid);
350 
351  std::vector<double> par_temp = fv.parameters();
352  std::vector<double> par(4);
353  par[0] = DTChamberTag; //DTChamberTag is the ID of a Chamber
354  par[1] = par_temp[0] / dd4hep::mm;
355  par[2] = par_temp[1] / dd4hep::mm;
356  par[3] = par_temp[2] / dd4hep::mm;
357 
358 #ifdef EDM_ML_DEBUG
359  edm::LogVerbatim("DTGeometryParsFromDD")
360  << "(1) DD4hep, Chamber DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3];
361 #endif
362  PosRotPair posRot(plane(fv));
363  rig.insert(rawid, posRot.first, posRot.second, par);
364 }
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 182 of file DTGeometryParsFromDD.cc.

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

185  {
186  MuonGeometryNumbering mdddnum(muonConstants);
187  DTNumberingScheme dtnum(muonConstants);
188  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
189  DTLayerId layId(rawid);
190 #ifdef EDM_ML_DEBUG
191  edm::LogVerbatim("DTGeometry") << "inserting Layer " << layId;
192 #endif
193  // Layer specific parameter (size)
194  std::vector<double> par;
195  par.emplace_back(DTLayerTag);
196  std::vector<double> size = extractParameters(fv);
197  par.insert(par.end(), size.begin(), size.end());
198 
199  // Loop on wires
200  bool doWire = fv.firstChild();
201  int WCounter = 0;
202  int firstWire = fv.copyno();
203  //float wireLength = par[1]/cm;
204  while (doWire) {
205  WCounter++;
206  doWire = fv.nextSibling(); // next wire
207  }
208  std::vector<double> sensSize = extractParameters(fv);
209  //int lastWire=fv.copyno();
210  par.emplace_back(firstWire);
211  par.emplace_back(WCounter);
212  par.emplace_back(sensSize[1]);
213  fv.parent();
214 
215  PosRotPair posRot(plane(fv));
216 
217 #ifdef EDM_ML_DEBUG
218  edm::LogVerbatim("DTGeometryParsFromDD")
219  << "(3) DDD, Layer DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3] << " "
220  << par[4] << " " << par[5] << " " << par[6];
221 #endif
222  rig.insert(layId, posRot.first, posRot.second, par);
223 }
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 389 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().

391  {
392  MuonGeometryNumbering mdddnum(muonConstants);
393  DTNumberingScheme dtnum(muonConstants);
394  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.history()));
395  DTLayerId layId(rawid);
396 
397  std::vector<double> par_temp = fv.parameters();
398  std::vector<double> par(4);
399  par[0] = DTLayerTag; //DTLayerTag is the ID of a Layer
400  par[1] = par_temp[0] / dd4hep::mm;
401  par[2] = par_temp[1] / dd4hep::mm;
402  par[3] = par_temp[2] / dd4hep::mm;
403 
404  fv.down();
405  bool doWire = fv.sibling();
406  int firstWire = fv.volume()->GetNumber();
407  auto const& wpar = fv.parameters();
408  float wireLength = wpar[1] / dd4hep::mm;
409 
410  int WCounter = 0;
411  while (doWire) {
412  doWire = fv.checkChild();
413  WCounter++;
414  }
415 
416  par.emplace_back(firstWire);
417  par.emplace_back(WCounter);
418  par.emplace_back(wireLength);
419 
420  fv.up();
421 
422  PosRotPair posRot(plane(fv));
423 
424 #ifdef EDM_ML_DEBUG
425  edm::LogVerbatim("DTGeometryParsFromDD")
426  << "(3) DD4hep, Layer DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3] << " "
427  << par[4] << " " << par[5] << " " << par[6];
428 #endif
429  rig.insert(layId, posRot.first, posRot.second, par);
430 }
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 156 of file DTGeometryParsFromDD.cc.

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

159  {
160  MuonGeometryNumbering mdddnum(muonConstants);
161  DTNumberingScheme dtnum(muonConstants);
162  int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.geoHistory()));
163  DTSuperLayerId slId(rawid);
164 #ifdef EDM_ML_DEBUG
165  edm::LogVerbatim("DTGeometry") << "inserting SuperLayer " << slId;
166 #endif
167 
168  // Slayer specific parameter (size)
169  std::vector<double> par;
170  par.emplace_back(DTSuperLayerTag);
171  std::vector<double> size = extractParameters(fv);
172  par.insert(par.end(), size.begin(), size.end());
173 #ifdef EDM_ML_DEBUG
174  edm::LogVerbatim("DTGeometryParsFromDD")
175  << "(2) DDD, Super Layer DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3];
176 #endif
177  // Ok this is the slayer position...
178  PosRotPair posRot(plane(fv));
179  rig.insert(slId, posRot.first, posRot.second, par);
180 }
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 366 of file DTGeometryParsFromDD.cc.

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

368  {
369  MuonGeometryNumbering mdddnum(muonConstants);
370  DTNumberingScheme dtnum(muonConstants);
371  int rawid = dtnum.baseNumberToUnitNumber(mdddnum.geoHistoryToBaseNumber(fv.history()));
372  DTSuperLayerId slId(rawid);
373 
374  std::vector<double> par_temp = fv.parameters();
375  std::vector<double> par(4);
376  par[0] = DTSuperLayerTag; //DTSuperLayerTag is the ID of a SuperLayer
377  par[1] = par_temp[0] / dd4hep::mm;
378  par[2] = par_temp[1] / dd4hep::mm;
379  par[3] = par_temp[2] / dd4hep::mm;
380 
381 #ifdef EDM_ML_DEBUG
382  edm::LogVerbatim("DTGeometryParsFromDD")
383  << "(2) DD4hep, Super Layer DetID " << rawid << " " << par[0] << " " << par[1] << " " << par[2] << " " << par[3];
384 #endif
385  PosRotPair posRot(plane(fv));
386  rig.insert(slId, posRot.first, posRot.second, par);
387 }
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 241 of file DTGeometryParsFromDD.cc.

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

241  {
242  // extract the position
243  const DDTranslation& trans(fv.translation());
244 
245  std::vector<double> gtran(3);
246  gtran[0] = convertMmToCm(trans.x());
247  gtran[1] = convertMmToCm(trans.y());
248  gtran[2] = convertMmToCm(trans.z());
249 
250 #ifdef EDM_ML_DEBUG
251  edm::LogVerbatim("DTGeometryParsFromDD") << "(4) DDD, Position "
252  << " " << gtran[0] << " " << gtran[1] << " " << gtran[2];
253 #endif
254  // now the rotation
255  // 'active' and 'passive' rotations are inverse to each other
256  const DDRotationMatrix& rotation = fv.rotation(); //REMOVED .Inverse();
257  DD3Vector x, y, z;
258  rotation.GetComponents(x, y, z);
259 
260  std::vector<double> grmat(9);
261  grmat[0] = x.X();
262  grmat[1] = x.Y();
263  grmat[2] = x.Z();
264 
265  grmat[3] = y.X();
266  grmat[4] = y.Y();
267  grmat[5] = y.Z();
268 
269  grmat[6] = z.X();
270  grmat[7] = z.Y();
271  grmat[8] = z.Z();
272 
273  return std::pair<std::vector<double>, std::vector<double> >(gtran, grmat);
274 }
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 309 of file DTGeometryParsFromDD.cc.

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

309  {
310  const Double_t* tr = fv.trans();
311 
312  std::vector<double> gtran(3);
313 
314  gtran[0] = tr[0] / dd4hep::cm;
315  gtran[1] = tr[1] / dd4hep::cm;
316  gtran[2] = tr[2] / dd4hep::cm;
317 
318 #ifdef EDM_ML_DEBUG
319  edm::LogVerbatim("DTGeometryParsFromDD") << "(4) DD4hep, Position "
320  << " " << gtran[0] << " " << gtran[1] << " " << gtran[2];
321 #endif
323  DD3Vector x, y, z;
324  rotation.GetComponents(x, y, z);
325 
326  std::vector<double> grmat(9);
327 
328  grmat[0] = x.X();
329  grmat[1] = x.Y();
330  grmat[2] = x.Z();
331 
332  grmat[3] = y.X();
333  grmat[4] = y.Y();
334  grmat[5] = y.Z();
335 
336  grmat[6] = z.X();
337  grmat[7] = z.Y();
338  grmat[8] = z.Z();
339 
340  return std::pair<std::vector<double>, std::vector<double> >(gtran, grmat);
341 }
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