21 vector<const TOBRod*>& outerRods) :
22 theInnerComps(innerRods.
begin(),innerRods.
end()),
23 theOuterComps(outerRods.
begin(),outerRods.
end())
28 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
31 (**it).basicComponents().begin(),
32 (**it).basicComponents().end());
49 LogDebug(
"TkDetLayers") <<
"==== DEBUG TOBLayer =====" ;
50 LogDebug(
"TkDetLayers") <<
"innerCyl radius, thickness, lenght: "
55 LogDebug(
"TkDetLayers") <<
"outerCyl radius, thickness, lenght: "
60 LogDebug(
"TkDetLayers") <<
"Cyl radius, thickness, lenght: "
65 for (vector<const GeometricSearchDet*>::const_iterator
i=
theInnerComps.begin();
67 LogDebug(
"TkDetLayers") <<
"inner TOBRod pos z,perp,eta,phi: "
68 << (**i).position().z() <<
" , "
69 << (**i).position().perp() <<
" , "
70 << (**i).position().eta() <<
" , "
71 << (**i).position().phi() ;
74 for (vector<const GeometricSearchDet*>::const_iterator
i=
theOuterComps.begin();
76 LogDebug(
"TkDetLayers") <<
"outer TOBRod pos z,perp,eta,phi: "
77 << (**i).position().z() <<
" , "
78 << (**i).position().perp() <<
" , "
79 << (**i).position().eta() <<
" , "
80 << (**i).position().phi() ;
82 LogDebug(
"TkDetLayers") <<
"==== end DEBUG TOBLayer =====" ;
87 vector<const GeometricSearchDet*>::const_iterator
i;
99 std::vector<DetGroup> &
result)
const
103 if(! crossings.
isValid())
return;
105 vector<DetGroup> closestResult;
107 if (closestResult.empty()){
116 closestResult,
false);
118 vector<DetGroup> nextResult;
142 GlobalPoint gInnerPoint( innerCrossing.position());
158 if (innerDist < 0.) { innerDist += 2.*
Geom::pi();}
159 if (outerDist < 0.) { outerDist += 2.*
Geom::pi();}
162 if (innerDist < outerDist) {
174 vector<DetGroup>&
result)
const
205 double phiWin =
min(fabs(phiStart-phi1),fabs(phiStart-phi2));
217 bool checkClosest)
const
224 int negStartIndex = closestIndex-1;
225 int posStartIndex = closestIndex+1;
228 if (
PhiLess()( gCrossingPos.
phi(), sLayer[closestIndex]->surface().phi())) {
229 posStartIndex = closestIndex;
232 negStartIndex = closestIndex;
239 int quarter = sLayer.size()/4;
240 for (
int idet=negStartIndex; idet >= negStartIndex - quarter; idet--) {
242 if (!
overlap( gCrossingPos, neighborRod, window))
break;
243 if (!
Adder::add( neighborRod, tsos, prop, est, result))
break;
246 for (
int idet=posStartIndex; idet < posStartIndex + quarter; idet++) {
248 if (!
overlap( gCrossingPos, neighborRod, window))
break;
249 if (!
Adder::add( neighborRod, tsos, prop, est, result))
break;
260 const float phiOffset = 0.00034;
264 std::pair<float,float> phiRange(crossPoint.
phi()-phiWin, crossPoint.
phi()+phiWin);
280 vector<const GeomDet*>
tmp;
281 for (vector<const GeometricSearchDet*>::const_iterator it=rods.begin(); it!=rods.end(); it++) {
282 tmp.insert(tmp.end(),(*it)->basicComponents().begin(),(*it)->basicComponents().end());
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
static void orderAndMergeTwoLevels(const std::vector< DetGroup > &one, const std::vector< DetGroup > &two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
std::vector< const GeometricSearchDet * > theOuterComps
TOBLayer(std::vector< const TOBRod * > &innerRods, std::vector< const TOBRod * > &outerRods)
virtual float length() const =0
virtual PropagationDirection propagationDirection() const
ReferenceCountingPointer< BoundCylinder > theInnerCylinder
virtual void initialize()
int closestDetIndex() const
std::pair< float, float > const & phiSpan() const
LocalPoint localPosition() const
Geom::Phi< T > phi() const
PositionType position() const
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
double calculatePhiWindow(double Xmax, const GeomDet &det, const TrajectoryStateOnSurface &state) const
PeriodicBinFinderInPhi< double > BinFinderType
const GlobalPoint & position() const
virtual float thickness() const =0
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const
std::vector< const GeomDet * > theBasicComps
Scalar radius() const
Radius of the cylinder.
bool rangesIntersect(const Range &a, const Range &b)
std::vector< const GeometricSearchDet * > theInnerComps
int subLayerIndex() const
BoundCylinder * cylinder(const std::vector< const GeometricSearchDet * > &rods) const
virtual T binPosition(int ind) const
the middle of the bin in radians
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
const SubLayerCrossing & other() const
const Bounds & bounds() const
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
bool overlap(const GlobalPoint &gpos, const GeometricSearchDet &rod, float phiWin) const
virtual const BoundCylinder & specificSurface() const
Extension of the interface.
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result)
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
returns 0 if barrel layer crossed from inside, 1 if from outside
std::vector< std::vector< double > > tmp
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
const BoundPlane & surface() const
The nominal surface of the GeomDet.
std::vector< const GeometricSearchDet * > theComps
static unsigned int const shift
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const
BinFinderType theOuterBinFinder
BinFinderType theInnerBinFinder
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const
double transverseCurvature() const