27 theComponents(theRings.
begin(), theRings.
end()),
28 theBinFinder(nullptr),
29 isOverlapping(
false) {
33 float theRmin =
rings.front()->basicComponents().front()->position().perp();
34 float theRmax = theRmin;
35 float theZmin =
rings.front()->position().z();
36 float theZmax = theZmin;
40 for (vector<const ForwardDetRing*>::const_iterator it =
rings.begin(); it !=
rings.end(); it++) {
41 vector<const GeomDet*> tmp2 = (*it)->basicComponents();
44 theRmin =
min(theRmin, (*it)->specificSurface().innerRadius());
45 theRmax =
max(theRmax, (*it)->specificSurface().outerRadius());
46 float halfThick = (*it)->surface().bounds().thickness() / 2.;
47 float zCenter = (*it)->surface().position().z();
48 theZmin =
min(theZmin, zCenter - halfThick);
49 theZmax =
max(theZmax, zCenter + halfThick);
58 float zPos = (theZmax + theZmin) / 2.;
66 <<
" Z: " << specificSurface().position().z() <<
" R1: " << specificSurface().innerRadius()
67 <<
" R2: " << specificSurface().outerRadius() <<
" Per.: " << bf.
isRPeriodic()
73 for (vector<const ForwardDetRing*>::iterator
i =
theRings.begin();
i <
theRings.end();
i++) {
81 vector<DetWithState>
result;
84 <<
" R1 " << specificSurface().innerRadius() <<
" R2: " << specificSurface().outerRadius()
87 pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
90 LogTrace(
metname) <<
" MuRingForwardLayer::compatibleDets: not compatible"
91 <<
" (should not have been selected!)";
102 LogTrace(
metname) <<
" MuRingForwardLayer::fastCompatibleDets, closestRing: " << closest <<
" R1 "
114 int nclosest =
result.size();
129 for (
unsigned int idet = closest + 1; idet <
theRings.size(); idet++) {
134 inside =
theRings[idet]->specificSurface().bounds().inside(nextPos);
137 LogTrace(
metname) <<
" MuRingForwardLayer::fastCompatibleDets:NextRing" << idet <<
" R1 "
138 <<
theRings[idet]->specificSurface().innerRadius()
139 <<
" R2: " <<
theRings[idet]->specificSurface().outerRadius() <<
" FTS R " << nextPos.
perp();
141 vector<DetWithState> nextRodDets =
theRings[idet]->compatibleDets(tsos, prop, est);
142 if (!nextRodDets.empty()) {
143 result.insert(
result.end(), nextRodDets.begin(), nextRodDets.end());
150 for (
int idet = closest - 1; idet >= 0; idet--) {
155 inside =
theRings[idet]->specificSurface().bounds().inside(nextPos);
158 LogTrace(
metname) <<
" MuRingForwardLayer::fastCompatibleDets:PreviousRing:" << idet <<
" R1 "
159 <<
theRings[idet]->specificSurface().innerRadius()
160 <<
" R2: " <<
theRings[idet]->specificSurface().outerRadius() <<
" FTS R " << nextPos.
perp();
162 vector<DetWithState> nextRodDets =
theRings[idet]->compatibleDets(tsos, prop, est);
163 if (!nextRodDets.empty()) {
164 result.insert(
result.end(), nextRodDets.begin(), nextRodDets.end());
172 <<
" on closest: " << nclosest <<
" # checked rings: " << 1 + nnextdet;
181 cout <<
"dummy implementation of MuRingForwardLayer::groupedCompatibleDets()" << endl;
182 return vector<DetGroup>();