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();
26 for (; it !=
result.end(); ++it) {
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();
48 for (; it !=
result.end(); ++it) {
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);
110 trans_((fv->translation()) /
dd4hep::mm),
115 params_(computeLegacyShapeParameters(shape_, fv->solid())),
116 isFromDD4hep_(
true) {
132 stereo_ = (fv->
get<std::string_view>(
"TrackerStereoDetectors") == strue);
154 trans_(onePGD._x, onePGD._y, onePGD._z),
259 cont.emplace_back(
this);
299 const dd4hep::Solid& mySolid)
const {
300 std::vector<double> myOldDDShapeParameters;
304 const dd4hep::Box& myBox = dd4hep::Box(mySolid);
305 myOldDDShapeParameters = {(myBox.x()) / dd4hep::mm, (myBox.y()) / dd4hep::mm, (myBox.z()) / dd4hep::mm};
310 const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid);
311 myOldDDShapeParameters = {(myTrap->GetDZ()) / dd4hep::mm,
314 (myTrap->GetH1()) / dd4hep::mm,
315 (myTrap->GetBl1()) / dd4hep::mm,
316 (myTrap->GetTl1()) / dd4hep::mm,
318 (myTrap->GetH2()) / dd4hep::mm,
319 (myTrap->GetBl2()) / dd4hep::mm,
320 (myTrap->GetTl2()) / dd4hep::mm,
326 const dd4hep::Tube& myTube = dd4hep::Tube(mySolid);
334 myOldDDShapeParameters = {
335 (myTube->GetDz()) / dd4hep::mm,
336 (myTube->GetRmin()) / dd4hep::mm,
337 (myTube->GetRmax()) / dd4hep::mm,
342 return myOldDDShapeParameters;
346 std::ostringstream oss;
348 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