27 const float toCloseToEachOther2 = 1
e-4 * 1
e-4;
28 if UNLIKELY ((middlePoint - initialPoint).
mag2() < toCloseToEachOther2) {
30 <<
"initial state and PCA are identical. Things are bound to fail. Do not add the link.";
41 LogDebug(
"SimpleNavigableLayer") <<
"self propagating(" << dir <<
") from:\n"
44 <<
" and the direction is: " <<
dir;
48 propState =
propagator(dir).propagate(dest, detLayer()->surface());
54 LogDebug(
"SimpleNavigableLayer") <<
"second propagation(" << dir <<
") to: \n" << dest2;
55 double finalDot = (middlePoint - initialPoint).basicVector().dot((finalPoint - middlePoint).basicVector());
57 LogDebug(
"SimpleNavigableLayer") <<
"switch side back: ABORT.";
73 if (theCheckCrossingSide) {
74 bool backTobackTransverse =
78 if (backTobackTransverse || backToback) {
79 LogTrace(
"TkNavigation") <<
"Crossing over prevented!\nStaring from (x,y,z,r) (" << fts.
position().
x() <<
","
103 float length = bounds.
length() * 0.5f;
110 const float nSigma = theEpsilon;
118 if (
std::abs(zpos) < length + deltaZ)
119 result.push_back(bl);
121 return std::abs(zpos) < length - deltaZ;
132 if (fl == detLayer()) {
133 LogDebug(
"SimpleNavigableLayer") <<
"self propagating from:\n" << fts <<
"\n to \n" << *propState.
freeState();
137 if (theCheckCrossingSide) {
138 bool backTobackTransverse =
142 if (backTobackTransverse || backToback) {
143 LogTrace(
"TkNavigation") <<
"Crossing over prevented!\nStaring from (x,y,z,r) (" << fts.
position().
x() <<
","
145 <<
") going to TSOS (x,y,z,r)" << propState.
globalPosition().
x() <<
","
164 const float nSigma = theEpsilon;
168 deltaR += nSigma *
sqrt(err.
xx() + err.
yy());
173 if (innerR - deltaR < rpos && rpos < outerR + deltaR)
174 result.push_back(fl);
175 return (innerR + deltaR < rpos && rpos < outerR - deltaR);
182 for (
auto l : layers) {
185 if (wellInside(fts, dir, bl, result))
189 if (wellInside(fts, dir, fl, result))
199 if (wellInside(fts, dir, *
i, result))
208 if (wellInside(fts, dir, *
i, result))
217 typedef std::vector<const DetLayer*> Lvect;
218 typedef std::set<const DetLayer*> Lset;
221 const Lvect& someLayers = nextLayers(fts, timeDirection);
222 if (someLayers.empty()) {
223 LogDebug(
"SimpleNavigableLayer") <<
"Number of compatible layers: " << 0;
228 Lset layerToTry, nextLayerToTry;
229 layerToTry.insert(someLayers.begin(), someLayers.end());
231 while (!layerToTry.empty() && (counter++) <= 150) {
232 LogDebug(
"SimpleNavigableLayer") << counter <<
"] going to check on : " << layerToTry.size() <<
" next layers.";
234 nextLayerToTry.clear();
235 for (
auto toTry : layerToTry) {
237 LogDebug(
"SimpleNavigableLayer") << counter <<
"] adding layer with pointer: " << (toTry)
238 <<
" first detid: " << (toTry)->basicComponents().front()->geographicalId();
239 if (!collect.insert(toTry).second)
243 Lvect&& nextLayers = school->nextLayers(*toTry, fts, timeDirection);
244 LogDebug(
"SimpleNavigableLayer") << counter <<
"] this layer has : " << nextLayers.size() <<
" next layers.";
245 nextLayerToTry.insert(nextLayers.begin(), nextLayers.end());
248 layerToTry.swap(nextLayerToTry);
250 if (counter >= 150) {
251 edm::LogWarning(
"SimpleNavigableLayer") <<
"WARNING: compatibleLayers() more than 150 iterations!!! Bailing out..";
256 LogDebug(
"SimpleNavigableLayer") <<
"Number of compatible layers: " << collect.size();
258 return Lvect(collect.begin(), collect.end());
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
CartesianTrajectoryError cartesianError() const
virtual float length() const =0
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
LocalVector localDirection() const
GlobalPoint globalPosition() const
const Bounds & bounds() const
LocalError positionError() const
virtual float thickness() const =0
FreeTrajectoryState const * freeState(bool withErrors=true) const
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
FDLC::const_iterator ConstFDLI
std::vector< const DetLayer * > DLC
Abs< T >::type abs(const T &t)
const LocalTrajectoryError & localError() const
GlobalPoint position() const
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const final
const GlobalError position() const
Position error submatrix.
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
bool wellInside(const FreeTrajectoryState &fts, PropagationDirection dir, const BarrelDetLayer *bl, DLC &result) const
static std::atomic< unsigned int > counter
virtual const BoundDisk & specificSurface() const final
Log< level::Warning, false > LogWarning
const BasicVectorType & basicVector() const
TSOS crossingState(const FreeTrajectoryState &fts, PropagationDirection dir) const
BDLC::const_iterator ConstBDLI
GlobalVector globalDirection() const
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.