CMS 3D CMS Logo

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

#include <TIDRing.h>

Inheritance diagram for TIDRing:
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 __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))
 
virtual const BoundDiskspecificSurface () const
 
const BoundSurfacesurface () const override
 The surface of the GeometricSearchDet. More...
 
 TIDRing (std::vector< const GeomDet * > &innerDets, std::vector< const GeomDet * > &outerDets)
 
 ~TIDRing () 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 __attribute__((hot))
 
SubLayerCrossings computeCrossings (const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
 
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 * > & subLayer (int ind) const
 

Private Attributes

BinFinderType theBackBinFinder
 
std::vector< const GeomDet * > theBackDets
 
ReferenceCountingPointer< BoundDisktheBackDisk
 
std::vector< const GeomDet * > theDets
 
ReferenceCountingPointer< BoundDisktheDisk
 
BinFinderType theFrontBinFinder
 
std::vector< const GeomDet * > theFrontDets
 
ReferenceCountingPointer< BoundDisktheFrontDisk
 

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 TID rings

Definition at line 13 of file TIDRing.h.

Member Typedef Documentation

◆ BinFinderType

Definition at line 68 of file TIDRing.h.

Constructor & Destructor Documentation

◆ TIDRing()

TIDRing::TIDRing ( std::vector< const GeomDet * > &  innerDets,
std::vector< const GeomDet * > &  outerDets 
)

Definition at line 24 of file TIDRing.cc.

25  : GeometricSearchDet(true),
26  theFrontDets(innerDets.begin(), innerDets.end()),
27  theBackDets(outerDets.begin(), outerDets.end()) {
28  theDets.assign(theFrontDets.begin(), theFrontDets.end());
29  theDets.insert(theDets.end(), theBackDets.begin(), theBackDets.end());
30 
31  // the dets should be already phi-ordered. TO BE CHECKED
32  //sort( theFrontDets.begin(), theFrontDets.end(), DetLessPhi() );
33  //sort( theBackDets.begin(), theBackDets.end(), DetLessPhi() );
34 
36 
39 
40  theFrontBinFinder = BinFinderType(theFrontDets.front()->surface().position().phi(), theFrontDets.size());
41  theBackBinFinder = BinFinderType(theBackDets.front()->surface().position().phi(), theBackDets.size());
42 
43  LogDebug("TkDetLayers") << "DEBUG INFO for TIDRing";
44  for (vector<const GeomDet*>::const_iterator it = theFrontDets.begin(); it != theFrontDets.end(); it++) {
45  LogDebug("TkDetLayers") << "frontDet phi,z,r: " << (*it)->surface().position().phi() << " , "
46  << (*it)->surface().position().z() << " , " << (*it)->surface().position().perp();
47  }
48 
49  for (vector<const GeomDet*>::const_iterator it = theBackDets.begin(); it != theBackDets.end(); it++) {
50  LogDebug("TkDetLayers") << "backDet phi,z,r: " << (*it)->surface().position().phi() << " , "
51  << (*it)->surface().position().z() << " , " << (*it)->surface().position().perp();
52  }
53 }

References LogDebug, theBackBinFinder, theBackDets, theBackDisk, theDets, theDisk, theFrontBinFinder, theFrontDets, and theFrontDisk.

◆ ~TIDRing()

TIDRing::~TIDRing ( )
override

Definition at line 55 of file TIDRing.cc.

55 {}

Member Function Documentation

◆ addClosest()

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

Definition at line 132 of file TIDRing.cc.

136  {
137  const vector<const GeomDet*>& sub(subLayer(crossing.subLayerIndex()));
138  const GeomDet* det(sub[crossing.closestDetIndex()]);
139  return CompatibleDetToGroupAdder::add(*det, tsos, prop, est, result);
140 }

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

Referenced by groupedCompatibleDetsV().

◆ basicComponents()

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

Implements GeometricSearchDet.

Definition at line 21 of file TIDRing.h.

21 { return theDets; }

References theDets.

◆ compatible()

pair< bool, TrajectoryStateOnSurface > TIDRing::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 TIDRing.cc.

63  {
64  edm::LogError("TkDetLayers") << "temporary dummy implementation of TIDRing::compatible()!!";
65  return pair<bool, TrajectoryStateOnSurface>();
66 }

◆ components()

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

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 57 of file TIDRing.cc.

57  {
58  throw DetLayerException("TIDRing doesn't have GeometricSearchDet components");
59 }

◆ computeCrossings()

SubLayerCrossings TIDRing::computeCrossings ( const TrajectoryStateOnSurface tsos,
PropagationDirection  propDir 
) const
private

Definition at line 95 of file TIDRing.cc.

96  {
97  HelixPlaneCrossing::PositionType startPos(startingState.globalPosition());
98  HelixPlaneCrossing::DirectionType startDir(startingState.globalMomentum());
99 
100  auto rho = startingState.transverseCurvature();
101 
102  HelixForwardPlaneCrossing crossing(startPos, startDir, rho, propDir);
103 
104  pair<bool, double> frontPath = crossing.pathLength(*theFrontDisk);
105  if (!frontPath.first)
106  return SubLayerCrossings();
107 
108  pair<bool, double> backPath = crossing.pathLength(*theBackDisk);
109  if (!backPath.first)
110  return SubLayerCrossings();
111 
112  GlobalPoint gFrontPoint(crossing.position(frontPath.second));
113  GlobalPoint gBackPoint(crossing.position(backPath.second));
114 
115  int frontIndex = theFrontBinFinder.binIndex(gFrontPoint.barePhi());
116  SubLayerCrossing frontSLC(0, frontIndex, gFrontPoint);
117 
118  int backIndex = theBackBinFinder.binIndex(gBackPoint.barePhi());
119  SubLayerCrossing backSLC(1, backIndex, gBackPoint);
120 
121  // 0ss: frontDisk has index=0, backDisk has index=1
122  float frontDist = std::abs(Geom::deltaPhi(gFrontPoint.barePhi(), theFrontDets[frontIndex]->surface().phi()));
123  float backDist = std::abs(Geom::deltaPhi(gBackPoint.barePhi(), theBackDets[backIndex]->surface().phi()));
124 
125  if (frontDist < backDist) {
126  return SubLayerCrossings(frontSLC, backSLC, 0);
127  } else {
128  return SubLayerCrossings(backSLC, frontSLC, 1);
129  }
130 }

References funct::abs(), PeriodicBinFinderInPhi< T >::binIndex(), SiPixelRawToDigiRegional_cfi::deltaPhi, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), HelixForwardPlaneCrossing::pathLength(), HelixForwardPlaneCrossing::position(), rho, theBackBinFinder, theBackDets, theBackDisk, theFrontBinFinder, theFrontDets, theFrontDisk, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

◆ groupedCompatibleDetsV()

void TIDRing::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 TIDRing.cc.

71  {
72  SubLayerCrossings crossings;
73  crossings = computeCrossings(tsos, prop.propagationDirection());
74  if (!crossings.isValid())
75  return;
76 
77  std::vector<DetGroup> closestResult;
78  addClosest(tsos, prop, est, crossings.closest(), closestResult);
79  if (closestResult.empty())
80  return;
81 
82  DetGroupElement closestGel(closestResult.front().front());
83  float phiWindow = tkDetUtil::computeWindowSize(closestGel.det(), closestGel.trajectoryState(), est);
84  searchNeighbors(tsos, prop, est, crossings.closest(), phiWindow, closestResult, false);
85 
86  vector<DetGroup> nextResult;
87  searchNeighbors(tsos, prop, est, crossings.other(), phiWindow, nextResult, true);
88 
89  int crossingSide = LayerCrossingSide().endcapSide(closestGel.trajectoryState(), prop);
91  std::move(closestResult), std::move(nextResult), result, crossings.closestIndex(), crossingSide);
92 }

References addClosest(), SubLayerCrossings::closest(), SubLayerCrossings::closestIndex(), computeCrossings(), tkDetUtil::computeWindowSize(), LayerCrossingSide::endcapSide(), SubLayerCrossings::isValid(), eostools::move(), DetGroupMerger::orderAndMergeTwoLevels(), SubLayerCrossings::other(), trackingPOGFilters_cfi::phiWindow, Propagator::propagationDirection(), mps_fire::result, and searchNeighbors().

Referenced by TIDLayer::groupedCompatibleDetsV().

◆ searchNeighbors()

void TIDRing::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 142 of file TIDRing.cc.

148  {
149  const GlobalPoint& gCrossingPos = crossing.position();
150 
151  const vector<const GeomDet*>& sLayer(subLayer(crossing.subLayerIndex()));
152 
153  int closestIndex = crossing.closestDetIndex();
154  int negStartIndex = closestIndex - 1;
155  int posStartIndex = closestIndex + 1;
156 
157  if (checkClosest) { // must decide if the closest is on the neg or pos side
158  if (Geom::phiLess(gCrossingPos.barePhi(), sLayer[closestIndex]->surface().phi())) {
159  posStartIndex = closestIndex;
160  } else {
161  negStartIndex = closestIndex;
162  }
163  }
164 
165  const BinFinderType& binFinder = (crossing.subLayerIndex() == 0 ? theFrontBinFinder : theBackBinFinder);
166 
167  typedef CompatibleDetToGroupAdder Adder;
168  int half = sLayer.size() / 2; // to check if dets are called twice....
169  for (int idet = negStartIndex; idet >= negStartIndex - half; idet--) {
170  const GeomDet& neighborDet = *sLayer[binFinder.binIndex(idet)];
171  if (!tkDetUtil::overlapInPhi(gCrossingPos, neighborDet, window))
172  break;
173  if (!Adder::add(neighborDet, tsos, prop, est, result))
174  break;
175  // maybe also add shallow crossing angle test here???
176  }
177  for (int idet = posStartIndex; idet < posStartIndex + half; idet++) {
178  const GeomDet& neighborDet = *sLayer[binFinder.binIndex(idet)];
179  if (!tkDetUtil::overlapInPhi(gCrossingPos, neighborDet, window))
180  break;
181  if (!Adder::add(neighborDet, tsos, prop, est, result))
182  break;
183  // maybe also add shallow crossing angle test here???
184  }
185 }

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(), theBackBinFinder, theFrontBinFinder, and svgfig::window().

Referenced by groupedCompatibleDetsV().

◆ specificSurface()

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

Definition at line 35 of file TIDRing.h.

35 { return *theDisk; }

References theDisk.

◆ subLayer()

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

Definition at line 57 of file TIDRing.h.

57 { return (ind == 0 ? theFrontDets : theBackDets); }

References theBackDets, and theFrontDets.

Referenced by addClosest(), and searchNeighbors().

◆ surface()

const BoundSurface& TIDRing::surface ( ) const
inlineoverridevirtual

The surface of the GeometricSearchDet.

Implements GeometricSearchDet.

Definition at line 19 of file TIDRing.h.

19 { return *theDisk; }

References theDisk.

Member Data Documentation

◆ theBackBinFinder

BinFinderType TIDRing::theBackBinFinder
private

Definition at line 71 of file TIDRing.h.

Referenced by computeCrossings(), searchNeighbors(), and TIDRing().

◆ theBackDets

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

Definition at line 62 of file TIDRing.h.

Referenced by computeCrossings(), subLayer(), and TIDRing().

◆ theBackDisk

ReferenceCountingPointer<BoundDisk> TIDRing::theBackDisk
private

Definition at line 66 of file TIDRing.h.

Referenced by computeCrossings(), and TIDRing().

◆ theDets

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

Definition at line 60 of file TIDRing.h.

Referenced by basicComponents(), and TIDRing().

◆ theDisk

ReferenceCountingPointer<BoundDisk> TIDRing::theDisk
private

Definition at line 64 of file TIDRing.h.

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

◆ theFrontBinFinder

BinFinderType TIDRing::theFrontBinFinder
private

Definition at line 70 of file TIDRing.h.

Referenced by computeCrossings(), searchNeighbors(), and TIDRing().

◆ theFrontDets

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

Definition at line 61 of file TIDRing.h.

Referenced by computeCrossings(), subLayer(), and TIDRing().

◆ theFrontDisk

ReferenceCountingPointer<BoundDisk> TIDRing::theFrontDisk
private

Definition at line 65 of file TIDRing.h.

Referenced by computeCrossings(), and TIDRing().

SubLayerCrossing::position
const GlobalPoint & position() const
Definition: SubLayerCrossings.h:14
tkDetUtil::computeWindowSize
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
Definition: TkDetUtil.cc:10
SubLayerCrossings::isValid
bool isValid()
Definition: SubLayerCrossings.h:28
GeometricSearchDet::GeometricSearchDet
GeometricSearchDet(bool doHaveGroups)
Definition: GeometricSearchDet.h:24
GeomDet
Definition: GeomDet.h:27
TIDRing::theDisk
ReferenceCountingPointer< BoundDisk > theDisk
Definition: TIDRing.h:64
LayerCrossingSide
Definition: LayerCrossingSide.h:15
TIDRing::theBackDets
std::vector< const GeomDet * > theBackDets
Definition: TIDRing.h:62
SubLayerCrossings::closestIndex
int closestIndex() const
Definition: SubLayerCrossings.h:31
TIDRing::subLayer
const std::vector< const GeomDet * > & subLayer(int ind) const
Definition: TIDRing.h:57
svgfig.window
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
TIDRing::addClosest
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
Definition: TIDRing.cc:132
TIDRing::theBackDisk
ReferenceCountingPointer< BoundDisk > theBackDisk
Definition: TIDRing.h:66
TIDRing::computeCrossings
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
Definition: TIDRing.cc:95
TIDRing::theFrontDets
std::vector< const GeomDet * > theFrontDets
Definition: TIDRing.h:61
TIDRing::theDets
std::vector< const GeomDet * > theDets
Definition: TIDRing.h:60
TIDRing::searchNeighbors
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))
Definition: TIDRing.cc:142
LayerCrossingSide::endcapSide
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
Definition: LayerCrossingSide.h:31
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
Propagator::propagationDirection
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
TIDRing::theBackBinFinder
BinFinderType theBackBinFinder
Definition: TIDRing.h:71
Point3DBase< float, GlobalTag >
trackingPOGFilters_cfi.phiWindow
phiWindow
Definition: trackingPOGFilters_cfi.py:109
DetGroupMerger::orderAndMergeTwoLevels
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
Definition: DetGroupMerger.cc:6
DDAxes::rho
CompatibleDetToGroupAdder::add
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
Definition: CompatibleDetToGroupAdder.cc:7
SubLayerCrossings::closest
const SubLayerCrossing & closest() const
Definition: SubLayerCrossings.h:29
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
Geom::phiLess
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
PV3DBase::barePhi
T barePhi() const
Definition: PV3DBase.h:65
PVValHelper::add
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
Definition: PVValidationHelpers.cc:12
TIDRing::theFrontDisk
ReferenceCountingPointer< BoundDisk > theFrontDisk
Definition: TIDRing.h:65
SubLayerCrossing::closestDetIndex
int closestDetIndex() const
Definition: SubLayerCrossings.h:13
DetGroupElement
Definition: DetGroup.h:10
tkDetUtil::overlapInPhi
bool overlapInPhi(float phi, const GeomDet &det, float phiWindow)
Definition: TkDetUtil.h:18
DetLayerException
Common base class.
Definition: DetLayerException.h:15
eostools.move
def move(src, dest)
Definition: eostools.py:511
CompatibleDetToGroupAdder
Definition: CompatibleDetToGroupAdder.h:13
SubLayerCrossings::other
const SubLayerCrossing & other() const
Definition: SubLayerCrossings.h:30
PeriodicBinFinderInPhi::binIndex
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
Definition: PeriodicBinFinderInPhi.h:25
ForwardRingDiskBuilderFromDet
Definition: ForwardRingDiskBuilderFromDet.h:19
SubLayerCrossing
Definition: SubLayerCrossings.h:7
SubLayerCrossing::subLayerIndex
int subLayerIndex() const
Definition: SubLayerCrossings.h:12
mps_fire.result
result
Definition: mps_fire.py:303
HelixForwardPlaneCrossing
Definition: HelixForwardPlaneCrossing.h:13
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TIDRing::theFrontBinFinder
BinFinderType theFrontBinFinder
Definition: TIDRing.h:70
Basic3DVector< float >
TIDRing::BinFinderType
PeriodicBinFinderInPhi< float > BinFinderType
Definition: TIDRing.h:68
SubLayerCrossings
Definition: SubLayerCrossings.h:22