CMS 3D CMS Logo

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

#include <BoundSpan.h>

Public Member Functions

 BoundSpan ()
 
void compute (Surface const &plane)
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
std::pair< float, float > const & zSpan () const
 

Private Attributes

std::pair< float, float > m_phiSpan
 
std::pair< float, float > m_rSpan
 
std::pair< float, float > m_zSpan
 

Detailed Description

Definition at line 13 of file BoundSpan.h.

Constructor & Destructor Documentation

◆ BoundSpan()

BoundSpan::BoundSpan ( )
inline

Definition at line 17 of file BoundSpan.h.

17 : m_phiSpan(0., 0.), m_zSpan(0., 0.), m_rSpan(0., 0.) {}

Member Function Documentation

◆ compute()

void BoundSpan::compute ( Surface const &  plane)

Definition at line 8 of file BoundSpan.cc.

8  {
9  const TrapezoidalPlaneBounds* trapezoidalBounds(dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
10  const RectangularPlaneBounds* rectangularBounds(dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));
11 
12  Surface::GlobalPoint corners[8];
13 
14  if (trapezoidalBounds) {
15  std::array<const float, 4> const& parameters = (*trapezoidalBounds).parameters();
16 
17  auto hbotedge = parameters[0];
18  auto htopedge = parameters[1];
19  auto hapothem = parameters[3];
20  auto thickness = (*trapezoidalBounds).thickness();
21 
22  corners[0] = plane.toGlobal(LocalPoint(-htopedge, hapothem, thickness / 2));
23  corners[1] = plane.toGlobal(LocalPoint(htopedge, hapothem, thickness / 2));
24  corners[2] = plane.toGlobal(LocalPoint(hbotedge, -hapothem, thickness / 2));
25  corners[3] = plane.toGlobal(LocalPoint(-hbotedge, -hapothem, thickness / 2));
26  corners[4] = plane.toGlobal(LocalPoint(-htopedge, hapothem, -thickness / 2));
27  corners[5] = plane.toGlobal(LocalPoint(htopedge, hapothem, -thickness / 2));
28  corners[6] = plane.toGlobal(LocalPoint(hbotedge, -hapothem, -thickness / 2));
29  corners[7] = plane.toGlobal(LocalPoint(-hbotedge, -hapothem, -thickness / 2));
30 
31  } else if (rectangularBounds) {
32  auto length = rectangularBounds->length();
33  auto width = rectangularBounds->width();
34  auto thickness = (*rectangularBounds).thickness();
35 
36  corners[0] = plane.toGlobal(LocalPoint(-width / 2, -length / 2, thickness / 2));
37  corners[1] = plane.toGlobal(LocalPoint(-width / 2, +length / 2, thickness / 2));
38  corners[2] = plane.toGlobal(LocalPoint(+width / 2, -length / 2, thickness / 2));
39  corners[3] = plane.toGlobal(LocalPoint(+width / 2, +length / 2, thickness / 2));
40  corners[4] = plane.toGlobal(LocalPoint(-width / 2, -length / 2, -thickness / 2));
41  corners[5] = plane.toGlobal(LocalPoint(-width / 2, +length / 2, -thickness / 2));
42  corners[6] = plane.toGlobal(LocalPoint(+width / 2, -length / 2, -thickness / 2));
43  corners[7] = plane.toGlobal(LocalPoint(+width / 2, +length / 2, -thickness / 2));
44  } else {
45  }
46 
47  float phimin = corners[0].barePhi();
48  float phimax = phimin;
49  float zmin = corners[0].z();
50  float zmax = zmin;
51  float rmin = corners[0].perp2();
52  float rmax = rmin;
53  for (int i = 1; i < 8; i++) {
54  auto cPhi = corners[i].barePhi();
55  if (Geom::phiLess(cPhi, phimin)) {
56  phimin = cPhi;
57  }
58  if (Geom::phiLess(phimax, cPhi)) {
59  phimax = cPhi;
60  }
61  auto z = corners[i].z();
62  if (z < zmin)
63  zmin = z;
64  if (z > zmax)
65  zmax = z;
66  auto r = corners[i].perp2();
67  if (r < rmin)
68  rmin = r;
69  if (r > rmax)
70  rmax = r;
71  }
72  m_zSpan.first = zmin;
73  m_zSpan.second = zmax;
74  m_rSpan.first = std::sqrt(rmin);
75  m_rSpan.second = std::sqrt(rmax);
76  m_phiSpan.first = phimin;
77  m_phiSpan.second = phimax;
78 }

References Surface::bounds(), mps_fire::i, m_phiSpan, m_rSpan, m_zSpan, Geom::phiLess(), phimax, phimin, alignCSCRings::r, mathSSE::sqrt(), Calorimetry_cff::thickness, Surface::toGlobal(), ApeEstimator_cff::width, z, SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

Referenced by Bounds::computeSpan().

◆ phiSpan()

std::pair<float, float> const& BoundSpan::phiSpan ( ) const
inline

Definition at line 19 of file BoundSpan.h.

19 { return m_phiSpan; }

References m_phiSpan.

Referenced by Bounds::phiSpan().

◆ rSpan()

std::pair<float, float> const& BoundSpan::rSpan ( ) const
inline

Definition at line 21 of file BoundSpan.h.

21 { return m_rSpan; }

References m_rSpan.

Referenced by Bounds::rSpan().

◆ zSpan()

std::pair<float, float> const& BoundSpan::zSpan ( ) const
inline

Definition at line 20 of file BoundSpan.h.

20 { return m_zSpan; }

References m_zSpan.

Referenced by Bounds::zSpan().

Member Data Documentation

◆ m_phiSpan

std::pair<float, float> BoundSpan::m_phiSpan
private

Definition at line 24 of file BoundSpan.h.

Referenced by compute(), and phiSpan().

◆ m_rSpan

std::pair<float, float> BoundSpan::m_rSpan
private

Definition at line 26 of file BoundSpan.h.

Referenced by compute(), and rSpan().

◆ m_zSpan

std::pair<float, float> BoundSpan::m_zSpan
private

Definition at line 25 of file BoundSpan.h.

Referenced by compute(), and zSpan().

ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
BeamSpotPI::parameters
parameters
Definition: BeamSpotPayloadInspectorHelper.h:29
mps_fire.i
i
Definition: mps_fire.py:428
phimin
float phimin
Definition: ReggeGribovPartonMCHadronizer.h:107
BoundSpan::m_rSpan
std::pair< float, float > m_rSpan
Definition: BoundSpan.h:26
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
BoundSpan::m_phiSpan
std::pair< float, float > m_phiSpan
Definition: BoundSpan.h:24
Point3DBase< float, GlobalTag >
Geom::phiLess
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
TrapezoidalPlaneBounds
Definition: TrapezoidalPlaneBounds.h:15
alignCSCRings.r
r
Definition: alignCSCRings.py:93
phimax
float phimax
Definition: ReggeGribovPartonMCHadronizer.h:106
BoundSpan::m_zSpan
std::pair< float, float > m_zSpan
Definition: BoundSpan.h:25
RectangularPlaneBounds
Definition: RectangularPlaneBounds.h:12