@@ -72,8 +72,6 @@ std::unique_ptr<GeometricTimingDet> DDCmsMTDConstruction::construct(const DDComp
7272 DDFilteredView fv (cpv, filter);
7373
7474 CmsMTDStringToEnum theCmsMTDStringToEnum;
75- // temporary workaround to distinguish BTL scenarios ordering without introducing a dependency on MTDTopologyMode
76- auto isBTLV2 = false ;
7775 // temporary workaround to distinguish ETL scenarios ordering without introducing a dependency on MTDTopologyMode
7876 const bool prev8 (fv.name ().find (" EModule" ) != std::string::npos);
7977
@@ -136,12 +134,7 @@ std::unique_ptr<GeometricTimingDet> DDCmsMTDConstruction::construct(const DDComp
136134 // the level chosen for old corresponds to wafers for D50 and previous scenarios
137135 //
138136 if ((thisNode == GeometricTimingDet::BTLModule) && limit == 0 ) {
139- if (theCmsMTDConstruction.isBTLV2 (fv)) {
140- limit = num;
141- isBTLV2 = true ;
142- } else {
143- limit = num + 1 ;
144- }
137+ limit = num;
145138 } else if ((thisNode == ETLEndComponent) && limit == 0 ) {
146139 limit = num;
147140 }
@@ -174,26 +167,15 @@ std::unique_ptr<GeometricTimingDet> DDCmsMTDConstruction::construct(const DDComp
174167 edm::LogVerbatim (" MTDNumbering" ) << " GeometricTimingDet order before sorting \n " << before.str ();
175168#endif
176169
177- if (!isBTLV2 ) {
178- for ( size_t index = 0 ; index < layer. size (); index++) {
179- GeometricTimingDet::ConstGeometricTimingDetContainer& icomp = layer[ index]-> components ();
170+ for ( size_t index = 0 ; index < layer. size (); index++ ) {
171+ GeometricTimingDet::ConstGeometricTimingDetContainer& icomp = layer[index]-> components ();
172+ if ( index > 0 ) {
180173 std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderZ);
181174 std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderRR);
182- if (index > 0 ) {
183- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderPhi);
184- }
185- }
186- } else {
187- for (size_t index = 0 ; index < layer.size (); index++) {
188- GeometricTimingDet::ConstGeometricTimingDetContainer& icomp = layer[index]->components ();
189- if (index > 0 ) {
190- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderZ);
191- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderRR);
192- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderPhi);
193- } else {
194- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::btlOrderPhi);
195- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::btlOrderZ);
196- }
175+ std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderPhi);
176+ } else {
177+ std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::btlOrderPhi);
178+ std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::btlOrderZ);
197179 }
198180 }
199181
@@ -276,8 +258,6 @@ std::unique_ptr<GeometricTimingDet> DDCmsMTDConstruction::construct(const cms::D
276258 CmsMTDStringToEnum theCmsMTDStringToEnum;
277259
278260 CmsMTDConstruction<cms::DDFilteredView> theCmsMTDConstruction;
279- // temporary workaround to distinguish BTL scenarios ordering without introducing a dependency on MTDTopologyMode
280- auto isBTLV2 = false ;
281261 // temporary workaround to distinguish ETL scenarios ordering without introducing a dependency on MTDTopologyMode
282262 const bool prev8 (fv.name ().find (" EModule" ) != std::string::npos);
283263
@@ -319,11 +299,6 @@ std::unique_ptr<GeometricTimingDet> DDCmsMTDConstruction::construct(const cms::D
319299#ifdef EDM_ML_DEBUG
320300 edm::LogVerbatim (" DD4hep_MTDNumbering" ) << " Registered in GeometricTimingDet as type " << thisNode;
321301#endif
322- if (isBTLV2 == false ) {
323- if (theCmsMTDConstruction.isBTLV2 (fv)) {
324- isBTLV2 = true ;
325- }
326- }
327302 theCmsMTDConstruction.buildBTLModule (fv, layer.back ());
328303 } else if (thisNode == ETLEndComponent) {
329304#ifdef EDM_ML_DEBUG
@@ -346,26 +321,15 @@ std::unique_ptr<GeometricTimingDet> DDCmsMTDConstruction::construct(const cms::D
346321 edm::LogVerbatim (" DD4hep_MTDNumbering" ) << " GeometricTimingDet order before sorting \n " << before.str ();
347322#endif
348323
349- if (!isBTLV2 ) {
350- for ( size_t index = 0 ; index < layer. size (); index++) {
351- GeometricTimingDet::ConstGeometricTimingDetContainer& icomp = layer[ index]-> components ();
324+ for ( size_t index = 0 ; index < layer. size (); index++ ) {
325+ GeometricTimingDet::ConstGeometricTimingDetContainer& icomp = layer[index]-> components ();
326+ if ( index > 0 ) {
352327 std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderZ);
353328 std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderRR);
354- if (index > 0 ) {
355- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderPhi);
356- }
357- }
358- } else {
359- for (size_t index = 0 ; index < layer.size (); index++) {
360- GeometricTimingDet::ConstGeometricTimingDetContainer& icomp = layer[index]->components ();
361- if (index > 0 ) {
362- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderZ);
363- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderRR);
364- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderPhi);
365- } else {
366- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::btlOrderPhi);
367- std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::btlOrderZ);
368- }
329+ std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::mtdOrderPhi);
330+ } else {
331+ std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::btlOrderPhi);
332+ std::stable_sort (icomp.begin (), icomp.end (), CmsMTDConstruction<DDFilteredView>::btlOrderZ);
369333 }
370334 }
371335
0 commit comments