Skip to content

Commit 00bacc9

Browse files
authored
Merge pull request #47757 from fabiocos/fc-fixtopo20250402
MTD geometry: fix for geometry navigation issues in scenario D119
2 parents a7589ef + 77eeb67 commit 00bacc9

File tree

6 files changed

+42
-24
lines changed

6 files changed

+42
-24
lines changed

Geometry/MTDCommonData/data/etl/v10/etl.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@
131131

132132
<!-- Vector section -->
133133

134-
<Vector name="StartCopyNo_Front_Disc_1" type="numeric" nEntries="27">
134+
<Vector name="StartCopyNo_Front_Disc_1" type="numeric" nEntries="27">
135135
1, 7, 21, 47, 79, 115, 153, 195, 237, 275, 309, 343, 377, 409, 439,
136-
471, 505, 541, 289, 578, 617, 701, 739, 773, 803, 827, 841
136+
471, 505, 541, 577, 617, 661, 701, 739, 773, 803, 827, 841
137137
</Vector>
138138

139139
<Vector name="StartCopyNo_Back_Disc_1" type="numeric" nEntries="27">
@@ -146,9 +146,9 @@
146146
477, 511, 549, 585, 625, 669, 709, 747, 781, 811, 835, 849
147147
</Vector>
148148

149-
<Vector name="StartCopyNo_Back_Disc_2" type="numeric" nEntries="27">
149+
<Vector name="StartCopyNo_Back_Disc_2" type="numeric" nEntries="19">
150150
1, 7, 21, 41, 65, 89, 109, 129, 149, 167, 185, 205, 225, 245, 269,
151-
293, 313, 327, 333, 333, 333, 333, 333, 333, 333, 333, 333
151+
293, 313, 327, 333
152152
</Vector>
153153

154154
<Vector name="Offset_Front_Disc_1" type="numeric" nEntries="27">
@@ -163,8 +163,8 @@
163163
4, 4, 0, 0, 0, 0, 0, 0, 2, 4, 8, 12, 14, 16, 14, 12, 8, 4, 0, 0, 0, 0, 0, 0, 0, 4, 0
164164
</Vector>
165165

166-
<Vector name="Offset_Back_Disc_2" type="numeric" nEntries="27">
167-
0, 0, 0, 0, 4, 8, 12, 12, 16, 16, 12, 12, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0 ,0, 0 ,0
166+
<Vector name="Offset_Back_Disc_2" type="numeric" nEntries="19">
167+
0, 0, 0, 0, 4, 8, 12, 12, 16, 16, 12, 12, 8, 4, 0, 0, 0, 0, 0
168168
</Vector>
169169

170170

Geometry/MTDCommonData/data/etl/v9/etl.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@
131131

132132
<!-- Vector section -->
133133

134-
<Vector name="StartCopyNo_Front_Disc_1" type="numeric" nEntries="27">
134+
<Vector name="StartCopyNo_Front_Disc_1" type="numeric" nEntries="27">
135135
1, 7, 21, 47, 79, 115, 153, 195, 237, 275, 309, 343, 377, 409, 439,
136-
471, 505, 541, 289, 578, 617, 701, 739, 773, 803, 827, 841
136+
471, 505, 541, 577, 617, 661, 701, 739, 773, 803, 827, 841
137137
</Vector>
138138

139139
<Vector name="StartCopyNo_Back_Disc_1" type="numeric" nEntries="27">

Geometry/MTDGeometryBuilder/plugins/MTDTopologyEP.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,14 @@ void MTDTopologyEP::fillETLtopology(const PMTDParameters& ptp, int& mtdTopologyM
9292
// Check on the internal consistency of thr ETL layout information provided by parameters
9393

9494
for (size_t it = 3; it <= 9; it++) {
95+
bool exception = ((MTDTopologyMode::etlLayoutFromTopoMode(mtdTopologyMode) == MTDTopologyMode::EtlLayout::v10) &&
96+
(it == 5 || it == 9));
9597
if (ptp.vitems_[it].vpars_.size() != ptp.vitems_[2].vpars_.size()) {
96-
throw cms::Exception("MTDTopologyEP") << "Inconsistent size of ETL structure arrays";
98+
if (!exception) {
99+
throw cms::Exception("MTDTopologyEP") << "Inconsistent size of ETL structure arrays";
100+
} else {
101+
LogDebug("MTDTopologyEP") << "Building ETL topology for scenario 1.7";
102+
}
97103
}
98104
}
99105

RecoMTD/DetLayers/src/MTDDetSector.cc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,12 @@ vector<GeometricSearchDet::DetWithState> MTDDetSector::compatibleDets(const Traj
8787

8888
TrajectoryStateOnSurface& tsos = compat.second;
8989
GlobalPoint startPos = tsos.globalPosition();
90+
LocalTrajectoryError startLocalErr = tsos.localError();
9091

9192
LogTrace("MTDDetLayers") << "Starting position: " << startPos << " starting p/pT: " << tsos.globalMomentum().mag()
92-
<< " / " << tsos.globalMomentum().perp();
93+
<< " / " << tsos.globalMomentum().perp() << " local error x/y "
94+
<< std::sqrt(startLocalErr.positionError().xx()) << " "
95+
<< std::sqrt(startLocalErr.positionError().yy());
9396

9497
// determine distance of det center from extrapolation on the surface, sort dets accordingly
9598

@@ -116,9 +119,12 @@ vector<GeometricSearchDet::DetWithState> MTDDetSector::compatibleDets(const Traj
116119
bool isCompatible(true);
117120
size_t idetNew(idetMin);
118121
size_t closest = theDets.size();
122+
LogTrace("MTDDetLayers") << "MTDDetSector::compatibleDets, maximum size available " << closest;
119123

120124
while (isCompatible) {
121125
idetNew = vshift(theDets[idetNew]->geographicalId().rawId(), iside, closest);
126+
LogTrace("MTDDetLayers") << "MTDDetSector::compatibleDets, vshift iside " << iside << " idetNew " << idetNew
127+
<< " closest " << closest;
122128
if (idetNew >= theDets.size()) {
123129
if (closest < theDets.size()) {
124130
idetNew = closest;
@@ -131,6 +137,7 @@ vector<GeometricSearchDet::DetWithState> MTDDetSector::compatibleDets(const Traj
131137
compatibleDetsLine(idetNew, result, tsos, prop, est);
132138
}
133139
}
140+
LogTrace("MTDDetLayers") << "MTDDetSector::compatibleDets, exiting loop on vshift iside " << iside;
134141
}
135142
}
136143

@@ -171,11 +178,15 @@ bool MTDDetSector::add(size_t idet,
171178

172179
if (compat.first) {
173180
result.push_back(DetWithState(theDets[idet], compat.second));
174-
LogTrace("MTDDetLayers") << "MTDDetSector::compatibleDets found compatible det idetMin " << idet
181+
LogTrace("MTDDetLayers") << "MTDDetSector::compatibleDets found compatible det idetMin " << idet + 1
175182
<< " detId = " << theDets[idet]->geographicalId().rawId() << " at "
176183
<< theDets[idet]->position()
177184
<< " dist = " << std::sqrt((tsos.globalPosition() - theDets[idet]->position()).mag2());
178185
}
186+
if (result.size() > basicComponents().size()) {
187+
throw cms::Exception("MTDDetLayersFailure")
188+
<< "ETL compatibleDets in sector in excess of collection size: " << basicComponents().size();
189+
}
179190

180191
return compat.first;
181192
}

RecoMTD/DetLayers/src/MTDSectorForwardDoubleLayer.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ vector<DetGroup> MTDSectorForwardDoubleLayer::groupedCompatibleDets(const Trajec
140140
result.push_back(DetGroup(detWithStates1));
141141
if (!detWithStates2.empty())
142142
result.push_back(DetGroup(detWithStates2));
143-
LogTrace("MTDDetLayers") << "DoubleLayer Compatible dets: " << result.size();
143+
LogTrace("MTDDetLayers") << "DoubleLayer Compatible dets: " << result.size() << " front: " << detWithStates1.size()
144+
<< " back: " << detWithStates2.size();
144145
return result;
145146
}
146147

RecoMTD/DetLayers/test/TestETLNavigation.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,10 @@ void TestETLNavigation::analyze(edm::StreamID, edm::Event const&, edm::EventSetu
108108
} else {
109109
ETLDetId newId(isector->basicComponents()[idetNew]->geographicalId().rawId());
110110
LogVerbatim("MTDLayerDumpFull")
111-
<< std::fixed << "...............hshift= " << std::setw(2) << iside << " side = " << std::setw(4)
112-
<< newId.mtdSide() << " Disc/Side/Sector = " << std::setw(4) << newId.nDisc() << " " << std::setw(4)
113-
<< newId.discSide() << " " << std::setw(4) << newId.sector() << " mod/type = " << std::setw(4)
114-
<< newId.module() << " " << std::setw(4) << newId.modType()
111+
<< std::fixed << "...............hshift= " << std::setw(2) << iside << " ETLDetId " << newId.rawId()
112+
<< " side = " << std::setw(4) << newId.mtdSide() << " Disc/Side/Sector = " << std::setw(4)
113+
<< newId.nDisc() << " " << std::setw(4) << newId.discSide() << " " << std::setw(4) << newId.sector()
114+
<< " mod/type = " << std::setw(4) << newId.module() << " " << std::setw(4) << newId.modType()
115115
<< " pos = " << fvecround(isector->basicComponents()[idetNew]->position(), 4);
116116
LogVerbatim("MTDLayerDump") << std::fixed << "...............hshift= " << std::setw(2) << iside
117117
<< " side = " << std::setw(4) << newId.mtdSide()
@@ -133,10 +133,10 @@ void TestETLNavigation::analyze(edm::StreamID, edm::Event const&, edm::EventSetu
133133
if (closest < isector->basicComponents().size()) {
134134
ETLDetId newId(isector->basicComponents()[closest]->geographicalId().rawId());
135135
LogVerbatim("MTDLayerDumpFull")
136-
<< std::fixed << ".......closest.vshift= " << std::setw(2) << iside << " side = " << std::setw(4)
137-
<< newId.mtdSide() << " Disc/Side/Sector = " << std::setw(4) << newId.nDisc() << " " << std::setw(4)
138-
<< newId.discSide() << " " << std::setw(4) << newId.sector() << " mod/type = " << std::setw(4)
139-
<< newId.module() << " " << std::setw(4) << newId.modType()
136+
<< std::fixed << ".......closest.vshift= " << std::setw(2) << iside << " ETLDetId " << newId.rawId()
137+
<< " side = " << std::setw(4) << newId.mtdSide() << " Disc/Side/Sector = " << std::setw(4)
138+
<< newId.nDisc() << " " << std::setw(4) << newId.discSide() << " " << std::setw(4) << newId.sector()
139+
<< " mod/type = " << std::setw(4) << newId.module() << " " << std::setw(4) << newId.modType()
140140
<< " pos = " << fvecround(isector->basicComponents()[closest]->position(), 4);
141141
LogVerbatim("MTDLayerDump")
142142
<< std::fixed << ".......closest.vshift= " << std::setw(2) << iside << " side = " << std::setw(4)
@@ -148,10 +148,10 @@ void TestETLNavigation::analyze(edm::StreamID, edm::Event const&, edm::EventSetu
148148
} else {
149149
ETLDetId newId(isector->basicComponents()[idetNew]->geographicalId().rawId());
150150
LogVerbatim("MTDLayerDumpFull")
151-
<< std::fixed << "...............vshift= " << std::setw(2) << iside << " side = " << std::setw(4)
152-
<< newId.mtdSide() << " Disc/Side/Sector = " << std::setw(4) << newId.nDisc() << " " << std::setw(4)
153-
<< newId.discSide() << " " << std::setw(4) << newId.sector() << " mod/type = " << std::setw(4)
154-
<< newId.module() << " " << std::setw(4) << newId.modType()
151+
<< std::fixed << "...............vshift= " << std::setw(2) << iside << " ETLDetId " << newId.rawId()
152+
<< " side = " << std::setw(4) << newId.mtdSide() << " Disc/Side/Sector = " << std::setw(4)
153+
<< newId.nDisc() << " " << std::setw(4) << newId.discSide() << " " << std::setw(4) << newId.sector()
154+
<< " mod/type = " << std::setw(4) << newId.module() << " " << std::setw(4) << newId.modType()
155155
<< " pos = " << fvecround(isector->basicComponents()[idetNew]->position(), 4);
156156
LogVerbatim("MTDLayerDump") << std::fixed << "...............vshift= " << std::setw(2) << iside
157157
<< " side = " << std::setw(4) << newId.mtdSide()

0 commit comments

Comments
 (0)