CMS 3D CMS Logo

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

#include <BarrelDetLayer.h>

Inheritance diagram for BarrelDetLayer:
DetLayer GeometricSearchDet GCC11_FINAL< T, TOPO > RodBarrelLayer GCC11_FINAL< T, TOPO > GCC11_FINAL< T, TOPO > MuRodBarrelLayer

Public Member Functions

 BarrelDetLayer ()
 
virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const GCC11_FINAL
 
bool contains (const Local3DPoint &p) const
 
virtual Location location () const GCC11_FINAL
 DetLayer interface. More...
 
virtual const BoundCylinderspecificSurface () const GCC11_FINAL
 Extension of the interface. More...
 
virtual const BoundSurfacesurface () const GCC11_FINAL
 GeometricSearchDet interface. More...
 
virtual ~BarrelDetLayer ()
 
- Public Member Functions inherited from DetLayer
template<typename... Args>
std::vector< const DetLayer * > compatibleLayers (Args &&...args) const
 Returns all layers compatible. More...
 
 DetLayer (bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
NavigableLayernavigableLayer () const
 Return the NavigableLayer associated with this DetLayer. More...
 
template<typename... Args>
std::vector< const DetLayer * > nextLayers (Args &&...args) const
 
int seqNum () const
 
void setNavigableLayer (NavigableLayer *nlp)
 Set the NavigableLayer associated with this DetLayer. More...
 
void setSeqNum (int sq)
 
virtual SubDetector subDetector () const =0
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
virtual ~DetLayer ()
 
- 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 ()
 
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
 
virtual bool hasGroups () const =0
 
virtual const
Surface::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Protected Member Functions

virtual BoundCylindercomputeSurface ()
 
virtual void initialize ()
 
void setSurface (BoundCylinder *cp)
 

Private Attributes

ReferenceCountingPointer
< BoundCylinder
theCylinder
 

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 Attributes inherited from GeometricSearchDet
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 ( )
inline

Definition at line 26 of file BarrelDetLayer.h.

26  : DetLayer(true),
27  theCylinder(0){}
DetLayer(bool ibar)
Definition: DetLayer.h:30
ReferenceCountingPointer< BoundCylinder > theCylinder
BarrelDetLayer::~BarrelDetLayer ( )
virtual

Definition at line 10 of file BarrelDetLayer.cc.

10 {}

Member Function Documentation

pair< bool, TrajectoryStateOnSurface > BarrelDetLayer::compatible ( const TrajectoryStateOnSurface ts,
const Propagator ,
const MeasurementEstimator  
) const
virtual

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.

Reimplemented in GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, GCC11_FINAL< T, TOPO >, and GCC11_FINAL< T, TOPO >.

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(), PV3DBase< T, PVType, FrameType >::perp(), CartesianTrajectoryError::position(), Propagator::propagate(), mathSSE::sqrt(), unlikely, and PV3DBase< T, PVType, FrameType >::z().

Referenced by MuRodBarrelLayer::compatibleDets().

77 {
78  if unlikely(theCylinder == 0) 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  // take into account the thickness of the layer
86  float deltaZ = 0.5f* surface().bounds().thickness() *
87  std::abs(myState.globalDirection().z())/myState.globalDirection().perp();
88 
89  // take into account the error on the predicted state
90  const float nSigma = 3.;
91  if (myState.hasError()) {
92  deltaZ += nSigma * sqrt( myState.cartesianError().position().czz());
93  }
94  //
95  // check z assuming symmetric bounds around position().z()
96  //
97  deltaZ += 0.5f*surface().bounds().length();
98  return make_pair(fabs(myState.globalPosition().z()-surface().position().z())<deltaZ,
99  myState);
100 }
virtual float length() const =0
virtual const BoundSurface & surface() const GCC11_FINAL
GeometricSearchDet interface.
const Bounds & bounds() const
Definition: Surface.h:128
float float float z
#define unlikely(x)
Definition: Likely.h:21
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
string const
Definition: compareJSON.py:14
return(e1-e2)*(e1-e2)+dp *dp
T perp() const
Magnitude of transverse component.
if(dp >Float(M_PI)) dp-
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const GCC11_FINAL
volatile std::atomic< bool > shutdown_flag false
const PositionType & position() const
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
static const int ERROR
ReferenceCountingPointer< BoundCylinder > theCylinder
BoundCylinder * BarrelDetLayer::computeSurface ( )
protectedvirtual

Definition at line 31 of file BarrelDetLayer.cc.

References BoundingBox::corners(), F(), max(), bookConverter::min, alignCSCRings::r, makeMuonMisalignmentScenario::rot, and detailsBasic3DVector::z.

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
float float float z
const T & max(const T &a, const T &b)
static std::vector< GlobalPoint > corners(const Plane &)
Definition: BoundingBox.cc:24
virtual const std::vector< const GeomDet * > & basicComponents() const =0
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.

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

Definition at line 23 of file BarrelDetLayer.cc.

Referenced by MuRodBarrelLayer::MuRodBarrelLayer().

24 {
26 }
virtual BoundCylinder * computeSurface()
void setSurface(BoundCylinder *cp)
virtual Location BarrelDetLayer::location ( ) const
inlinevirtual

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 CommonMethods::cp().

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

Member Data Documentation

ReferenceCountingPointer<BoundCylinder> BarrelDetLayer::theCylinder
private

Definition at line 59 of file BarrelDetLayer.h.

Referenced by specificSurface(), and surface().