CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
TBPLayer Class Reference

#include <TBPLayer.h>

Inheritance diagram for TBPLayer:
TBLayer BarrelDetLayer DetLayer GeometricSearchDet Phase2OTtiltedBarrelLayer

Public Types

typedef PeriodicBinFinderInPhi< float > BinFinderType
 
- 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
 

Public Member Functions

BoundCylindercylinder (const std::vector< const GeometricSearchDet *> &rods) const __attribute__((cold))
 
 TBPLayer (std::vector< const PixelRod *> &inner, std::vector< const PixelRod *> &outer) __attribute__((cold))
 
 TBPLayer (std::vector< const TOBRod *> &inner, std::vector< const TOBRod *> &outer) __attribute__((cold))
 
 TBPLayer (std::vector< const Phase2OTBarrelRod *> &inner, std::vector< const Phase2OTBarrelRod *> &outer) __attribute__((cold))
 
 ~TBPLayer () override __attribute__((cold))
 
- Public Member Functions inherited from TBLayer
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 ()
 

Private Member Functions

std::tuple< bool, int, int > computeIndexes (GlobalPoint gInnerPoint, GlobalPoint gOuterPoint) const override __attribute__((hot))
 
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const override __attribute__((hot))
 
void construct () __attribute__((cold))
 
void searchNeighbors (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const override __attribute__((hot))
 

Static Private Member Functions

static float calculatePhiWindow (float Xmax, const GeomDet &det, const TrajectoryStateOnSurface &state) __attribute__((hot))
 

Private Attributes

BinFinderType theInnerBinFinder
 
BinFinderType theOuterBinFinder
 

Additional Inherited Members

- Protected Member Functions inherited from TBLayer
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))
 
bool isPhase2OT () const
 
bool isPixel () const
 
bool isTIB () const
 
bool isTOB () const
 
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 inherited from TBLayer
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
 

Detailed Description

A concrete implementation for TOB layer or PixelBarrel layer or a Phase 2 OT Barrel layer as long as it is similar to the previous ones

Definition at line 15 of file TBPLayer.h.

Member Typedef Documentation

◆ BinFinderType

Definition at line 17 of file TBPLayer.h.

Constructor & Destructor Documentation

◆ TBPLayer() [1/3]

TBPLayer::TBPLayer ( std::vector< const PixelRod *> &  inner,
std::vector< const PixelRod *> &  outer 
)
inline

Definition at line 19 of file TBPLayer.h.

References construct().

21  construct();
22  }
void construct() __attribute__((cold))
Definition: TBPLayer.cc:20
TBLayer(std::vector< const TDET *> &inner, std::vector< const TDET *> &outer, GeomDetEnumerators::SubDetector ime)
Definition: TBLayer.h:13

◆ TBPLayer() [2/3]

TBPLayer::TBPLayer ( std::vector< const TOBRod *> &  inner,
std::vector< const TOBRod *> &  outer 
)
inline

Definition at line 24 of file TBPLayer.h.

References construct().

26  construct();
27  }
void construct() __attribute__((cold))
Definition: TBPLayer.cc:20
TBLayer(std::vector< const TDET *> &inner, std::vector< const TDET *> &outer, GeomDetEnumerators::SubDetector ime)
Definition: TBLayer.h:13

◆ TBPLayer() [3/3]

TBPLayer::TBPLayer ( std::vector< const Phase2OTBarrelRod *> &  inner,
std::vector< const Phase2OTBarrelRod *> &  outer 
)
inline

Definition at line 29 of file TBPLayer.h.

References construct().

32  construct();
33  }
void construct() __attribute__((cold))
Definition: TBPLayer.cc:20
TBLayer(std::vector< const TDET *> &inner, std::vector< const TDET *> &outer, GeomDetEnumerators::SubDetector ime)
Definition: TBLayer.h:13

◆ ~TBPLayer()

TBPLayer::~TBPLayer ( )
override

Definition at line 64 of file TBPLayer.cc.

64 {}

Member Function Documentation

◆ calculatePhiWindow()

static float TBPLayer::calculatePhiWindow ( float  Xmax,
const GeomDet det,
const TrajectoryStateOnSurface state 
)
staticprivate

◆ computeIndexes()

std::tuple< bool, int, int > TBPLayer::computeIndexes ( GlobalPoint  gInnerPoint,
GlobalPoint  gOuterPoint 
) const
overrideprivatevirtual

Implements TBLayer.

Definition at line 76 of file TBPLayer.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), f, Geom::ftwoPi(), and Geom::phiLess().

76  {
77  int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.barePhi());
78  float innerDist = theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.barePhi();
79 
80  int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.barePhi());
81  float outerDist = theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.barePhi();
82 
83  innerDist *= Geom::phiLess(theInnerBinFinder.binPosition(innerIndex), gInnerPoint.barePhi()) ? -1.f : 1.f;
84  outerDist *= Geom::phiLess(theOuterBinFinder.binPosition(outerIndex), gOuterPoint.barePhi()) ? -1.f : 1.f;
85  if (innerDist < 0.f) {
86  innerDist += Geom::ftwoPi();
87  }
88  if (outerDist < 0.f) {
89  outerDist += Geom::ftwoPi();
90  }
91 
92  return std::make_tuple(innerDist < outerDist, innerIndex, outerIndex);
93 }
constexpr float ftwoPi()
Definition: Pi.h:36
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
BinFinderType theOuterBinFinder
Definition: TBPLayer.h:63
T barePhi() const
Definition: PV3DBase.h:65
double f[11][100]
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
BinFinderType theInnerBinFinder
Definition: TBPLayer.h:62
T binPosition(int ind) const override
the middle of the bin in radians

◆ computeWindowSize()

float TBPLayer::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
overrideprivatevirtual

Implements TBLayer.

Definition at line 95 of file TBPLayer.cc.

References barrelUtil::computeWindowSize().

97  {
98  return barrelUtil::computeWindowSize(det, tsos, est);
99 }
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
Definition: BarrelUtil.h:31

◆ construct()

void TBPLayer::construct ( )
private

Definition at line 20 of file TBPLayer.cc.

References mps_fire::i, BarrelDetLayer::initialize(), and LogDebug.

Referenced by TBPLayer().

20  {
21  theComps.assign(theInnerComps.begin(), theInnerComps.end());
22  theComps.insert(theComps.end(), theOuterComps.begin(), theOuterComps.end());
23 
24  for (vector<const GeometricSearchDet*>::const_iterator it = theComps.begin(); it != theComps.end(); it++) {
25  theBasicComps.insert(theBasicComps.end(), (**it).basicComponents().begin(), (**it).basicComponents().end());
26  }
27 
30 
31  if (!theInnerComps.empty())
32  theInnerBinFinder = BinFinderType(theInnerComps.front()->position().phi(), theInnerComps.size());
33 
34  if (!theOuterComps.empty())
35  theOuterBinFinder = BinFinderType(theOuterComps.front()->position().phi(), theOuterComps.size());
36 
38 
39  //--------- DEBUG INFO --------------
40  LogDebug("TkDetLayers") << "==== DEBUG TBPLayer =====";
41  LogDebug("TkDetLayers") << "innerCyl radius, thickness, lenght: " << theInnerCylinder->radius() << " , "
42  << theInnerCylinder->bounds().thickness() << " , " << theInnerCylinder->bounds().length();
43 
44  LogDebug("TkDetLayers") << "outerCyl radius, thickness, lenght: " << theOuterCylinder->radius() << " , "
45  << theOuterCylinder->bounds().thickness() << " , " << theOuterCylinder->bounds().length();
46 
47  LogDebug("TkDetLayers") << "Cyl radius, thickness, lenght: " << specificSurface().radius() << " , "
48  << specificSurface().bounds().thickness() << " , " << specificSurface().bounds().length();
49 
50  for (vector<const GeometricSearchDet*>::const_iterator i = theInnerComps.begin(); i != theInnerComps.end(); i++) {
51  LogDebug("TkDetLayers") << "inner Rod pos z,perp,eta,phi: " << (**i).position().z() << " , "
52  << (**i).position().perp() << " , " << (**i).position().eta() << " , "
53  << (**i).position().phi();
54  }
55 
56  for (vector<const GeometricSearchDet*>::const_iterator i = theOuterComps.begin(); i != theOuterComps.end(); i++) {
57  LogDebug("TkDetLayers") << "outer Rod pos z,perp,eta,phi: " << (**i).position().z() << " , "
58  << (**i).position().perp() << " , " << (**i).position().eta() << " , "
59  << (**i).position().phi();
60  }
61  LogDebug("TkDetLayers") << "==== end DEBUG TBPLayer =====";
62 }
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
Definition: TBLayer.h:75
virtual void initialize()
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TBLayer.h:70
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:69
BinFinderType theOuterBinFinder
Definition: TBPLayer.h:63
PeriodicBinFinderInPhi< float > BinFinderType
Definition: TBPLayer.h:17
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
BinFinderType theInnerBinFinder
Definition: TBPLayer.h:62
std::vector< const GeomDet * > theBasicComps
Definition: TBLayer.h:72
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TBLayer.h:71
ReferenceCountingPointer< BoundCylinder > theInnerCylinder
Definition: TBLayer.h:74
BoundCylinder * cylinder(const std::vector< const GeometricSearchDet *> &rods) const __attribute__((cold))
Definition: TBPLayer.cc:66
#define LogDebug(id)

◆ cylinder()

BoundCylinder * TBPLayer::cylinder ( const std::vector< const GeometricSearchDet *> &  rods) const

Definition at line 66 of file TBPLayer.cc.

References createJobs::tmp.

Referenced by Phase2OTtiltedBarrelLayer::Phase2OTtiltedBarrelLayer().

66  {
67  vector<const GeomDet*> tmp;
68  for (vector<const GeometricSearchDet*>::const_iterator it = rods.begin(); it != rods.end(); it++) {
69  tmp.insert(tmp.end(), (*it)->basicComponents().begin(), (*it)->basicComponents().end());
70  }
71  return CylinderBuilderFromDet()(tmp.begin(), tmp.end());
72 }
tmp
align.sh
Definition: createJobs.py:716

◆ searchNeighbors()

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

Implements TBLayer.

Definition at line 101 of file TBPLayer.cc.

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

107  {
108  using barrelUtil::overlap;
109 
110  const GlobalPoint& gCrossingPos = crossing.position();
111  auto gphi = gCrossingPos.barePhi();
112 
113  const vector<const GeometricSearchDet*>& sLayer(subLayer(crossing.subLayerIndex()));
114 
115  int closestIndex = crossing.closestDetIndex();
116  int negStartIndex = closestIndex - 1;
117  int posStartIndex = closestIndex + 1;
118 
119  if (checkClosest) { // must decide if the closest is on the neg or pos side
120  if (Geom::phiLess(gphi, sLayer[closestIndex]->surface().phi())) {
121  posStartIndex = closestIndex;
122  } else {
123  negStartIndex = closestIndex;
124  }
125  }
126 
127  const BinFinderType& binFinder = (crossing.subLayerIndex() == 0 ? theInnerBinFinder : theOuterBinFinder);
128 
129  typedef CompatibleDetToGroupAdder Adder;
130  int quarter = sLayer.size() / 4;
131  for (int idet = negStartIndex; idet >= negStartIndex - quarter; idet--) {
132  const GeometricSearchDet& neighborRod = *sLayer[binFinder.binIndex(idet)];
133  if (!overlap(gphi, neighborRod, window))
134  break;
135  if (!Adder::add(neighborRod, tsos, prop, est, result))
136  break;
137  // maybe also add shallow crossing angle test here???
138  }
139  for (int idet = posStartIndex; idet < posStartIndex + quarter; idet++) {
140  const GeometricSearchDet& neighborRod = *sLayer[binFinder.binIndex(idet)];
141  if (!overlap(gphi, neighborRod, window))
142  break;
143  if (!Adder::add(neighborRod, tsos, prop, est, result))
144  break;
145  // maybe also add shallow crossing angle test here???
146  }
147 }
const BoundSurface & surface() const final
GeometricSearchDet interface.
BinFinderType theOuterBinFinder
Definition: TBPLayer.h:63
T barePhi() const
Definition: PV3DBase.h:65
PeriodicBinFinderInPhi< float > BinFinderType
Definition: TBPLayer.h:17
const GlobalPoint & position() const
int closestDetIndex() const
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
Definition: TBLayer.h:51
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
bool overlap(float phi, const GeometricSearchDet &gsdet, float phiWin)
Definition: BarrelUtil.h:38
int subLayerIndex() const
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
void add(std::map< std::string, TH1 *> &h, TH1 *hist)
BinFinderType theInnerBinFinder
Definition: TBPLayer.h:62

Member Data Documentation

◆ theInnerBinFinder

BinFinderType TBPLayer::theInnerBinFinder
private

Definition at line 62 of file TBPLayer.h.

◆ theOuterBinFinder

BinFinderType TBPLayer::theOuterBinFinder
private

Definition at line 63 of file TBPLayer.h.