34 using namespace geant_units;
35 using namespace geant_units::operators;
55 buildGeometry(fview, muonConstants, rig);
68 buildGeometry(fview, muonConstants, rgeo);
78 edm::LogVerbatim(
"DTGeometryParsFromDD") <<
"(0) DTGeometryParsFromDD - DDD ";
96 insertChamber(fv, type, muonConstants, rig);
103 insertSuperLayer(fv, type, muonConstants, rig);
110 insertLayer(fv, type, muonConstants, rig);
131 int rawid = dtnum.getDetId(mdddnum.geoHistoryToBaseNumber(fv.
geoHistory()));
137 par.emplace_back(DTChamberTag);
138 vector<double>
size = extractParameters(fv);
139 par.insert(par.end(), size.begin(), size.end());
141 <<
"(1) DDD, Chamber DetID " << rawid <<
" " << par[0] <<
" " << par[1] <<
" " << par[2] <<
" " << par[3];
147 PosRotPair posRot(plane(fv));
148 rig.
insert(rawid, posRot.first, posRot.second, par);
163 par.emplace_back(DTSuperLayerTag);
164 vector<double> size = extractParameters(fv);
165 par.insert(par.end(), size.begin(), size.end());
167 <<
"(2) DDD, Super Layer DetID " << rawid <<
" " << par[0] <<
" " << par[1] <<
" " << par[2] <<
" " << par[3];
170 rig.
insert(slId, posRot.first, posRot.second, par);
185 par.emplace_back(DTLayerTag);
186 vector<double> size = extractParameters(fv);
187 par.insert(par.end(), size.begin(), size.end());
192 int firstWire = fv.
copyno();
198 vector<double> sensSize = extractParameters(fv);
200 par.emplace_back(firstWire);
201 par.emplace_back(WCounter);
202 par.emplace_back(sensSize[1]);
208 <<
"(3) DDD, Layer DetID " << rawid <<
" " << par[0] <<
" " << par[1] <<
" " << par[2] <<
" " << par[3] <<
" "
209 << par[4] <<
" " << par[5] <<
" " << par[6];
210 rig.
insert(layId, posRot.first, posRot.second, par);
233 std::vector<double> gtran(3);
239 <<
" " << gtran[0] <<
" " << gtran[1] <<
" " << gtran[2];
244 rotation.GetComponents(x, y, z);
246 std::vector<double> grmat(9);
259 return pair<std::vector<double>, std::vector<double> >(gtran, grmat);
267 edm::LogVerbatim(
"DTGeometryParsFromDD") <<
"(0) DTGeometryParsFromDD - DD4hep ";
272 insertChamber(fv, muonConstants, rig);
276 insertSuperLayer(fv, muonConstants, rig);
281 insertLayer(fv, muonConstants, rig);
295 const Double_t* tr = fv.
trans();
297 std::vector<double> gtran(3);
299 gtran[0] = tr[0] / dd4hep::cm;
300 gtran[1] = tr[1] / dd4hep::cm;
301 gtran[2] = tr[2] / dd4hep::cm;
304 <<
" " << gtran[0] <<
" " << gtran[1] <<
" " << gtran[2];
308 rotation.GetComponents(x, y, z);
310 std::vector<double> grmat(9);
324 return pair<std::vector<double>, std::vector<double> >(gtran, grmat);
336 vector<double> par(4);
337 par[0] = DTChamberTag;
338 par[1] = par_temp[0] / dd4hep::mm;
339 par[2] = par_temp[1] / dd4hep::mm;
340 par[3] = par_temp[2] / dd4hep::mm;
343 <<
"(1) DD4hep, Chamber DetID " << rawid <<
" " << par[0] <<
" " << par[1] <<
" " << par[2] <<
" " << par[3];
345 rig.
insert(rawid, posRot.first, posRot.second, par);
357 vector<double> par(4);
358 par[0] = DTSuperLayerTag;
359 par[1] = par_temp[0] / dd4hep::mm;
360 par[2] = par_temp[1] / dd4hep::mm;
361 par[3] = par_temp[2] / dd4hep::mm;
364 <<
"(2) DD4hep, Super Layer DetID " << rawid <<
" " << par[0] <<
" " << par[1] <<
" " << par[2] <<
" " << par[3];
366 rig.
insert(slId, posRot.first, posRot.second, par);
378 vector<double> par(4);
380 par[1] = par_temp[0] / dd4hep::mm;
381 par[2] = par_temp[1] / dd4hep::mm;
382 par[3] = par_temp[2] / dd4hep::mm;
386 int firstWire = fv.
volume()->GetNumber();
388 float wireLength = wpar[1] / dd4hep::mm;
396 par.emplace_back(firstWire);
397 par.emplace_back(WCounter);
398 par.emplace_back(wireLength);
405 <<
"(3) DD4hep, Layer DetID " << rawid <<
" " << par[0] <<
" " << par[1] <<
" " << par[2] <<
" " << par[3] <<
" "
406 << par[4] <<
" " << par[5] <<
" " << par[6];
407 rig.
insert(layId, posRot.first, posRot.second, par);
Log< level::Info, true > LogVerbatim
void up()
set current node to the parent node in the filtered tree
void insertSuperLayer(DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
create the SL
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.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >> DD3Vector
const RotationMatrix rotation() const
void build(const DDCompactView *cview, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig)
bool nextSibling()
set the current node to the next sibling ...
const DDRotationMatrix & rotation() const
The absolute rotation of the current node.
void insertLayer(DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
create the layer
bool insert(DetId id, const std::vector< double > &trans, const std::vector< double > &rot, const std::vector< double > &pars)
const DDSolid & solid(void) const
Returns a reference object of the solid being the shape of this LogicalPart.
Compact representation of the geometrical detector hierarchy.
const DDGeoHistory & geoHistory() const
The list of ancestors up to the root-node of the current node.
const PlacedVolume volume() const
The physical volume of the current node.
bool sibling()
set the current node to the next sub sibling
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
void down()
set current node to the child node in the filtered tree
A DDSolid represents the shape of a part.
int copyno() const
Copy number associated with the current node.
virtual ~DTGeometryParsFromDD()
Destructor.
int baseNumberToUnitNumber(const MuonBaseNumber &num) const override
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
bool nextSibling()
set the current node to the next sibling
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
const ExpandedNodes & history()
The numbering history of the current node.
std::vector< double > extractParameters(DDFilteredView &fv) const
get parameter also for boolean solid.
DDSolidShape shape(void) const
The type of the solid.
bool parent()
set the current node to the parent node ...
bool firstChild()
set the current node to the first child
const std::vector< std::string > & strings() const
a reference to the std::string-valued values stored in the given instance of DDValue ...
DTGeometryParsFromDD()
Constructor.
void insertChamber(DDFilteredView &fv, const std::string &type, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
create the chamber
DDSolid solidA(void) const
const Double_t * trans() const
The absolute translation of the current node.
void buildGeometry(DDFilteredView &fv, const MuonGeometryConstants &muonConstants, RecoIdealGeometry &rig) const
std::pair< std::vector< double >, std::vector< double > > PosRotPair
DDsvalues_type mergedSpecifics() const
int getDetId(const MuonBaseNumber &num) const
bool firstChild()
set the current node to the first child ...
constexpr NumType convertMmToCm(NumType millimeters)
const std::vector< double > parameters() const
extract shape parameters
const DDTranslation & translation() const
The absolute translation of the current node.
bool checkChild()
count the number of children matching selection
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
tuple size
Write out results.
PosRotPair plane(const DDFilteredView &fv) const