CMS 3D CMS Logo

IdealZPrism.cc
Go to the documentation of this file.
2 #include <cmath>
3 
7 
9 
10 namespace {
11 
12  // magic numbers determined by ParticleFlow
13  constexpr float EMDepthCorrection = 22.;
14  constexpr float HADDepthCorrection = 25.;
15 
16  GlobalPoint correct(GlobalPoint const& ori, IdealZPrism::DEPTH depth) {
17  if (depth == IdealZPrism::None)
18  return ori;
20  if (ori.z() < 0)
21  zcorr = -zcorr;
22  return ori + GlobalVector(0., 0., zcorr);
23  }
24 } // namespace
25 
27  if (idzp.forPF())
28  m_geoForPF.reset(new IdealZPrism(*idzp.forPF()));
29 }
30 
32  if (&idzp != this) {
33  CaloCellGeometry::operator=(idzp);
34  if (idzp.forPF())
35  m_geoForPF.reset(new IdealZPrism(*idzp.forPF()));
36  }
37  return *this;
38 }
39 
41  : CaloCellGeometry(faceCenter, mgr, parm),
42  m_geoForPF(depth == None ? nullptr : new IdealZPrism(correct(faceCenter, depth), mgr, parm, None)) {
43  initSpan();
44 }
45 
47 
49 
51 
53 
55 
57 
58 void IdealZPrism::vocalCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref) const { localCorners(vec, pv, ref); }
59 
60 GlobalPoint IdealZPrism::etaPhiR(float eta, float phi, float rad) {
61  return GlobalPoint(rad * cosf(phi) / coshf(eta), rad * sinf(phi) / coshf(eta), rad * tanhf(eta));
62 }
63 
65  return GlobalPoint(perp * cosf(phi), perp * sinf(phi), perp * sinhf(eta));
66 }
67 
68 GlobalPoint IdealZPrism::etaPhiZ(float eta, float phi, float z) {
69  return GlobalPoint(z * cosf(phi) / sinhf(eta), z * sinf(phi) / sinhf(eta), z);
70 }
71 
73  assert(8 == lc.size());
74  assert(nullptr != pv);
75 
80  const CCGFloat z(pv[IdealZPrism::k_Z]);
81 
82  std::vector<GlobalPoint> gc(8, GlobalPoint(0, 0, 0));
83 
84  const GlobalPoint p(etaPhiZ(eta, 0, z));
85 
86  const float z_near(z);
87  const float z_far(z * (1 - 2 * dz / p.mag()));
88  gc[0] = etaPhiZ(eta + dEta, +dPhi, z_near); // (+,+,near)
89  gc[1] = etaPhiZ(eta + dEta, -dPhi, z_near); // (+,-,near)
90  gc[2] = etaPhiZ(eta - dEta, -dPhi, z_near); // (-,-,near)
91  gc[3] = etaPhiZ(eta - dEta, +dPhi, z_near); // (-,+,far)
92  gc[4] = GlobalPoint(gc[0].x(), gc[0].y(), z_far); // (+,+,far)
93  gc[5] = GlobalPoint(gc[1].x(), gc[1].y(), z_far); // (+,-,far)
94  gc[6] = GlobalPoint(gc[2].x(), gc[2].y(), z_far); // (-,-,far)
95  gc[7] = GlobalPoint(gc[3].x(), gc[3].y(), z_far); // (-,+,far)
96 
97  for (unsigned int i(0); i != 8; ++i) {
98  lc[i] = Pt3D(gc[i].x(), gc[i].y(), gc[i].z());
99  }
100 
101  ref = 0.25 * (lc[0] + lc[1] + lc[2] + lc[3]);
102 }
103 
105  if (co.uninitialized()) {
106  CornersVec& corners(co);
107 
108  const GlobalPoint p(getPosition());
109  const CCGFloat z_near(p.z());
110  const CCGFloat z_far(z_near + 2 * dz() * p.z() / fabs(p.z()));
111  const CCGFloat eta(p.eta());
112  const CCGFloat phi(p.phi());
113 
114  corners[0] = etaPhiZ(eta + dEta(), phi + dPhi(), z_near); // (+,+,near)
115  corners[1] = etaPhiZ(eta + dEta(), phi - dPhi(), z_near); // (+,-,near)
116  corners[2] = etaPhiZ(eta - dEta(), phi - dPhi(), z_near); // (-,-,near)
117  corners[3] = etaPhiZ(eta - dEta(), phi + dPhi(), z_near); // (-,+,near)
118  corners[4] = GlobalPoint(corners[0].x(), corners[0].y(), z_far); // (+,+,far)
119  corners[5] = GlobalPoint(corners[1].x(), corners[1].y(), z_far); // (+,-,far)
120  corners[6] = GlobalPoint(corners[2].x(), corners[2].y(), z_far); // (-,-,far)
121  corners[7] = GlobalPoint(corners[3].x(), corners[3].y(), z_far); // (-,+,far)
122  }
123 }
124 
125 std::ostream& operator<<(std::ostream& s, const IdealZPrism& cell) {
126  s << "Center: " << cell.getPosition() << std::endl;
127  s << "dEta = " << cell.dEta() << ", dPhi = " << cell.dPhi() << ", dz = " << cell.dz() << std::endl;
128  return s;
129 }
CaloCellGeometry::Pt3DVec
std::vector< Pt3D > Pt3DVec
Definition: CaloCellGeometry.h:55
IdealZPrism::dPhi
CCGFloat dPhi() const
Definition: IdealZPrism.cc:50
DDAxes::y
IdealZPrism::z
CCGFloat z() const
Definition: IdealZPrism.cc:56
mps_fire.i
i
Definition: mps_fire.py:355
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
IdealZPrism::etaPhiZ
static GlobalPoint etaPhiZ(float eta, float phi, float z)
Definition: IdealZPrism.cc:68
IdealZPrism::k_dEta
static constexpr uint32_t k_dEta
Definition: IdealZPrism.h:34
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
IdealZPrism::initCorners
void initCorners(CornersVec &) override
Definition: IdealZPrism.cc:104
IdealZPrism::IdealZPrism
IdealZPrism()
Definition: IdealZPrism.cc:8
IdealZPrism::k_dZ
static constexpr uint32_t k_dZ
Definition: IdealZPrism.h:36
Pt3D
IdealZPrism::Pt3D Pt3D
Definition: IdealZPrism.cc:5
cms::cuda::assert
assert(be >=bs)
operator<<
std::ostream & operator<<(std::ostream &s, const IdealZPrism &cell)
Definition: IdealZPrism.cc:125
DDAxes::x
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
EZArrayFL< GlobalPoint >
cms::cuda::co
T *__restrict__ co
Definition: prefixScan.h:46
perp
T perp() const
Magnitude of transverse component.
Definition: Basic3DVectorLD.h:133
IdealZPrism::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: IdealZPrism.h:30
IdealZPrism::etaPhiR
static GlobalPoint etaPhiR(float eta, float phi, float rad)
Definition: IdealZPrism.cc:60
IdealZPrism::dz
CCGFloat dz() const
Definition: IdealZPrism.cc:52
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
IdealZPrism::eta
CCGFloat eta() const
Definition: IdealZPrism.cc:54
alignCSCRings.s
s
Definition: alignCSCRings.py:92
None
Definition: APVGainStruct.h:52
IdealZPrism::DEPTH
DEPTH
Definition: IdealZPrism.h:28
PVValHelper::eta
Definition: PVValidationHelpers.h:69
IdealZPrism.h
HLT_2018_cff.EMDepthCorrection
EMDepthCorrection
Definition: HLT_2018_cff.py:11776
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
IdealZPrism::k_Z
static constexpr uint32_t k_Z
Definition: IdealZPrism.h:38
Pt3DVec
IdealZPrism::Pt3DVec Pt3DVec
Definition: IdealZPrism.cc:6
Point3DBase< float, GlobalTag >
CaloCellGeometry::Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
Definition: CaloCellGeometry.h:54
IdealZPrism::vocalCorners
void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
Definition: IdealZPrism.cc:58
IdealZPrism
Definition: IdealZPrism.h:26
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
CaloCellGeometry::initSpan
void initSpan()
Definition: CaloCellGeometry.h:120
IdealZPrism::k_dPhi
static constexpr uint32_t k_dPhi
Definition: IdealZPrism.h:35
CaloCellGeometry::getPosition
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: CaloCellGeometry.h:80
IdealZPrism::localCorners
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: IdealZPrism.cc:72
PVValHelper::phi
Definition: PVValidationHelpers.h:68
CaloCellGeometry
Definition: CaloCellGeometry.h:50
CaloCellGeometry::param
const CCGFloat * param() const
Definition: CaloCellGeometry.h:99
IdealZPrism::k_Eta
static constexpr uint32_t k_Eta
Definition: IdealZPrism.h:37
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
IdealZPrism::m_geoForPF
std::unique_ptr< IdealZPrism > m_geoForPF
Definition: IdealZPrism.h:78
IdealZPrism::EM
Definition: IdealZPrism.h:28
IdealZPrism::operator=
IdealZPrism & operator=(const IdealZPrism &idzp)
Definition: IdealZPrism.cc:31
DDAxes::phi
IdealZPrism::Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: IdealZPrism.h:31
IdealZPrism::~IdealZPrism
~IdealZPrism() override
Definition: IdealZPrism.cc:46
HLT_2018_cff.HADDepthCorrection
HADDepthCorrection
Definition: HLT_2018_cff.py:11778
IdealZPrism::None
Definition: IdealZPrism.h:28
EZMgrFL
Definition: EZMgrFL.h:8
IdealZPrism::etaPhiPerp
static GlobalPoint etaPhiPerp(float eta, float phi, float perp)
Definition: IdealZPrism.cc:64
IdealZPrism::Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: IdealZPrism.h:32
CCGFloat
IdealZPrism::CCGFloat CCGFloat
Definition: IdealZPrism.cc:4
IdealZPrism::forPF
std::shared_ptr< const IdealZPrism > forPF() const
Definition: IdealZPrism.h:61
IdealZPrism::dEta
CCGFloat dEta() const
Definition: IdealZPrism.cc:48