CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
GlobalDetRodRangeZPhi Class Reference

#include <GlobalDetRodRangeZPhi.h>

Public Types

typedef std::pair< float, float > Range
 

Public Member Functions

 GlobalDetRodRangeZPhi (const Plane &RodPlane)
 
Range phiRange () const
 
Range zRange () const
 

Private Attributes

Range thePhiRange
 
Range theZRange
 

Detailed Description

Implementation class for PhiZMeasurementEstimator etc.

Definition at line 12 of file GlobalDetRodRangeZPhi.h.

Member Typedef Documentation

◆ Range

typedef std::pair<float, float> GlobalDetRodRangeZPhi::Range

Definition at line 14 of file GlobalDetRodRangeZPhi.h.

Constructor & Destructor Documentation

◆ GlobalDetRodRangeZPhi()

GlobalDetRodRangeZPhi::GlobalDetRodRangeZPhi ( const Plane RodPlane)

Definition at line 8 of file GlobalDetRodRangeZPhi.cc.

References Surface::bounds(), TCMET_cfi::corner, l1tTrackerHTMiss_cfi::deltaZ, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, Bounds::length(), SiStripPI::max, SiStripPI::min, PV3DBase< T, PVType, FrameType >::perp(), phi, Geom::phiLess(), phimax, phimin, thePhiRange, theZRange, Bounds::thickness(), Surface::toGlobal(), Bounds::width(), z, SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

8  {
9  float dx = plane.bounds().width() / 2.;
10  float dy = plane.bounds().length() / 2.;
11  float dz = plane.bounds().thickness() / 2.;
12 
13  // rods may be inverted (actually are in every other layer), so have to find out the
14  // orientation of the local frame
15  float deltaZ =
16  (plane.toGlobal(LocalPoint(0, 0, -dz)).perp() < plane.toGlobal(LocalPoint(0, 0, dz)).perp()) ? -dz : dz;
17 
18  const std::array<Surface::GlobalPoint, 4> corners{{plane.toGlobal(LocalPoint(-dx, -dy, deltaZ)),
19  plane.toGlobal(LocalPoint(-dx, dy, deltaZ)),
20  plane.toGlobal(LocalPoint(dx, -dy, deltaZ)),
21  plane.toGlobal(LocalPoint(dx, dy, deltaZ))}};
22 
23  float phimin = corners[0].phi();
24  float phimax = phimin;
25 
26  float zmin = corners[0].z();
27  float zmax = zmin;
28 
29  for (const auto& corner : corners) {
30  float phi = corner.phi();
31  if (Geom::phiLess(phi, phimin))
32  phimin = phi;
33  if (Geom::phiLess(phimax, phi))
34  phimax = phi;
35 
36  float z = corner.z();
37  zmin = std::min(zmin, z);
38  zmax = std::max(zmax, z);
39  }
40 
41  theZRange.first = zmin;
42  theZRange.second = zmax;
43  thePhiRange.first = phimin;
44  thePhiRange.second = phimax;
45 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18

Member Function Documentation

◆ phiRange()

Range GlobalDetRodRangeZPhi::phiRange ( ) const
inline

Definition at line 19 of file GlobalDetRodRangeZPhi.h.

References thePhiRange.

◆ zRange()

Range GlobalDetRodRangeZPhi::zRange ( ) const
inline

Definition at line 18 of file GlobalDetRodRangeZPhi.h.

References theZRange.

18 { return theZRange; }

Member Data Documentation

◆ thePhiRange

Range GlobalDetRodRangeZPhi::thePhiRange
private

Definition at line 23 of file GlobalDetRodRangeZPhi.h.

Referenced by GlobalDetRodRangeZPhi(), and phiRange().

◆ theZRange

Range GlobalDetRodRangeZPhi::theZRange
private

Definition at line 22 of file GlobalDetRodRangeZPhi.h.

Referenced by GlobalDetRodRangeZPhi(), and zRange().