25 const float toCloseToEachOther2 = 1
e-4*1
e-4;
26 if unlikely( (middlePoint-initialPoint).
mag2() < toCloseToEachOther2){
27 LogDebug(
"SimpleNavigableLayer")<<
"initial state and PCA are identical. Things are bound to fail. Do not add the link.";
39 LogDebug(
"SimpleNavigableLayer")<<
"self propagating("<< dir <<
") from:\n"
42 <<
" and the direction is: "<<
dir;
46 propState = propagator(dir).propagate( dest, detLayer()->surface());
51 LogDebug(
"SimpleNavigableLayer")<<
"second propagation("<< dir <<
") to: \n"
53 double finalDot = (middlePoint - initialPoint).basicVector().dot((finalPoint-middlePoint).basicVector());
55 LogDebug(
"SimpleNavigableLayer")<<
"switch side back: ABORT.";
67 TSOS propState = (bl==detLayer()) ?
68 crossingState(fts,dir)
72 if ( !propState.
isValid())
return false;
75 if (theCheckCrossingSide){
79 if (backTobackTransverse || backToback ){
80 LogTrace(
"TkNavigation") <<
"Crossing over prevented!\nStaring from (x,y,z,r) ("
82 <<
") going to TSOS (x,y,z,r)"
103 float length = bounds.
length()*0.5f;
106 float deltaZ = 0.5f*bounds.thickness() *
111 const float nSigma = theEpsilon;
119 if (
std::abs( zpos) < length + deltaZ) result.push_back( bl);
121 return std::abs( zpos) < length - deltaZ;
130 if ( !propState.
isValid())
return false;
133 LogDebug(
"SimpleNavigableLayer")<<
"self propagating from:\n"
139 if (theCheckCrossingSide){
143 if (backTobackTransverse || backToback ){
144 LogTrace(
"TkNavigation") <<
"Crossing over prevented!\nStaring from (x,y,z,r) ("
146 <<
") going to TSOS (x,y,z,r)"
164 const float nSigma = theEpsilon;
168 deltaR += nSigma *
sqrt(err.
xx() + err.
yy());
173 if ( innerR-deltaR < rpos && rpos < outerR+deltaR) result.push_back( fl);
174 return ( innerR+deltaR < rpos && rpos < outerR-deltaR);
182 for (
auto l : layers) {
185 if (wellInside( fts, dir, bl, result))
return true;
189 if (wellInside( fts, dir, fl, result))
return true;
201 if (wellInside( fts, dir, *
i, result))
return true;
212 if (wellInside( fts, dir, *
i, result))
return true;
221 typedef std::vector<const DetLayer*> Lvect;
222 typedef std::set<const DetLayer *> Lset;
225 Lvect && someLayers = nextLayers(fts,timeDirection);
226 if (someLayers.empty()) {
227 LogDebug(
"SimpleNavigableLayer") <<
"Number of compatible layers: "<< 0;
233 Lset layerToTry, nextLayerToTry;
234 layerToTry.insert(someLayers.begin(),someLayers.end());
236 while (!layerToTry.empty() && (counter++)<=150){
238 <<counter<<
"] going to check on : "<<layerToTry.size()<<
" next layers.";
240 nextLayerToTry.clear();
241 for (
auto toTry : layerToTry){
244 <<counter<<
"] adding layer with pointer: "<<(toTry)
245 <<
" first detid: "<< (toTry)->basicComponents().front()->geographicalId();
246 if (!collect.insert(toTry).second)
continue;
249 Lvect && nextLayers = school->nextLayers(*toTry,fts,timeDirection);
251 <<counter<<
"] this layer has : "<<nextLayers.size()<<
" next layers.";
252 nextLayerToTry.insert(nextLayers.begin(),nextLayers.end());
255 layerToTry.swap(nextLayerToTry);
258 edm::LogWarning(
"SimpleNavigableLayer") <<
"WARNING: compatibleLayers() more than 150 iterations!!! Bailing out..";
264 <<
"Number of compatible layers: "<< collect.size();
266 return Lvect(collect.begin(),collect.end());
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
CartesianTrajectoryError cartesianError() const
virtual float length() const =0
LocalVector localDirection() const
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
GlobalPoint globalPosition() const
const Bounds & bounds() const
LocalError positionError() const
virtual float thickness() const =0
FreeTrajectoryState const * freeState(bool withErrors=true) const
virtual std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection, int &counter) const
virtual const BoundDisk & specificSurface() 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 BoundCylinder & specificSurface() const
Extension of the interface.
bool wellInside(const FreeTrajectoryState &fts, PropagationDirection dir, const BarrelDetLayer *bl, DLC &result) const
static std::atomic< unsigned int > counter
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.