CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Attributes
BarrelDetLayer Class Reference

#include <BarrelDetLayer.h>

Inheritance diagram for BarrelDetLayer:
DetLayer GeometricSearchDet TBLayer TBPLayer TIBLayer Phase2OTtiltedBarrelLayer

Public Member Functions

 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)
 
virtual SubDetector subDetector () const =0
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
 ~DetLayer () override
 
- Public Member Functions inherited from GeometricSearchDet
virtual const std::vector< const GeomDet * > & basicComponents () const =0
 
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
 
virtual const std::vector< const GeometricSearchDet * > & components () const =0
 Returns basic components, if any. More...
 
 GeometricSearchDet (bool doHaveGroups)
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual void groupedCompatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
 
bool hasGroups () const
 
virtual const Surface::PositionTypeposition () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Protected Member Functions

SimpleCylinderBounds const & bounds () const
 
virtual BoundCylindercomputeSurface ()
 
virtual void initialize ()
 
void setSurface (BoundCylinder *cp)
 

Private Attributes

ReferenceCountingPointer< BoundCylindertheCylinder
 

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 Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A specialization of the DetLayer interface for barrel layers. Barrel layers are cylinders with their axes parallel to the global Z axis. The methods that have a common implementation for all BarrelDetLayers are implemented in this class, but some methods are left abstract.

Definition at line 23 of file BarrelDetLayer.h.

Constructor & Destructor Documentation

BarrelDetLayer::BarrelDetLayer ( bool  doHaveGroup)
inline

Definition at line 26 of file BarrelDetLayer.h.

References ~BarrelDetLayer().

26  : DetLayer(doHaveGroup,true),
27  theCylinder(nullptr){}
DetLayer(bool doHaveGroup, bool ibar)
Definition: DetLayer.h:27
ReferenceCountingPointer< BoundCylinder > theCylinder
BarrelDetLayer::~BarrelDetLayer ( )
override

Definition at line 10 of file BarrelDetLayer.cc.

Referenced by BarrelDetLayer().

10 {}

Member Function Documentation

SimpleCylinderBounds const& BarrelDetLayer::bounds ( ) const
inlineprotected

Definition at line 56 of file BarrelDetLayer.h.

References theCylinder.

56 { return static_cast<SimpleCylinderBounds const &>(theCylinder->bounds());}
ReferenceCountingPointer< BoundCylinder > theCylinder
pair< bool, TrajectoryStateOnSurface > BarrelDetLayer::compatible ( const TrajectoryStateOnSurface ts,
const Propagator ,
const MeasurementEstimator  
) const
finalvirtual

tests the geometrical compatibility of the Det with the predicted state. The FreeTrajectoryState argument is propagated to the Det surface using the Propagator argument. The resulting TrajectoryStateOnSurface is tested for compatibility with the surface bounds. If compatible, a std::pair< true, propagatedState> is returned. If the propagation fails, or if the state is not compatible, a std::pair< false, propagatedState> is returned.

Implements GeometricSearchDet.

Definition at line 74 of file BarrelDetLayer.cc.

References funct::abs(), TrajectoryStateOnSurface::cartesianError(), GlobalErrorBase< T, ErrorWeightType >::czz(), TrajectoryStateOnSurface::globalDirection(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::isValid(), gsfElectronCkfTrackCandidateMaker_cff::nSigma, PV3DBase< T, PVType, FrameType >::perp(), CartesianTrajectoryError::position(), Propagator::propagate(), mathSSE::sqrt(), UNLIKELY, and PV3DBase< T, PVType, FrameType >::z().

Referenced by surface().

77 {
78  if UNLIKELY(theCylinder == nullptr) edm::LogError("DetLayers")
79  << "ERROR: BarrelDetLayer::compatible() is used before the layer surface is initialized" ;
80  // throw an exception? which one?
81 
82  TrajectoryStateOnSurface myState = prop.propagate( ts, specificSurface());
83  if UNLIKELY(!myState.isValid()) return make_pair( false, myState);
84 
85 
86  // check z assuming symmetric bounds around position().z()
87  auto z0 = std::abs(myState.globalPosition().z()-specificSurface().position().z());
88  auto deltaZ = 0.5f*bounds().length();
89  if (z0<deltaZ) return make_pair( true, myState);
90 
91  // take into account the thickness of the layer
92  deltaZ += 0.5f*bounds().thickness() *
93  std::abs(myState.globalDirection().z())/myState.globalDirection().perp();
94 
95  // take also into account the error on the predicted state
96  const float nSigma = 3.;
97  if (myState.hasError())
98  deltaZ += nSigma * sqrt( myState.cartesianError().position().czz());
99  //
100  // check z again
101  return make_pair(z0<deltaZ, myState);
102 }
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const final
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
return((rh^lh)&mask)
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
SimpleCylinderBounds const & bounds() const
virtual const Surface::PositionType & position() const
Returns position of the surface.
T perp() const
Magnitude of transverse component.
HLT enums.
const BoundSurface & surface() const final
GeometricSearchDet interface.
static const int ERROR
ReferenceCountingPointer< BoundCylinder > theCylinder
#define UNLIKELY(x)
BoundCylinder * BarrelDetLayer::computeSurface ( )
protectedvirtual

Definition at line 31 of file BarrelDetLayer.cc.

References Cylinder::computeRadius(), BoundingBox::corners(), F(), SiStripPI::max, min(), alignCSCRings::r, and makeMuonMisalignmentScenario::rot.

Referenced by specificSurface().

31  {
32  vector< const GeomDet*> comps = basicComponents();
33 
34  // Find extension in Z
35  float theRmin = comps.front()->position().perp();
36  float theRmax = theRmin;
37  float theZmin = comps.front()->position().z();
38  float theZmax = theZmin;
39  for ( vector< const GeomDet*>::const_iterator deti = comps.begin();
40  deti != comps.end(); deti++) {
41  vector<GlobalPoint> corners =
42  BoundingBox().corners( dynamic_cast<const Plane&>((*deti)->surface()));
43  for (vector<GlobalPoint>::const_iterator ic = corners.begin();
44  ic != corners.end(); ic++) {
45  float r = ic->perp();
46  float z = ic->z();
47  theRmin = min( theRmin, r);
48  theRmax = max( theRmax, r);
49  theZmin = min( theZmin, z);
50  theZmax = max( theZmax, z);
51  }
52  // in addition to the corners we have to check the middle of the
53  // det +/- thickness/2
54  // , since the min radius for some barrel dets is reached there
55  float rdet = (**deti).position().perp();
56  float thick = (**deti).surface().bounds().thickness();
57  theRmin = min( theRmin, rdet-thick/2.F);
58  theRmax = max( theRmax, rdet+thick/2.F);
59  }
60 
61  // By default the barrel layers are positioned at the center of the
62  // global frame, and the axes of their local frame coincide with
63  // those of the global grame (z along the cylinder axis)
64  PositionType pos(0.,0.,0.);
66 
67  auto scp = new SimpleCylinderBounds( theRmin, theRmax,
68  theZmin, theZmax);
69  return new Cylinder(Cylinder::computeRadius(*scp), pos, rot, scp);
70 }
BoundSurface::RotationType RotationType
BoundSurface::PositionType PositionType
virtual const std::vector< const GeomDet * > & basicComponents() const =0
T min(T a, T b)
Definition: MathUtil.h:58
static std::vector< GlobalPoint > corners(const Plane &)
Definition: BoundingBox.cc:24
static float computeRadius(Bounds const &bounds)
Definition: Cylinder.h:30
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
bool BarrelDetLayer::contains ( const Local3DPoint p) const

Definition at line 19 of file BarrelDetLayer.cc.

Referenced by specificSurface().

19  {
20  return surface().bounds().inside(p);
21 }
const Bounds & bounds() const
Definition: Surface.h:120
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
const BoundSurface & surface() const final
GeometricSearchDet interface.
void BarrelDetLayer::initialize ( void  )
protectedvirtual
Location BarrelDetLayer::location ( ) const
inlinefinalvirtual

DetLayer interface.

Implements DetLayer.

Definition at line 39 of file BarrelDetLayer.h.

References GeomDetEnumerators::barrel.

void BarrelDetLayer::setSurface ( BoundCylinder cp)
protected

Definition at line 15 of file BarrelDetLayer.cc.

References SimDataFormats::CaloAnalysis::cp.

Referenced by specificSurface().

15  {
16  theCylinder = cp;
17 }
ReferenceCountingPointer< BoundCylinder > theCylinder
virtual const BoundCylinder& BarrelDetLayer::specificSurface ( ) const
inlinefinalvirtual

Extension of the interface.

Definition at line 43 of file BarrelDetLayer.h.

References computeSurface(), contains(), SimDataFormats::CaloAnalysis::cp, initialize(), AlCaHLTBitMon_ParallelJobs::p, setSurface(), and theCylinder.

Referenced by MTDNavigationSchool::addBarrelLayer(), MuonNavigationSchool::addBarrelLayer(), GroupedCkfTrajectoryBuilder::advanceOneLayer(), CkfDebugger::analyseRecHitNotFound(), DirectMuonNavigation::checkCompatible(), DirectMTDNavigation::checkCompatible(), DirectTrackerNavigation::checkCompatible(), PixelHitMatcher::compatibleHits(), MuonShowerInformationFiller::crossingPoint(), MultipleScatteringGeometry::detLayers(), RectangularEtaPhiTrackingRegion::estimator(), HitPairGeneratorFromLayerPairForPhotonConversion::getLayerRadius(), GroupedCkfTrajectoryBuilder::groupedLimitedCandidates(), PixelTripletNoTipGenerator::hitTriplets(), ThirdHitCorrection::init(), InnerDeltaPhi::initBarrelLayer(), InnerDeltaPhi::initBarrelMS(), ThirdHitRZPredictionBase::initLayer(), ThirdHitPrediction::initLayer(), TkLayerLess::insideOutLess(), TkLayerLess::insideOutLessSigned(), SimpleNavigationSchool::linkNextForwardLayer(), OutInConversionSeedFinder::makeEstimator(), MSLayer::MSLayer(), MuonDetLayerComp::operator()(), MTDDetLayerComp::operator()(), ExtractBarrelDetLayerR::operator()(), MTDNavigationPrinter::printLayers(), MuonNavigationPrinter::printLayers(), TIBLayer::TIBLayer(), and SimpleNavigableLayer::wellInside().

43 { return *theCylinder;}
ReferenceCountingPointer< BoundCylinder > theCylinder
const BoundSurface& BarrelDetLayer::surface ( ) const
inlinefinalvirtual

Member Data Documentation

ReferenceCountingPointer<BoundCylinder> BarrelDetLayer::theCylinder
private

Definition at line 61 of file BarrelDetLayer.h.

Referenced by bounds(), specificSurface(), and surface().