27 theComps(blades.
begin(),blades.
end())
29 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
32 (**it).basicComponents().begin(),
33 (**it).basicComponents().end());
48 float theRmin = (*(
theComps.begin()))->surface().position().perp();
49 float theRmax = theRmin;
50 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
52 theRmin =
std::min( theRmin, (*it)->surface().position().perp());
53 theRmax =
std::max( theRmax, (*it)->surface().position().perp());
55 float split_inner_outer_radius = 0.5 * (theRmin + theRmax);
57 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
59 if((**it).surface().position().perp() <= split_inner_outer_radius) ++
_num_innerpanels;
74 vector<const GeometricSearchDet*>::const_iterator
i;
84 std::vector<DetGroup> &
result)
const {
85 vector<DetGroup> closestResult_inner;
86 vector<DetGroup> closestResult_outer;
87 vector<DetGroup> nextResult_inner;
88 vector<DetGroup> nextResult_outer;
89 vector<DetGroup> result_inner;
90 vector<DetGroup> result_outer;
91 int frontindex_inner = 0;
92 int frontindex_outer = 0;
102 if (!crossings_outer.isValid){
109 tsos, prop, est, closestResult_inner);
111 if(closestResult_inner.empty()){
113 tsos, prop, est, result_inner);
114 frontindex_inner = crossings_inner.
nextIndex;
117 tsos, prop, est, nextResult_inner)) {
122 theHelicity, crossingSide);
123 if (theHelicity == crossingSide) frontindex_inner = crossings_inner.
closestIndex;
124 else frontindex_inner = crossings_inner.
nextIndex;
126 result_inner.swap(closestResult_inner);
130 if(!closestResult_inner.empty()){
133 searchNeighbors( tsos, prop, est, crossings_inner, window, result_inner,
true);
142 tsos, prop, est, closestResult_outer);
144 if(closestResult_outer.empty()){
146 tsos, prop, est, result_outer);
147 frontindex_outer = crossings_outer.nextIndex;
150 tsos, prop, est, nextResult_outer)) {
155 theHelicity, crossingSide);
156 if (theHelicity == crossingSide) frontindex_outer = crossings_outer.closestIndex;
157 else frontindex_outer = crossings_outer.nextIndex;
159 result_outer.swap(closestResult_outer);
160 frontindex_outer = crossings_outer.closestIndex;
163 if(!closestResult_outer.empty()){
166 searchNeighbors( tsos, prop, est, crossings_inner, window, result_outer,
false);
169 if(result_inner.empty() && result_outer.empty() )
return;
170 if(result_inner.empty()) result.swap(result_outer);
171 else if(result_outer.empty()) result.swap(result_inner);
177 theHelicity, crossingSide);
190 bool innerDisk)
const
203 vector<DetGroup>
tmp;
204 vector<DetGroup> newResult;
205 for (
int idet=negStart; idet >= negStart - quarter+1; idet--) {
212 if (!
Adder::add( *neighbor, tsos, prop, est, tmp))
break;
215 Merger::orderAndMergeTwoLevels( std::move(tmp), std::move(result), newResult, theHelicity, crossingSide);
220 if (!
Adder::add( *neighbor, tsos, prop, est, tmp))
break;
223 Merger::orderAndMergeTwoLevels( std::move(tmp), std::move(result), newResult, theHelicity, crossingSide);
225 result.swap(newResult);
227 for (
int idet=posStart; idet < posStart + quarter-1; idet++) {
234 if (!
Adder::add( *neighbor, tsos, prop, est, tmp))
break;
237 Merger::orderAndMergeTwoLevels( std::move(result), std::move(tmp), newResult, theHelicity, crossingSide);
242 if (!
Adder::add( *neighbor, tsos, prop, est, tmp))
break;
245 Merger::orderAndMergeTwoLevels( std::move(result), std::move(tmp), newResult, theHelicity, crossingSide);
247 result.swap(newResult);
271 pair<bool,double> thePath = turbineCrossing.pathLength(
specificSurface() );
273 if (!thePath.first) {
280 int closestIndex = 0;
288 float closestDist = 0;
291 const Plane& closestPlane( static_cast<const Plane&>(
294 pair<bool,double> theClosestBladePath = theBladeCrossing.
pathLength( closestPlane );
297 closestDist = closestPos.
x();
300 closestIndex+1 : closestIndex-1;
302 const Plane& closestPlane( static_cast<const Plane&>(
305 pair<bool,double> theClosestBladePath = theBladeCrossing.
pathLength( closestPlane );
308 closestDist = closestPos.
x();
311 closestIndex+1 : closestIndex-1;
316 const Plane& nextPlane( static_cast<const Plane&>(
318 pair<bool,double> theNextBladePath = theBladeCrossing.
pathLength( nextPlane );
320 nextDist = nextPos.
x();
322 const Plane& nextPlane( static_cast<const Plane&>(
324 pair<bool,double> theNextBladePath = theBladeCrossing.
pathLength( nextPlane );
326 nextDist = nextPos.
x();
329 if (fabs(closestDist) < fabs(nextDist)) {
virtual BoundDisk * computeSurface()
virtual PropagationDirection propagationDirection() const
unsigned int _num_innerpanels
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
void setSurface(BoundDisk *cp)
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
virtual std::pair< bool, double > pathLength(const Plane &)
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
Vector2DBase< float, LocalTag > Local2DVector
std::vector< const GeometricSearchDet * > theComps
const Plane & surface() const
The nominal surface of the GeomDet.
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
std::vector< const GeomDet * > theBasicComps
int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade) const
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
LocalPoint toLocal(const GlobalPoint &gp) const
virtual const BoundDisk & specificSurface() const
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
PixelForwardLayerPhase1(std::vector< const PixelBlade * > &blades)
unsigned int _num_outerpanels
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
virtual PositionType position(double s) const
virtual const Surface::PositionType & position() const
Returns position of the surface.
PeriodicBinFinderInPhi< double > BinFinderType
BinFinderType theBinFinder_inner
~PixelForwardLayerPhase1()
std::vector< std::vector< double > > tmp
GlobalVector globalMomentum() const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
BinFinderType theBinFinder_outer
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubTurbineCrossings &crossings, float window, std::vector< DetGroup > &result, bool innerDisk) const
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))
const PositionType & position() const
double transverseCurvature() const
SubTurbineCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir, bool innerDisk) const