26 const float toCloseToEachOther2 = 1
e-4 * 1
e-4;
28 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());
58 LogDebug(
"SimpleNavigableLayer") <<
"switch side back: ABORT.";
74 if (theCheckCrossingSide) {
75 bool backTobackTransverse =
79 if (backTobackTransverse || backToback) {
80 LogTrace(
"TkNavigation") <<
"Crossing over prevented!\nStaring from (x,y,z,r) (" << fts.
position().
x() <<
"," 104 float length = bounds.
length() * 0.5f;
111 const float nSigma = theEpsilon;
119 if (
std::abs(zpos) < length + deltaZ)
120 result.push_back(bl);
122 return std::abs(zpos) < length - deltaZ;
133 if (fl == detLayer()) {
134 LogDebug(
"SimpleNavigableLayer") <<
"self propagating from:\n" << fts <<
"\n to \n" << *propState.
freeState();
138 if (theCheckCrossingSide) {
139 bool backTobackTransverse =
143 if (backTobackTransverse || backToback) {
144 LogTrace(
"TkNavigation") <<
"Crossing over prevented!\nStaring from (x,y,z,r) (" << fts.
position().
x() <<
"," 146 <<
") going to TSOS (x,y,z,r)" << propState.
globalPosition().
x() <<
"," 165 const float nSigma = theEpsilon;
169 deltaR += nSigma *
sqrt(err.
xx() + err.
yy());
174 if (innerR - deltaR < rpos && rpos < outerR + deltaR)
175 result.push_back(fl);
176 return (innerR + deltaR < rpos && rpos < outerR - deltaR);
183 for (
auto l : layers) {
186 if (wellInside(fts, dir, bl, result))
190 if (wellInside(fts, dir, fl, result))
200 if (wellInside(fts, dir, *
i, result))
209 if (wellInside(fts, dir, *
i, result))
218 typedef std::vector<const DetLayer*> Lvect;
219 typedef std::set<const DetLayer*> Lset;
222 const Lvect& someLayers = nextLayers(fts, timeDirection);
223 if (someLayers.empty()) {
224 LogDebug(
"SimpleNavigableLayer") <<
"Number of compatible layers: " << 0;
229 Lset layerToTry, nextLayerToTry;
230 layerToTry.insert(someLayers.begin(), someLayers.end());
232 while (!layerToTry.empty() && (counter++) <= 150) {
233 LogDebug(
"SimpleNavigableLayer") << counter <<
"] going to check on : " << layerToTry.size() <<
" next layers.";
235 nextLayerToTry.clear();
236 for (
auto toTry : layerToTry) {
238 LogDebug(
"SimpleNavigableLayer") << counter <<
"] adding layer with pointer: " << (toTry)
239 <<
" first detid: " << (toTry)->basicComponents().front()->geographicalId();
240 if (!collect.insert(toTry).second)
244 Lvect&& nextLayers = school->nextLayers(*toTry, fts, timeDirection);
245 LogDebug(
"SimpleNavigableLayer") << counter <<
"] this layer has : " << nextLayers.size() <<
" next layers.";
246 nextLayerToTry.insert(nextLayers.begin(), nextLayers.end());
249 layerToTry.swap(nextLayerToTry);
251 if (counter >= 150) {
252 edm::LogWarning(
"SimpleNavigableLayer") <<
"WARNING: compatibleLayers() more than 150 iterations!!! Bailing out..";
257 LogDebug(
"SimpleNavigableLayer") <<
"Number of compatible layers: " << collect.size();
259 return Lvect(collect.begin(), collect.end());
virtual float length() const =0
CartesianTrajectoryError cartesianError() const
LocalVector localDirection() const
GlobalPoint globalPosition() const
const Bounds & bounds() const
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
LocalError positionError() const
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
virtual const BoundDisk & specificSurface() const final
virtual float thickness() const =0
const GlobalError position() const
Position error submatrix.
bool wellInside(const FreeTrajectoryState &fts, PropagationDirection dir, const BarrelDetLayer *bl, DLC &result) const
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
const BasicVectorType & basicVector() const
TSOS crossingState(const FreeTrajectoryState &fts, PropagationDirection dir) const
BDLC::const_iterator ConstBDLI
GlobalVector globalDirection() const
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const final
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.