CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
TIBLayer Class Reference

#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 () __attribute__((cold))
 
- Public Member Functions inherited from TBLayer
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 final __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,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const
 
bool contains (const Local3DPoint &p) const
 
virtual Location location () const
 DetLayer interface. More...
 
virtual const BoundCylinderspecificSurface () const
 Extension of the interface. More...
 
virtual const BoundSurfacesurface () const
 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::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Private Member Functions

std::tuple< bool, int, int > computeIndexes (GlobalPoint gInnerPoint, GlobalPoint gOuterPoint) const __attribute__((hot))
 
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const __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 __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
*, TrajectoryStateOnSurface
DetWithState
 
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 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
< BoundCylinder
theInnerCylinder
 
std::vector< const
GeometricSearchDet * > 
theOuterComps
 
ReferenceCountingPointer
< BoundCylinder
theOuterCylinder
 
- 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 20 of file TIBLayer.cc.

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

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

Definition at line 89 of file TIBLayer.cc.

89 {}

Member Function Documentation

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

Implements TBLayer.

Definition at line 124 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().

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

Implements TBLayer.

Definition at line 189 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().

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

Definition at line 95 of file TIBLayer.cc.

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

Referenced by TIBLayer().

96 {
97  float leftPos = rings.front()->surface().position().z();
98  float rightPos = rings.back()->surface().position().z();
99 
100  const BoundCylinder & frontRing = static_cast<const BoundCylinder &>(rings.front()->surface());
101  const BoundCylinder & backRing = static_cast<const BoundCylinder &>(rings.back()->surface());
102  float r = frontRing.radius();
103  const Bounds& leftBounds = frontRing.bounds();
104  const Bounds& rightBounds = backRing.bounds();
105 
106  //float r = rings.front()->specificSurface().radius();
107  //const Bounds& leftBounds = rings.front()->specificSurface().bounds();
108  //const Bounds& rightBounds = rings.back()->specificSurface().bounds();
109 
110  float thick = leftBounds.thickness() / 2;
111  float zmin = leftPos - leftBounds.length() / 2;
112  float zmax = rightPos + rightBounds.length() / 2;
113  float rmin = r-thick;
114  float rmax = r+thick;
115  float zpos = 0.5*(leftPos+rightPos);
116 
117  auto scp = new SimpleCylinderBounds(rmin, rmax, zmin-zpos, zmax-zpos);
118  return new Cylinder(r, Surface::PositionType( 0, 0, zpos),
119  rings.front()->surface().rotation(), scp);
120 
121 }
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 178 of file TIBLayer.cc.

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

Referenced by searchNeighbors().

181 {
182  float halfLength = 0.5f*det.surface().bounds().length();
183 
184 // edm::LogInfo(TkDetLayers) << " TIBLayer: checking ring with z " << det.position().z();
185 
186  return std::abs( crossPoint.z()-det.position().z()) < (halfLength + window);
187 }
def window
Definition: svgfig.py:642
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void TIBLayer::searchNeighbors ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
float  window,
std::vector< DetGroup > &  result,
bool  checkClosest 
) const
privatevirtual

Implements TBLayer.

Definition at line 140 of file TIBLayer.cc.

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

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