CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
Phase2EndcapSingleRing Class Referencefinal

#include <Phase2EndcapSingleRing.h>

Inheritance diagram for Phase2EndcapSingleRing:
GeometricSearchDet

Public Member Functions

const std::vector< const GeomDet * > & basicComponents () const override
 
std::pair< bool, TrajectoryStateOnSurfacecompatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
 
const std::vector< const GeometricSearchDet * > & components () const override
 Returns basic components, if any. More...
 
void groupedCompatibleDetsV (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override
 
 Phase2EndcapSingleRing (std::vector< const GeomDet *> &allDets)
 
virtual const BoundDiskspecificSurface () const
 
const BoundSurfacesurface () const override
 The surface of the GeometricSearchDet. More...
 
 ~Phase2EndcapSingleRing () override
 
- 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::PositionTypeposition () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Private Types

typedef PeriodicBinFinderInPhi< float > BinFinderType
 

Private Member Functions

bool addClosest (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const
 
SubLayerCrossing computeCrossing (const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const
 
void searchNeighbors (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const
 
const std::vector< const GeomDet * > & subLayer (int ind) const
 

Private Attributes

BinFinderType theBinFinder
 
std::vector< const GeomDet * > theDets
 
ReferenceCountingPointer< BoundDisktheDisk
 

Additional Inherited Members

- Public Types inherited from GeometricSearchDet
typedef std::pair< const GeomDet *, TrajectoryStateOnSurfaceDetWithState
 
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 Phase2 SubDisk rings

Definition at line 13 of file Phase2EndcapSingleRing.h.

Member Typedef Documentation

◆ BinFinderType

Definition at line 63 of file Phase2EndcapSingleRing.h.

Constructor & Destructor Documentation

◆ Phase2EndcapSingleRing()

Phase2EndcapSingleRing::Phase2EndcapSingleRing ( std::vector< const GeomDet *> &  allDets)

Definition at line 24 of file Phase2EndcapSingleRing.cc.

References LogDebug, theBinFinder, theDets, and theDisk.

25  : GeometricSearchDet(true), theDets(allDets.begin(), allDets.end()) {
27 
28  theBinFinder = BinFinderType(theDets.front()->surface().position().phi(), theDets.size());
29 
30 #ifdef EDM_ML_DEBUG
31  LogDebug("TkDetLayers") << "DEBUG INFO for Phase2EndcapSingleRing";
32  for (vector<const GeomDet*>::const_iterator it = theDets.begin(); it != theDets.end(); it++) {
33  LogDebug("TkDetLayers") << "Det detId,phi,z,r: " << (*it)->geographicalId().rawId() << " , "
34  << (*it)->surface().position().phi() << " , " << (*it)->surface().position().z() << " , "
35  << (*it)->surface().position().perp();
36  }
37 
38 #endif
39 }
PeriodicBinFinderInPhi< float > BinFinderType
GeometricSearchDet(bool doHaveGroups)
std::vector< const GeomDet * > theDets
ReferenceCountingPointer< BoundDisk > theDisk
#define LogDebug(id)

◆ ~Phase2EndcapSingleRing()

Phase2EndcapSingleRing::~Phase2EndcapSingleRing ( )
overridedefault

Member Function Documentation

◆ addClosest()

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

Definition at line 100 of file Phase2EndcapSingleRing.cc.

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

Referenced by groupedCompatibleDetsV().

104  {
105  const vector<const GeomDet*>& sub(subLayer(crossing.subLayerIndex()));
106 
107  const GeomDet* det(sub[crossing.closestDetIndex()]);
108 
109  bool firstgroup = CompatibleDetToGroupAdder::add(*det, tsos, prop, est, result);
110 
111  return firstgroup;
112 }
const std::vector< const GeomDet * > & subLayer(int ind) const
int closestDetIndex() 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))

◆ basicComponents()

const std::vector<const GeomDet*>& Phase2EndcapSingleRing::basicComponents ( ) const
inlineoverridevirtual

Implements GeometricSearchDet.

Definition at line 21 of file Phase2EndcapSingleRing.h.

References theDets.

21 { return theDets; }
std::vector< const GeomDet * > theDets

◆ compatible()

pair< bool, TrajectoryStateOnSurface > Phase2EndcapSingleRing::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 47 of file Phase2EndcapSingleRing.cc.

49  {
50  edm::LogError("TkDetLayers") << "temporary dummy implementation of Phase2EndcapSingleRing::compatible()!!";
51  return pair<bool, TrajectoryStateOnSurface>();
52 }
Log< level::Error, false > LogError

◆ components()

const vector< const GeometricSearchDet * > & Phase2EndcapSingleRing::components ( ) const
overridevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 43 of file Phase2EndcapSingleRing.cc.

43  {
44  throw DetLayerException("Phase2EndcapSingleRing doesn't have GeometricSearchDet components");
45 }
Common base class.

◆ computeCrossing()

SubLayerCrossing Phase2EndcapSingleRing::computeCrossing ( const TrajectoryStateOnSurface tsos,
PropagationDirection  propDir 
) const
private

Definition at line 80 of file Phase2EndcapSingleRing.cc.

References PeriodicBinFinderInPhi< T >::binIndex(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), rho, theBinFinder, theDisk, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

81  {
82  auto rho = startingState.transverseCurvature();
83 
84  HelixPlaneCrossing::PositionType startPos(startingState.globalPosition());
85  HelixPlaneCrossing::DirectionType startDir(startingState.globalMomentum());
86  HelixForwardPlaneCrossing crossing(startPos, startDir, rho, propDir);
87 
88  pair<bool, double> frontPath = crossing.pathLength(*theDisk);
89  if (!frontPath.first)
90  return SubLayerCrossing();
91 
92  GlobalPoint gFrontPoint(crossing.position(frontPath.second)); //There is only one path
93 
94  int frontIndex = theBinFinder.binIndex(gFrontPoint.barePhi());
95  SubLayerCrossing frontSLC(0, frontIndex, gFrontPoint);
96 
97  return frontSLC;
98 }
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
ReferenceCountingPointer< BoundDisk > theDisk

◆ groupedCompatibleDetsV()

void Phase2EndcapSingleRing::groupedCompatibleDetsV ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
) const
overridevirtual

Reimplemented from GeometricSearchDet.

Definition at line 54 of file Phase2EndcapSingleRing.cc.

References addClosest(), DetGroupMerger::addSameLevel(), computeCrossing(), tkDetUtil::computeWindowSize(), SubLayerCrossing::isValid(), eostools::move(), trackingPOGFilters_cfi::phiWindow, Propagator::propagationDirection(), mps_fire::result, and searchNeighbors().

57  {
58  SubLayerCrossing crossing;
59 
60  crossing = computeCrossing(tsos, prop.propagationDirection());
61 
62  if (!crossing.isValid())
63  return;
64 
65  std::vector<DetGroup> closestResult;
66 
67  addClosest(tsos, prop, est, crossing, closestResult);
68  if (closestResult.empty())
69  return;
70 
71  DetGroupElement closestGel(closestResult.front().front());
72 
73  float phiWindow = tkDetUtil::computeWindowSize(closestGel.det(), closestGel.trajectoryState(), est);
74 
75  searchNeighbors(tsos, prop, est, crossing, phiWindow, closestResult, false);
76 
78 }
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
SubLayerCrossing computeCrossing(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
Definition: TkDetUtil.cc:10
static void addSameLevel(std::vector< DetGroup > &&gvec, std::vector< DetGroup > &result)
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const
def move(src, dest)
Definition: eostools.py:511

◆ searchNeighbors()

void Phase2EndcapSingleRing::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 114 of file Phase2EndcapSingleRing.cc.

References PVValHelper::add(), PV3DBase< T, PVType, FrameType >::barePhi(), PeriodicBinFinderInPhi< T >::binIndex(), SubLayerCrossing::closestDetIndex(), tkDetUtil::overlapInPhi(), Geom::phiLess(), SubLayerCrossing::position(), mps_fire::result, subLayer(), SubLayerCrossing::subLayerIndex(), theBinFinder, and svgfig::window().

Referenced by groupedCompatibleDetsV().

120  {
121  const GlobalPoint& gCrossingPos = crossing.position();
122 
123  const vector<const GeomDet*>& sLayer(subLayer(crossing.subLayerIndex()));
124 
125  int closestIndex = crossing.closestDetIndex();
126  int negStartIndex = closestIndex - 1;
127  int posStartIndex = closestIndex + 1;
128 
129  if (checkClosest) { // must decide if the closest is on the neg or pos side
130  if (Geom::phiLess(gCrossingPos.barePhi(), sLayer[closestIndex]->surface().phi())) {
131  posStartIndex = closestIndex;
132  } else {
133  negStartIndex = closestIndex;
134  }
135  }
136 
137  const BinFinderType& binFinder = theBinFinder;
138 
139  typedef CompatibleDetToGroupAdder Adder;
140  int half = sLayer.size() / 2; // to check if dets are called twice....
141  for (int idet = negStartIndex; idet >= negStartIndex - half; idet--) {
142  const GeomDet& neighborDet = *sLayer[binFinder.binIndex(idet)];
143  if (!tkDetUtil::overlapInPhi(gCrossingPos, neighborDet, window))
144  break;
145  if (!Adder::add(neighborDet, tsos, prop, est, result))
146  break;
147  }
148  for (int idet = posStartIndex; idet < posStartIndex + half; idet++) {
149  const GeomDet& neighborDet = *sLayer[binFinder.binIndex(idet)];
150  if (!tkDetUtil::overlapInPhi(gCrossingPos, neighborDet, window))
151  break;
152  if (!Adder::add(neighborDet, tsos, prop, est, result))
153  break;
154  }
155 }
PeriodicBinFinderInPhi< float > BinFinderType
bool overlapInPhi(float phi, const GeomDet &det, float phiWindow)
Definition: TkDetUtil.h:32
T barePhi() const
Definition: PV3DBase.h:65
const std::vector< const GeomDet * > & subLayer(int ind) const
const GlobalPoint & position() const
int closestDetIndex() const
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
Definition: svgfig.py:643
int subLayerIndex() const
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
void add(std::map< std::string, TH1 *> &h, TH1 *hist)

◆ specificSurface()

virtual const BoundDisk& Phase2EndcapSingleRing::specificSurface ( ) const
inlinevirtual

Definition at line 35 of file Phase2EndcapSingleRing.h.

References theDisk.

35 { return *theDisk; }
ReferenceCountingPointer< BoundDisk > theDisk

◆ subLayer()

const std::vector<const GeomDet*>& Phase2EndcapSingleRing::subLayer ( int  ind) const
inlineprivate

Definition at line 56 of file Phase2EndcapSingleRing.h.

References theDets.

Referenced by addClosest(), and searchNeighbors().

56 { return theDets; }
std::vector< const GeomDet * > theDets

◆ surface()

const BoundSurface& Phase2EndcapSingleRing::surface ( ) const
inlineoverridevirtual

The surface of the GeometricSearchDet.

Implements GeometricSearchDet.

Definition at line 19 of file Phase2EndcapSingleRing.h.

References theDisk.

19 { return *theDisk; }
ReferenceCountingPointer< BoundDisk > theDisk

Member Data Documentation

◆ theBinFinder

BinFinderType Phase2EndcapSingleRing::theBinFinder
private

◆ theDets

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

Definition at line 59 of file Phase2EndcapSingleRing.h.

Referenced by basicComponents(), Phase2EndcapSingleRing(), and subLayer().

◆ theDisk

ReferenceCountingPointer<BoundDisk> Phase2EndcapSingleRing::theDisk
private