27 theComps(blades.
begin(),blades.
end())
37 float theRmax = theRmin;
38 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
40 theRmin =
std::min( theRmin, (*it)->surface().position().perp());
41 theRmax =
std::max( theRmax, (*it)->surface().position().perp());
45 float split_inner_outer_radius = 10.;
47 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
49 if((**it).surface().position().perp() <= split_inner_outer_radius) ++
_num_innerpanels;
52 edm::LogInfo(
"TkDetLayers") <<
" Rmin, Rmax, R_average = " << theRmin <<
", " << theRmax <<
", "
53 << split_inner_outer_radius << std::endl
54 <<
" num inner, outer disks = "
58 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
61 (**it).basicComponents().begin(),
62 (**it).basicComponents().end());
75 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for PixelForwardLayerPhase1" <<
"\n"
77 <<
"Based on phi separation for inner: " <<
theComps.front()->surface().position().phi()
79 <<
"PixelForwardLayerPhase1.surfcace.phi(): " << std::endl
81 <<
"PixelForwardLayerPhase1.surfcace.z(): "
83 <<
"PixelForwardLayerPhase1.surfcace.innerR(): "
85 <<
"PixelForwardLayerPhase1.surfcace.outerR(): "
88 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
90 LogDebug(
"TkDetLayers") <<
"blades phi,z,r: "
91 << (*it)->surface().position().phi() <<
" , "
92 << (*it)->surface().position().z() <<
" , "
93 << (*it)->surface().position().perp();
105 vector<const GeometricSearchDet*>::const_iterator
i;
115 std::vector<DetGroup> &
result)
const {
116 std::vector<DetGroup> closestResult_inner;
117 std::vector<DetGroup> closestResult_outer;
118 std::vector<DetGroup> nextResult_inner;
119 std::vector<DetGroup> nextResult_outer;
120 std::vector<DetGroup> result_inner;
121 std::vector<DetGroup> result_outer;
122 int frontindex_inner = 0;
123 int frontindex_outer = 0;
133 if (!crossings_outer.isValid){
134 edm::LogInfo(
"TkDetLayers") <<
"outer computeCrossings returns invalid in PixelForwardLayerPhase1::groupedCompatibleDets:";
141 tsos, prop, est, closestResult_inner);
143 if(closestResult_inner.empty()){
145 tsos, prop, est, result_inner);
146 frontindex_inner = crossings_inner.
nextIndex;
149 tsos, prop, est, nextResult_inner)) {
153 std::vector<DetGroup> tmp99 = closestResult_inner;
155 theHelicity, crossingSide);
156 if (theHelicity == crossingSide) frontindex_inner = crossings_inner.
closestIndex;
157 else frontindex_inner = crossings_inner.
nextIndex;
159 result_inner.swap(closestResult_inner);
164 if(!closestResult_inner.empty()){
167 searchNeighbors( tsos, prop, est, crossings_inner, window, result_inner,
true);
176 tsos, prop, est, closestResult_outer);
178 if(closestResult_outer.empty()){
180 tsos, prop, est, result_outer);
181 frontindex_outer = crossings_outer.nextIndex;
184 tsos, prop, est, nextResult_outer)) {
188 std::vector<DetGroup> tmp99 = closestResult_outer;
190 theHelicity, crossingSide);
191 if (theHelicity == crossingSide) frontindex_outer = crossings_outer.closestIndex;
192 else frontindex_outer = crossings_outer.nextIndex;
194 result_outer.swap(closestResult_outer);
195 frontindex_outer = crossings_outer.closestIndex;
198 if(!closestResult_outer.empty()){
201 searchNeighbors( tsos, prop, est, crossings_outer, window, result_outer,
false);
204 if(result_inner.empty() && result_outer.empty() )
return;
205 if(result_inner.empty()) result.swap(result_outer);
206 else if(result_outer.empty()) result.swap(result_inner);
212 theHelicity, crossingSide);
226 bool innerDisk)
const
239 for (
int idet=negStart; idet >= negStart - quarter+1; idet--) {
240 std::vector<DetGroup> tmp1;
241 std::vector<DetGroup> newResult;
246 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
249 std::vector<DetGroup> tmp2; tmp2.swap(result);
250 Merger::orderAndMergeTwoLevels( std::move(tmp1), std::move(tmp2), newResult, theHelicity, crossingSide);
255 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
258 std::vector<DetGroup> tmp2; tmp2.swap(result);
259 Merger::orderAndMergeTwoLevels( std::move(tmp1), std::move(tmp2), newResult, theHelicity, crossingSide);
261 result.swap(newResult);
263 for (
int idet=posStart; idet < posStart + quarter-1; idet++) {
264 std::vector<DetGroup> tmp1;
265 std::vector<DetGroup> newResult;
270 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
273 std::vector<DetGroup> tmp2; tmp2.swap(result);
274 Merger::orderAndMergeTwoLevels(std::move(tmp2), std::move(tmp1), newResult, theHelicity, crossingSide);
279 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
282 std::vector<DetGroup> tmp2; tmp2.swap(result);
283 Merger::orderAndMergeTwoLevels(std::move(tmp2), std::move(tmp1), newResult, theHelicity, crossingSide);
285 result.swap(newResult);
310 if (!thePath.first) {
316 int closestIndex = 0;
325 float closestDist = 0;
327 const BoundPlane& closestPlane( static_cast<const BoundPlane&>(
330 pair<bool,double> theClosestBladePath = theBladeCrossing.
pathLength( closestPlane );
332 closestDist = closestPos.
x();
334 nextIndex =
PhiLess()( closestPlane.phi(), turbinePoint.barePhi()) ?
335 closestIndex+1 : closestIndex-1;
337 const BoundPlane& closestPlane( static_cast<const BoundPlane&>(
340 pair<bool,double> theClosestBladePath = theBladeCrossing.
pathLength( closestPlane );
342 closestDist = closestPos.
x();
344 nextIndex =
PhiLess()( closestPlane.phi(), turbinePoint.barePhi()) ?
345 closestIndex+1 : closestIndex-1;
350 const BoundPlane& nextPlane( static_cast<const BoundPlane&>(
352 pair<bool,double> theNextBladePath = theBladeCrossing.
pathLength( nextPlane );
354 nextDist = nextPos.
x();
356 const BoundPlane& nextPlane( static_cast<const BoundPlane&>(
358 pair<bool,double> theNextBladePath = theBladeCrossing.
pathLength( nextPlane );
360 nextDist = nextPos.
x();
PeriodicBinFinderInPhi< float > BinFinderType
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 &)
virtual DirectionType direction(double s) const
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
static int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade)
Vector2DBase< float, LocalTag > Local2DVector
virtual PositionType position(double s) const
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
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubTurbineCrossings &crossings, float window, std::vector< DetGroup > &result, bool innerDisk) const __attribute__((hot))
std::vector< const GeomDet * > theBasicComps
virtual const BoundDisk & specificSurface() const
virtual std::pair< bool, double > pathLength(const Plane &plane)
PixelForwardLayerPhase1(std::vector< const Phase1PixelBlade * > &blades)
Abs< T >::type abs(const T &t)
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
static float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
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.
BinFinderType theBinFinder_inner
~PixelForwardLayerPhase1()
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
SubTurbineCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir, bool innerDisk) const __attribute__((hot))
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