28 theComponents(theRings.begin(), theRings.
end()),
29 theBinFinder(nullptr),
30 isOverlapping(
false) {
32 float theRmin =
rings.front()->basicComponents().front()->position().perp();
33 float theRmax = theRmin;
34 float theZmin =
rings.front()->position().z();
35 float theZmax = theZmin;
39 for (
const auto& it :
rings) {
40 vector<const GeomDet*> tmp2 = it->basicComponents();
43 theRmin =
min(theRmin, it->specificSurface().innerRadius());
44 theRmax =
max(theRmax, it->specificSurface().outerRadius());
45 float halfThick = it->surface().bounds().thickness() / 2.;
46 float zCenter = it->surface().position().z();
47 theZmin =
min(theZmin, zCenter - halfThick);
48 theZmax =
max(theZmax, zCenter + halfThick);
57 float zPos = (theZmax + theZmin) / 2.;
65 <<
" Z: " << specificSurface().position().z() <<
" R1: " << specificSurface().innerRadius()
66 <<
" R2: " << specificSurface().outerRadius() <<
" Per.: " << bf.
isRPeriodic()
79 vector<DetWithState>
result;
81 LogTrace(
"MTDDetLayers") <<
"MTDRingForwardLayer::compatibleDets,"
82 <<
" R1 " << specificSurface().innerRadius() <<
" R2: " << specificSurface().outerRadius()
85 pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
88 LogTrace(
"MTDDetLayers") <<
" MTDRingForwardLayer::compatibleDets: not compatible"
89 <<
" (should not have been selected!)";
100 LogTrace(
"MTDDetLayers") <<
" MTDRingForwardLayer::fastCompatibleDets, closestRing: " << closest <<
" R1 "
112 int nclosest =
result.size();
128 for (
unsigned int idet = closest + 1; idet <
theRings.size(); idet++) {
133 inside =
theRings[idet]->specificSurface().bounds().inside(nextPos);
137 LogTrace(
"MTDDetLayers") <<
" MTDRingForwardLayer::fastCompatibleDets:NextRing" << idet <<
" R1 "
138 <<
theRings[idet]->specificSurface().innerRadius()
139 <<
" R2: " <<
theRings[idet]->specificSurface().outerRadius() <<
" FTS R "
143 vector<DetWithState> nextRodDets =
theRings[idet]->compatibleDets(tsos, prop, est);
144 if (!nextRodDets.empty()) {
145 result.insert(
result.end(), nextRodDets.begin(), nextRodDets.end());
152 for (
int idet = closest - 1; idet >= 0; idet--) {
157 inside =
theRings[idet]->specificSurface().bounds().inside(nextPos);
161 LogTrace(
"MTDDetLayers") <<
" MTDRingForwardLayer::fastCompatibleDets:PreviousRing:" << idet <<
" R1 "
162 <<
theRings[idet]->specificSurface().innerRadius()
163 <<
" R2: " <<
theRings[idet]->specificSurface().outerRadius() <<
" FTS R "
167 vector<DetWithState> nextRodDets =
theRings[idet]->compatibleDets(tsos, prop, est);
168 if (!nextRodDets.empty()) {
169 result.insert(
result.end(), nextRodDets.begin(), nextRodDets.end());
177 LogTrace(
"MTDDetLayers") <<
" MTDRingForwardLayer::fastCompatibleDets: found: " <<
result.size()
178 <<
" on closest: " << nclosest <<
" # checked rings: " << 1 + nnextdet;
188 edm::LogError(
"MTDDetLayers") <<
"dummy implementation of MTDRingForwardLayer::groupedCompatibleDets()";
189 return vector<DetGroup>();