23 const float toCloseToEachOther2 = 1
e-4*1
e-4;
24 if unlikely( (middlePoint-initialPoint).
mag2() < toCloseToEachOther2){
25 LogDebug(
"SimpleNavigableLayer")<<
"initial state and PCA are identical. Things are bound to fail. Do not add the link.";
37 LogDebug(
"SimpleNavigableLayer")<<
"self propagating("<< dir <<
") from:\n"
40 <<
" and the direction is: "<<
dir;
44 propState =
propagator(dir).propagate( dest, detLayer()->surface());
49 LogDebug(
"SimpleNavigableLayer")<<
"second propagation("<< dir <<
") to: \n"
51 double finalDot = (middlePoint - initialPoint).basicVector().dot((finalPoint-middlePoint).basicVector());
53 LogDebug(
"SimpleNavigableLayer")<<
"switch side back: ABORT.";
65 TSOS propState = (bl==detLayer()) ?
66 crossingState(fts,dir)
70 if ( !propState.
isValid())
return false;
73 if (theCheckCrossingSide){
77 if (backTobackTransverse || backToback ){
78 LogTrace(
"TkNavigation") <<
"Crossing over prevented!\nStaring from (x,y,z,r) ("
80 <<
") going to TSOS (x,y,z,r)"
101 float length = bounds.
length()*0.5f;
104 float deltaZ = 0.5f*bounds.thickness() *
109 const float nSigma = theEpsilon;
117 if (
std::abs( zpos) < length + deltaZ) result.push_back( bl);
119 return std::abs( zpos) < length - deltaZ;
128 if ( !propState.
isValid())
return false;
131 LogDebug(
"SimpleNavigableLayer")<<
"self propagating from:\n"
137 if (theCheckCrossingSide){
141 if (backTobackTransverse || backToback ){
142 LogTrace(
"TkNavigation") <<
"Crossing over prevented!\nStaring from (x,y,z,r) ("
144 <<
") going to TSOS (x,y,z,r)"
162 const float nSigma = theEpsilon;
166 deltaR += nSigma *
sqrt(err.
xx() + err.
yy());
171 if ( innerR-deltaR < rpos && rpos < outerR+deltaR) result.push_back( fl);
172 return ( innerR+deltaR < rpos && rpos < outerR-deltaR);
180 for (
auto l : layers) {
183 if (wellInside( fts, dir, bl, result))
return true;
187 if (wellInside( fts, dir, fl, result))
return true;
199 if (wellInside( fts, dir, *
i, result))
return true;
210 if (wellInside( fts, dir, *
i, result))
return true;
219 typedef std::vector<const DetLayer*> Lvect;
220 typedef std::set<const DetLayer *> Lset;
223 Lvect && someLayers = nextLayers(fts,timeDirection);
224 if (someLayers.empty()) {
225 LogDebug(
"SimpleNavigableLayer") <<
"Number of compatible layers: "<< 0;
231 Lset layerToTry, nextLayerToTry;
232 layerToTry.insert(someLayers.begin(),someLayers.end());
234 while (!layerToTry.empty() && (counter++)<=150){
236 <<counter<<
"] going to check on : "<<layerToTry.size()<<
" next layers.";
238 nextLayerToTry.clear();
239 for (
auto toTry : layerToTry){
242 <<counter<<
"] adding layer with pointer: "<<(toTry)
243 <<
" first detid: "<< (toTry)->basicComponents().front()->geographicalId();
244 if (!collect.insert(toTry).second)
continue;
247 Lvect && nextLayers = (toTry)->nextLayers(fts,timeDirection);
249 <<counter<<
"] this layer has : "<<nextLayers.size()<<
" next layers.";
250 nextLayerToTry.insert(nextLayers.begin(),nextLayers.end());
253 layerToTry.swap(nextLayerToTry);
256 edm::LogWarning(
"SimpleNavigableLayer") <<
"WARNING: compatibleLayers() more than 150 iterations!!! Bailing out..";
262 <<
"Number of compatible layers: "<< collect.size();
264 return Lvect(collect.begin(),collect.end());
virtual std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const GCC11_FINAL
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
CartesianTrajectoryError cartesianError() const
virtual float length() const =0
LocalVector localDirection() const
GlobalPoint globalPosition() const
const Bounds & bounds() const
TSOS crossingState(const FreeTrajectoryState &fts, PropagationDirection dir) const dso_internal
LocalError positionError() const
bool wellInside(const FreeTrajectoryState &fts, PropagationDirection dir, const BarrelDetLayer *bl, DLC &result) const dso_internal
virtual float thickness() const =0
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
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
double deltaR(double eta1, double eta2, double phi1, double phi2)
GlobalPoint position() const
const GlobalError position() const
Position error submatrix.
virtual const BoundDisk & specificSurface() const GCC11_FINAL
static std::atomic< unsigned int > counter
const BasicVectorType & basicVector() const
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
BDLC::const_iterator ConstBDLI
GlobalVector globalDirection() const
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.