28 theComps(blades.
begin(),blades.
end())
38 float theRmax = theRmin;
39 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
41 theRmin =
std::min( theRmin, (*it)->surface().position().perp());
42 theRmax =
std::max( theRmax, (*it)->surface().position().perp());
46 float split_inner_outer_radius = 10.;
48 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
50 if((**it).surface().position().perp() <= split_inner_outer_radius) ++
_num_innerpanels;
53 edm::LogInfo(
"TkDetLayers") <<
" Rmin, Rmax, R_average = " << theRmin <<
", " << theRmax <<
", " 54 << split_inner_outer_radius << std::endl
55 <<
" num inner, outer disks = " 59 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
62 (**it).basicComponents().begin(),
63 (**it).basicComponents().end());
76 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for PixelForwardLayerPhase1" <<
"\n" 78 <<
"Based on phi separation for inner: " <<
theComps.front()->surface().position().phi()
80 <<
"PixelForwardLayerPhase1.surfcace.phi(): " << std::endl
82 <<
"PixelForwardLayerPhase1.surfcace.z(): " 84 <<
"PixelForwardLayerPhase1.surfcace.innerR(): " 86 <<
"PixelForwardLayerPhase1.surfcace.outerR(): " 89 for(vector<const GeometricSearchDet*>::const_iterator it=
theComps.begin();
91 LogDebug(
"TkDetLayers") <<
"blades phi,z,r: " 92 << (*it)->surface().position().phi() <<
" , " 93 << (*it)->surface().position().z() <<
" , " 94 << (*it)->surface().position().perp();
106 vector<const GeometricSearchDet*>::const_iterator
i;
116 std::vector<DetGroup> &
result)
const {
117 std::vector<DetGroup> closestResult_inner;
118 std::vector<DetGroup> closestResult_outer;
119 std::vector<DetGroup> nextResult_inner;
120 std::vector<DetGroup> nextResult_outer;
121 std::vector<DetGroup> result_inner;
122 std::vector<DetGroup> result_outer;
123 int frontindex_inner = 0;
124 int frontindex_outer = 0;
134 if (!crossings_outer.isValid){
135 edm::LogInfo(
"TkDetLayers") <<
"outer computeCrossings returns invalid in PixelForwardLayerPhase1::groupedCompatibleDets:";
142 tsos, prop, est, closestResult_inner);
144 if(closestResult_inner.empty()){
146 tsos, prop, est, result_inner);
147 frontindex_inner = crossings_inner.
nextIndex;
150 tsos, prop, est, nextResult_inner)) {
154 std::vector<DetGroup> tmp99 = closestResult_inner;
156 theHelicity, crossingSide);
157 if (theHelicity == crossingSide) frontindex_inner = crossings_inner.
closestIndex;
158 else frontindex_inner = crossings_inner.
nextIndex;
160 result_inner.swap(closestResult_inner);
165 if(!closestResult_inner.empty()){
168 searchNeighbors( tsos, prop, est, crossings_inner, window, result_inner,
true);
177 tsos, prop, est, closestResult_outer);
179 if(closestResult_outer.empty()){
181 tsos, prop, est, result_outer);
182 frontindex_outer = crossings_outer.nextIndex;
185 tsos, prop, est, nextResult_outer)) {
189 std::vector<DetGroup> tmp99 = closestResult_outer;
191 theHelicity, crossingSide);
192 if (theHelicity == crossingSide) frontindex_outer = crossings_outer.closestIndex;
193 else frontindex_outer = crossings_outer.nextIndex;
195 result_outer.swap(closestResult_outer);
196 frontindex_outer = crossings_outer.closestIndex;
199 if(!closestResult_outer.empty()){
202 searchNeighbors( tsos, prop, est, crossings_outer, window, result_outer,
false);
205 if(result_inner.empty() && result_outer.empty() )
return;
206 if(result_inner.empty()) result.swap(result_outer);
207 else if(result_outer.empty()) result.swap(result_inner);
213 theHelicity, crossingSide);
227 bool innerDisk)
const 240 for (
int idet=negStart; idet >= negStart - quarter+1; idet--) {
241 std::vector<DetGroup> tmp1;
242 std::vector<DetGroup> newResult;
247 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
250 std::vector<DetGroup> tmp2; tmp2.swap(result);
251 Merger::orderAndMergeTwoLevels(
std::move(tmp1),
std::move(tmp2), newResult, theHelicity, crossingSide);
256 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
259 std::vector<DetGroup> tmp2; tmp2.swap(result);
260 Merger::orderAndMergeTwoLevels(
std::move(tmp1),
std::move(tmp2), newResult, theHelicity, crossingSide);
262 result.swap(newResult);
264 for (
int idet=posStart; idet < posStart + quarter-1; idet++) {
265 std::vector<DetGroup> tmp1;
266 std::vector<DetGroup> newResult;
271 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
274 std::vector<DetGroup> tmp2; tmp2.swap(result);
275 Merger::orderAndMergeTwoLevels(
std::move(tmp2),
std::move(tmp1), newResult, theHelicity, crossingSide);
280 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
283 std::vector<DetGroup> tmp2; tmp2.swap(result);
284 Merger::orderAndMergeTwoLevels(
std::move(tmp2),
std::move(tmp1), newResult, theHelicity, crossingSide);
286 result.swap(newResult);
311 if (!thePath.first) {
317 int closestIndex = 0;
326 float closestDist = 0;
328 const BoundPlane& closestPlane( static_cast<const BoundPlane&>(
331 pair<bool,double> theClosestBladePath = theBladeCrossing.
pathLength( closestPlane );
333 closestDist = closestPos.
x();
335 nextIndex =
Geom::phiLess( closestPlane.phi(), turbinePoint.barePhi()) ?
336 closestIndex+1 : closestIndex-1;
338 const BoundPlane& closestPlane( static_cast<const BoundPlane&>(
341 pair<bool,double> theClosestBladePath = theBladeCrossing.
pathLength( closestPlane );
343 closestDist = closestPos.
x();
345 nextIndex =
Geom::phiLess( closestPlane.phi(), turbinePoint.barePhi()) ?
346 closestIndex+1 : closestIndex-1;
351 const BoundPlane& nextPlane( static_cast<const BoundPlane&>(
353 pair<bool,double> theNextBladePath = theBladeCrossing.
pathLength( nextPlane );
355 nextDist = nextPos.
x();
357 const BoundPlane& nextPlane( static_cast<const BoundPlane&>(
359 pair<bool,double> theNextBladePath = theBladeCrossing.
pathLength( nextPlane );
361 nextDist = nextPos.
x();
PeriodicBinFinderInPhi< float > BinFinderType
std::pair< bool, double > pathLength(const Plane &plane) override
virtual BoundDisk * computeSurface()
~PixelForwardLayerPhase1() override
GeometricSearchDet::DetWithState DetWithState
unsigned int _num_innerpanels
void setSurface(BoundDisk *cp)
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
GlobalPoint globalPosition() const
static int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade)
Vector2DBase< float, LocalTag > Local2DVector
std::vector< const GeometricSearchDet * > theComps
const Plane & surface() const
The nominal surface of the GeomDet.
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 PropagationDirection propagationDirection() const final
PixelForwardLayerPhase1(std::vector< const Phase1PixelBlade * > &blades)
Abs< T >::type abs(const T &t)
PositionType position(double s) const override
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
PositionType position(double s) const override
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
static float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
DirectionType direction(double s) const override
bool phiLess(float phi1, float phi2)
unsigned int _num_outerpanels
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
virtual const BoundDisk & specificSurface() const final
virtual const Surface::PositionType & position() const
Returns position of the surface.
std::pair< bool, double > pathLength(const Plane &) override
BinFinderType theBinFinder_inner
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
GlobalVector globalMomentum() const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
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))
const PositionType & position() const
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
double transverseCurvature() const