CMS 3D CMS Logo

GlobalDetRodRangeZPhi.cc
Go to the documentation of this file.
5 
6 #include <array>
7 
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 }
GlobalDetRodRangeZPhi::GlobalDetRodRangeZPhi
GlobalDetRodRangeZPhi(const Plane &RodPlane)
Definition: GlobalDetRodRangeZPhi.cc:8
Bounds::width
virtual float width() const =0
min
T min(T a, T b)
Definition: MathUtil.h:58
phimin
float phimin
Definition: ReggeGribovPartonMCHadronizer.h:107
VectorUtil.h
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
GlobalDetRodRangeZPhi.h
Bounds::length
virtual float length() const =0
Plane.h
GlobalDetRodRangeZPhi::thePhiRange
Range thePhiRange
Definition: GlobalDetRodRangeZPhi.h:23
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
DDAxes::z
Bounds.h
Bounds::thickness
virtual float thickness() const =0
Geom::phiLess
bool phiLess(float phi1, float phi2)
Definition: VectorUtil.h:18
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
GlobalDetRodRangeZPhi::theZRange
Range theZRange
Definition: GlobalDetRodRangeZPhi.h:22
PVValHelper::dy
Definition: PVValidationHelpers.h:50
phimax
float phimax
Definition: ReggeGribovPartonMCHadronizer.h:106
DDAxes::phi
PVValHelper::dz
Definition: PVValidationHelpers.h:51
Plane
Definition: Plane.h:16
TCMET_cfi.corner
corner
Definition: TCMET_cfi.py:34
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PVValHelper::dx
Definition: PVValidationHelpers.h:49