CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
TIBLayer Class Referencefinal

#include <TIBLayer.h>

Inheritance diagram for TIBLayer:
TBLayer BarrelDetLayer DetLayer GeometricSearchDet

Public Member Functions

 TIBLayer (std::vector< const TIBRing * > &innerRings, std::vector< const TIBRing * > &outerRings) __attribute__((cold))
 
 ~TIBLayer () 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))
 
BoundCylindercylinder (const std::vector< const GeometricSearchDet * > &rings) __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 bool overlap (const GlobalPoint &gpos, const GeometricSearchDet &ring, float window) __attribute__((hot))
 

Private Attributes

GeneralBinFinderInZforGeometricSearchDet< float > theInnerBinFinder
 
GeneralBinFinderInZforGeometricSearchDet< float > theOuterBinFinder
 

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
 
- 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 TIB layer built out of TIBRings

Definition at line 13 of file TIBLayer.h.

Constructor & Destructor Documentation

◆ TIBLayer()

TIBLayer::TIBLayer ( std::vector< const TIBRing * > &  innerRings,
std::vector< const TIBRing * > &  outerRings 
)

Definition at line 18 of file TIBLayer.cc.

19  : TBLayer(innerRings, outerRings, GeomDetEnumerators::TIB) {
20  theComps.assign(theInnerComps.begin(), theInnerComps.end());
21  theComps.insert(theComps.end(), theOuterComps.begin(), theOuterComps.end());
22 
23  std::sort(theComps.begin(), theComps.end(), isDetLessZ);
26 
27  for (auto& it : theComps) {
28  theBasicComps.insert(theBasicComps.end(), it->basicComponents().begin(), it->basicComponents().end());
29  }
30 
31  // initialize the surface
34  initialize();
35 
36  LogDebug("TkDetLayers") << "==== DEBUG TIBLayer =====";
37  LogDebug("TkDetLayers") << "innerCyl radius, thickness, lenght: " << theInnerCylinder->radius() << " , "
38  << theInnerCylinder->bounds().thickness() << " , " << theInnerCylinder->bounds().length();
39 
40  LogDebug("TkDetLayers") << "outerCyl radius, thickness, lenght: " << theOuterCylinder->radius() << " , "
41  << theOuterCylinder->bounds().thickness() << " , " << theOuterCylinder->bounds().length();
42 
43  LogDebug("TkDetLayers") << "Cyl radius, thickness, lenght: " << specificSurface().radius() << " , "
44  << specificSurface().bounds().thickness() << " , " << specificSurface().bounds().length();
45 
46  for (auto& i : theInnerComps) {
47  LogDebug("TkDetLayers") << "inner TIBRing pos z,radius,eta,phi: " << i->position().z() << " , "
48  << i->position().perp() << " , " << i->position().eta() << " , " << i->position().phi();
49  }
50 
51  for (auto& i : theOuterComps) {
52  LogDebug("TkDetLayers") << "outer TIBRing pos z,radius,eta,phi: " << i->position().z() << " , "
53  << i->position().perp() << " , " << i->position().eta() << " , " << i->position().phi();
54  }
55 
56  // initialise the bin finders
57  // vector<const GeometricSearchDet*> tmpIn;
58  //for (vector<const TIBRing*>::const_iterator i=theInnerRings.begin();
59  // i != theInnerRings.end(); i++) tmpIn.push_back(*i);
61 
63 }

References cylinder(), mps_fire::i, BarrelDetLayer::initialize(), isDetLessZ(), LogDebug, jetUpdater_cfi::sort, BarrelDetLayer::specificSurface(), TBLayer::theBasicComps, TBLayer::theComps, theInnerBinFinder, TBLayer::theInnerComps, TBLayer::theInnerCylinder, theOuterBinFinder, TBLayer::theOuterComps, and TBLayer::theOuterCylinder.

◆ ~TIBLayer()

TIBLayer::~TIBLayer ( )
override

Definition at line 65 of file TIBLayer.cc.

65 {}

Member Function Documentation

◆ computeIndexes()

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

Implements TBLayer.

Definition at line 92 of file TIBLayer.cc.

92  {
93  int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.z());
94  const GeometricSearchDet* innerRing = theInnerComps[innerIndex];
95  float innerDist = std::abs(innerRing->surface().position().z() - gInnerPoint.z());
96 
97  int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.z());
98  const GeometricSearchDet* outerRing = theOuterComps[outerIndex];
99  float outerDist = std::abs(outerRing->surface().position().z() - gOuterPoint.z());
100 
101  return std::make_tuple(innerDist < outerDist, innerIndex, outerIndex);
102 }

References funct::abs(), GeneralBinFinderInZforGeometricSearchDet< T >::binIndex(), GloballyPositioned< T >::position(), GeometricSearchDet::surface(), theInnerBinFinder, TBLayer::theInnerComps, theOuterBinFinder, TBLayer::theOuterComps, and PV3DBase< T, PVType, FrameType >::z().

◆ computeWindowSize()

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

Implements TBLayer.

Definition at line 152 of file TIBLayer.cc.

154  {
155  // we assume the outer and inner rings have about same thickness...
156 
157  // edm::LogInfo(TkDetLayers) << "TIBLayer::computeWindowSize: Y axis of tangent plane is"
158  // << plane.toGlobal( LocalVector(0,1,0)) ;
159 
161  float yError = localError.y();
162 
163  // float tanTheta = std::tan( tsos.globalMomentum().theta());
164  auto gm = tsos.globalMomentum();
165  auto cotanTheta = gm.z() / gm.perp();
166  float thickCorrection = 0.5f * det->surface().bounds().thickness() * std::abs(cotanTheta);
167 
168  // FIXME: correct this in case of wide phi window !
169 
170  return yError + thickCorrection;
171 }

References funct::abs(), Surface::bounds(), TrajectoryStateOnSurface::globalMomentum(), MeasurementEstimator::maximalLocalDisplacement(), GeomDet::surface(), Bounds::thickness(), PV2DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ cylinder()

BoundCylinder * TIBLayer::cylinder ( const std::vector< const GeometricSearchDet * > &  rings)
private

Definition at line 67 of file TIBLayer.cc.

67  {
68  float leftPos = rings.front()->surface().position().z();
69  float rightPos = rings.back()->surface().position().z();
70 
71  const BoundCylinder& frontRing = static_cast<const BoundCylinder&>(rings.front()->surface());
72  const BoundCylinder& backRing = static_cast<const BoundCylinder&>(rings.back()->surface());
73  float r = frontRing.radius();
74  const Bounds& leftBounds = frontRing.bounds();
75  const Bounds& rightBounds = backRing.bounds();
76 
77  //float r = rings.front()->specificSurface().radius();
78  //const Bounds& leftBounds = rings.front()->specificSurface().bounds();
79  //const Bounds& rightBounds = rings.back()->specificSurface().bounds();
80 
81  float thick = leftBounds.thickness() / 2;
82  float zmin = leftPos - leftBounds.length() / 2;
83  float zmax = rightPos + rightBounds.length() / 2;
84  float rmin = r - thick;
85  float rmax = r + thick;
86  float zpos = 0.5 * (leftPos + rightPos);
87 
88  auto scp = new SimpleCylinderBounds(rmin, rmax, zmin - zpos, zmax - zpos);
89  return new Cylinder(r, Surface::PositionType(0, 0, zpos), rings.front()->surface().rotation(), scp);
90 }

References Bounds::length(), alignCSCRings::r, Bounds::thickness(), SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

Referenced by TIBLayer().

◆ overlap()

bool TIBLayer::overlap ( const GlobalPoint gpos,
const GeometricSearchDet ring,
float  window 
)
staticprivate

Definition at line 144 of file TIBLayer.cc.

144  {
145  float halfLength = 0.5f * det.surface().bounds().length();
146 
147  // edm::LogInfo(TkDetLayers) << " TIBLayer: checking ring with z " << det.position().z();
148 
149  return std::abs(crossPoint.z() - det.position().z()) < (halfLength + window);
150 }

References funct::abs(), Surface::bounds(), Bounds::length(), GeometricSearchDet::position(), GeometricSearchDet::surface(), svgfig::window(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by searchNeighbors().

◆ searchNeighbors()

void TIBLayer::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 104 of file TIBLayer.cc.

110  {
111  const GlobalPoint& gCrossingPos = crossing.position();
112 
113  const std::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 (gCrossingPos.z() < sLayer[closestIndex]->surface().position().z()) {
121  posStartIndex = closestIndex;
122  } else {
123  negStartIndex = closestIndex;
124  }
125  }
126 
127  typedef CompatibleDetToGroupAdder Adder;
128  for (int idet = negStartIndex; idet >= 0; idet--) {
129  const GeometricSearchDet* neighborRing = sLayer[idet];
130  if (!overlap(gCrossingPos, *neighborRing, window))
131  break;
132  if (!Adder::add(*neighborRing, tsos, prop, est, result))
133  break;
134  }
135  for (int idet = posStartIndex; idet < static_cast<int>(sLayer.size()); idet++) {
136  const GeometricSearchDet* neighborRing = sLayer[idet];
137  if (!overlap(gCrossingPos, *neighborRing, window))
138  break;
139  if (!Adder::add(*neighborRing, tsos, prop, est, result))
140  break;
141  }
142 }

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

Member Data Documentation

◆ theInnerBinFinder

GeneralBinFinderInZforGeometricSearchDet<float> TIBLayer::theInnerBinFinder
private

Definition at line 39 of file TIBLayer.h.

Referenced by computeIndexes(), and TIBLayer().

◆ theOuterBinFinder

GeneralBinFinderInZforGeometricSearchDet<float> TIBLayer::theOuterBinFinder
private

Definition at line 40 of file TIBLayer.h.

Referenced by computeIndexes(), and TIBLayer().

SubLayerCrossing::position
const GlobalPoint & position() const
Definition: SubLayerCrossings.h:14
mps_fire.i
i
Definition: mps_fire.py:428
GeneralBinFinderInZforGeometricSearchDet< float >
TBLayer::TBLayer
TBLayer(std::vector< const TDET * > &inner, std::vector< const TDET * > &outer, GeomDetEnumerators::SubDetector ime)
Definition: TBLayer.h:13
GeomDetEnumerators::TIB
Definition: GeomDetEnumerators.h:13
BarrelDetLayer::initialize
virtual void initialize()
Definition: BarrelDetLayer.cc:18
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
Bounds
Definition: Bounds.h:18
TIBLayer::theInnerBinFinder
GeneralBinFinderInZforGeometricSearchDet< float > theInnerBinFinder
Definition: TIBLayer.h:39
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
TBLayer::theInnerCylinder
ReferenceCountingPointer< BoundCylinder > theInnerCylinder
Definition: TBLayer.h:74
Bounds::length
virtual float length() const =0
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
SimpleCylinderBounds
Definition: SimpleCylinderBounds.h:19
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
Vector2DBase
Definition: Vector2DBase.h:8
Point3DBase< float, GlobalTag >
isDetLessZ
bool isDetLessZ(const GeometricSearchDet *a, const GeometricSearchDet *b)
Definition: DetLessZ.h:10
TBLayer::theComps
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:69
Bounds::thickness
virtual float thickness() const =0
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
TBLayer::theBasicComps
std::vector< const GeomDet * > theBasicComps
Definition: TBLayer.h:72
PVValHelper::add
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
Definition: PVValidationHelpers.cc:12
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
TBLayer::theOuterComps
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TBLayer.h:71
SubLayerCrossing::closestDetIndex
int closestDetIndex() const
Definition: SubLayerCrossings.h:13
GeneralBinFinderInZforGeometricSearchDet::binIndex
int binIndex(T z) const override
returns an index in the valid range for the bin closest to Z
Definition: GeneralBinFinderInZforGeometricSearchDet.h:37
TBLayer::subLayer
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
Definition: TBLayer.h:51
TBLayer::theOuterCylinder
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
Definition: TBLayer.h:75
alignCSCRings.r
r
Definition: alignCSCRings.py:93
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
TIBLayer::cylinder
BoundCylinder * cylinder(const std::vector< const GeometricSearchDet * > &rings) __attribute__((cold))
Definition: TIBLayer.cc:67
TIBLayer::overlap
static bool overlap(const GlobalPoint &gpos, const GeometricSearchDet &ring, float window) __attribute__((hot))
Definition: TIBLayer.cc:144
TBLayer::theInnerComps
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TBLayer.h:70
CompatibleDetToGroupAdder
Definition: CompatibleDetToGroupAdder.h:13
GeometricSearchDet::surface
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
BoundCylinder
SubLayerCrossing::subLayerIndex
int subLayerIndex() const
Definition: SubLayerCrossings.h:12
Cylinder
Definition: Cylinder.h:19
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GeometricSearchDet
Definition: GeometricSearchDet.h:17
TIBLayer::theOuterBinFinder
GeneralBinFinderInZforGeometricSearchDet< float > theOuterBinFinder
Definition: TIBLayer.h:40
BarrelDetLayer::specificSurface
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
Definition: BarrelDetLayer.h:39
MeasurementEstimator::maximalLocalDisplacement
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0