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) {}

◆ ~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.

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

References 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.

60  {
61  if
62  UNLIKELY(theCylinder == nullptr)
63  edm::LogError("DetLayers") << "ERROR: BarrelDetLayer::compatible() is used before the layer surface is initialized";
64  // throw an exception? which one?
65 
66  TrajectoryStateOnSurface myState = prop.propagate(ts, specificSurface());
67  if
68  UNLIKELY(!myState.isValid()) return make_pair(false, myState);
69 
70  // check z assuming symmetric bounds around position().z()
71  auto z0 = std::abs(myState.globalPosition().z() - specificSurface().position().z());
72  auto deltaZ = 0.5f * bounds().length();
73  if (z0 < deltaZ)
74  return make_pair(true, myState);
75 
76  // take into account the thickness of the layer
77  deltaZ += 0.5f * bounds().thickness() * std::abs(myState.globalDirection().z()) / myState.globalDirection().perp();
78 
79  // take also into account the error on the predicted state
80  const float nSigma = 3.;
81  if (myState.hasError())
82  deltaZ += nSigma * sqrt(myState.cartesianError().position().czz());
83  //
84  // check z again
85  return make_pair(z0 < deltaZ, myState);
86 }

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

◆ computeSurface()

BoundCylinder * BarrelDetLayer::computeSurface ( )
protectedvirtual

Definition at line 21 of file BarrelDetLayer.cc.

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 }

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

◆ contains()

bool BarrelDetLayer::contains ( const Local3DPoint p) const

Definition at line 16 of file BarrelDetLayer.cc.

16 { return surface().bounds().inside(p); }

References AlCaHLTBitMon_ParallelJobs::p.

◆ 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.

14 { theCylinder = cp; }

References CommonMethods::cp().

◆ 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().

BarrelDetLayer::computeSurface
virtual BoundCylinder * computeSurface()
Definition: BarrelDetLayer.cc:21
funct::false
false
Definition: Factorize.h:29
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
BarrelDetLayer::surface
const BoundSurface & surface() const final
GeometricSearchDet interface.
Definition: BarrelDetLayer.h:29
min
T min(T a, T b)
Definition: MathUtil.h:58
FrontierCondition_GT_autoExpress_cfi.auto
auto
Definition: FrontierCondition_GT_autoExpress_cfi.py:15
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
BarrelDetLayer::theCylinder
ReferenceCountingPointer< BoundCylinder > theCylinder
Definition: BarrelDetLayer.h:53
GeometricSearchDet::RotationType
BoundSurface::RotationType RotationType
Definition: GeometricSearchDet.h:21
mathSSE::return
return((rh ^ lh) &mask)
GeometricSearchDet::position
virtual const Surface::PositionType & position() const
Returns position of the surface.
Definition: GeometricSearchDet.h:31
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
watchdog.const
const
Definition: watchdog.py:83
F
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
GeomDetEnumerators::barrel
Definition: GeomDetEnumerators.h:9
SimpleCylinderBounds
Definition: SimpleCylinderBounds.h:19
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
BoundingBox
Definition: BoundingBox.h:12
BarrelDetLayer::compatible
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const final
Definition: BarrelDetLayer.cc:58
Bounds::inside
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
DDAxes::z
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
funct::true
true
Definition: Factorize.h:173
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
BarrelDetLayer
Definition: BarrelDetLayer.h:22
alignCSCRings.r
r
Definition: alignCSCRings.py:93
std
Definition: JetResolutionObject.h:76
BarrelDetLayer::setSurface
void setSurface(BoundCylinder *cp)
Definition: BarrelDetLayer.cc:14
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
BoundingBox::corners
static std::vector< GlobalPoint > corners(const Plane &)
Definition: BoundingBox.cc:20
DetLayer::DetLayer
DetLayer(bool doHaveGroup, bool ibar)
Definition: DetLayer.h:26
Cylinder::computeRadius
static float computeRadius(Bounds const &bounds)
Definition: Cylinder.h:28
Cylinder
Definition: Cylinder.h:19
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GeometricSearchDet::PositionType
BoundSurface::PositionType PositionType
Definition: GeometricSearchDet.h:20
GeometricSearchDet::basicComponents
virtual const std::vector< const GeomDet * > & basicComponents() const =0
dqm::qstatus::ERROR
static const int ERROR
Definition: MonitorElement.h:54
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192
BarrelDetLayer::specificSurface
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
Definition: BarrelDetLayer.h:39
HLTSiStripMonitoring_cff.nSigma
nSigma
Definition: HLTSiStripMonitoring_cff.py:151
BarrelDetLayer::bounds
SimpleCylinderBounds const & bounds() const
Definition: BarrelDetLayer.h:49