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);
96 stereo_ = (getString(
"TrackerStereoDetectors", *fv) == strue);
97 isLowerSensor_ = (getString(
"TrackerLowerDetectors", *fv) == strue);
98 isUpperSensor_ = (getString(
"TrackerUpperDetectors", *fv) == strue);
99 isFirstSensor_ = (getString(
"TrackerFirstDetectors", *fv) == strue);
112 trans_((fv->translation()) /
dd4hep::mm),
117 params_(computeLegacyShapeParameters(shape_, fv->solid())),
118 isFromDD4hep_(
true) {
134 stereo_ = (fv->
get<std::string_view>(
"TrackerStereoDetectors") == strue);
158 trans_(onePGD._x, onePGD._y, onePGD._z),
263 cont.emplace_back(
this);
303 const dd4hep::Solid& mySolid)
const {
304 std::vector<double> myOldDDShapeParameters;
308 const dd4hep::Box& myBox = dd4hep::Box(mySolid);
309 myOldDDShapeParameters = {(myBox.x()) / dd4hep::mm, (myBox.y()) / dd4hep::mm, (myBox.z()) / dd4hep::mm};
314 const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid);
315 myOldDDShapeParameters = {(myTrap->GetDZ()) / dd4hep::mm,
318 (myTrap->GetH1()) / dd4hep::mm,
319 (myTrap->GetBl1()) / dd4hep::mm,
320 (myTrap->GetTl1()) / dd4hep::mm,
322 (myTrap->GetH2()) / dd4hep::mm,
323 (myTrap->GetBl2()) / dd4hep::mm,
324 (myTrap->GetTl2()) / dd4hep::mm,
330 const dd4hep::Tube& myTube = dd4hep::Tube(mySolid);
338 myOldDDShapeParameters = {
339 (myTube->GetDz()) / dd4hep::mm,
340 (myTube->GetRmin()) / dd4hep::mm,
341 (myTube->GetRmax()) / dd4hep::mm,
346 return myOldDDShapeParameters;
350 std::ostringstream oss;
352 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