CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Phase1PixelBlade Class Referencefinal

#include <Phase1PixelBlade.h>

Inheritance diagram for Phase1PixelBlade:
GeometricSearchDet

Public Member Functions

const std::vector< const
GeomDet * > & 
basicComponents () const override
 
std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const override __attribute__((cold))
 
const std::vector< const
GeometricSearchDet * > & 
components () const override __attribute__((cold))
 Returns basic components, if any. More...
 
void groupedCompatibleDetsV (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
 
 Phase1PixelBlade (std::vector< const GeomDet * > &frontDets, std::vector< const GeomDet * > &backDets) __attribute__((cold))
 
virtual const BoundDiskSectorspecificSurface () const
 
const BoundSurfacesurface () const override
 The surface of the GeometricSearchDet. More...
 
 ~Phase1PixelBlade () override __attribute__((cold))
 
- Public Member Functions inherited from GeometricSearchDet
virtual std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
 
 GeometricSearchDet (bool doHaveGroups)
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
bool hasGroups () const
 
virtual const
Surface::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Private Member Functions

bool addClosest (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
 
SubLayerCrossings computeCrossings (const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
 
std::pair< float, float > computeRadiusRanges (const std::vector< const GeomDet * > &)
 
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
 
int findBin (float R, int layer) const
 
int findBin2 (GlobalPoint thispoint, int layer) const
 
GlobalPoint findPosition (int index, int diskSectorIndex) const
 
bool overlap (const GlobalPoint &gpos, const GeomDet &det, float phiWin) const
 
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))
 
const std::vector< const
GeomDet * > & 
subBlade (int ind) const
 

Private Attributes

std::pair< float, float > back_radius_range_
 
std::pair< float, float > front_radius_range_
 
std::vector< const GeomDet * > theBackDets
 
ReferenceCountingPointer
< BoundDiskSector
theBackDiskSector
 
std::vector< const GeomDet * > theDets
 
ReferenceCountingPointer
< BoundDiskSector
theDiskSector
 
std::vector< const GeomDet * > theFrontDets
 
ReferenceCountingPointer
< BoundDiskSector
theFrontDiskSector
 

Additional Inherited Members

- Public Types inherited from GeometricSearchDet
typedef std::pair< const
GeomDet
*, TrajectoryStateOnSurface
DetWithState
 
typedef BoundSurface::PositionType PositionType
 
typedef BoundSurface::RotationType RotationType
 
typedef TrajectoryStateOnSurface TrajectoryState
 
- Protected Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A concrete implementation for Phase1PixelBlade

Definition at line 16 of file Phase1PixelBlade.h.

Constructor & Destructor Documentation

Phase1PixelBlade::Phase1PixelBlade ( std::vector< const GeomDet * > &  frontDets,
std::vector< const GeomDet * > &  backDets 
)

Definition at line 21 of file Phase1PixelBlade.cc.

References BladeShapeBuilderFromDet::build(), LogDebug, PV3DBase< T, PVType, FrameType >::perp(), GeometricSearchDet::position(), theBackDets, theBackDiskSector, theDets, theDiskSector, theFrontDets, theFrontDiskSector, and PV3DBase< T, PVType, FrameType >::z().

22  : GeometricSearchDet(true),
23  theFrontDets(frontDets),
24  theBackDets(backDets),
25  front_radius_range_(std::make_pair(0, 0)),
26  back_radius_range_(std::make_pair(0, 0)) {
27  theDets.assign(theFrontDets.begin(), theFrontDets.end());
28  theDets.insert(theDets.end(), theBackDets.begin(), theBackDets.end());
29 
33 
34  //--------- DEBUG INFO --------------
35  LogDebug("TkDetLayers") << "DEBUG INFO for Phase1PixelBlade";
36  LogDebug("TkDetLayers") << "Blade z, perp, innerRadius, outerR[disk, front, back]: " << this->position().z() << " , "
37  << this->position().perp() << " , (" << theDiskSector->innerRadius() << " , "
38  << theDiskSector->outerRadius() << "), (" << theFrontDiskSector->innerRadius() << " , "
39  << theFrontDiskSector->outerRadius() << "), (" << theBackDiskSector->innerRadius() << " , "
40  << theBackDiskSector->outerRadius() << ")" << std::endl;
41 
42  for (vector<const GeomDet*>::const_iterator it = theFrontDets.begin(); it != theFrontDets.end(); it++) {
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;
47  }
48 
49  for (vector<const GeomDet*>::const_iterator it = theBackDets.begin(); it != theBackDets.end(); it++) {
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;
54  }
55 }
std::pair< float, float > front_radius_range_
std::vector< const GeomDet * > theBackDets
T perp() const
Definition: PV3DBase.h:69
GeometricSearchDet(bool doHaveGroups)
T z() const
Definition: PV3DBase.h:61
std::vector< const GeomDet * > theDets
static BoundDiskSector * build(const std::vector< const GeomDet * > &dets) __attribute__((cold))
virtual const Surface::PositionType & position() const
Returns position of the surface.
ReferenceCountingPointer< BoundDiskSector > theDiskSector
ReferenceCountingPointer< BoundDiskSector > theFrontDiskSector
std::pair< float, float > back_radius_range_
std::vector< const GeomDet * > theFrontDets
ReferenceCountingPointer< BoundDiskSector > theBackDiskSector
#define LogDebug(id)
Phase1PixelBlade::~Phase1PixelBlade ( )
override

Definition at line 19 of file Phase1PixelBlade.cc.

19 {}

Member Function Documentation

bool Phase1PixelBlade::addClosest ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
std::vector< DetGroup > &  result 
) const
private

Definition at line 162 of file Phase1PixelBlade.cc.

References CompatibleDetToGroupAdder::add(), SubLayerCrossing::closestDetIndex(), mps_fire::result, subBlade(), and SubLayerCrossing::subLayerIndex().

Referenced by groupedCompatibleDetsV().

166  {
167  const vector<const GeomDet*>& sBlade(subBlade(crossing.subLayerIndex()));
168 
169  return CompatibleDetToGroupAdder().add(*sBlade[crossing.closestDetIndex()], tsos, prop, est, result);
170 }
int closestDetIndex() const
tuple result
Definition: mps_fire.py:311
const std::vector< const GeomDet * > & subBlade(int ind) const
int subLayerIndex() const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
const std::vector<const GeomDet*>& Phase1PixelBlade::basicComponents ( ) const
inlineoverridevirtual

Implements GeometricSearchDet.

Definition at line 25 of file Phase1PixelBlade.h.

References theDets.

25 { return theDets; }
std::vector< const GeomDet * > theDets
pair< bool, TrajectoryStateOnSurface > Phase1PixelBlade::compatible ( const TrajectoryStateOnSurface ts,
const Propagator ,
const MeasurementEstimator  
) const
overridevirtual

tests the geometrical compatibility of the Det with the predicted state. The FreeTrajectoryState argument is propagated to the Det surface using the Propagator argument. The resulting TrajectoryStateOnSurface is tested for compatibility with the surface bounds. If compatible, a std::pair< true, propagatedState> is returned. If the propagation fails, or if the state is not compatible, a std::pair< false, propagatedState> is returned.

Implements GeometricSearchDet.

Definition at line 61 of file Phase1PixelBlade.cc.

63  {
64  edm::LogError("TkDetLayers") << "temporary dummy implementation of Phase1PixelBlade::compatible()!!";
65  return pair<bool, TrajectoryStateOnSurface>();
66 }
Log< level::Error, false > LogError
const vector< const GeometricSearchDet * > & Phase1PixelBlade::components ( ) const
overridevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 57 of file Phase1PixelBlade.cc.

57  {
58  throw DetLayerException("TOBRod doesn't have GeometricSearchDet components");
59 }
Common base class.
SubLayerCrossings Phase1PixelBlade::computeCrossings ( const TrajectoryStateOnSurface tsos,
PropagationDirection  propDir 
) const
private

Definition at line 115 of file Phase1PixelBlade.cc.

References findBin2(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), mag(), rho, theBackDiskSector, theFrontDiskSector, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

116  {
117  HelixPlaneCrossing::PositionType startPos(startingState.globalPosition());
118  HelixPlaneCrossing::DirectionType startDir(startingState.globalMomentum());
119  double rho(startingState.transverseCurvature());
120  HelixArbitraryPlaneCrossing crossing(startPos, startDir, rho, propDir);
121 
122  pair<bool, double> innerPath = crossing.pathLength(*theFrontDiskSector);
123  if (!innerPath.first)
124  return SubLayerCrossings();
125 
126  GlobalPoint gInnerPoint(crossing.position(innerPath.second));
127  //Code for use of binfinder
128  //int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.perp());
129  //float innerDist = std::abs( theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.z());
130 
131  // int innerIndex = findBin(gInnerPoint.perp(),0);
132  int innerIndex = findBin2(gInnerPoint, 0);
133 
134  //fixme gc patched for SLHC - force order here to be in z
135  //float innerDist = std::abs( findPosition(innerIndex,0).perp() - gInnerPoint.perp());
136  float innerDist = (startingState.globalPosition() - gInnerPoint).mag();
137  SubLayerCrossing innerSLC(0, innerIndex, gInnerPoint);
138 
139  pair<bool, double> outerPath = crossing.pathLength(*theBackDiskSector);
140  if (!outerPath.first)
141  return SubLayerCrossings();
142 
143  GlobalPoint gOuterPoint(crossing.position(outerPath.second));
144  //Code for use of binfinder
145  //int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.perp());
146  //float outerDist = std::abs( theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.perp());
147  // int outerIndex = findBin(gOuterPoint.perp(),1);
148  int outerIndex = findBin2(gOuterPoint, 1);
149 
150  //fixme gc patched for SLHC - force order here to be in z
151  //float outerDist = std::abs( findPosition(outerIndex,1).perp() - gOuterPoint.perp());
152  float outerDist = (startingState.globalPosition() - gOuterPoint).mag();
153  SubLayerCrossing outerSLC(1, outerIndex, gOuterPoint);
154 
155  if (innerDist < outerDist) {
156  return SubLayerCrossings(innerSLC, outerSLC, 0);
157  } else {
158  return SubLayerCrossings(outerSLC, innerSLC, 1);
159  }
160 }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
int findBin2(GlobalPoint thispoint, int layer) const
ReferenceCountingPointer< BoundDiskSector > theFrontDiskSector
ReferenceCountingPointer< BoundDiskSector > theBackDiskSector
std::pair< float, float > Phase1PixelBlade::computeRadiusRanges ( const std::vector< const GeomDet * > &  current_dets)
private

Definition at line 276 of file Phase1PixelBlade.cc.

References BoundingBox::corners(), Vector3DBase< T, FrameTag >::cross(), mps_fire::i, SiStripPI::max, min(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), alignCSCRings::r, idealTransformation::rotation, Surface::toGlobal(), GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and MetAnalyzer::zAxis.

276  {
278  Vector posSum(0, 0, 0);
279  for (auto i : current_dets)
280  posSum += (*i).surface().position().basicVector();
281 
282  Surface::PositionType meanPos(0., 0., posSum.z() / float(current_dets.size()));
283 
284  // temporary plane - for the computation of bounds
285  const Plane& tmpplane = current_dets.front()->surface();
286 
287  GlobalVector xAxis;
288  GlobalVector yAxis;
290 
291  GlobalVector planeXAxis = tmpplane.toGlobal(LocalVector(1, 0, 0));
292  const GlobalPoint& planePosition = tmpplane.position();
293 
294  if (planePosition.x() * planeXAxis.x() + planePosition.y() * planeXAxis.y() > 0.) {
295  yAxis = planeXAxis;
296  } else {
297  yAxis = -planeXAxis;
298  }
299 
300  GlobalVector planeZAxis = tmpplane.toGlobal(LocalVector(0, 0, 1));
301  if (planeZAxis.z() * planePosition.z() > 0.) {
302  zAxis = planeZAxis;
303  } else {
304  zAxis = -planeZAxis;
305  }
306 
307  xAxis = yAxis.cross(zAxis);
308 
310  Plane plane(meanPos, rotation);
311 
312  Surface::PositionType tmpPos = current_dets.front()->surface().position();
313 
314  float rmin(plane.toLocal(tmpPos).perp());
315  float rmax(plane.toLocal(tmpPos).perp());
316 
317  for (auto it : current_dets) {
318  vector<GlobalPoint> corners = BoundingBox().corners(it->specificSurface());
319  for (const auto& i : corners) {
320  float r = plane.toLocal(i).perp();
321  rmin = min(rmin, r);
322  rmax = max(rmax, r);
323  }
324  }
325 
326  return std::make_pair(rmin, rmax);
327 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
Local3DVector LocalVector
Definition: LocalVector.h:12
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
T y() const
Definition: PV3DBase.h:60
Definition: Plane.h:16
T z() const
Definition: PV3DBase.h:61
T min(T a, T b)
Definition: MathUtil.h:58
static std::vector< GlobalPoint > corners(const Plane &)
Definition: BoundingBox.cc:20
TkRotation< float > RotationType
tuple zAxis
Definition: MetAnalyzer.py:57
T x() const
Definition: PV3DBase.h:59
const PositionType & position() const
float Phase1PixelBlade::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
private

Definition at line 172 of file Phase1PixelBlade.cc.

References MeasurementEstimator::maximalLocalDisplacement(), GeomDet::surface(), and x.

Referenced by groupedCompatibleDetsV().

174  {
175  return est.maximalLocalDisplacement(tsos, det->surface()).x();
176 }
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
int Phase1PixelBlade::findBin ( float  R,
int  layer 
) const
private

Definition at line 240 of file Phase1PixelBlade.cc.

References funct::abs(), mps_fire::i, theBackDets, and theFrontDets.

240  {
241  vector<const GeomDet*> localDets = diskSectorIndex == 0 ? theFrontDets : theBackDets;
242 
243  int theBin = 0;
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) {
248  rDiff = testDiff;
249  theBin = i - localDets.begin();
250  }
251  }
252  return theBin;
253 }
std::vector< const GeomDet * > theBackDets
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< const GeomDet * > theFrontDets
int Phase1PixelBlade::findBin2 ( GlobalPoint  thispoint,
int  layer 
) const
private

Definition at line 255 of file Phase1PixelBlade.cc.

References mps_fire::i, mag(), theBackDets, and theFrontDets.

Referenced by computeCrossings().

255  {
256  const vector<const GeomDet*>& localDets = diskSectorIndex == 0 ? theFrontDets : theBackDets;
257 
258  int theBin = 0;
259  float sDiff = (thispoint - localDets.front()->surface().position()).mag();
260 
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) {
264  sDiff = testDiff;
265  theBin = i - localDets.begin();
266  }
267  }
268  return theBin;
269 }
std::vector< const GeomDet * > theBackDets
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
std::vector< const GeomDet * > theFrontDets
GlobalPoint Phase1PixelBlade::findPosition ( int  index,
int  diskSectorIndex 
) const
private

Definition at line 271 of file Phase1PixelBlade.cc.

References theBackDets, and theFrontDets.

271  {
272  vector<const GeomDet*> diskSector = diskSectorType == 0 ? theFrontDets : theBackDets;
273  return (diskSector[index])->surface().position();
274 }
std::vector< const GeomDet * > theBackDets
std::vector< const GeomDet * > theFrontDets
void Phase1PixelBlade::groupedCompatibleDetsV ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
) const
overridevirtual

Reimplemented from GeometricSearchDet.

Definition at line 68 of file Phase1PixelBlade.cc.

References addClosest(), SubLayerCrossings::closest(), computeCrossings(), computeWindowSize(), SubLayerCrossings::isValid(), eostools::move(), DetGroupMerger::orderAndMergeTwoLevels(), SubLayerCrossings::other(), Propagator::propagationDirection(), searchNeighbors(), and svgfig::window().

71  {
72  SubLayerCrossings crossings;
73 
74  crossings = computeCrossings(tsos, prop.propagationDirection());
75  if (!crossings.isValid())
76  return;
77 
78  vector<DetGroup> closestResult;
79  addClosest(tsos, prop, est, crossings.closest(), closestResult);
80 
81  if (closestResult.empty()) {
82  vector<DetGroup> nextResult;
83  addClosest(tsos, prop, est, crossings.other(), nextResult);
84  if (nextResult.empty())
85  return;
86 
87  //DetGroupElement nextGel( nextResult.front().front());
88  //int crossingSide = LayerCrossingSide().endcapSide( nextGel.trajectoryState(), prop);
89 
91  std::move(nextResult),
92  result,
93  0,
94  0); //fixme gc patched for SLHC - already correctly sorted for SLHC
95  //crossings.closestIndex(), crossingSide);
96  } else {
97  DetGroupElement closestGel(closestResult.front().front());
98  float window = computeWindowSize(closestGel.det(), closestGel.trajectoryState(), est);
99 
100  searchNeighbors(tsos, prop, est, crossings.closest(), window, closestResult, false);
101 
102  vector<DetGroup> nextResult;
103  searchNeighbors(tsos, prop, est, crossings.other(), window, nextResult, true);
104 
105  //int crossingSide = LayerCrossingSide().endcapSide( closestGel.trajectoryState(), prop);
107  std::move(nextResult),
108  result,
109  0,
110  0); //fixme gc patched for SLHC - already correctly sorted for SLHC
111  //crossings.closestIndex(), crossingSide);
112  }
113 }
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
def window
Definition: svgfig.py:643
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
tuple result
Definition: mps_fire.py:311
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
def move
Definition: eostools.py:511
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
const SubLayerCrossing & other() const
const SubLayerCrossing & closest() const
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))
bool Phase1PixelBlade::overlap ( const GlobalPoint gpos,
const GeomDet det,
float  phiWin 
) const
private

Definition at line 215 of file Phase1PixelBlade.cc.

References funct::abs(), Surface::bounds(), Bounds::length(), phase1PixelTopology::localX(), GeomDet::surface(), and GloballyPositioned< T >::toLocal().

Referenced by searchNeighbors().

215  {
216  // check if the z window around TSOS overlaps with the detector theDet (with a 1% margin added)
217 
218  // const float tolerance = 0.1;
219  const float relativeMargin = 1.01;
220 
221  LocalPoint localCrossPoint(det.surface().toLocal(crossPoint));
222  // if (std::abs(localCrossPoint.z()) > tolerance) {
223  // edm::LogInfo(TkDetLayers) << "Phase1PixelBlade::overlap calculation assumes point on surface, but it is off by "
224  // << localCrossPoint.z() ;
225  // }
226 
227  float localX = localCrossPoint.x();
228  float detHalfLength = det.surface().bounds().length() / 2.;
229 
230  // edm::LogInfo(TkDetLayers) << "Phase1PixelBlade::overlap: Det at " << det.position() << " hit at " << localY
231  // << " Window " << window << " halflength " << detHalfLength ;
232 
233  if ((std::abs(localX) - window) < relativeMargin * detHalfLength) { // FIXME: margin hard-wired!
234  return true;
235  } else {
236  return false;
237  }
238 }
def window
Definition: svgfig.py:643
virtual float length() const =0
const Bounds & bounds() const
Definition: Surface.h:87
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
LocalPoint toLocal(const GlobalPoint &gp) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
constexpr uint16_t localX(uint16_t px)
void Phase1PixelBlade::searchNeighbors ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
float  window,
std::vector< DetGroup > &  result,
bool  checkClosest 
) const
private

Definition at line 178 of file Phase1PixelBlade.cc.

References PVValHelper::add(), SubLayerCrossing::closestDetIndex(), overlap(), PV3DBase< T, PVType, FrameType >::perp(), SubLayerCrossing::position(), subBlade(), and SubLayerCrossing::subLayerIndex().

Referenced by groupedCompatibleDetsV().

184  {
185  const GlobalPoint& gCrossingPos = crossing.position();
186  const vector<const GeomDet*>& sBlade(subBlade(crossing.subLayerIndex()));
187 
188  int closestIndex = crossing.closestDetIndex();
189  int negStartIndex = closestIndex - 1;
190  int posStartIndex = closestIndex + 1;
191 
192  if (checkClosest) { // must decide if the closest is on the neg or pos side
193  if (gCrossingPos.perp() < sBlade[closestIndex]->surface().position().perp()) {
194  posStartIndex = closestIndex;
195  } else {
196  negStartIndex = closestIndex;
197  }
198  }
199 
200  typedef CompatibleDetToGroupAdder Adder;
201  for (int idet = negStartIndex; idet >= 0; idet--) {
202  if (!overlap(gCrossingPos, *sBlade[idet], window))
203  break;
204  if (!Adder::add(*sBlade[idet], tsos, prop, est, result))
205  break;
206  }
207  for (int idet = posStartIndex; idet < static_cast<int>(sBlade.size()); idet++) {
208  if (!overlap(gCrossingPos, *sBlade[idet], window))
209  break;
210  if (!Adder::add(*sBlade[idet], tsos, prop, est, result))
211  break;
212  }
213 }
def window
Definition: svgfig.py:643
T perp() const
Definition: PV3DBase.h:69
int closestDetIndex() const
tuple result
Definition: mps_fire.py:311
const GlobalPoint & position() const
const std::vector< const GeomDet * > & subBlade(int ind) const
int subLayerIndex() const
bool overlap(const GlobalPoint &gpos, const GeomDet &det, float phiWin) const
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
virtual const BoundDiskSector& Phase1PixelBlade::specificSurface ( ) const
inlinevirtual

Definition at line 40 of file Phase1PixelBlade.h.

References theDiskSector.

40 { return *theDiskSector; }
ReferenceCountingPointer< BoundDiskSector > theDiskSector
const std::vector<const GeomDet*>& Phase1PixelBlade::subBlade ( int  ind) const
inlineprivate

Definition at line 76 of file Phase1PixelBlade.h.

References theBackDets, and theFrontDets.

Referenced by addClosest(), and searchNeighbors().

76 { return (ind == 0 ? theFrontDets : theBackDets); }
std::vector< const GeomDet * > theBackDets
std::vector< const GeomDet * > theFrontDets
const BoundSurface& Phase1PixelBlade::surface ( ) const
inlineoverridevirtual

The surface of the GeometricSearchDet.

Implements GeometricSearchDet.

Definition at line 23 of file Phase1PixelBlade.h.

References theDiskSector.

23 { return *theDiskSector; }
ReferenceCountingPointer< BoundDiskSector > theDiskSector

Member Data Documentation

std::pair<float, float> Phase1PixelBlade::back_radius_range_
private

Definition at line 85 of file Phase1PixelBlade.h.

std::pair<float, float> Phase1PixelBlade::front_radius_range_
private

Definition at line 84 of file Phase1PixelBlade.h.

std::vector<const GeomDet*> Phase1PixelBlade::theBackDets
private

Definition at line 83 of file Phase1PixelBlade.h.

Referenced by findBin(), findBin2(), findPosition(), Phase1PixelBlade(), and subBlade().

ReferenceCountingPointer<BoundDiskSector> Phase1PixelBlade::theBackDiskSector
private

Definition at line 89 of file Phase1PixelBlade.h.

Referenced by computeCrossings(), and Phase1PixelBlade().

std::vector<const GeomDet*> Phase1PixelBlade::theDets
private

Definition at line 81 of file Phase1PixelBlade.h.

Referenced by basicComponents(), and Phase1PixelBlade().

ReferenceCountingPointer<BoundDiskSector> Phase1PixelBlade::theDiskSector
private

Definition at line 87 of file Phase1PixelBlade.h.

Referenced by Phase1PixelBlade(), specificSurface(), and surface().

std::vector<const GeomDet*> Phase1PixelBlade::theFrontDets
private

Definition at line 82 of file Phase1PixelBlade.h.

Referenced by findBin(), findBin2(), findPosition(), Phase1PixelBlade(), and subBlade().

ReferenceCountingPointer<BoundDiskSector> Phase1PixelBlade::theFrontDiskSector
private

Definition at line 88 of file Phase1PixelBlade.h.

Referenced by computeCrossings(), and Phase1PixelBlade().