23 theFrontDets(frontDets),
24 theBackDets(backDets),
25 front_radius_range_(std::make_pair(0, 0)),
26 back_radius_range_(std::make_pair(0, 0)) {
35 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for Phase1PixelBlade";
36 LogDebug(
"TkDetLayers") <<
"Blade z, perp, innerRadius, outerR[disk, front, back]: " << this->
position().
z() <<
" , "
43 LogDebug(
"TkDetLayers") <<
"frontDet phi,z,r: " << (*it)->position().phi() <<
" , " << (*it)->position().z()
44 <<
" , " << (*it)->position().perp() <<
" , "
45 <<
" rmin: " << (*it)->surface().rSpan().first
46 <<
" rmax: " << (*it)->surface().rSpan().second << std::endl;
50 LogDebug(
"TkDetLayers") <<
"backDet phi,z,r: " << (*it)->position().phi() <<
" , " << (*it)->position().z() <<
" , "
51 << (*it)->position().perp() <<
" , "
52 <<
" rmin: " << (*it)->surface().rSpan().first
53 <<
" rmax: " << (*it)->surface().rSpan().second << std::endl;
64 edm::LogError(
"TkDetLayers") <<
"temporary dummy implementation of Phase1PixelBlade::compatible()!!";
65 return pair<bool, TrajectoryStateOnSurface>();
71 std::vector<DetGroup>&
result)
const {
78 vector<DetGroup> closestResult;
81 if (closestResult.empty()) {
82 vector<DetGroup> nextResult;
84 if (nextResult.empty())
102 vector<DetGroup> nextResult;
123 if (!innerPath.first)
126 GlobalPoint gInnerPoint(crossing.position(innerPath.second));
132 int innerIndex =
findBin2(gInnerPoint, 0);
140 if (!outerPath.first)
143 GlobalPoint gOuterPoint(crossing.position(outerPath.second));
148 int outerIndex =
findBin2(gOuterPoint, 1);
155 if (innerDist < outerDist) {
166 vector<DetGroup>&
result)
const {
184 bool checkClosest)
const {
189 int negStartIndex = closestIndex - 1;
190 int posStartIndex = closestIndex + 1;
193 if (gCrossingPos.
perp() < sBlade[closestIndex]->surface().position().perp()) {
194 posStartIndex = closestIndex;
196 negStartIndex = closestIndex;
201 for (
int idet = negStartIndex; idet >= 0; idet--) {
202 if (!
overlap(gCrossingPos, *sBlade[idet], window))
204 if (!
Adder::add(*sBlade[idet], tsos, prop, est, result))
207 for (
int idet = posStartIndex; idet < static_cast<int>(sBlade.size()); idet++) {
208 if (!
overlap(gCrossingPos, *sBlade[idet], window))
210 if (!
Adder::add(*sBlade[idet], tsos, prop, est, result))
219 const float relativeMargin = 1.01;
227 float localX = localCrossPoint.x();
233 if ((
std::abs(localX) - window) < relativeMargin * detHalfLength) {
244 float rDiff =
std::abs(R - localDets.front()->surface().position().perp());
245 for (vector<const GeomDet*>::const_iterator
i = localDets.begin();
i != localDets.end();
i++) {
246 float testDiff =
std::abs(R - (**i).surface().position().perp());
247 if (testDiff < rDiff) {
249 theBin =
i - localDets.begin();
259 float sDiff = (thispoint - localDets.front()->surface().position()).
mag();
261 for (vector<const GeomDet*>::const_iterator
i = localDets.begin();
i != localDets.end();
i++) {
262 float testDiff = (thispoint - (**i).surface().position()).
mag();
263 if (testDiff < sDiff) {
265 theBin =
i - localDets.begin();
273 return (diskSector[index])->surface().position();
278 Vector posSum(0, 0, 0);
279 for (
auto i : current_dets)
280 posSum += (*i).surface().position().basicVector();
285 const Plane& tmpplane = current_dets.front()->surface();
294 if (planePosition.
x() * planeXAxis.
x() + planePosition.
y() * planeXAxis.
y() > 0.) {
301 if (planeZAxis.
z() * planePosition.
z() > 0.) {
307 xAxis = yAxis.
cross(zAxis);
310 Plane plane(meanPos, rotation);
317 for (
auto it : current_dets) {
319 for (
const auto&
i : corners) {
326 return std::make_pair(rmin, rmax);
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Local3DVector LocalVector
std::vector< const GeomDet * > theBackDets
std::pair< float, float > computeRadiusRanges(const std::vector< const GeomDet * > &)
virtual float length() const =0
Phase1PixelBlade(std::vector< const GeomDet * > &frontDets, std::vector< const GeomDet * > &backDets) __attribute__((cold))
int closestDetIndex() const
ROOT::Math::Plane3D::Vector Vector
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const override __attribute__((cold))
GlobalPoint globalPosition() const
const Bounds & bounds() const
virtual PropagationDirection propagationDirection() const final
Log< level::Error, false > LogError
const Plane & surface() const
The nominal surface of the GeomDet.
const GlobalPoint & position() const
const std::vector< const GeomDet * > & subBlade(int ind) const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
LocalPoint toLocal(const GlobalPoint &gp) const
int subLayerIndex() const
int findBin2(GlobalPoint thispoint, int layer) const
Abs< T >::type abs(const T &t)
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
std::vector< const GeomDet * > theDets
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
bool overlap(const GlobalPoint &gpos, const GeomDet &det, float phiWin) const
const std::vector< const GeometricSearchDet * > & components() const override __attribute__((cold))
Returns basic components, if any.
const SubLayerCrossing & other() const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
static BoundDiskSector * build(const std::vector< const GeomDet * > &dets) __attribute__((cold))
virtual const Surface::PositionType & position() const
Returns position of the surface.
constexpr uint16_t localX(uint16_t px)
~Phase1PixelBlade() override __attribute__((cold))
ReferenceCountingPointer< BoundDiskSector > theDiskSector
GlobalPoint findPosition(int index, int diskSectorIndex) const
static std::vector< GlobalPoint > corners(const Plane &)
ReferenceCountingPointer< BoundDiskSector > theFrontDiskSector
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
int findBin(float R, int layer) const
TkRotation< float > RotationType
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const __attribute__((hot))
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
const PositionType & position() const
std::vector< const GeomDet * > theFrontDets
ReferenceCountingPointer< BoundDiskSector > theBackDiskSector
double transverseCurvature() const