test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
*, TrajectoryStateOnSurface
DetWithState
 
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 () __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 __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 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::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))
 
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 __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
< 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 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 16 of file TBPLayer.h.

Member Typedef Documentation

Definition at line 18 of file TBPLayer.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file TBPLayer.h.

References construct().

22  :
void construct() __attribute__((cold))
Definition: TBPLayer.cc:23
TBLayer(std::vector< const TDET * > &inner, std::vector< const TDET * > &outer, GeomDetEnumerators::SubDetector ime)
Definition: TBLayer.h:17
TBPLayer::TBPLayer ( std::vector< const TOBRod * > &  inner,
std::vector< const TOBRod * > &  outer 
)
inline

Definition at line 25 of file TBPLayer.h.

References construct().

26  :
void construct() __attribute__((cold))
Definition: TBPLayer.cc:23
TBLayer(std::vector< const TDET * > &inner, std::vector< const TDET * > &outer, GeomDetEnumerators::SubDetector ime)
Definition: TBLayer.h:17
TBPLayer::TBPLayer ( std::vector< const Phase2OTBarrelRod * > &  inner,
std::vector< const Phase2OTBarrelRod * > &  outer 
)
inline

Definition at line 29 of file TBPLayer.h.

References construct().

30  :
void construct() __attribute__((cold))
Definition: TBPLayer.cc:23
TBLayer(std::vector< const TDET * > &inner, std::vector< const TDET * > &outer, GeomDetEnumerators::SubDetector ime)
Definition: TBLayer.h:17
TBPLayer::~TBPLayer ( )

Definition at line 85 of file TBPLayer.cc.

85 {}

Member Function Documentation

static float TBPLayer::calculatePhiWindow ( float  Xmax,
const GeomDet det,
const TrajectoryStateOnSurface state 
)
staticprivate
std::tuple< bool, int, int > TBPLayer::computeIndexes ( GlobalPoint  gInnerPoint,
GlobalPoint  gOuterPoint 
) const
privatevirtual

Implements TBLayer.

Definition at line 99 of file TBPLayer.cc.

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

99  {
100  int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.barePhi());
101  float innerDist = theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.barePhi();
102 
103  int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.barePhi());
104  float outerDist = theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.barePhi() ;
105 
106 
107  innerDist *= PhiLess()( theInnerBinFinder.binPosition(innerIndex),gInnerPoint.barePhi()) ? -1.f : 1.f;
108  outerDist *= PhiLess()( theOuterBinFinder.binPosition(outerIndex),gOuterPoint.barePhi()) ? -1.f : 1.f;
109  if (innerDist < 0.f) { innerDist += Geom::ftwoPi();}
110  if (outerDist < 0.f) { outerDist += Geom::ftwoPi();}
111 
112  return std::make_tuple(innerDist < outerDist,innerIndex, outerIndex);
113 }
constexpr float ftwoPi()
Definition: Pi.h:36
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
BinFinderType theOuterBinFinder
Definition: TBPLayer.h:69
T barePhi() const
Definition: PV3DBase.h:68
virtual T binPosition(int ind) const
the middle of the bin in radians
double f[11][100]
BinFinderType theInnerBinFinder
Definition: TBPLayer.h:68
float TBPLayer::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
privatevirtual

Implements TBLayer.

Definition at line 117 of file TBPLayer.cc.

References barrelUtil::computeWindowSize().

120 {
121 
122  return barrelUtil::computeWindowSize(det,tsos,est);
123 }
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
Definition: BarrelUtil.h:35
void TBPLayer::construct ( )
private

Definition at line 23 of file TBPLayer.cc.

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

Referenced by TBPLayer().

23  {
24  theComps.assign(theInnerComps.begin(),theInnerComps.end());
25  theComps.insert(theComps.end(),theOuterComps.begin(),theOuterComps.end());
26 
27  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
28  it!=theComps.end();it++){
29  theBasicComps.insert(theBasicComps.end(),
30  (**it).basicComponents().begin(),
31  (**it).basicComponents().end());
32  }
33 
36 
37  if (theInnerComps.size())
38  theInnerBinFinder = BinFinderType(theInnerComps.front()->position().phi(),
39  theInnerComps.size());
40 
41  if (theOuterComps.size())
42  theOuterBinFinder = BinFinderType(theOuterComps.front()->position().phi(),
43  theOuterComps.size());
44 
46 
47  //--------- DEBUG INFO --------------
48  LogDebug("TkDetLayers") << "==== DEBUG TBPLayer =====" ;
49  LogDebug("TkDetLayers") << "innerCyl radius, thickness, lenght: "
50  << theInnerCylinder->radius() << " , "
51  << theInnerCylinder->bounds().thickness() << " , "
52  << theInnerCylinder->bounds().length() ;
53 
54  LogDebug("TkDetLayers") << "outerCyl radius, thickness, lenght: "
55  << theOuterCylinder->radius() << " , "
56  << theOuterCylinder->bounds().thickness() << " , "
57  << theOuterCylinder->bounds().length() ;
58 
59  LogDebug("TkDetLayers") << "Cyl radius, thickness, lenght: "
60  << specificSurface().radius() << " , "
61  << specificSurface().bounds().thickness() << " , "
62  << specificSurface().bounds().length() ;
63 
64  for (vector<const GeometricSearchDet*>::const_iterator i=theInnerComps.begin();
65  i != theInnerComps.end(); i++){
66  LogDebug("TkDetLayers") << "inner Rod pos z,perp,eta,phi: "
67  << (**i).position().z() << " , "
68  << (**i).position().perp() << " , "
69  << (**i).position().eta() << " , "
70  << (**i).position().phi() ;
71  }
72 
73  for (vector<const GeometricSearchDet*>::const_iterator i=theOuterComps.begin();
74  i != theOuterComps.end(); i++){
75  LogDebug("TkDetLayers") << "outer Rod pos z,perp,eta,phi: "
76  << (**i).position().z() << " , "
77  << (**i).position().perp() << " , "
78  << (**i).position().eta() << " , "
79  << (**i).position().phi() ;
80  }
81  LogDebug("TkDetLayers") << "==== end DEBUG TBPLayer =====" ;
82 }
#define LogDebug(id)
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
Definition: TBLayer.h:89
int i
Definition: DBlmapReader.cc:9
virtual void initialize()
std::vector< const GeometricSearchDet * > theInnerComps
Definition: TBLayer.h:84
BoundCylinder * cylinder(const std::vector< const GeometricSearchDet * > &rods) const __attribute__((cold))
Definition: TBPLayer.cc:87
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:83
BinFinderType theOuterBinFinder
Definition: TBPLayer.h:69
PeriodicBinFinderInPhi< float > BinFinderType
Definition: TBPLayer.h:18
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
BinFinderType theInnerBinFinder
Definition: TBPLayer.h:68
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
BoundCylinder * TBPLayer::cylinder ( const std::vector< const GeometricSearchDet * > &  rods) const

Definition at line 87 of file TBPLayer.cc.

References tmp.

Referenced by Phase2OTtiltedBarrelLayer::Phase2OTtiltedBarrelLayer().

88 {
89  vector<const GeomDet*> tmp;
90  for (vector<const GeometricSearchDet*>::const_iterator it=rods.begin(); it!=rods.end(); it++) {
91  tmp.insert(tmp.end(),(*it)->basicComponents().begin(),(*it)->basicComponents().end());
92  }
93  return CylinderBuilderFromDet()( tmp.begin(), tmp.end());
94 }
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void TBPLayer::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 126 of file TBPLayer.cc.

References Clusterizer1DCommons::add(), PV3DBase< T, PVType, FrameType >::barePhi(), PeriodicBinFinderInPhi< T >::binIndex(), SubLayerCrossing::closestDetIndex(), barrelUtil::overlap(), muon::overlap(), phi(), SubLayerCrossing::position(), and SubLayerCrossing::subLayerIndex().

132  {
133  using barrelUtil::overlap;
134 
135  GlobalPoint gCrossingPos = crossing.position();
136  auto gphi = gCrossingPos.barePhi();
137 
138  const vector<const GeometricSearchDet*>& sLayer( subLayer( crossing.subLayerIndex()));
139 
140  int closestIndex = crossing.closestDetIndex();
141  int negStartIndex = closestIndex-1;
142  int posStartIndex = closestIndex+1;
143 
144  if (checkClosest) { // must decide if the closest is on the neg or pos side
145  if ( PhiLess()( gphi, sLayer[closestIndex]->surface().phi())) {
146  posStartIndex = closestIndex;
147  }
148  else {
149  negStartIndex = closestIndex;
150  }
151  }
152 
153  const BinFinderType& binFinder = (crossing.subLayerIndex()==0 ? theInnerBinFinder : theOuterBinFinder);
154 
155  typedef CompatibleDetToGroupAdder Adder;
156  int quarter = sLayer.size()/4;
157  for (int idet=negStartIndex; idet >= negStartIndex - quarter; idet--) {
158  const GeometricSearchDet & neighborRod = *sLayer[binFinder.binIndex(idet)];
159  if (!overlap( gphi, neighborRod, window)) break;
160  if (!Adder::add( neighborRod, tsos, prop, est, result)) break;
161  // maybe also add shallow crossing angle test here???
162  }
163  for (int idet=posStartIndex; idet < posStartIndex + quarter; idet++) {
164  const GeometricSearchDet & neighborRod = *sLayer[binFinder.binIndex(idet)];
165  if (!overlap( gphi, neighborRod, window)) break;
166  if (!Adder::add( neighborRod, tsos, prop, est, result)) break;
167  // maybe also add shallow crossing angle test here???
168  }
169 }
def window
Definition: svgfig.py:642
int closestDetIndex() const
virtual const BoundSurface & surface() const final
GeometricSearchDet interface.
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
BinFinderType theOuterBinFinder
Definition: TBPLayer.h:69
tuple result
Definition: mps_fire.py:84
bool overlap(const reco::Muon &muon1, const reco::Muon &muon2, double pullX=1.0, double pullY=1.0, bool checkAdjacentChambers=false)
const GlobalPoint & position() const
T barePhi() const
Definition: PV3DBase.h:68
PeriodicBinFinderInPhi< float > BinFinderType
Definition: TBPLayer.h:18
int subLayerIndex() const
bool overlap(float phi, const GeometricSearchDet &gsdet, float phiWin)
Definition: BarrelUtil.h:46
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
Definition: TBLayer.h:64
BinFinderType theInnerBinFinder
Definition: TBPLayer.h:68

Member Data Documentation

BinFinderType TBPLayer::theInnerBinFinder
private

Definition at line 68 of file TBPLayer.h.

BinFinderType TBPLayer::theOuterBinFinder
private

Definition at line 69 of file TBPLayer.h.