CMS 3D CMS Logo

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

#include <TOBRod.h>

Inheritance diagram for TOBRod:
DetRod GeometricSearchDet

Public Types

typedef PeriodicBinFinderInZ< float > BinFinderType
 
- Public Types inherited from GeometricSearchDet
typedef std::pair< const GeomDet *, TrajectoryStateOnSurfaceDetWithState
 
typedef BoundSurface::PositionType PositionType
 
typedef BoundSurface::RotationType RotationType
 
typedef TrajectoryStateOnSurface TrajectoryState
 

Public Member Functions

const std::vector< const GeomDet * > & basicComponents () const override
 
std::pair< bool, TrajectoryStateOnSurfacecompatible (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))
 
 TOBRod (std::vector< const GeomDet * > &innerDets, std::vector< const GeomDet * > &outerDets) __attribute__((cold))
 
 ~TOBRod () override __attribute__((cold))
 
- Public Member Functions inherited from DetRod
 GeometricSearchDet (bool doHaveGroups)
 
virtual const PlanespecificSurface () const final
 Return the rod surface as a Plane. More...
 
const BoundSurfacesurface () const final
 The surface of the GeometricSearchDet. More...
 
 ~DetRod () 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 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))
 
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) 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 * > & subRod (int ind) const
 

Private Attributes

std::vector< const GeomDet * > theDets
 
BinFinderType theInnerBinFinder
 
std::vector< const GeomDet * > theInnerDets
 
ReferenceCountingPointer< PlanetheInnerPlane
 
BinFinderType theOuterBinFinder
 
std::vector< const GeomDet * > theOuterDets
 
ReferenceCountingPointer< PlanetheOuterPlane
 

Additional Inherited Members

- Protected Member Functions inherited from DetRod
void setPlane (Plane *plane)
 Set the rod's plane. More...
 
- Protected Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A concrete implementation for TOB Rod

Definition at line 14 of file TOBRod.h.

Member Typedef Documentation

◆ BinFinderType

Definition at line 16 of file TOBRod.h.

Constructor & Destructor Documentation

◆ TOBRod()

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

Definition at line 25 of file TOBRod.cc.

26  : DetRod(true), theInnerDets(innerDets), theOuterDets(outerDets) {
27  theDets.assign(theInnerDets.begin(), theInnerDets.end());
28  theDets.insert(theDets.end(), theOuterDets.begin(), theOuterDets.end());
29 
30  RodPlaneBuilderFromDet planeBuilder;
31  setPlane(planeBuilder(theDets));
32  theInnerPlane = planeBuilder(theInnerDets);
33  theOuterPlane = planeBuilder(theOuterDets);
34 
35  sort(theDets.begin(), theDets.end(), DetZLess());
36  sort(theInnerDets.begin(), theInnerDets.end(), DetZLess());
37  sort(theOuterDets.begin(), theOuterDets.end(), DetZLess());
40 
41  LogDebug("TkDetLayers") << "==== DEBUG TOBRod =====";
42  for (vector<const GeomDet*>::const_iterator i = theInnerDets.begin(); i != theInnerDets.end(); i++) {
43  LogDebug("TkDetLayers") << "inner TOBRod's Det pos z,perp,eta,phi: " << (**i).position().z() << " , "
44  << (**i).position().perp() << " , " << (**i).position().eta() << " , "
45  << (**i).position().phi();
46  }
47 
48  for (vector<const GeomDet*>::const_iterator i = theOuterDets.begin(); i != theOuterDets.end(); i++) {
49  LogDebug("TkDetLayers") << "outer TOBRod's Det pos z,perp,eta,phi: " << (**i).position().z() << " , "
50  << (**i).position().perp() << " , " << (**i).position().eta() << " , "
51  << (**i).position().phi();
52  }
53  LogDebug("TkDetLayers") << "==== end DEBUG TOBRod =====";
54 }

References mps_fire::i, LogDebug, DetRod::setPlane(), theDets, theInnerBinFinder, theInnerDets, theInnerPlane, theOuterBinFinder, theOuterDets, and theOuterPlane.

◆ ~TOBRod()

TOBRod::~TOBRod ( )
override

Definition at line 56 of file TOBRod.cc.

56 {}

Member Function Documentation

◆ addClosest()

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

Definition at line 138 of file TOBRod.cc.

142  {
143  const vector<const GeomDet*>& sRod(subRod(crossing.subLayerIndex()));
144  return CompatibleDetToGroupAdder::add(*sRod[crossing.closestDetIndex()], tsos, prop, est, result);
145 }

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

Referenced by groupedCompatibleDetsV().

◆ basicComponents()

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

Implements GeometricSearchDet.

Definition at line 23 of file TOBRod.h.

23 { return theDets; }

References theDets.

◆ compatible()

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

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

◆ components()

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

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 58 of file TOBRod.cc.

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

◆ computeCrossings()

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

Definition at line 105 of file TOBRod.cc.

106  {
107  GlobalPoint startPos(startingState.globalPosition());
108  GlobalVector startDir(startingState.globalMomentum());
109  double rho(startingState.transverseCurvature());
110 
111  HelixBarrelPlaneCrossingByCircle crossing(startPos, startDir, rho, propDir);
112 
113  std::pair<bool, double> outerPath = crossing.pathLength(*theOuterPlane);
114  if (!outerPath.first)
115  return SubLayerCrossings();
116  GlobalPoint gOuterPoint(crossing.position(outerPath.second));
117 
118  std::pair<bool, double> innerPath = crossing.pathLength(*theInnerPlane);
119  if (!innerPath.first)
120  return SubLayerCrossings();
121  GlobalPoint gInnerPoint(crossing.position(innerPath.second));
122 
123  int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.z());
124  float innerDist = std::abs(theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.z());
125  SubLayerCrossing innerSLC(0, innerIndex, gInnerPoint);
126 
127  int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.z());
128  float outerDist = std::abs(theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.z());
129  SubLayerCrossing outerSLC(1, outerIndex, gOuterPoint);
130 
131  if (innerDist < outerDist) {
132  return SubLayerCrossings(innerSLC, outerSLC, 0);
133  } else {
134  return SubLayerCrossings(outerSLC, innerSLC, 1);
135  }
136 }

References funct::abs(), PeriodicBinFinderInZ< T >::binIndex(), PeriodicBinFinderInZ< T >::binPosition(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), rho, theInnerBinFinder, theInnerPlane, theOuterBinFinder, theOuterPlane, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

◆ computeWindowSize()

float TOBRod::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
private

Definition at line 147 of file TOBRod.cc.

149  {
150  return est.maximalLocalDisplacement(tsos, det->surface()).y();
151 }

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

Referenced by groupedCompatibleDetsV().

◆ groupedCompatibleDetsV()

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

Reimplemented from GeometricSearchDet.

Definition at line 69 of file TOBRod.cc.

72  {
73  SubLayerCrossings crossings;
74  crossings = computeCrossings(tsos, prop.propagationDirection());
75  if (!crossings.isValid())
76  return;
77 
78  std::vector<DetGroup> closestResult;
79  addClosest(tsos, prop, est, crossings.closest(), closestResult);
80  if (closestResult.empty()) {
81  std::vector<DetGroup> nextResult;
82  addClosest(tsos, prop, est, crossings.other(), nextResult);
83  if (nextResult.empty())
84  return;
85 
86  DetGroupElement nextGel(nextResult.front().front());
87  int crossingSide = LayerCrossingSide().barrelSide(nextGel.trajectoryState(), prop);
89  std::move(closestResult), std::move(nextResult), result, crossings.closestIndex(), crossingSide);
90  } else {
91  DetGroupElement closestGel(closestResult.front().front());
92  float window = computeWindowSize(closestGel.det(), closestGel.trajectoryState(), est);
93 
94  searchNeighbors(tsos, prop, est, crossings.closest(), window, closestResult, false);
95 
96  std::vector<DetGroup> nextResult;
97  searchNeighbors(tsos, prop, est, crossings.other(), window, nextResult, true);
98 
99  int crossingSide = LayerCrossingSide().barrelSide(closestGel.trajectoryState(), prop);
101  std::move(closestResult), std::move(nextResult), result, crossings.closestIndex(), crossingSide);
102  }
103 }

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

◆ searchNeighbors()

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

184  {
185  const GlobalPoint& gCrossingPos = crossing.position();
186 
187  const vector<const GeomDet*>& sRod(subRod(crossing.subLayerIndex()));
188 
189  int closestIndex = crossing.closestDetIndex();
190  int negStartIndex = closestIndex - 1;
191  int posStartIndex = closestIndex + 1;
192 
193  if (checkClosest) { // must decide if the closest is on the neg or pos side
194  if (gCrossingPos.z() < sRod[closestIndex]->surface().position().z()) {
195  posStartIndex = closestIndex;
196  } else {
197  negStartIndex = closestIndex;
198  }
199  }
200 
201  typedef CompatibleDetToGroupAdder Adder;
202  for (int idet = negStartIndex; idet >= 0; idet--) {
203  if (!overlap(gCrossingPos, *sRod[idet], window))
204  break;
205  if (!Adder::add(*sRod[idet], tsos, prop, est, result))
206  break;
207  }
208  for (int idet = posStartIndex; idet < static_cast<int>(sRod.size()); idet++) {
209  if (!overlap(gCrossingPos, *sRod[idet], window))
210  break;
211  if (!Adder::add(*sRod[idet], tsos, prop, est, result))
212  break;
213  }
214 }

References PVValHelper::add(), SubLayerCrossing::closestDetIndex(), goodZToMuMu_cfi::overlap, SubLayerCrossing::position(), mps_fire::result, SubLayerCrossing::subLayerIndex(), subRod(), svgfig::window(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by groupedCompatibleDetsV().

◆ subRod()

const std::vector<const GeomDet*>& TOBRod::subRod ( int  ind) const
inlineprivate

Definition at line 61 of file TOBRod.h.

61 { return (ind == 0 ? theInnerDets : theOuterDets); }

References theInnerDets, and theOuterDets.

Referenced by addClosest(), and searchNeighbors().

Member Data Documentation

◆ theDets

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

Definition at line 64 of file TOBRod.h.

Referenced by basicComponents(), and TOBRod().

◆ theInnerBinFinder

BinFinderType TOBRod::theInnerBinFinder
private

Definition at line 71 of file TOBRod.h.

Referenced by computeCrossings(), and TOBRod().

◆ theInnerDets

std::vector<const GeomDet*> TOBRod::theInnerDets
private

Definition at line 65 of file TOBRod.h.

Referenced by subRod(), and TOBRod().

◆ theInnerPlane

ReferenceCountingPointer<Plane> TOBRod::theInnerPlane
private

Definition at line 68 of file TOBRod.h.

Referenced by computeCrossings(), and TOBRod().

◆ theOuterBinFinder

BinFinderType TOBRod::theOuterBinFinder
private

Definition at line 72 of file TOBRod.h.

Referenced by computeCrossings(), and TOBRod().

◆ theOuterDets

std::vector<const GeomDet*> TOBRod::theOuterDets
private

Definition at line 66 of file TOBRod.h.

Referenced by subRod(), and TOBRod().

◆ theOuterPlane

ReferenceCountingPointer<Plane> TOBRod::theOuterPlane
private

Definition at line 69 of file TOBRod.h.

Referenced by computeCrossings(), and TOBRod().

Vector3DBase
Definition: Vector3DBase.h:8
SubLayerCrossing::position
const GlobalPoint & position() const
Definition: SubLayerCrossings.h:14
SubLayerCrossings::isValid
bool isValid()
Definition: SubLayerCrossings.h:28
DDAxes::y
TOBRod::theOuterDets
std::vector< const GeomDet * > theOuterDets
Definition: TOBRod.h:66
mps_fire.i
i
Definition: mps_fire.py:428
TOBRod::theInnerPlane
ReferenceCountingPointer< Plane > theInnerPlane
Definition: TOBRod.h:68
LayerCrossingSide
Definition: LayerCrossingSide.h:15
SubLayerCrossings::closestIndex
int closestIndex() const
Definition: SubLayerCrossings.h:31
PeriodicBinFinderInZ::binIndex
int binIndex(T z) const override
returns an index in the valid range for the bin that contains Z
Definition: PeriodicBinFinderInZ.h:26
TOBRod::BinFinderType
PeriodicBinFinderInZ< float > BinFinderType
Definition: TOBRod.h:16
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
TOBRod::theInnerDets
std::vector< const GeomDet * > theInnerDets
Definition: TOBRod.h:65
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
DetRod
Definition: DetRod.h:13
Propagator::propagationDirection
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
TOBRod::theOuterBinFinder
BinFinderType theOuterBinFinder
Definition: TOBRod.h:72
Point3DBase< float, GlobalTag >
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
TOBRod::theInnerBinFinder
BinFinderType theInnerBinFinder
Definition: TOBRod.h:71
RodPlaneBuilderFromDet
Definition: RodPlaneBuilderFromDet.h:15
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:223
DetRod::setPlane
void setPlane(Plane *plane)
Set the rod's plane.
Definition: DetRod.h:28
HelixBarrelPlaneCrossingByCircle
Definition: HelixBarrelPlaneCrossingByCircle.h:13
PVValHelper::add
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
Definition: PVValidationHelpers.cc:12
TOBRod::computeWindowSize
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const __attribute__((hot))
Definition: TOBRod.cc:147
SubLayerCrossing::closestDetIndex
int closestDetIndex() const
Definition: SubLayerCrossings.h:13
TOBRod::subRod
const std::vector< const GeomDet * > & subRod(int ind) const
Definition: TOBRod.h:61
TOBRod::theDets
std::vector< const GeomDet * > theDets
Definition: TOBRod.h:64
DetGroupElement
Definition: DetGroup.h:10
goodZToMuMu_cfi.overlap
overlap
Definition: goodZToMuMu_cfi.py:108
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
TOBRod::computeCrossings
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const __attribute__((hot))
Definition: TOBRod.cc:105
PeriodicBinFinderInZ::binPosition
T binPosition(int ind) const override
the middle of the bin
Definition: PeriodicBinFinderInZ.h:32
DetLayerException
Common base class.
Definition: DetLayerException.h:15
eostools.move
def move(src, dest)
Definition: eostools.py:511
TOBRod::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: TOBRod.cc:178
CompatibleDetToGroupAdder
Definition: CompatibleDetToGroupAdder.h:13
LayerCrossingSide::barrelSide
static int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
returns 0 if barrel layer crossed from inside, 1 if from outside
Definition: LayerCrossingSide.h:18
SubLayerCrossings::other
const SubLayerCrossing & other() const
Definition: SubLayerCrossings.h:30
TOBRod::addClosest
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
Definition: TOBRod.cc:138
SubLayerCrossing
Definition: SubLayerCrossings.h:7
SubLayerCrossing::subLayerIndex
int subLayerIndex() const
Definition: SubLayerCrossings.h:12
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TOBRod::theOuterPlane
ReferenceCountingPointer< Plane > theOuterPlane
Definition: TOBRod.h:69
MeasurementEstimator::maximalLocalDisplacement
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
SubLayerCrossings
Definition: SubLayerCrossings.h:22