@@ -78,20 +78,24 @@ GeometricDet::GeometricDet(DDFilteredView* fv, GeometricEnumType type)
7878 rot_(fv->rotation ()),
7979 shape_(cms::dd::name_from_value(cms::LegacySolidShapeMap, fv->shape ())),
8080 params_(fv->parameters ()),
81- radLength_(getDouble(" TrackerRadLength" , *fv)),
82- xi_(getDouble(" TrackerXi" , *fv)),
83- pixROCRows_(getDouble(" PixelROCRows" , *fv)),
84- pixROCCols_(getDouble(" PixelROCCols" , *fv)),
85- pixROCx_(getDouble(" PixelROC_X" , *fv)),
86- pixROCy_(getDouble(" PixelROC_Y" , *fv)),
87- stereo_(getString(" TrackerStereoDetectors" , *fv) == strue),
88- isLowerSensor_(getString(" TrackerLowerDetectors" , *fv) == strue),
89- isUpperSensor_(getString(" TrackerUpperDetectors" , *fv) == strue),
90- siliconAPVNum_(getDouble(" SiliconAPVNumber" , *fv)),
9181 isFromDD4hep_(false ) {
9282 // workaround instead of this at initialization
9383 const DDFilteredView::nav_type& nt = fv->navPos ();
9484 ddd_ = nav_type (nt.begin (), nt.end ());
85+
86+ // Only look for sensor-related info on sensor volumes!
87+ if (type_ == DetUnit) {
88+ radLength_ = getDouble (" TrackerRadLength" , *fv);
89+ xi_ = getDouble (" TrackerXi" , *fv);
90+ pixROCRows_ = getDouble (" PixelROCRows" , *fv);
91+ pixROCCols_ = getDouble (" PixelROCCols" , *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);
97+ siliconAPVNum_ = getDouble (" SiliconAPVNumber" , *fv);
98+ }
9599}
96100
97101/*
@@ -107,18 +111,28 @@ GeometricDet::GeometricDet(cms::DDFilteredView* fv, GeometricEnumType type)
107111 rot_(fv->rotation ()),
108112 shape_(fv->shape ()),
109113 params_(computeLegacyShapeParameters(shape_, fv->solid ())),
110- pixROCRows_(fv->get<double >(" PixelROCRows" )),
111- pixROCCols_(fv->get<double >(" PixelROCCols" )),
112- pixROCx_(fv->get<double >(" PixelROC_X" )),
113- pixROCy_(fv->get<double >(" PixelROC_Y" )),
114- stereo_(fv->get<std::string_view>(" TrackerStereoDetectors" ) == strue),
115- isLowerSensor_(fv->get<std::string_view>(" TrackerLowerDetectors" ) == strue),
116- isUpperSensor_(fv->get<std::string_view>(" TrackerUpperDetectors" ) == strue),
117- siliconAPVNum_(fv->get<double >(" SiliconAPVNumber" )),
118114 isFromDD4hep_(true ) {
119- fv->findSpecPar (" TrackerRadLength" , " TrackerXi" );
120- radLength_ = fv->getNextValue (" TrackerRadLength" );
121- xi_ = fv->getNextValue (" TrackerXi" );
115+ // Only look for sensor-related info on sensor volumes!
116+ if (type_ == DetUnit) {
117+ // IT sensors only (NB: hence could add a branch here, but not a critical part on perf)
118+ pixROCRows_ = fv->get <double >(" PixelROCRows" );
119+ pixROCCols_ = fv->get <double >(" PixelROCCols" );
120+ pixROCx_ = fv->get <double >(" PixelROC_X" );
121+ pixROCy_ = fv->get <double >(" PixelROC_Y" );
122+
123+ // Phase 1 OT sensors only (NB: hence could add a branch here, but not a critical part on perf)
124+ stereo_ = (fv->get <std::string_view>(" TrackerStereoDetectors" ) == strue);
125+ siliconAPVNum_ = fv->get <double >(" SiliconAPVNumber" );
126+
127+ // Phase 2 OT sensors only (NB: hence could add a branch here, but not a critical part on perf)
128+ isLowerSensor_ = (fv->get <std::string_view>(" TrackerLowerDetectors" ) == strue);
129+ isUpperSensor_ = (fv->get <std::string_view>(" TrackerUpperDetectors" ) == strue);
130+
131+ // All sensors: IT or OT, Phase 1 or Phase 2 (NB: critical part on perf)
132+ fv->findSpecPar (" TrackerRadLength" , " TrackerXi" );
133+ radLength_ = fv->getNextValue (" TrackerRadLength" );
134+ xi_ = fv->getNextValue (" TrackerXi" );
135+ }
122136}
123137
124138/*
0 commit comments