1 #include <DD4hep/DD4hepUnits.h> 19 template <
typename DDView>
20 double getDouble(
const char*
s, DDView
const&
ev) {
22 std::vector<const DDsvalues_type*>
result;
24 std::vector<const DDsvalues_type*>::iterator
it =
result.begin();
32 const std::vector<std::string>&
temp =
val.strings();
33 if (
temp.size() != 1) {
36 return double(::atof(
temp[0].c_str()));
41 template <
typename DDView>
44 std::vector<const DDsvalues_type*>
result;
46 std::vector<const DDsvalues_type*>::iterator
it =
result.begin();
54 const std::vector<std::string>&
temp =
val.strings();
55 if (
temp.size() != 1) {
74 : ddname_(fv->
name()),
77 trans_(fv->translation()),
83 isFromDD4hep_(
false) {
90 radLength_ = getDouble(
"TrackerRadLength", *fv);
91 xi_ = getDouble(
"TrackerXi", *fv);
94 pixROCx_ = getDouble(
"PixelROC_X", *fv);
95 pixROCy_ = getDouble(
"PixelROC_Y", *fv);
100 isFirstSensor_ = (getString(
"TrackerFirstDetectors", *fv) == strue);
102 stereo_ = (getString(
"TrackerStereoDetectors", *fv) == strue);
103 isLowerSensor_ = (getString(
"TrackerLowerDetectors", *fv) == strue);
104 isUpperSensor_ = (getString(
"TrackerUpperDetectors", *fv) == strue);
116 trans_((fv->translation()) /
dd4hep::mm),
121 params_(computeLegacyShapeParameters(shape_, fv->solid())),
122 isFromDD4hep_(
true) {
146 stereo_ = (fv->
get<std::string_view>(
"TrackerStereoDetectors") == strue);
168 trans_(onePGD._x, onePGD._y, onePGD._z),
273 cont.emplace_back(
this);
313 const dd4hep::Solid& mySolid)
const {
314 std::vector<double> myOldDDShapeParameters;
318 const dd4hep::Box& myBox = dd4hep::Box(mySolid);
319 myOldDDShapeParameters = {(myBox.x()) / dd4hep::mm, (myBox.y()) / dd4hep::mm, (myBox.z()) / dd4hep::mm};
324 const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid);
325 myOldDDShapeParameters = {(myTrap->GetDZ()) / dd4hep::mm,
328 (myTrap->GetH1()) / dd4hep::mm,
329 (myTrap->GetBl1()) / dd4hep::mm,
330 (myTrap->GetTl1()) / dd4hep::mm,
332 (myTrap->GetH2()) / dd4hep::mm,
333 (myTrap->GetBl2()) / dd4hep::mm,
334 (myTrap->GetTl2()) / dd4hep::mm,
340 const dd4hep::Tube& myTube = dd4hep::Tube(mySolid);
348 myOldDDShapeParameters = {
349 (myTube->GetDz()) / dd4hep::mm,
350 (myTube->GetRmin()) / dd4hep::mm,
351 (myTube->GetRmax()) / dd4hep::mm,
356 return myOldDDShapeParameters;
360 std::ostringstream oss;
362 for (
int const*
it =
n;
it !=
n + sz; ++
it) {
std::vector< GeometricDet * > GeometricDetContainer
constexpr double convertDegToRad(NumType degrees)
void addComponent(GeometricDet *)
std::vector< double > params_
Bounds * buildBounds(const cms::DDSolidShape &, const std::vector< double > &) const
std::enable_if<!std::numeric_limits< NumType >::is_integer, bool >::type almostEqual(NumType x, NumType y, int ulp)
Position positionBounds() const
bool DDfetch(const DDsvalues_type *, DDValue &)
helper for retrieving DDValues from DDsvalues_type *.
std::vector< int > nav_type
enum GeometricDet::GDEnumType GeometricEnumType
ConstGeometricDetContainer container_
static std::string printNavType(int const *n, size_t sz)
double getNextValue(const std::string &) const
extract another value from the same SpecPar
Rotation rotationBounds() const
GeometricDet(DDFilteredView *fv, GeometricEnumType dd)
std::vector< GeometricDet const * > ConstGeometricDetContainer
const std::array< const cms::dd::ValuePair< LegacySolidShape, cms::DDSolidShape >, 21 > LegacySolidShapeMap
constexpr valType roundIfNear0(valType value, double tolerance=1.e-7)
Namespace of DDCMS conversion namespace.
std::vector< double > computeLegacyShapeParameters(const cms::DDSolidShape &mySolidShape, const dd4hep::Solid &mySolid) const
T get(const std::string &)
extract attribute value
constexpr NumType convertMmToCm(NumType millimeters)
constexpr valType make0To2pi(valType angle)
DDExpandedView::nav_type nav_type
void addComponents(GeometricDetContainer const &cont)
nav_type navPos() const
return the stack of sibling numbers
ConstGeometricDetContainer deepComponents() const
Mapping::value_type::name_type name_from_value(Mapping a, V value)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > Translation
cont
load Luminosity info ##
std::unique_ptr< Bounds > bounds() const
void findSpecPar(T const &first, Ts const &... rest)
find a current Node SpecPar that has at least