1 #include <DD4hep/DD4hepUnits.h>
17 template <
typename DDView>
18 double getDouble(
const char*
s, DDView
const&
ev) {
20 std::vector<const DDsvalues_type*>
result;
22 std::vector<const DDsvalues_type*>::iterator it =
result.begin();
24 for (; it !=
result.end(); ++it) {
30 const std::vector<std::string>&
temp =
val.strings();
31 if (
temp.size() != 1) {
34 return double(::atof(
temp[0].c_str()));
39 template <
typename DDView>
42 std::vector<const DDsvalues_type*>
result;
44 std::vector<const DDsvalues_type*>::iterator it =
result.begin();
46 for (; it !=
result.end(); ++it) {
52 const std::vector<std::string>&
temp =
val.strings();
53 if (
temp.size() != 1) {
72 : ddname_(fv->
name()),
75 trans_(fv->translation()),
81 isFromDD4hep_(
false) {
88 radLength_ = getDouble(
"TrackerRadLength", *fv);
89 xi_ = getDouble(
"TrackerXi", *fv);
92 pixROCx_ = getDouble(
"PixelROC_X", *fv);
93 pixROCy_ = getDouble(
"PixelROC_Y", *fv);
94 stereo_ = (getString(
"TrackerStereoDetectors", *fv) == strue);
95 isLowerSensor_ = (getString(
"TrackerLowerDetectors", *fv) == strue);
96 isUpperSensor_ = (getString(
"TrackerUpperDetectors", *fv) == strue);
108 trans_((fv->translation()) /
dd4hep::mm),
113 params_(computeLegacyShapeParameters(shape_, fv->solid())),
114 isFromDD4hep_(
true) {
124 stereo_ = (fv->
get<std::string_view>(
"TrackerStereoDetectors") == strue);
142 : ddname_(onePGD._name),
145 geographicalID_(onePGD._geographicalID),
146 trans_(onePGD._x, onePGD._y, onePGD._z),
160 radLength_(onePGD._radLength),
162 pixROCRows_(onePGD._pixROCRows),
163 pixROCCols_(onePGD._pixROCCols),
164 pixROCx_(onePGD._pixROCx),
165 pixROCy_(onePGD._pixROCy),
166 stereo_(onePGD._stereo),
167 siliconAPVNum_(onePGD._siliconAPVNum)
251 cont.emplace_back(
this);
270 void operator()(
GeometricDet const* det)
const {
delete const_cast<GeometricDet*>(det); }
291 const dd4hep::Solid& mySolid)
const {
292 std::vector<double> myOldDDShapeParameters;
296 const dd4hep::Box& myBox = dd4hep::Box(mySolid);
297 myOldDDShapeParameters = {(myBox.x()) / dd4hep::mm, (myBox.y()) / dd4hep::mm, (myBox.z()) / dd4hep::mm};
302 const dd4hep::Trap& myTrap = dd4hep::Trap(mySolid);
303 myOldDDShapeParameters = {(myTrap->GetDZ()) / dd4hep::mm,
306 (myTrap->GetH1()) / dd4hep::mm,
307 (myTrap->GetBl1()) / dd4hep::mm,
308 (myTrap->GetTl1()) / dd4hep::mm,
310 (myTrap->GetH2()) / dd4hep::mm,
311 (myTrap->GetBl2()) / dd4hep::mm,
312 (myTrap->GetTl2()) / dd4hep::mm,
318 const dd4hep::Tube& myTube = dd4hep::Tube(mySolid);
319 myOldDDShapeParameters = {
320 (myTube->GetDz()) / dd4hep::mm,
321 (myTube->GetRmin()) / dd4hep::mm,
322 (myTube->GetRmax()) / dd4hep::mm,
327 return myOldDDShapeParameters;