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::ForwardDetLayer ( bool  doHaveGroups)
inline

Definition at line 24 of file ForwardDetLayer.h.

24 : DetLayer(doHaveGroups, false) {}

◆ ~ForwardDetLayer()

ForwardDetLayer::~ForwardDetLayer ( )
override

Definition at line 10 of file ForwardDetLayer.cc.

10 {}

Member Function Documentation

◆ bounds()

SimpleDiskBounds const& ForwardDetLayer::bounds ( ) const
inlineprotected

Definition at line 54 of file ForwardDetLayer.h.

54 { return static_cast<SimpleDiskBounds const&>(theDisk->bounds()); }

References theDisk.

Referenced by zmax(), and zmin().

◆ compatible()

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

86  {
87  if
88  UNLIKELY(theDisk == nullptr)
89  edm::LogError("DetLayers") << "ERROR: BarrelDetLayer::compatible() is used before the layer surface is initialized";
90  // throw an exception? which one?
91 
92  TrajectoryStateOnSurface myState = prop.propagate(ts, specificSurface());
93  if
94  UNLIKELY(!myState.isValid()) return make_pair(false, myState);
95 
96  // check z; (are we sure?????)
97  // auto z = myState.localPosition().z();
98  // if ( z<bounds().minZ | z>bounds().maxZ) return make_pair( false, myState);
99 
100  // check r
101  auto r2 = myState.localPosition().perp2();
102  if ((r2 > rmin() * rmin()) & (r2 < rmax() * rmax()))
103  return make_pair(true, myState);
104 
105  // take into account the thickness of the layer
106  float deltaR = 0.5f * bounds().thickness() * myState.localDirection().perp() / std::abs(myState.localDirection().z());
107 
108  // and take into account the error on the predicted state
109  const float nSigma = 3.;
110  if (myState.hasError()) {
111  LocalError err = myState.localError().positionError();
112  // ignore correlation for the moment...
113  deltaR += nSigma * sqrt(err.xx() + err.yy());
114  }
115 
116  // check r again;
117  auto ri2 = std::max(rmin() - deltaR, 0.f);
118  ri2 *= ri2;
119  auto ro2 = rmax() + deltaR;
120  ro2 *= ro2;
121  return make_pair((r2 > ri2) & (r2 < ro2), myState);
122 }

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, and PV3DBase< T, PVType, FrameType >::z().

◆ computeSurface()

BoundDisk * ForwardDetLayer::computeSurface ( )
protectedvirtual

Definition at line 19 of file ForwardDetLayer.cc.

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

References makeMuonMisalignmentScenario::components, BoundingBox::corners(), 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(), and PixelForwardLayerPhase1::PixelForwardLayerPhase1().

◆ contains()

bool ForwardDetLayer::contains ( const Local3DPoint p) const

Definition at line 15 of file ForwardDetLayer.cc.

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

References AlCaHLTBitMon_ParallelJobs::p.

◆ initialize()

void ForwardDetLayer::initialize ( void  )
protectedvirtual

Definition at line 17 of file ForwardDetLayer.cc.

◆ location()

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.

◆ rmax()

float ForwardDetLayer::rmax ( ) const
inlineprotected

Definition at line 47 of file ForwardDetLayer.h.

47 { return theDisk->outerRadius(); }

References theDisk.

◆ rmin()

float ForwardDetLayer::rmin ( ) const
inlineprotected

Definition at line 46 of file ForwardDetLayer.h.

46 { return theDisk->innerRadius(); }

References theDisk.

◆ setSurface()

void ForwardDetLayer::setSurface ( BoundDisk cp)
protected

◆ specificSurface()

virtual const BoundDisk& ForwardDetLayer::specificSurface ( ) const
inlinefinalvirtual

◆ surface()

const BoundSurface& ForwardDetLayer::surface ( ) const
inlinefinalvirtual

◆ zmax()

float ForwardDetLayer::zmax ( ) const
inlineprotected

Definition at line 49 of file ForwardDetLayer.h.

49 { return (theDisk->position().z() + bounds().thickness() * 0.5f); }

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

◆ zmin()

float ForwardDetLayer::zmin ( ) const
inlineprotected

Definition at line 48 of file ForwardDetLayer.h.

48 { return (theDisk->position().z() - bounds().thickness() * 0.5f); }

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

Member Data Documentation

◆ theDisk

ReferenceCountingPointer<BoundDisk> ForwardDetLayer::theDisk
private

Definition at line 57 of file ForwardDetLayer.h.

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

Vector3DBase
Definition: Vector3DBase.h:8
ForwardDetLayer::theDisk
ReferenceCountingPointer< BoundDisk > theDisk
Definition: ForwardDetLayer.h:57
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
funct::false
false
Definition: Factorize.h:34
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
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
ForwardDetLayer::surface
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
Definition: ForwardDetLayer.h:29
pos
Definition: PixelAliasList.h:18
ForwardDetLayer::setSurface
void setSurface(BoundDisk *cp)
Definition: ForwardDetLayer.cc:13
GeometricSearchDet::RotationType
BoundSurface::RotationType RotationType
Definition: GeometricSearchDet.h:21
mathSSE::return
return((rh ^ lh) &mask)
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
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
SimpleDiskBounds
Definition: SimpleDiskBounds.h:11
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
BoundingBox
Definition: BoundingBox.h:12
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
GeometricSearchDet::components
virtual const std::vector< const GeometricSearchDet * > & components() const =0
Returns basic components, if any.
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
ForwardDetLayer::rmax
float rmax() const
Definition: ForwardDetLayer.h:47
funct::true
true
Definition: Factorize.h:173
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
runTheMatrix.err
err
Definition: runTheMatrix.py:288
LocalError
Definition: LocalError.h:12
GeomDetEnumerators::endcap
Definition: GeomDetEnumerators.h:9
SimpleDiskBounds::thickness
float thickness() const override
Definition: SimpleDiskBounds.h:18
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
LocalVector
Local3DVector LocalVector
Definition: LocalVector.h:12
perp2
T perp2() const
Squared magnitude of transverse component.
Definition: Basic3DVectorLD.h:130
BarrelDetLayer
Definition: BarrelDetLayer.h:22
alignCSCRings.r
r
Definition: alignCSCRings.py:93
ForwardDetLayer::bounds
SimpleDiskBounds const & bounds() const
Definition: ForwardDetLayer.h:54
std
Definition: JetResolutionObject.h:76
ForwardDetLayer::computeSurface
virtual BoundDisk * computeSurface()
Definition: ForwardDetLayer.cc:19
HLT_2018_cff.xAxis
xAxis
Definition: HLT_2018_cff.py:44410
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
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
HLT_2018_cff.yAxis
yAxis
Definition: HLT_2018_cff.py:44412
ForwardDetLayer::compatible
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
Definition: ForwardDetLayer.cc:84
BoundDisk
Disk BoundDisk
Definition: BoundDisk.h:54
HLTSiStripMonitoring_cff.nSigma
nSigma
Definition: HLTSiStripMonitoring_cff.py:151
ForwardDetLayer::specificSurface
virtual const BoundDisk & specificSurface() const final
Definition: ForwardDetLayer.h:39
ForwardDetLayer::rmin
float rmin() const
Definition: ForwardDetLayer.h:46