CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
TBLayer Class Referenceabstract

#include <TBLayer.h>

Inheritance diagram for TBLayer:
BarrelDetLayer DetLayer GeometricSearchDet TBPLayer TIBLayer Phase2OTtiltedBarrelLayer

Public Member Functions

const std::vector< const GeomDet * > & basicComponents () const final
 
const std::vector< const GeometricSearchDet * > & components () const final __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))
 
SubDetector subDetector () const final
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
template<typename TDET >
 TBLayer (std::vector< const TDET *> &inner, std::vector< const TDET *> &outer, GeomDetEnumerators::SubDetector ime)
 
 ~TBLayer () override __attribute__((cold))
 
- Public Member Functions inherited from BarrelDetLayer
 BarrelDetLayer (bool doHaveGroup)
 
std::pair< bool, TrajectoryStateOnSurfacecompatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const final
 
bool contains (const Local3DPoint &p) const
 
Location location () const final
 DetLayer interface. More...
 
virtual const BoundCylinderspecificSurface () const final
 Extension of the interface. More...
 
const BoundSurfacesurface () const final
 GeometricSearchDet interface. More...
 
 ~BarrelDetLayer () override
 
- Public Member Functions inherited from DetLayer
 DetLayer (bool doHaveGroup, bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
int seqNum () const
 
void setSeqNum (int sq)
 
 ~DetLayer () 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 ()
 

Protected 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 &startingState, PropagationDirection propDir) const __attribute__((hot))
 
virtual std::tuple< bool, int, int > computeIndexes (GlobalPoint gInnerPoint, GlobalPoint gOuterPoint) const =0
 
virtual float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const =0
 
bool isPhase2OT () const
 
bool isPixel () const
 
bool isTIB () const
 
bool isTOB () const
 
virtual void searchNeighbors (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const =0
 
const std::vector< const GeometricSearchDet * > & subLayer (int ind) const
 
- Protected Member Functions inherited from BarrelDetLayer
SimpleCylinderBounds const & bounds () const
 
virtual BoundCylindercomputeSurface ()
 
virtual void initialize ()
 
void setSurface (BoundCylinder *cp)
 

Protected Attributes

GeomDetEnumerators::SubDetector me
 
std::vector< const GeomDet * > theBasicComps
 
std::vector< const GeometricSearchDet * > theComps
 
std::vector< const GeometricSearchDet * > theInnerComps
 
ReferenceCountingPointer< BoundCylindertheInnerCylinder
 
std::vector< const GeometricSearchDet * > theOuterComps
 
ReferenceCountingPointer< BoundCylindertheOuterCylinder
 
- Protected Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Additional Inherited Members

- Public Types inherited from DetLayer
typedef GeomDetEnumerators::Location Location
 
typedef GeomDetEnumerators::SubDetector SubDetector
 
- Public Types inherited from GeometricSearchDet
typedef std::pair< const GeomDet *, TrajectoryStateOnSurfaceDetWithState
 
typedef BoundSurface::PositionType PositionType
 
typedef BoundSurface::RotationType RotationType
 
typedef TrajectoryStateOnSurface TrajectoryState
 

Detailed Description

Definition at line 10 of file TBLayer.h.

Constructor & Destructor Documentation

◆ TBLayer()

template<typename TDET >
TBLayer::TBLayer ( std::vector< const TDET *> &  inner,
std::vector< const TDET *> &  outer,
GeomDetEnumerators::SubDetector  ime 
)
inline

Definition at line 13 of file TBLayer.h.

14  : BarrelDetLayer(true),
15  theInnerComps(inner.begin(), inner.end()),
16  theOuterComps(outer.begin(), outer.end()),
17  me(ime) {}
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TBLayer.h:70
BarrelDetLayer(bool doHaveGroup)
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:77
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TBLayer.h:71

◆ ~TBLayer()

TBLayer::~TBLayer ( )
override

Definition at line 10 of file TBLayer.cc.

References mps_fire::i, and theComps.

10  {
11  for (auto i : theComps)
12  delete i;
13 }
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:69

Member Function Documentation

◆ addClosest()

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

Definition at line 86 of file TBLayer.cc.

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

Referenced by groupedCompatibleDetsV().

90  {
91  auto const& sub = subLayer(crossing.subLayerIndex());
92  auto det = sub[crossing.closestDetIndex()];
93  return CompatibleDetToGroupAdder().add(*det, tsos, prop, est, result);
94 }
int closestDetIndex() const
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
Definition: TBLayer.h:51
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*>& TBLayer::basicComponents ( ) const
inlinefinalvirtual

Implements GeometricSearchDet.

Definition at line 23 of file TBLayer.h.

References theBasicComps.

23 { return theBasicComps; }
std::vector< const GeomDet * > theBasicComps
Definition: TBLayer.h:72

◆ components()

const std::vector<const GeometricSearchDet*>& TBLayer::components ( ) const
inlinefinalvirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 25 of file TBLayer.h.

References theComps.

Referenced by Phase2OTtiltedBarrelLayer::Phase2OTtiltedBarrelLayer().

25 { return theComps; }
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:69

◆ computeCrossings()

SubLayerCrossings TBLayer::computeCrossings ( const TrajectoryStateOnSurface startingState,
PropagationDirection  propDir 
) const
protected

Definition at line 46 of file TBLayer.cc.

References computeIndexes(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), HelixBarrelCylinderCrossing::hasSolution(), HelixBarrelCylinderCrossing::onlyPos, perp(), HelixBarrelCylinderCrossing::position(), rho, theInnerCylinder, theOuterCylinder, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

47  {
48  GlobalPoint startPos(startingState.globalPosition());
49  GlobalVector startDir(startingState.globalMomentum());
50  double rho(startingState.transverseCurvature());
51 
52  bool inBetween = ((theOuterCylinder->position() - startPos).perp() < theOuterCylinder->radius()) &&
53  ((theInnerCylinder->position() - startPos).perp() > theInnerCylinder->radius());
54 
55  HelixBarrelCylinderCrossing innerCrossing(
56  startPos, startDir, rho, propDir, *theInnerCylinder, HelixBarrelCylinderCrossing::onlyPos);
57  if (!inBetween && !innerCrossing.hasSolution())
58  return SubLayerCrossings();
59 
60  HelixBarrelCylinderCrossing outerCrossing(
61  startPos, startDir, rho, propDir, *theOuterCylinder, HelixBarrelCylinderCrossing::onlyPos);
62 
63  if (!innerCrossing.hasSolution() && outerCrossing.hasSolution()) {
64  innerCrossing = outerCrossing;
65  } else if (!outerCrossing.hasSolution() && innerCrossing.hasSolution()) {
66  outerCrossing = innerCrossing;
67  }
68 
69  GlobalPoint gInnerPoint(innerCrossing.position());
70  GlobalPoint gOuterPoint(outerCrossing.position());
71 
72  int innerIndex, outerIndex;
73  bool inLess;
74  std::tie(inLess, innerIndex, outerIndex) = computeIndexes(gInnerPoint, gOuterPoint);
75 
76  SubLayerCrossing innerSLC(0, innerIndex, gInnerPoint);
77  SubLayerCrossing outerSLC(1, outerIndex, gOuterPoint);
78 
79  if (inLess) {
80  return SubLayerCrossings(innerSLC, outerSLC, 0);
81  } else {
82  return SubLayerCrossings(outerSLC, innerSLC, 1);
83  }
84 }
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
Definition: TBLayer.h:75
virtual std::tuple< bool, int, int > computeIndexes(GlobalPoint gInnerPoint, GlobalPoint gOuterPoint) const =0
GlobalPoint globalPosition() const
T perp() const
Magnitude of transverse component.
GlobalVector globalMomentum() const
ReferenceCountingPointer< BoundCylinder > theInnerCylinder
Definition: TBLayer.h:74

◆ computeIndexes()

virtual std::tuple<bool, int, int> TBLayer::computeIndexes ( GlobalPoint  gInnerPoint,
GlobalPoint  gOuterPoint 
) const
protectedpure virtual

Implemented in TBPLayer, and TIBLayer.

Referenced by computeCrossings().

◆ computeWindowSize()

virtual float TBLayer::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
protectedpure virtual

Implemented in TBPLayer, and TIBLayer.

Referenced by groupedCompatibleDetsV().

◆ groupedCompatibleDetsV()

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

Reimplemented from GeometricSearchDet.

Definition at line 15 of file TBLayer.cc.

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

Referenced by Phase2OTtiltedBarrelLayer::groupedCompatibleDetsV().

18  {
19  SubLayerCrossings crossings;
20  crossings = computeCrossings(tsos, prop.propagationDirection());
21  if (!crossings.isValid())
22  return;
23 
24  std::vector<DetGroup> closestResult;
25  addClosest(tsos, prop, est, crossings.closest(), closestResult);
26  // for TIB this differs from compatibleDets logic, which checks next in such cases!!!
27  if (closestResult.empty()) {
28  if (!isTIB())
29  addClosest(tsos, prop, est, crossings.other(), result);
30  return;
31  }
32 
33  DetGroupElement closestGel(closestResult.front().front());
34  float window = computeWindowSize(closestGel.det(), closestGel.trajectoryState(), est);
35 
36  searchNeighbors(tsos, prop, est, crossings.closest(), window, closestResult, false);
37 
38  std::vector<DetGroup> nextResult;
39  searchNeighbors(tsos, prop, est, crossings.other(), window, nextResult, true);
40 
41  int crossingSide = LayerCrossingSide().barrelSide(closestGel.trajectoryState(), prop);
43  std::move(closestResult), std::move(nextResult), result, crossings.closestIndex(), crossingSide);
44 }
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const __attribute__((hot))
Definition: TBLayer.cc:46
int closestIndex() const
static int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
returns 0 if barrel layer crossed from inside, 1 if from outside
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
Definition: TBLayer.cc:86
virtual float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const =0
bool isTIB() const
Definition: TBLayer.h:55
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
const SubLayerCrossing & closest() const
const SubLayerCrossing & other() const
virtual void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const =0
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
def move(src, dest)
Definition: eostools.py:511

◆ isPhase2OT()

bool TBLayer::isPhase2OT ( ) const
inlineprotected

Definition at line 58 of file TBLayer.h.

References me, and GeomDetEnumerators::P2OTB.

58 { return me == GeomDetEnumerators::P2OTB; }
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:77

◆ isPixel()

bool TBLayer::isPixel ( ) const
inlineprotected

Definition at line 57 of file TBLayer.h.

References me, and GeomDetEnumerators::PixelBarrel.

GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:77

◆ isTIB()

bool TBLayer::isTIB ( ) const
inlineprotected

Definition at line 55 of file TBLayer.h.

References me, and GeomDetEnumerators::TIB.

Referenced by groupedCompatibleDetsV().

55 { return me == GeomDetEnumerators::TIB; }
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:77

◆ isTOB()

bool TBLayer::isTOB ( ) const
inlineprotected

Definition at line 56 of file TBLayer.h.

References me, and GeomDetEnumerators::TOB.

56 { return me == GeomDetEnumerators::TOB; }
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:77

◆ searchNeighbors()

virtual void TBLayer::searchNeighbors ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
float  window,
std::vector< DetGroup > &  result,
bool  checkClosest 
) const
protectedpure virtual

Implemented in TBPLayer, and TIBLayer.

Referenced by groupedCompatibleDetsV().

◆ subDetector()

SubDetector TBLayer::subDetector ( ) const
inlinefinalvirtual

The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)

Implements DetLayer.

Definition at line 33 of file TBLayer.h.

References me, and GeomDetEnumerators::subDetGeom.

constexpr SubDetector subDetGeom[21]
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:77

◆ subLayer()

const std::vector<const GeometricSearchDet*>& TBLayer::subLayer ( int  ind) const
inlineprotected

Definition at line 51 of file TBLayer.h.

References theInnerComps, and theOuterComps.

Referenced by addClosest(), and TIBLayer::searchNeighbors().

51  {
52  return (ind == 0 ? theInnerComps : theOuterComps);
53  }
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TBLayer.h:70
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TBLayer.h:71

Member Data Documentation

◆ me

GeomDetEnumerators::SubDetector TBLayer::me
protected

Definition at line 77 of file TBLayer.h.

Referenced by isPhase2OT(), isPixel(), isTIB(), isTOB(), and subDetector().

◆ theBasicComps

std::vector<const GeomDet*> TBLayer::theBasicComps
protected

◆ theComps

std::vector<const GeometricSearchDet*> TBLayer::theComps
protected

◆ theInnerComps

std::vector<const GeometricSearchDet*> TBLayer::theInnerComps
protected

Definition at line 70 of file TBLayer.h.

Referenced by TIBLayer::computeIndexes(), subLayer(), and TIBLayer::TIBLayer().

◆ theInnerCylinder

ReferenceCountingPointer<BoundCylinder> TBLayer::theInnerCylinder
protected

Definition at line 74 of file TBLayer.h.

Referenced by computeCrossings(), and TIBLayer::TIBLayer().

◆ theOuterComps

std::vector<const GeometricSearchDet*> TBLayer::theOuterComps
protected

Definition at line 71 of file TBLayer.h.

Referenced by TIBLayer::computeIndexes(), subLayer(), and TIBLayer::TIBLayer().

◆ theOuterCylinder

ReferenceCountingPointer<BoundCylinder> TBLayer::theOuterCylinder
protected

Definition at line 75 of file TBLayer.h.

Referenced by computeCrossings(), and TIBLayer::TIBLayer().