test
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 TBLayer TBPLayer TIBLayer

Public Member Functions

 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 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 (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::PositionType
position () 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
< 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
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.

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

Definition at line 10 of file BarrelDetLayer.cc.

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

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 
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 }
virtual const BoundSurface & surface() const final
GeometricSearchDet interface.
#define unlikely(x)
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const final
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.
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
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-
volatile std::atomic< bool > shutdown_flag false
static const int ERROR
ReferenceCountingPointer< BoundCylinder > theCylinder
BoundCylinder * BarrelDetLayer::computeSurface ( )
protectedvirtual

Definition at line 31 of file BarrelDetLayer.cc.

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

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

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 final
GeometricSearchDet interface.
const Bounds & bounds() const
Definition: Surface.h:120
void BarrelDetLayer::initialize ( void  )
protectedvirtual

Definition at line 23 of file BarrelDetLayer.cc.

Referenced by TBPLayer::construct(), MuRodBarrelLayer::MuRodBarrelLayer(), and TIBLayer::TIBLayer().

24 {
26 }
virtual BoundCylinder * computeSurface()
void setSurface(BoundCylinder *cp)
virtual 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 CommonMethods::cp().

15  {
16  theCylinder = cp;
17 }
ReferenceCountingPointer< BoundCylinder > theCylinder
virtual const BoundCylinder& BarrelDetLayer::specificSurface ( ) const
inlinefinalvirtual
virtual 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().