36 float theRmax = theRmin;
37 for (vector<const GeometricSearchDet*>::const_iterator it =
theComps.begin(); it !=
theComps.end(); it++) {
38 theRmin =
std::min(theRmin, (*it)->surface().position().perp());
39 theRmax =
std::max(theRmax, (*it)->surface().position().perp());
43 float split_inner_outer_radius = 10.;
45 for (vector<const GeometricSearchDet*>::const_iterator it =
theComps.begin(); it !=
theComps.end(); it++) {
46 if ((**it).surface().position().perp() <= split_inner_outer_radius)
50 edm::LogInfo(
"TkDetLayers") <<
" Rmin, Rmax, R_average = " << theRmin <<
", " << theRmax <<
", " 51 << split_inner_outer_radius << std::endl
55 for (vector<const GeometricSearchDet*>::const_iterator it =
theComps.begin(); it !=
theComps.end(); it++) {
67 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for PixelForwardLayerPhase1" 70 <<
"Based on phi separation for inner: " <<
theComps.front()->surface().position().phi()
71 <<
" and on phi separation for outer: " 73 <<
"PixelForwardLayerPhase1.surfcace.phi(): " << std::endl
75 <<
"PixelForwardLayerPhase1.surfcace.z(): " << this->
surface().
position().
z() <<
"\n" 76 <<
"PixelForwardLayerPhase1.surfcace.innerR(): " << this->
specificSurface().innerRadius()
78 <<
"PixelForwardLayerPhase1.surfcace.outerR(): " << this->
specificSurface().outerRadius();
80 for (vector<const GeometricSearchDet*>::const_iterator it =
theComps.begin(); it !=
theComps.end(); it++) {
81 LogDebug(
"TkDetLayers") <<
"blades phi,z,r: " << (*it)->surface().position().phi() <<
" , " 82 << (*it)->surface().position().z() <<
" , " << (*it)->surface().position().perp();
92 vector<const GeometricSearchDet*>::const_iterator
i;
101 std::vector<DetGroup>&
result)
const {
102 std::vector<DetGroup> closestResult_inner;
103 std::vector<DetGroup> closestResult_outer;
104 std::vector<DetGroup> nextResult_inner;
105 std::vector<DetGroup> nextResult_outer;
106 std::vector<DetGroup> result_inner;
107 std::vector<DetGroup> result_outer;
108 int frontindex_inner = 0;
109 int frontindex_outer = 0;
120 if (!crossings_outer.isValid) {
122 <<
"outer computeCrossings returns invalid in PixelForwardLayerPhase1::groupedCompatibleDets:";
131 if (closestResult_inner.empty()) {
133 frontindex_inner = crossings_inner.
nextIndex;
140 std::vector<DetGroup> tmp99 = closestResult_inner;
142 std::move(tmp99),
std::move(nextResult_inner), result_inner, theHelicity, crossingSide);
143 if (theHelicity == crossingSide)
146 frontindex_inner = crossings_inner.
nextIndex;
148 result_inner.swap(closestResult_inner);
153 if (!closestResult_inner.empty()) {
168 closestResult_outer);
170 if (closestResult_outer.empty()) {
176 frontindex_outer = crossings_outer.nextIndex;
187 std::vector<DetGroup> tmp99 = closestResult_outer;
189 std::move(tmp99),
std::move(nextResult_outer), result_outer, theHelicity, crossingSide);
190 if (theHelicity == crossingSide)
191 frontindex_outer = crossings_outer.closestIndex;
193 frontindex_outer = crossings_outer.nextIndex;
195 result_outer.swap(closestResult_outer);
196 frontindex_outer = crossings_outer.closestIndex;
199 if (!closestResult_outer.empty()) {
205 if (result_inner.empty() && result_outer.empty())
207 if (result_inner.empty())
208 result.swap(result_outer);
209 else if (result_outer.empty())
210 result.swap(result_inner);
226 bool innerDisk)
const {
236 for (
int idet = negStart; idet >= negStart - quarter + 1; idet--) {
237 std::vector<DetGroup> tmp1;
238 std::vector<DetGroup> newResult;
243 if (!
Adder::add(*neighbor, tsos, prop, est, tmp1))
247 std::vector<DetGroup> tmp2;
249 Merger::orderAndMergeTwoLevels(
std::move(tmp1),
std::move(tmp2), newResult, theHelicity, crossingSide);
254 if (!
Adder::add(*neighbor, tsos, prop, est, tmp1))
258 std::vector<DetGroup> tmp2;
260 Merger::orderAndMergeTwoLevels(
std::move(tmp1),
std::move(tmp2), newResult, theHelicity, crossingSide);
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))
275 std::vector<DetGroup> tmp2;
277 Merger::orderAndMergeTwoLevels(
std::move(tmp2),
std::move(tmp1), newResult, theHelicity, crossingSide);
282 if (!
Adder::add(*neighbor, tsos, prop, est, tmp1))
286 std::vector<DetGroup> tmp2;
288 Merger::orderAndMergeTwoLevels(
std::move(tmp2),
std::move(tmp1), newResult, theHelicity, crossingSide);
311 if (!thePath.first) {
317 int closestIndex = 0;
326 float closestDist = 0;
330 pair<bool, double> theClosestBladePath = theBladeCrossing.
pathLength(closestPlane);
332 closestDist = closestPos.
x();
334 nextIndex =
Geom::phiLess(closestPlane.phi(), turbinePoint.barePhi()) ? closestIndex + 1 : closestIndex - 1;
339 pair<bool, double> theClosestBladePath = theBladeCrossing.
pathLength(closestPlane);
341 closestDist = closestPos.
x();
343 nextIndex =
Geom::phiLess(closestPlane.phi(), turbinePoint.barePhi()) ? closestIndex + 1 : closestIndex - 1;
350 pair<bool, double> theNextBladePath = theBladeCrossing.
pathLength(nextPlane);
352 nextDist = nextPos.
x();
356 pair<bool, double> theNextBladePath = theBladeCrossing.
pathLength(nextPlane);
358 nextDist = nextPos.
x();
PeriodicBinFinderInPhi< float > BinFinderType
std::pair< bool, double > pathLength(const Plane &plane) override
virtual BoundDisk * computeSurface()
virtual const Surface::PositionType & position() const
Returns position of the surface.
~PixelForwardLayerPhase1() override
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
GeometricSearchDet::DetWithState DetWithState
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
unsigned int _num_innerpanels
Geom::Phi< T > phi() const
void setSurface(BoundDisk *cp)
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
Global3DPoint GlobalPoint
static int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade)
virtual PropagationDirection propagationDirection() const final
std::vector< const GeometricSearchDet * > theComps
PositionType position(double s) const override
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
GlobalPoint globalPosition() const
Abs< T >::type abs(const T &t)
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
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)
PositionType position(double s) const override
bool phiLess(float phi1, float phi2)
Log< level::Info, false > LogInfo
unsigned int _num_outerpanels
const Plane & surface() const
The nominal surface of the GeomDet.
const PositionType & position() const
std::pair< bool, double > pathLength(const Plane &) override
double transverseCurvature() const
GlobalVector globalMomentum() const
BinFinderType theBinFinder_inner
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
Vector2DBase< float, LocalTag > Local2DVector
virtual const BoundDisk & specificSurface() const final
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
BinFinderType theBinFinder_outer
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
SubTurbineCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir, bool innerDisk) const __attribute__((hot))
DirectionType direction(double s) const override
PixelForwardLayerPhase1(std::vector< const Phase1PixelBlade *> &blades)