CMS 3D CMS Logo

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

#include <Phase1PixelBlade.h>

Inheritance diagram for Phase1PixelBlade:
GeometricSearchDet

Public Member Functions

virtual const std::vector
< const GeomDet * > & 
basicComponents () const
 
std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const __attribute__((cold))
 
virtual const std::vector
< const GeometricSearchDet * > & 
components () const __attribute__((cold))
 Returns basic components, if any. More...
 
virtual void groupedCompatibleDetsV (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))
 
 Phase1PixelBlade (std::vector< const GeomDet * > &frontDets, std::vector< const GeomDet * > &backDets) __attribute__((cold))
 
virtual const BoundDiskSectorspecificSurface () const
 
virtual const BoundSurfacesurface () const
 The surface of the GeometricSearchDet. More...
 
 ~Phase1PixelBlade () __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  :
23  GeometricSearchDet(true),
24  theFrontDets(frontDets),
25  theBackDets(backDets),
26  front_radius_range_(std::make_pair(0,0)),
27  back_radius_range_(std::make_pair(0,0))
28 {
29  theDets.assign(theFrontDets.begin(),theFrontDets.end());
30  theDets.insert(theDets.end(),theBackDets.begin(),theBackDets.end());
31 
35 
36  //--------- DEBUG INFO --------------
37  LogDebug("TkDetLayers") << "DEBUG INFO for Phase1PixelBlade" ;
38  LogDebug("TkDetLayers") << "Blade z, perp, innerRadius, outerR[disk, front, back]: "
39  << this->position().z() << " , "
40  << this->position().perp() << " , ("
41  << theDiskSector->innerRadius() << " , "
42  << theDiskSector->outerRadius() << "), ("
43  << theFrontDiskSector->innerRadius() << " , "
44  << theFrontDiskSector->outerRadius() << "), ("
45  << theBackDiskSector->innerRadius() << " , "
46  << theBackDiskSector->outerRadius() << ")" << std::endl;
47 
48  for(vector<const GeomDet*>::const_iterator it=theFrontDets.begin();
49  it!=theFrontDets.end(); it++){
50  LogDebug("TkDetLayers") << "frontDet phi,z,r: "
51  << (*it)->position().phi() << " , "
52  << (*it)->position().z() << " , "
53  << (*it)->position().perp() << " , "
54  << " rmin: " << (*it)->surface().rSpan().first
55  << " rmax: " << (*it)->surface().rSpan().second
56  << std::endl;
57  }
58 
59  for(vector<const GeomDet*>::const_iterator it=theBackDets.begin();
60  it!=theBackDets.end(); it++){
61  LogDebug("TkDetLayers") << "backDet phi,z,r: "
62  << (*it)->position().phi() << " , "
63  << (*it)->position().z() << " , "
64  << (*it)->position().perp() << " , "
65  << " rmin: " << (*it)->surface().rSpan().first
66  << " rmax: " << (*it)->surface().rSpan().second
67  << std::endl;
68  }
69 
70 }
#define LogDebug(id)
std::pair< float, float > front_radius_range_
std::vector< const GeomDet * > theBackDets
T perp() const
Definition: PV3DBase.h:72
GeometricSearchDet(bool doHaveGroups)
T z() const
Definition: PV3DBase.h:64
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
Phase1PixelBlade::~Phase1PixelBlade ( )

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 183 of file Phase1PixelBlade.cc.

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

Referenced by groupedCompatibleDetsV().

188 {
189 
190  const vector<const GeomDet*>& sBlade( subBlade( crossing.subLayerIndex()));
191 
192  return CompatibleDetToGroupAdder().add( *sBlade[crossing.closestDetIndex()],
193  tsos, prop, est, result);
194 }
int closestDetIndex() const
const std::vector< const GeomDet * > & subBlade(int ind) const
int subLayerIndex() const
tuple result
Definition: query.py:137
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
virtual const std::vector<const GeomDet*>& Phase1PixelBlade::basicComponents ( ) const
inlinevirtual

Implements GeometricSearchDet.

Definition at line 27 of file Phase1PixelBlade.h.

References theDets.

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

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 79 of file Phase1PixelBlade.cc.

80  {
81  edm::LogError("TkDetLayers") << "temporary dummy implementation of Phase1PixelBlade::compatible()!!" ;
82  return pair<bool,TrajectoryStateOnSurface>();
83 }
const vector< const GeometricSearchDet * > & Phase1PixelBlade::components ( ) const
virtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 74 of file Phase1PixelBlade.cc.

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

Definition at line 133 of file Phase1PixelBlade.cc.

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

Referenced by groupedCompatibleDetsV().

135 {
136  HelixPlaneCrossing::PositionType startPos( startingState.globalPosition());
137  HelixPlaneCrossing::DirectionType startDir( startingState.globalMomentum());
138  double rho( startingState.transverseCurvature());
139  HelixArbitraryPlaneCrossing crossing( startPos, startDir, rho, propDir);
140 
141  pair<bool,double> innerPath = crossing.pathLength( *theFrontDiskSector);
142  if (!innerPath.first) return SubLayerCrossings();
143 
144  GlobalPoint gInnerPoint( crossing.position(innerPath.second));
145  //Code for use of binfinder
146  //int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.perp());
147  //float innerDist = std::abs( theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.z());
148 
149  // int innerIndex = findBin(gInnerPoint.perp(),0);
150  int innerIndex = findBin2(gInnerPoint,0);
151 
152  //fixme gc patched for SLHC - force order here to be in z
153  //float innerDist = std::abs( findPosition(innerIndex,0).perp() - gInnerPoint.perp());
154  float innerDist = ( startingState.globalPosition() - gInnerPoint).mag();
155  SubLayerCrossing innerSLC( 0, innerIndex, gInnerPoint);
156 
157  pair<bool,double> outerPath = crossing.pathLength( *theBackDiskSector);
158  if (!outerPath.first) return SubLayerCrossings();
159 
160  GlobalPoint gOuterPoint( crossing.position(outerPath.second));
161  //Code for use of binfinder
162  //int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.perp());
163  //float outerDist = std::abs( theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.perp());
164  // int outerIndex = findBin(gOuterPoint.perp(),1);
165  int outerIndex = findBin2(gOuterPoint,1);
166 
167  //fixme gc patched for SLHC - force order here to be in z
168  //float outerDist = std::abs( findPosition(outerIndex,1).perp() - gOuterPoint.perp());
169  float outerDist = ( startingState.globalPosition() - gOuterPoint).mag();
170  SubLayerCrossing outerSLC( 1, outerIndex, gOuterPoint);
171 
172  if (innerDist < outerDist) {
173  return SubLayerCrossings( innerSLC, outerSLC, 0);
174  }
175  else {
176  return SubLayerCrossings( outerSLC, innerSLC, 1);
177  }
178 }
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 319 of file Phase1PixelBlade.cc.

References BoundingBox::corners(), Vector3DBase< T, FrameTag >::cross(), i, bookConverter::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.

319  {
320 
322  Vector posSum(0,0,0);
323  for (auto i : current_dets)
324  posSum += (*i).surface().position().basicVector();
325 
326  Surface::PositionType meanPos( 0.,0.,posSum.z()/float(current_dets.size()));
327 
328  // temporary plane - for the computation of bounds
329  const Plane& tmpplane = current_dets.front()->surface();
330 
331  GlobalVector xAxis;
332  GlobalVector yAxis;
334 
335  GlobalVector planeXAxis = tmpplane.toGlobal(LocalVector(1, 0, 0));
336  GlobalPoint planePosition = tmpplane.position();
337 
338  if (planePosition.x() * planeXAxis.x()
339  + planePosition.y() * planeXAxis.y() > 0.){
340  yAxis = planeXAxis;
341  } else {
342  yAxis = -planeXAxis;
343  }
344 
345  GlobalVector planeZAxis = tmpplane.toGlobal(LocalVector( 0, 0, 1));
346  if (planeZAxis.z() * planePosition.z() > 0.) {
347  zAxis = planeZAxis;
348  } else {
349  zAxis = -planeZAxis;
350  }
351 
352  xAxis = yAxis.cross(zAxis);
353 
355  Plane plane(meanPos, rotation);
356 
357  Surface::PositionType tmpPos = current_dets.front()->surface().position();
358 
359  float rmin(plane.toLocal(tmpPos).perp());
360  float rmax(plane.toLocal(tmpPos).perp());
361 
362  for (auto it : current_dets) {
363  vector<GlobalPoint> corners = BoundingBox().corners(it->specificSurface());
364  for (auto i : corners) {
365  float r = plane.toLocal(i).perp();
366  rmin = min(rmin, r);
367  rmax = max(rmax, r);
368  }
369  }
370 
371  return std::make_pair(rmin, rmax);
372 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
int i
Definition: DBlmapReader.cc:9
Local3DVector LocalVector
Definition: LocalVector.h:12
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
T y() const
Definition: PV3DBase.h:63
Definition: Plane.h:17
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
T z() const
Definition: PV3DBase.h:64
T min(T a, T b)
Definition: MathUtil.h:58
static std::vector< GlobalPoint > corners(const Plane &)
Definition: BoundingBox.cc:24
TkRotation< float > RotationType
tuple zAxis
Definition: MetAnalyzer.py:56
T x() const
Definition: PV3DBase.h:62
const PositionType & position() const
float Phase1PixelBlade::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
private

Definition at line 197 of file Phase1PixelBlade.cc.

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

Referenced by groupedCompatibleDetsV().

200 {
201  return
202  est.maximalLocalDisplacement(tsos, det->surface()).x();
203 }
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
int Phase1PixelBlade::findBin ( float  R,
int  layer 
) const
private

Definition at line 272 of file Phase1PixelBlade.cc.

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

273 {
274  vector<const GeomDet*> localDets = diskSectorIndex==0 ? theFrontDets : theBackDets;
275 
276 
277  int theBin = 0;
278  float rDiff = std::abs( R - localDets.front()->surface().position().perp());
279  for (vector<const GeomDet*>::const_iterator i=localDets.begin(); i !=localDets.end(); i++){
280  float testDiff = std::abs( R - (**i).surface().position().perp());
281  if ( testDiff < rDiff) {
282  rDiff = testDiff;
283  theBin = i - localDets.begin();
284  }
285  }
286  return theBin;
287 }
int i
Definition: DBlmapReader.cc:9
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 290 of file Phase1PixelBlade.cc.

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

Referenced by computeCrossings().

291 {
292  const vector<const GeomDet*> & localDets = diskSectorIndex==0 ? theFrontDets : theBackDets;
293 
294 
295 
296  int theBin = 0;
297  float sDiff = (thispoint - localDets.front()->surface().position()).mag();
298 
299  for (vector<const GeomDet*>::const_iterator i=localDets.begin(); i !=localDets.end(); i++){
300  float testDiff = ( thispoint - (**i).surface().position()).mag();
301  if ( testDiff < sDiff) {
302  sDiff = testDiff;
303  theBin = i - localDets.begin();
304  }
305  }
306  return theBin;
307 }
int i
Definition: DBlmapReader.cc:9
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 312 of file Phase1PixelBlade.cc.

References theBackDets, and theFrontDets.

313 {
314  vector<const GeomDet*> diskSector = diskSectorType == 0 ? theFrontDets : theBackDets;
315  return (diskSector[index])->surface().position();
316 }
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
virtual

Reimplemented from GeometricSearchDet.

Definition at line 88 of file Phase1PixelBlade.cc.

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

91  {
92 
93 
94  SubLayerCrossings crossings;
95 
96  crossings = computeCrossings( tsos, prop.propagationDirection());
97  if(! crossings.isValid()) return;
98 
99  vector<DetGroup> closestResult;
100  addClosest( tsos, prop, est, crossings.closest(), closestResult);
101 
102  if (closestResult.empty()) {
103  vector<DetGroup> nextResult;
104  addClosest( tsos, prop, est, crossings.other(), nextResult);
105  if(nextResult.empty()) return;
106 
107  //DetGroupElement nextGel( nextResult.front().front());
108  //int crossingSide = LayerCrossingSide().endcapSide( nextGel.trajectoryState(), prop);
109 
111  0,0);//fixme gc patched for SLHC - already correctly sorted for SLHC
112  //crossings.closestIndex(), crossingSide);
113  }
114  else {
115  DetGroupElement closestGel( closestResult.front().front());
116  float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
117 
118  searchNeighbors( tsos, prop, est, crossings.closest(), window,
119  closestResult, false);
120 
121  vector<DetGroup> nextResult;
122  searchNeighbors( tsos, prop, est, crossings.other(), window,
123  nextResult, true);
124 
125  //int crossingSide = LayerCrossingSide().endcapSide( closestGel.trajectoryState(), prop);
127  0,0);//fixme gc patched for SLHC - already correctly sorted for SLHC
128  //crossings.closestIndex(), crossingSide);
129  }
130 }
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
def window
Definition: svgfig.py:642
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:155
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
tuple result
Definition: query.py:137
def move
Definition: eostools.py:510
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 245 of file Phase1PixelBlade.cc.

References funct::abs(), Surface::bounds(), Bounds::length(), GeomDet::surface(), GloballyPositioned< T >::toLocal(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by searchNeighbors().

246 {
247  // check if the z window around TSOS overlaps with the detector theDet (with a 1% margin added)
248 
249  // const float tolerance = 0.1;
250  const float relativeMargin = 1.01;
251 
252  LocalPoint localCrossPoint( det.surface().toLocal(crossPoint));
253  // if (std::abs(localCrossPoint.z()) > tolerance) {
254  // edm::LogInfo(TkDetLayers) << "Phase1PixelBlade::overlap calculation assumes point on surface, but it is off by "
255  // << localCrossPoint.z() ;
256  // }
257 
258  float localX = localCrossPoint.x();
259  float detHalfLength = det.surface().bounds().length()/2.;
260 
261  // edm::LogInfo(TkDetLayers) << "Phase1PixelBlade::overlap: Det at " << det.position() << " hit at " << localY
262  // << " Window " << window << " halflength " << detHalfLength ;
263 
264  if ( ( std::abs(localX)-window) < relativeMargin*detHalfLength ) { // FIXME: margin hard-wired!
265  return true;
266  } else {
267  return false;
268  }
269 }
def window
Definition: svgfig.py:642
virtual float length() const =0
const Bounds & bounds() const
Definition: Surface.h:128
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
LocalPoint toLocal(const GlobalPoint &gp) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
T x() const
Definition: PV3DBase.h:62
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 208 of file Phase1PixelBlade.cc.

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

Referenced by groupedCompatibleDetsV().

215 {
216  GlobalPoint gCrossingPos = crossing.position();
217  const vector<const GeomDet*>& sBlade( subBlade( crossing.subLayerIndex()));
218 
219  int closestIndex = crossing.closestDetIndex();
220  int negStartIndex = closestIndex-1;
221  int posStartIndex = closestIndex+1;
222 
223  if (checkClosest) { // must decide if the closest is on the neg or pos side
224  if (gCrossingPos.perp() < sBlade[closestIndex]->surface().position().perp()) {
225  posStartIndex = closestIndex;
226  }
227  else {
228  negStartIndex = closestIndex;
229  }
230  }
231 
232  typedef CompatibleDetToGroupAdder Adder;
233  for (int idet=negStartIndex; idet >= 0; idet--) {
234  if (!overlap( gCrossingPos, *sBlade[idet], window)) break;
235  if (!Adder::add( *sBlade[idet], tsos, prop, est, result)) break;
236  }
237  for (int idet=posStartIndex; idet < static_cast<int>(sBlade.size()); idet++) {
238  if (!overlap( gCrossingPos, *sBlade[idet], window)) break;
239  if (!Adder::add( *sBlade[idet], tsos, prop, est, result)) break;
240  }
241 }
def window
Definition: svgfig.py:642
T perp() const
Definition: PV3DBase.h:72
int closestDetIndex() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
const GlobalPoint & position() const
const std::vector< const GeomDet * > & subBlade(int ind) const
int subLayerIndex() const
tuple result
Definition: query.py:137
bool overlap(const GlobalPoint &gpos, const GeomDet &det, float phiWin) const
virtual const BoundDiskSector& Phase1PixelBlade::specificSurface ( ) const
inlinevirtual

Definition at line 42 of file Phase1PixelBlade.h.

References theDiskSector.

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

Definition at line 79 of file Phase1PixelBlade.h.

References theBackDets, and theFrontDets.

Referenced by addClosest(), and searchNeighbors().

79  {
80  return (ind==0 ? theFrontDets : theBackDets);
81  }
std::vector< const GeomDet * > theBackDets
std::vector< const GeomDet * > theFrontDets
virtual const BoundSurface& Phase1PixelBlade::surface ( ) const
inlinevirtual

The surface of the GeometricSearchDet.

Implements GeometricSearchDet.

Definition at line 25 of file Phase1PixelBlade.h.

References theDiskSector.

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

Member Data Documentation

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

Definition at line 90 of file Phase1PixelBlade.h.

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

Definition at line 89 of file Phase1PixelBlade.h.

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

Definition at line 88 of file Phase1PixelBlade.h.

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

ReferenceCountingPointer<BoundDiskSector> Phase1PixelBlade::theBackDiskSector
private

Definition at line 94 of file Phase1PixelBlade.h.

Referenced by computeCrossings(), and Phase1PixelBlade().

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

Definition at line 86 of file Phase1PixelBlade.h.

Referenced by basicComponents(), and Phase1PixelBlade().

ReferenceCountingPointer<BoundDiskSector> Phase1PixelBlade::theDiskSector
private

Definition at line 92 of file Phase1PixelBlade.h.

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

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

Definition at line 87 of file Phase1PixelBlade.h.

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

ReferenceCountingPointer<BoundDiskSector> Phase1PixelBlade::theFrontDiskSector
private

Definition at line 93 of file Phase1PixelBlade.h.

Referenced by computeCrossings(), and Phase1PixelBlade().