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>();
TkRotation< Scalar > RotationType
const std::vector< const GeometricSearchDet * > & components() const override
const std::vector< const GeomDet * > & basicComponents() const override
~MTDRingForwardLayer() override
std::vector< const ForwardDetRing * > theRings
virtual int binIndex(T pos) const =0
Return the index of bin at given position.
GlobalPoint globalPosition() const
Log< level::Error, false > LogError
std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
LocalError positionError() const
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Point3DBase< Scalar, GlobalTag > PositionType
BaseBinFinder< double > * theBinFinder
const LocalTrajectoryError & localError() const
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
MTDRingForwardLayer(const std::vector< const ForwardDetRing * > &rings)
Constructor, takes ownership of pointers.
std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
std::vector< const GeometricSearchDet * > theComponents
bool isRPeriodic() const
Returns true if the Dets are periodic in R.
SubDetector subDetector() 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