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 22 of file BarrelDetLayer.h.

Constructor & Destructor Documentation

◆ BarrelDetLayer()

BarrelDetLayer::BarrelDetLayer ( bool  doHaveGroup)
inline

Definition at line 24 of file BarrelDetLayer.h.

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

◆ ~BarrelDetLayer()

BarrelDetLayer::~BarrelDetLayer ( )
override

Definition at line 11 of file BarrelDetLayer.cc.

11 {}

Member Function Documentation

◆ bounds()

SimpleCylinderBounds const& BarrelDetLayer::bounds ( ) const
inlineprotected

Definition at line 49 of file BarrelDetLayer.h.

References runTheMatrix::const, and theCylinder.

49 { return static_cast<SimpleCylinderBounds const&>(theCylinder->bounds()); }
ReferenceCountingPointer< BoundCylinder > theCylinder

◆ compatible()

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 58 of file BarrelDetLayer.cc.

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

60  {
61  if UNLIKELY (theCylinder == nullptr)
62  edm::LogError("DetLayers") << "ERROR: BarrelDetLayer::compatible() is used before the layer surface is initialized";
63  // throw an exception? which one?
64 
65  TrajectoryStateOnSurface myState = prop.propagate(ts, specificSurface());
66  if UNLIKELY (!myState.isValid())
67  return make_pair(false, myState);
68 
69  // check z assuming symmetric bounds around position().z()
70  auto z0 = std::abs(myState.globalPosition().z() - specificSurface().position().z());
71  auto deltaZ = 0.5f * bounds().length();
72  if (z0 < deltaZ)
73  return make_pair(true, myState);
74 
75  // take into account the thickness of the layer
76  deltaZ += 0.5f * bounds().thickness() * std::abs(myState.globalDirection().z()) / myState.globalDirection().perp();
77 
78  // take also into account the error on the predicted state
79  const float nSigma = 3.;
80  if (myState.hasError())
81  deltaZ += nSigma * sqrt(myState.cartesianError().position().czz());
82  //
83  // check z again
84  return make_pair(z0 < deltaZ, myState);
85 }
virtual const Surface::PositionType & position() const
Returns position of the surface.
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
const BoundSurface & surface() const final
GeometricSearchDet interface.
return((rh ^ lh) &mask)
Log< level::Error, false > LogError
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const final
T sqrt(T t)
Definition: SSEVec.h:23
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
T perp() const
Magnitude of transverse component.
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
HLT enums.
#define UNLIKELY(x)
Definition: Likely.h:21
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
static const int ERROR
ReferenceCountingPointer< BoundCylinder > theCylinder

◆ computeSurface()

BoundCylinder * BarrelDetLayer::computeSurface ( )
protectedvirtual

Definition at line 21 of file BarrelDetLayer.cc.

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

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

◆ contains()

bool BarrelDetLayer::contains ( const Local3DPoint p) const

Definition at line 16 of file BarrelDetLayer.cc.

References AlCaHLTBitMon_ParallelJobs::p.

16 { return surface().bounds().inside(p); }
const BoundSurface & surface() const final
GeometricSearchDet interface.
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
const Bounds & bounds() const
Definition: Surface.h:87

◆ initialize()

void BarrelDetLayer::initialize ( void  )
protectedvirtual

◆ location()

Location BarrelDetLayer::location ( ) const
inlinefinalvirtual

DetLayer interface.

Implements DetLayer.

Definition at line 36 of file BarrelDetLayer.h.

References GeomDetEnumerators::barrel.

◆ setSurface()

void BarrelDetLayer::setSurface ( BoundCylinder cp)
protected

Definition at line 14 of file BarrelDetLayer.cc.

References CommonMethods::cp().

14 { theCylinder = cp; }
ReferenceCountingPointer< BoundCylinder > theCylinder
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)

◆ specificSurface()

virtual const BoundCylinder& BarrelDetLayer::specificSurface ( ) const
inlinefinalvirtual

◆ surface()

const BoundSurface& BarrelDetLayer::surface ( ) const
inlinefinalvirtual

Member Data Documentation

◆ theCylinder

ReferenceCountingPointer<BoundCylinder> BarrelDetLayer::theCylinder
private

Definition at line 53 of file BarrelDetLayer.h.

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