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 ( std::vector< const TIBRing * > &  innerRings,
std::vector< const TIBRing * > &  outerRings 
)

Definition at line 18 of file TIBLayer.cc.

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

20  : TBLayer(innerRings,outerRings, GeomDetEnumerators::TIB)
21 {
22  theComps.assign(theInnerComps.begin(),theInnerComps.end());
23  theComps.insert(theComps.end(),theOuterComps.begin(),theOuterComps.end());
24 
25  std::sort(theComps.begin(),theComps.end(),isDetLessZ);
26  std::sort(theInnerComps.begin(),theInnerComps.end(),isDetLessZ);
27  std::sort(theOuterComps.begin(),theOuterComps.end(),isDetLessZ);
28 
29  for(auto & it : theComps)
30  {
31  theBasicComps.insert(theBasicComps.end(),
32  it->basicComponents().begin(),
33  it->basicComponents().end());
34  }
35 
36  // initialize the surface
39  initialize();
40 
41  LogDebug("TkDetLayers") << "==== DEBUG TIBLayer =====" ;
42  LogDebug("TkDetLayers") << "innerCyl radius, thickness, lenght: "
43  << theInnerCylinder->radius() << " , "
44  << theInnerCylinder->bounds().thickness() << " , "
45  << theInnerCylinder->bounds().length() ;
46 
47  LogDebug("TkDetLayers") << "outerCyl radius, thickness, lenght: "
48  << theOuterCylinder->radius() << " , "
49  << theOuterCylinder->bounds().thickness() << " , "
50  << theOuterCylinder->bounds().length() ;
51 
52  LogDebug("TkDetLayers") << "Cyl radius, thickness, lenght: "
53  << specificSurface().radius() << " , "
54  << specificSurface().bounds().thickness() << " , "
55  << specificSurface().bounds().length() ;
56 
57  for (auto & i : theInnerComps)
58  {
59  LogDebug("TkDetLayers") << "inner TIBRing pos z,radius,eta,phi: "
60  << i->position().z() << " , "
61  << i->position().perp() << " , "
62  << i->position().eta() << " , "
63  << i->position().phi() ;
64  }
65 
66  for (auto & i : theOuterComps)
67  {
68  LogDebug("TkDetLayers") << "outer TIBRing pos z,radius,eta,phi: "
69  << i->position().z() << " , "
70  << i->position().perp() << " , "
71  << i->position().eta() << " , "
72  << i->position().phi() ;
73  }
74 
75 
76 
77  // initialise the bin finders
78  // vector<const GeometricSearchDet*> tmpIn;
79  //for (vector<const TIBRing*>::const_iterator i=theInnerRings.begin();
80  // i != theInnerRings.end(); i++) tmpIn.push_back(*i);
82  theInnerComps.end());
83 
85  theOuterComps.end());
86 }
#define LogDebug(id)
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
Definition: TBLayer.h:89
virtual void initialize()
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TBLayer.h:84
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:83
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
GeneralBinFinderInZforGeometricSearchDet< float > theOuterBinFinder
Definition: TIBLayer.h:43
bool isDetLessZ(const GeometricSearchDet *a, const GeometricSearchDet *b)
Definition: DetLessZ.h:10
TBLayer(std::vector< const TDET * > &inner, std::vector< const TDET * > &outer, GeomDetEnumerators::SubDetector ime)
Definition: TBLayer.h:17
BoundCylinder * cylinder(const std::vector< const GeometricSearchDet * > &rings) __attribute__((cold))
Definition: TIBLayer.cc:94
GeneralBinFinderInZforGeometricSearchDet< float > theInnerBinFinder
Definition: TIBLayer.h:42
std::vector< const GeomDet * > theBasicComps
Definition: TBLayer.h:86
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TBLayer.h:85
ReferenceCountingPointer< BoundCylinder > theInnerCylinder
Definition: TBLayer.h:88
TIBLayer::~TIBLayer ( )
override

Definition at line 88 of file TIBLayer.cc.

88 {}

Member Function Documentation

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

Implements TBLayer.

Definition at line 123 of file TIBLayer.cc.

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

123  {
124 
125  int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.z());
126  const GeometricSearchDet* innerRing = theInnerComps[innerIndex];
127  float innerDist = std::abs( innerRing->surface().position().z() - gInnerPoint.z());
128 
129  int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.z());
130  const GeometricSearchDet* outerRing = theOuterComps[outerIndex];
131  float outerDist = std::abs( outerRing->surface().position().z() - gOuterPoint.z());
132 
133 
134  return std::make_tuple(innerDist < outerDist,innerIndex, outerIndex);
135 
136 
137 }
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TBLayer.h:84
int binIndex(T z) const override
returns an index in the valid range for the bin closest to Z
GeneralBinFinderInZforGeometricSearchDet< float > theOuterBinFinder
Definition: TIBLayer.h:43
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
GeneralBinFinderInZforGeometricSearchDet< float > theInnerBinFinder
Definition: TIBLayer.h:42
std::vector< const GeometricSearchDet * > theOuterComps
Definition: TBLayer.h:85
const PositionType & position() const
float TIBLayer::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
overrideprivatevirtual

Implements TBLayer.

Definition at line 188 of file TIBLayer.cc.

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

191 {
192  // we assume the outer and inner rings have about same thickness...
193 
194 // edm::LogInfo(TkDetLayers) << "TIBLayer::computeWindowSize: Y axis of tangent plane is"
195 // << plane.toGlobal( LocalVector(0,1,0)) ;
196 
198  float yError = localError.y();
199 
200  // float tanTheta = std::tan( tsos.globalMomentum().theta());
201  auto gm = tsos.globalMomentum();
202  auto cotanTheta = gm.z()/gm.perp();
203  float thickCorrection = 0.5f*det->surface().bounds().thickness()*std::abs( cotanTheta);
204 
205  // FIXME: correct this in case of wide phi window !
206 
207  return yError + thickCorrection;
208 }
const Bounds & bounds() const
Definition: Surface.h:120
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual float thickness() const =0
GlobalVector globalMomentum() const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
BoundCylinder * TIBLayer::cylinder ( const std::vector< const GeometricSearchDet * > &  rings)
private

Definition at line 94 of file TIBLayer.cc.

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

Referenced by TIBLayer().

95 {
96  float leftPos = rings.front()->surface().position().z();
97  float rightPos = rings.back()->surface().position().z();
98 
99  const BoundCylinder & frontRing = static_cast<const BoundCylinder &>(rings.front()->surface());
100  const BoundCylinder & backRing = static_cast<const BoundCylinder &>(rings.back()->surface());
101  float r = frontRing.radius();
102  const Bounds& leftBounds = frontRing.bounds();
103  const Bounds& rightBounds = backRing.bounds();
104 
105  //float r = rings.front()->specificSurface().radius();
106  //const Bounds& leftBounds = rings.front()->specificSurface().bounds();
107  //const Bounds& rightBounds = rings.back()->specificSurface().bounds();
108 
109  float thick = leftBounds.thickness() / 2;
110  float zmin = leftPos - leftBounds.length() / 2;
111  float zmax = rightPos + rightBounds.length() / 2;
112  float rmin = r-thick;
113  float rmax = r+thick;
114  float zpos = 0.5*(leftPos+rightPos);
115 
116  auto scp = new SimpleCylinderBounds(rmin, rmax, zmin-zpos, zmax-zpos);
117  return new Cylinder(r, Surface::PositionType( 0, 0, zpos),
118  rings.front()->surface().rotation(), scp);
119 
120 }
virtual float length() const =0
virtual float thickness() const =0
Definition: Bounds.h:22
bool TIBLayer::overlap ( const GlobalPoint gpos,
const GeometricSearchDet ring,
float  window 
)
staticprivate

Definition at line 177 of file TIBLayer.cc.

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

Referenced by searchNeighbors().

180 {
181  float halfLength = 0.5f*det.surface().bounds().length();
182 
183 // edm::LogInfo(TkDetLayers) << " TIBLayer: checking ring with z " << det.position().z();
184 
185  return std::abs( crossPoint.z()-det.position().z()) < (halfLength + window);
186 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
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
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 139 of file TIBLayer.cc.

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

146 {
147  const GlobalPoint& gCrossingPos = crossing.position();
148 
149  const std::vector<const GeometricSearchDet*>& sLayer( subLayer( crossing.subLayerIndex()));
150 
151  int closestIndex = crossing.closestDetIndex();
152  int negStartIndex = closestIndex-1;
153  int posStartIndex = closestIndex+1;
154 
155  if (checkClosest) { // must decide if the closest is on the neg or pos side
156  if (gCrossingPos.z() < sLayer[closestIndex]->surface().position().z()) {
157  posStartIndex = closestIndex;
158  }
159  else {
160  negStartIndex = closestIndex;
161  }
162  }
163 
164  typedef CompatibleDetToGroupAdder Adder;
165  for (int idet=negStartIndex; idet >= 0; idet--) {
166  const GeometricSearchDet* neighborRing = sLayer[idet];
167  if (!overlap( gCrossingPos, *neighborRing, window)) break;
168  if (!Adder::add( *neighborRing, tsos, prop, est, result)) break;
169  }
170  for (int idet=posStartIndex; idet < static_cast<int>(sLayer.size()); idet++) {
171  const GeometricSearchDet* neighborRing = sLayer[idet];
172  if (!overlap( gCrossingPos, *neighborRing, window)) break;
173  if (!Adder::add( *neighborRing, tsos, prop, est, result)) break;
174  }
175 }
static bool overlap(const GlobalPoint &gpos, const GeometricSearchDet &ring, float window) __attribute__((hot))
Definition: TIBLayer.cc:177
int closestDetIndex() const
const GlobalPoint & position() const
int subLayerIndex() const
T z() const
Definition: PV3DBase.h:64
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
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
Definition: TBLayer.h:64

Member Data Documentation

GeneralBinFinderInZforGeometricSearchDet<float> TIBLayer::theInnerBinFinder
private

Definition at line 42 of file TIBLayer.h.

Referenced by computeIndexes(), and TIBLayer().

GeneralBinFinderInZforGeometricSearchDet<float> TIBLayer::theOuterBinFinder
private

Definition at line 43 of file TIBLayer.h.

Referenced by computeIndexes(), and TIBLayer().