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

virtual const std::vector< const GeomDet * > & basicComponents () const final
 
virtual 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 __attribute__((hot))
 
virtual 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 () __attribute__((cold))
 
- Public Member Functions inherited from BarrelDetLayer
 BarrelDetLayer (bool doHaveGroup)
 
virtual std::pair< bool, TrajectoryStateOnSurfacecompatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const final
 
bool contains (const Local3DPoint &p) const
 
virtual Location location () const final
 DetLayer interface. More...
 
virtual const BoundCylinderspecificSurface () const final
 Extension of the interface. More...
 
virtual const BoundSurfacesurface () const final
 GeometricSearchDet interface. More...
 
virtual ~BarrelDetLayer ()
 
- Public Member Functions inherited from DetLayer
 DetLayer (bool doHaveGroup, bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
int seqNum () const
 
void setSeqNum (int sq)
 
virtual ~DetLayer ()
 
- 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 13 of file TBLayer.h.

Constructor & Destructor Documentation

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

Definition at line 17 of file TBLayer.h.

References ~TBLayer().

18  :
19  BarrelDetLayer(true),
20  theInnerComps(inner.begin(),inner.end()),
21  theOuterComps(outer.begin(),outer.end()), me(ime){}
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TBLayer.h:84
BarrelDetLayer(bool doHaveGroup)
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:91
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TBLayer.h:85
TBLayer::~TBLayer ( )

Definition at line 11 of file TBLayer.cc.

References mps_fire::i, and theComps.

Referenced by TBLayer().

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

Member Function Documentation

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(), subLayer(), and SubLayerCrossing::subLayerIndex().

Referenced by groupedCompatibleDetsV(), and subDetector().

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

Implements GeometricSearchDet.

Definition at line 28 of file TBLayer.h.

References theBasicComps.

28 {return theBasicComps;}
std::vector< const GeomDet * > theBasicComps
Definition: TBLayer.h:86
virtual const std::vector<const GeometricSearchDet*>& TBLayer::components ( ) const
inlinefinalvirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 30 of file TBLayer.h.

References groupedCompatibleDetsV(), mps_fire::result, and theComps.

Referenced by Phase2OTtiltedBarrelLayer::Phase2OTtiltedBarrelLayer().

30 {return theComps;}
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:83
SubLayerCrossings TBLayer::computeCrossings ( const TrajectoryStateOnSurface startingState,
PropagationDirection  propDir 
) const
protected

Definition at line 50 of file TBLayer.cc.

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

Referenced by groupedCompatibleDetsV(), and subDetector().

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

Implemented in TBPLayer, and TIBLayer.

Referenced by computeCrossings(), and subDetector().

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

Implemented in TBPLayer, and TIBLayer.

Referenced by groupedCompatibleDetsV(), and subDetector().

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

Reimplemented from GeometricSearchDet.

Definition at line 18 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 components(), and Phase2OTtiltedBarrelLayer::groupedCompatibleDetsV().

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

Definition at line 71 of file TBLayer.h.

References me, GeomDetEnumerators::P2OTB, searchNeighbors(), and svgfig::window().

71 { return me==GeomDetEnumerators::P2OTB;}
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:91
bool TBLayer::isPixel ( ) const
inlineprotected

Definition at line 70 of file TBLayer.h.

References me, and GeomDetEnumerators::PixelBarrel.

GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:91
bool TBLayer::isTIB ( ) const
inlineprotected

Definition at line 68 of file TBLayer.h.

References me, and GeomDetEnumerators::TIB.

Referenced by groupedCompatibleDetsV().

68 { return me==GeomDetEnumerators::TIB;}
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:91
bool TBLayer::isTOB ( ) const
inlineprotected

Definition at line 69 of file TBLayer.h.

References me, and GeomDetEnumerators::TOB.

69 { return me==GeomDetEnumerators::TOB;}
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:91
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(), and isPhase2OT().

virtual SubDetector TBLayer::subDetector ( ) const
inlinefinalvirtual

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

Implements DetLayer.

Definition at line 39 of file TBLayer.h.

References addClosest(), computeCrossings(), computeIndexes(), computeWindowSize(), me, and GeomDetEnumerators::subDetGeom.

SubDetector subDetGeom[21]
GeomDetEnumerators::SubDetector me
Definition: TBLayer.h:91
const std::vector<const GeometricSearchDet*>& TBLayer::subLayer ( int  ind) const
inlineprotected

Definition at line 64 of file TBLayer.h.

References theInnerComps, and theOuterComps.

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

64  {
65  return (ind==0 ? theInnerComps : theOuterComps);
66  }
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TBLayer.h:84
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TBLayer.h:85

Member Data Documentation

GeomDetEnumerators::SubDetector TBLayer::me
protected

Definition at line 91 of file TBLayer.h.

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

std::vector<const GeomDet*> TBLayer::theBasicComps
protected
std::vector<const GeometricSearchDet*> TBLayer::theComps
protected
std::vector<const GeometricSearchDet*> TBLayer::theInnerComps
protected

Definition at line 84 of file TBLayer.h.

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

ReferenceCountingPointer<BoundCylinder> TBLayer::theInnerCylinder
protected

Definition at line 88 of file TBLayer.h.

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

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

Definition at line 85 of file TBLayer.h.

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

ReferenceCountingPointer<BoundCylinder> TBLayer::theOuterCylinder
protected

Definition at line 89 of file TBLayer.h.

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