26 theComponents(theRings.
begin(), theRings.
end()),
27 theBinFinder(nullptr),
28 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 (vector<const ForwardDetRing*>::const_iterator it = rings.begin(); it != rings.end(); it++) {
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()
72 for (vector<const ForwardDetRing*>::iterator
i =
theRings.begin();
i <
theRings.end();
i++) {
80 vector<DetWithState>
result;
82 LogTrace(metname) <<
"MuRingForwardLayer::compatibleDets,"
83 <<
" R1 " << specificSurface().innerRadius() <<
" R2: " << specificSurface().outerRadius()
86 pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
89 LogTrace(metname) <<
" MuRingForwardLayer::compatibleDets: not compatible"
90 <<
" (should not have been selected!)";
101 LogTrace(metname) <<
" MuRingForwardLayer::fastCompatibleDets, closestRing: " << closest <<
" R1 "
113 int nclosest = result.size();
128 for (
unsigned int idet = closest + 1; idet <
theRings.size(); idet++) {
133 inside =
theRings[idet]->specificSurface().bounds().inside(nextPos);
136 LogTrace(metname) <<
" MuRingForwardLayer::fastCompatibleDets:NextRing" << idet <<
" R1 "
137 <<
theRings[idet]->specificSurface().innerRadius()
138 <<
" R2: " <<
theRings[idet]->specificSurface().outerRadius() <<
" FTS R " << nextPos.
perp();
140 vector<DetWithState> nextRodDets =
theRings[idet]->compatibleDets(tsos, prop, est);
141 if (!nextRodDets.empty()) {
142 result.insert(result.end(), nextRodDets.begin(), nextRodDets.end());
149 for (
int idet = closest - 1; idet >= 0; idet--) {
154 inside =
theRings[idet]->specificSurface().bounds().inside(nextPos);
157 LogTrace(metname) <<
" MuRingForwardLayer::fastCompatibleDets:PreviousRing:" << idet <<
" R1 "
158 <<
theRings[idet]->specificSurface().innerRadius()
159 <<
" R2: " <<
theRings[idet]->specificSurface().outerRadius() <<
" FTS R " << nextPos.
perp();
161 vector<DetWithState> nextRodDets =
theRings[idet]->compatibleDets(tsos, prop, est);
162 if (!nextRodDets.empty()) {
163 result.insert(result.end(), nextRodDets.begin(), nextRodDets.end());
170 LogTrace(metname) <<
" MuRingForwardLayer::fastCompatibleDets: found: " << result.size()
171 <<
" on closest: " << nclosest <<
" # checked rings: " << 1 + nnextdet;
180 cout <<
"dummy implementation of MuRingForwardLayer::groupedCompatibleDets()" << endl;
181 return vector<DetGroup>();
TkRotation< Scalar > RotationType
std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
const std::string metname
MuRingForwardLayer(const std::vector< const ForwardDetRing * > &rings)
Constructor, takes ownership of pointers.
virtual int binIndex(T pos) const =0
Return the index of bin at given position.
GlobalPoint globalPosition() const
std::vector< const ForwardDetRing * > theRings
LocalError positionError() const
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Point3DBase< Scalar, GlobalTag > PositionType
const std::vector< const GeometricSearchDet * > & components() const override
const LocalTrajectoryError & localError() const
~MuRingForwardLayer() override
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
std::vector< const GeometricSearchDet * > theComponents
const std::vector< const GeomDet * > & basicComponents() const override
BaseBinFinder< double > * theBinFinder
SubDetector subDetector() const override
bool isRPeriodic() const
Returns true if the Dets are periodic in R.
std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
bool isROverlapping() const
Returns true if any 2 of the Det overlap in R.
std::vector< const GeomDet * > theBasicComps