CMS 3D CMS Logo

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