CMS 3D CMS Logo

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

#include <ForwardDetLayer.h>

Inheritance diagram for ForwardDetLayer:
DetLayer GeometricSearchDet PixelForwardLayer PixelForwardLayerPhase1 TECLayer

Public Member Functions

std::pair< bool, TrajectoryStateOnSurfacecompatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
 
bool contains (const Local3DPoint &p) const
 
 ForwardDetLayer (bool doHaveGroups)
 
Location location () const final
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const final
 
const BoundSurfacesurface () const final
 The surface of the GeometricSearchDet. More...
 
 ~ForwardDetLayer () 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

SimpleDiskBounds const & bounds () const
 
virtual BoundDiskcomputeSurface ()
 
virtual void initialize ()
 
float rmax () const
 
float rmin () const
 
void setSurface (BoundDisk *cp)
 
float zmax () const
 
float zmin () const
 

Private Attributes

ReferenceCountingPointer< BoundDisktheDisk
 

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 forward layers. Forward layers are disks with their axes parallel to the global Z axis. The methods that have a common implementation for all ForwardDetLayers are implemented in this class, but some methods are left abstract.

Definition at line 22 of file ForwardDetLayer.h.

Constructor & Destructor Documentation

ForwardDetLayer::ForwardDetLayer ( bool  doHaveGroups)
inline

Definition at line 24 of file ForwardDetLayer.h.

References ~ForwardDetLayer().

24 : DetLayer(doHaveGroups, false) {}
DetLayer(bool doHaveGroup, bool ibar)
Definition: DetLayer.h:26
ForwardDetLayer::~ForwardDetLayer ( )
override

Definition at line 9 of file ForwardDetLayer.cc.

Referenced by ForwardDetLayer().

9 {}

Member Function Documentation

SimpleDiskBounds const& ForwardDetLayer::bounds ( ) const
inlineprotected

Definition at line 54 of file ForwardDetLayer.h.

References watchdog::const, and theDisk.

Referenced by zmax(), and zmin().

54 { return static_cast<SimpleDiskBounds const&>(theDisk->bounds()); }
ReferenceCountingPointer< BoundDisk > theDisk
pair< bool, TrajectoryStateOnSurface > ForwardDetLayer::compatible ( const TrajectoryStateOnSurface ts,
const Propagator ,
const MeasurementEstimator  
) const
overridevirtual

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 83 of file ForwardDetLayer.cc.

References funct::abs(), PbPb_ZMuSkimMuonDPG_cff::deltaR, runTheMatrix::err, f, TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), SiStripPI::max, HLTSiStripMonitoring_cff::nSigma, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::perp2(), LocalTrajectoryError::positionError(), Propagator::propagate(), diffTwoXMLs::r2, mathSSE::sqrt(), UNLIKELY, LocalError::xx(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by surface().

85  {
86  if
87  UNLIKELY(theDisk == nullptr)
88  edm::LogError("DetLayers") << "ERROR: BarrelDetLayer::compatible() is used before the layer surface is initialized";
89  // throw an exception? which one?
90 
91  TrajectoryStateOnSurface myState = prop.propagate(ts, specificSurface());
92  if
93  UNLIKELY(!myState.isValid()) return make_pair(false, myState);
94 
95  // check z; (are we sure?????)
96  // auto z = myState.localPosition().z();
97  // if ( z<bounds().minZ | z>bounds().maxZ) return make_pair( false, myState);
98 
99  // check r
100  auto r2 = myState.localPosition().perp2();
101  if ((r2 > rmin() * rmin()) & (r2 < rmax() * rmax()))
102  return make_pair(true, myState);
103 
104  // take into account the thickness of the layer
105  float deltaR = 0.5f * bounds().thickness() * myState.localDirection().perp() / std::abs(myState.localDirection().z());
106 
107  // and take into account the error on the predicted state
108  const float nSigma = 3.;
109  if (myState.hasError()) {
110  LocalError err = myState.localError().positionError();
111  // ignore correlation for the moment...
112  deltaR += nSigma * sqrt(err.xx() + err.yy());
113  }
114 
115  // check r again;
116  auto ri2 = std::max(rmin() - deltaR, 0.f);
117  ri2 *= ri2;
118  auto ro2 = rmax() + deltaR;
119  ro2 *= ro2;
120  return make_pair((r2 > ri2) & (r2 < ro2), myState);
121 }
float xx() const
Definition: LocalError.h:22
SimpleDiskBounds const & bounds() const
float rmin() const
return((rh^lh)&mask)
float yy() const
Definition: LocalError.h:24
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
ReferenceCountingPointer< BoundDisk > theDisk
virtual const BoundDisk & specificSurface() const final
T perp2() const
Squared magnitude of transverse component.
T perp() const
Magnitude of transverse component.
HLT enums.
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
float rmax() const
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
#define UNLIKELY(x)
Definition: Likely.h:21
static const int ERROR
BoundDisk * ForwardDetLayer::computeSurface ( )
protectedvirtual

Definition at line 18 of file ForwardDetLayer.cc.

References makeMuonMisalignmentScenario::components, BoundingBox::corners(), Vector3DBase< T, FrameTag >::dot(), F(), LogDebug, SiStripPI::max, min(), alignCSCRings::r, makeMuonMisalignmentScenario::rot, Vector3DBase< T, FrameTag >::unit(), ApeEstimator_cff::width, HLT_2018_cff::xAxis, and HLT_2018_cff::yAxis.

Referenced by PixelForwardLayer::PixelForwardLayer(), PixelForwardLayerPhase1::PixelForwardLayerPhase1(), and zmax().

18  {
19  LogDebug("DetLayers") << "ForwaLayer::computeSurface callded";
20  vector<const GeomDet*> comps = basicComponents();
21 
22  vector<const GeomDet*>::const_iterator ifirst = comps.begin();
23  vector<const GeomDet*>::const_iterator ilast = comps.end();
24 
25  // Find extension in R
26  float theRmin = components().front()->position().perp();
27  float theRmax = theRmin;
28  float theZmin = components().back()->position().z();
29  float theZmax = theZmin;
30  for (vector<const GeomDet*>::const_iterator deti = ifirst; deti != ilast; deti++) {
31  vector<GlobalPoint> corners = BoundingBox().corners(dynamic_cast<const Plane&>((**deti).surface()));
32  for (vector<GlobalPoint>::const_iterator ic = corners.begin(); ic != corners.end(); ic++) {
33  float r = ic->perp();
34  LogDebug("DetLayers") << "corner.perp(): " << r;
35  float z = ic->z();
36  theRmin = min(theRmin, r);
37  theRmax = max(theRmax, r);
38  theZmin = min(theZmin, z);
39  theZmax = max(theZmax, z);
40  }
41 
42  // in addition to the corners we have to check the middle of the
43  // det +/- length/2
44  // , since the min (max) radius for typical fw dets is reached there
45 
46  float rdet = (**deti).position().perp();
47  float len = (**deti).surface().bounds().length();
48  float width = (**deti).surface().bounds().width();
49 
50  GlobalVector xAxis = (**deti).toGlobal(LocalVector(1, 0, 0));
51  GlobalVector yAxis = (**deti).toGlobal(LocalVector(0, 1, 0));
52  GlobalVector perpDir = GlobalVector((**deti).position() - GlobalPoint(0, 0, (**deti).position().z()));
53 
54  double xAxisCos = xAxis.unit().dot(perpDir.unit());
55  double yAxisCos = yAxis.unit().dot(perpDir.unit());
56 
57  LogDebug("DetLayers") << "in ForwardDetLayer::computeSurface(),xAxisCos,yAxisCos: " << xAxisCos << " , "
58  << yAxisCos;
59  LogDebug("DetLayers") << "det pos.perp,length,width: " << rdet << " , " << len << " , " << width;
60 
61  if (fabs(xAxisCos) > fabs(yAxisCos)) {
62  theRmin = min(theRmin, rdet - width / 2.F);
63  theRmax = max(theRmax, rdet + width / 2.F);
64  } else {
65  theRmin = min(theRmin, rdet - len / 2.F);
66  theRmax = max(theRmax, rdet + len / 2.F);
67  }
68  }
69 
70  LogDebug("DetLayers") << "creating SimpleDiskBounds with r range" << theRmin << " " << theRmax << " and z range "
71  << theZmin << " " << theZmax;
72 
73  // By default the forward layers are positioned around the z axis of the
74  // global frame, and the axes of their local frame coincide with
75  // those of the global grame (z along the disk axis)
76  float zPos = (theZmax + theZmin) / 2.;
77  PositionType pos(0., 0., zPos);
79 
80  return new BoundDisk(pos, rot, new SimpleDiskBounds(theRmin, theRmax, theZmin - zPos, theZmax - zPos));
81 }
#define LogDebug(id)
BoundSurface::RotationType RotationType
BoundSurface::PositionType PositionType
Local3DVector LocalVector
Definition: LocalVector.h:12
virtual const std::vector< const GeomDet * > & basicComponents() const =0
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PreciseFloatType< T, U >::Type dot(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:99
virtual const std::vector< const GeometricSearchDet * > & components() const =0
Returns basic components, if any.
T min(T a, T b)
Definition: MathUtil.h:58
Vector3DBase unit() const
Definition: Vector3DBase.h:54
Disk BoundDisk
Definition: BoundDisk.h:54
static std::vector< GlobalPoint > corners(const Plane &)
Definition: BoundingBox.cc:20
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:163
Global3DVector GlobalVector
Definition: GlobalVector.h:10
bool ForwardDetLayer::contains ( const Local3DPoint p) const

Definition at line 14 of file ForwardDetLayer.cc.

Referenced by specificSurface().

14 { return surface().bounds().inside(p); }
const Bounds & bounds() const
Definition: Surface.h:89
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
void ForwardDetLayer::initialize ( void  )
protectedvirtual

Definition at line 16 of file ForwardDetLayer.cc.

Referenced by specificSurface().

virtual BoundDisk * computeSurface()
void setSurface(BoundDisk *cp)
Location ForwardDetLayer::location ( ) const
inlinefinalvirtual

Which part of the detector (barrel, endcap)

Implements DetLayer.

Definition at line 36 of file ForwardDetLayer.h.

References GeomDetEnumerators::endcap.

float ForwardDetLayer::rmax ( ) const
inlineprotected

Definition at line 47 of file ForwardDetLayer.h.

References theDisk.

47 { return theDisk->outerRadius(); }
ReferenceCountingPointer< BoundDisk > theDisk
float ForwardDetLayer::rmin ( ) const
inlineprotected

Definition at line 46 of file ForwardDetLayer.h.

References theDisk.

46 { return theDisk->innerRadius(); }
ReferenceCountingPointer< BoundDisk > theDisk
void ForwardDetLayer::setSurface ( BoundDisk cp)
protected
virtual const BoundDisk& ForwardDetLayer::specificSurface ( ) const
inlinefinalvirtual
const BoundSurface& ForwardDetLayer::surface ( ) const
inlinefinalvirtual
float ForwardDetLayer::zmax ( ) const
inlineprotected

Definition at line 49 of file ForwardDetLayer.h.

References bounds(), computeSurface(), SimDataFormats::CaloAnalysis::cp, setSurface(), theDisk, and SimpleDiskBounds::thickness().

49 { return (theDisk->position().z() + bounds().thickness() * 0.5f); }
SimpleDiskBounds const & bounds() const
float thickness() const override
ReferenceCountingPointer< BoundDisk > theDisk
float ForwardDetLayer::zmin ( ) const
inlineprotected

Definition at line 48 of file ForwardDetLayer.h.

References bounds(), theDisk, and SimpleDiskBounds::thickness().

48 { return (theDisk->position().z() - bounds().thickness() * 0.5f); }
SimpleDiskBounds const & bounds() const
float thickness() const override
ReferenceCountingPointer< BoundDisk > theDisk

Member Data Documentation

ReferenceCountingPointer<BoundDisk> ForwardDetLayer::theDisk
private

Definition at line 57 of file ForwardDetLayer.h.

Referenced by bounds(), rmax(), rmin(), specificSurface(), surface(), zmax(), and zmin().