CMS 3D CMS Logo

IdealObliquePrism.cc
Go to the documentation of this file.
2 #include <cmath>
3 
7 
9 
11 
13  if (&idop != this)
14  CaloCellGeometry::operator=(idop);
15  return *this;
16 }
17 
19  : CaloCellGeometry(faceCenter, mgr, parm) {
20  initSpan();
21 }
22 
24 
26 
28 
30 
32 
34 
35 void IdealObliquePrism::vocalCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref) const { localCorners(vec, pv, ref); }
36 
38  return GlobalPoint(perp * cosf(phi), perp * sinf(phi), perp * sinhf(eta));
39 }
40 
42  return GlobalPoint(z * cosf(phi) / sinhf(eta), z * sinf(phi) / sinhf(eta), z);
43 }
44 
46  assert(8 == lc.size());
47  assert(nullptr != pv);
48 
54 
55  std::vector<GlobalPoint> gc(8, GlobalPoint(0, 0, 0));
56 
57  const GlobalPoint p(etaPhiZ(eta, 0, z));
58 
59  if (0 < dz) {
60  const CCGFloat r_near(p.perp() / cos(dPhi));
61  const CCGFloat r_far(r_near * ((p.mag() + 2 * dz) / p.mag()));
62  gc[0] = etaPhiPerp(eta + dEta, +dPhi, r_near); // (+,+,near)
63  gc[1] = etaPhiPerp(eta + dEta, -dPhi, r_near); // (+,-,near)
64  gc[2] = etaPhiPerp(eta - dEta, -dPhi, r_near); // (-,-,near)
65  gc[3] = etaPhiPerp(eta - dEta, +dPhi, r_near); // (-,+,near)
66  gc[4] = etaPhiPerp(eta + dEta, +dPhi, r_far); // (+,+,far)
67  gc[5] = etaPhiPerp(eta + dEta, -dPhi, r_far); // (+,-,far)
68  gc[6] = etaPhiPerp(eta - dEta, -dPhi, r_far); // (-,-,far)
69  gc[7] = etaPhiPerp(eta - dEta, +dPhi, r_far); // (-,+,far)
70  } else {
71  const CCGFloat z_near(z);
72  const CCGFloat z_far(z * (1 - 2 * dz / p.mag()));
73  gc[0] = etaPhiZ(eta + dEta, +dPhi, z_near); // (+,+,near)
74  gc[1] = etaPhiZ(eta + dEta, -dPhi, z_near); // (+,-,near)
75  gc[2] = etaPhiZ(eta - dEta, -dPhi, z_near); // (-,-,near)
76  gc[3] = etaPhiZ(eta - dEta, +dPhi, z_near); // (-,+,near)
77  gc[4] = etaPhiZ(eta + dEta, +dPhi, z_far); // (+,+,far)
78  gc[5] = etaPhiZ(eta + dEta, -dPhi, z_far); // (+,-,far)
79  gc[6] = etaPhiZ(eta - dEta, -dPhi, z_far); // (-,-,far)
80  gc[7] = etaPhiZ(eta - dEta, +dPhi, z_far); // (-,+,far)
81  }
82  for (unsigned int i(0); i != 8; ++i) {
83  lc[i] = Pt3D(gc[i].x(), gc[i].y(), gc[i].z());
84  }
85 
86  ref = 0.25 * (lc[0] + lc[1] + lc[2] + lc[3]);
87 }
88 
90  if (co.uninitialized()) {
91  CornersVec& corners(co);
92  if (dz() > 0) {
93  /* In this case, the faces are parallel to the zaxis.
94  This implies that all corners will have the same
95  cylindrical radius.
96  */
97  const GlobalPoint p(getPosition());
98  const CCGFloat r_near(p.perp() / cos(dPhi()));
99  const CCGFloat r_far(r_near * ((p.mag() + 2 * dz()) / p.mag()));
100  const CCGFloat eta(p.eta());
101  const CCGFloat phi(p.phi());
102  corners[0] = etaPhiPerp(eta + dEta(), phi + dPhi(), r_near); // (+,+,near)
103  corners[1] = etaPhiPerp(eta + dEta(), phi - dPhi(), r_near); // (+,-,near)
104  corners[2] = etaPhiPerp(eta - dEta(), phi - dPhi(), r_near); // (-,-,near)
105  corners[3] = etaPhiPerp(eta - dEta(), phi + dPhi(), r_near); // (-,+,near)
106  corners[4] = etaPhiPerp(eta + dEta(), phi + dPhi(), r_far); // (+,+,far)
107  corners[5] = etaPhiPerp(eta + dEta(), phi - dPhi(), r_far); // (+,-,far)
108  corners[6] = etaPhiPerp(eta - dEta(), phi - dPhi(), r_far); // (-,-,far)
109  corners[7] = etaPhiPerp(eta - dEta(), phi + dPhi(), r_far); // (-,+,far)
110  } else {
111  /* In this case, the faces are perpendicular to the zaxis.
112  This implies that all corners will have the same
113  z-dimension.
114  */
115  const GlobalPoint p(getPosition());
116  const CCGFloat z_near(p.z());
117  const CCGFloat mag(p.mag());
118  const CCGFloat z_far(z_near * (1 - 2 * dz() / mag)); // negative to correct sign
119  const CCGFloat eta(p.eta());
120  const CCGFloat phi(p.phi());
121 
122  corners[0] = etaPhiZ(eta + dEta(), phi + dPhi(), z_near); // (+,+,near)
123  corners[1] = etaPhiZ(eta + dEta(), phi - dPhi(), z_near); // (+,-,near)
124  corners[2] = etaPhiZ(eta - dEta(), phi - dPhi(), z_near); // (-,-,near)
125  corners[3] = etaPhiZ(eta - dEta(), phi + dPhi(), z_near); // (-,+,near)
126  corners[4] = etaPhiZ(eta + dEta(), phi + dPhi(), z_far); // (+,+,far)
127  corners[5] = etaPhiZ(eta + dEta(), phi - dPhi(), z_far); // (+,-,far)
128  corners[6] = etaPhiZ(eta - dEta(), phi - dPhi(), z_far); // (-,-,far)
129  corners[7] = etaPhiZ(eta - dEta(), phi + dPhi(), z_far); // (-,+,far)
130  }
131  }
132 }
133 
134 std::ostream& operator<<(std::ostream& s, const IdealObliquePrism& cell) {
135  s << "Center: " << cell.getPosition() << std::endl;
136  s << "dEta = " << cell.dEta() << ", dPhi = " << cell.dPhi() << ", dz = " << cell.dz() << std::endl;
137  return s;
138 }
IdealObliquePrism.h
CaloCellGeometry::Pt3DVec
std::vector< Pt3D > Pt3DVec
Definition: CaloCellGeometry.h:55
CCGFloat
IdealObliquePrism::CCGFloat CCGFloat
Definition: IdealObliquePrism.cc:4
DDAxes::y
IdealObliquePrism::dEta
CCGFloat dEta() const
Definition: IdealObliquePrism.cc:25
mps_fire.i
i
Definition: mps_fire.py:428
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
IdealObliquePrism::k_Eta
static constexpr uint32_t k_Eta
Definition: IdealObliquePrism.h:37
IdealObliquePrism::IdealObliquePrism
IdealObliquePrism()
Definition: IdealObliquePrism.cc:8
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
IdealObliquePrism::Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: IdealObliquePrism.h:32
IdealObliquePrism::etaPhiZ
static GlobalPoint etaPhiZ(float eta, float phi, float z)
Definition: IdealObliquePrism.cc:41
cms::cuda::assert
assert(be >=bs)
Pt3DVec
IdealObliquePrism::Pt3DVec Pt3DVec
Definition: IdealObliquePrism.cc:6
DDAxes::x
EZArrayFL< GlobalPoint >
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
IdealObliquePrism::dPhi
CCGFloat dPhi() const
Definition: IdealObliquePrism.cc:27
alignCSCRings.s
s
Definition: alignCSCRings.py:92
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
IdealObliquePrism
Definition: IdealObliquePrism.h:28
cms::cuda::co
__host__ __device__ VT * co
Definition: prefixScan.h:47
PVValHelper::eta
Definition: PVValidationHelpers.h:70
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
IdealObliquePrism::z
CCGFloat z() const
Definition: IdealObliquePrism.cc:33
CaloCellGeometry::Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
Definition: CaloCellGeometry.h:54
IdealObliquePrism::Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: IdealObliquePrism.h:31
IdealObliquePrism::localCorners
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: IdealObliquePrism.cc:45
Pt3D
IdealObliquePrism::Pt3D Pt3D
Definition: IdealObliquePrism.cc:5
CaloCellGeometry::initSpan
void initSpan()
Definition: CaloCellGeometry.h:120
IdealObliquePrism::k_dPhi
static constexpr uint32_t k_dPhi
Definition: IdealObliquePrism.h:35
CaloCellGeometry::getPosition
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: CaloCellGeometry.h:80
IdealObliquePrism::eta
CCGFloat eta() const
Definition: IdealObliquePrism.cc:31
IdealObliquePrism::initCorners
void initCorners(CornersVec &) override
Definition: IdealObliquePrism.cc:89
IdealObliquePrism::~IdealObliquePrism
~IdealObliquePrism() override
Definition: IdealObliquePrism.cc:23
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PVValHelper::phi
Definition: PVValidationHelpers.h:69
operator<<
std::ostream & operator<<(std::ostream &s, const IdealObliquePrism &cell)
Definition: IdealObliquePrism.cc:134
CaloCellGeometry
Definition: CaloCellGeometry.h:50
CaloCellGeometry::param
const CCGFloat * param() const
Definition: CaloCellGeometry.h:99
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
IdealObliquePrism::k_Z
static constexpr uint32_t k_Z
Definition: IdealObliquePrism.h:38
IdealObliquePrism::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: IdealObliquePrism.h:30
DDAxes::phi
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
IdealObliquePrism::operator=
IdealObliquePrism & operator=(const IdealObliquePrism &idop)
Definition: IdealObliquePrism.cc:12
IdealObliquePrism::k_dZ
static constexpr uint32_t k_dZ
Definition: IdealObliquePrism.h:36
IdealObliquePrism::etaPhiPerp
static GlobalPoint etaPhiPerp(float eta, float phi, float perp)
Definition: IdealObliquePrism.cc:37
IdealObliquePrism::k_dEta
static constexpr uint32_t k_dEta
Definition: IdealObliquePrism.h:34
IdealObliquePrism::vocalCorners
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: IdealObliquePrism.cc:35
EZMgrFL
Definition: EZMgrFL.h:8
IdealObliquePrism::dz
CCGFloat dz() const
Definition: IdealObliquePrism.cc:29