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);
92 isBricked_ = (getString(
"isBricked", *fv) == strue);
95 pixROCx_ = getDouble(
"PixelROC_X", *fv);
96 pixROCy_ = getDouble(
"PixelROC_Y", *fv);
97 stereo_ = (getString(
"TrackerStereoDetectors", *fv) == strue);
98 isLowerSensor_ = (getString(
"TrackerLowerDetectors", *fv) == strue);
99 isUpperSensor_ = (getString(
"TrackerUpperDetectors", *fv) == strue);
111 trans_((fv->translation()) /
dd4hep::mm),
116 params_(computeLegacyShapeParameters(shape_, fv->solid())),
117 isFromDD4hep_(
true) {
127 isBricked_ = (fv->
get<std::string_view>(
"isBricked") == strue);
134 stereo_ = (fv->
get<std::string_view>(
"TrackerStereoDetectors") == strue);
156 trans_(onePGD._x, onePGD._y, onePGD._z),
261 cont.emplace_back(
this);
301 const dd4hep::Solid& mySolid)
const {
302 std::vector<double> myOldDDShapeParameters;
306 const dd4hep::Box& myBox = dd4hep::Box(mySolid);
307 myOldDDShapeParameters = {(myBox.x()) / dd4hep::mm, (myBox.y()) / dd4hep::mm, (myBox.z()) / dd4hep::mm};
312 const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid);
313 myOldDDShapeParameters = {(myTrap->GetDZ()) / dd4hep::mm,
316 (myTrap->GetH1()) / dd4hep::mm,
317 (myTrap->GetBl1()) / dd4hep::mm,
318 (myTrap->GetTl1()) / dd4hep::mm,
320 (myTrap->GetH2()) / dd4hep::mm,
321 (myTrap->GetBl2()) / dd4hep::mm,
322 (myTrap->GetTl2()) / dd4hep::mm,
328 const dd4hep::Tube& myTube = dd4hep::Tube(mySolid);
336 myOldDDShapeParameters = {
337 (myTube->GetDz()) / dd4hep::mm,
338 (myTube->GetRmin()) / dd4hep::mm,
339 (myTube->GetRmax()) / dd4hep::mm,
344 return myOldDDShapeParameters;
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_
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