CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes
IdealZPrism Class Referencefinal

#include <IdealZPrism.h>

Inheritance diagram for IdealZPrism:
CaloCellGeometry

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
 
enum  DEPTH { None, EM, HADR }
 
typedef CaloCellGeometry::Pt3D Pt3D
 
typedef CaloCellGeometry::Pt3DVec Pt3DVec
 
- Public Types inherited from CaloCellGeometry
typedef float CCGFloat
 
typedef EZMgrFL< GlobalPointCornersMgr
 
typedef EZArrayFL< GlobalPointCornersVec
 
typedef EZMgrFL< CCGFloatParMgr
 
typedef EZArrayFL< CCGFloatParVec
 
typedef std::vector< ParVecParVecVec
 
typedef HepGeom::Point3D< CCGFloatPt3D
 
typedef std::vector< Pt3DPt3DVec
 
using RepCorners = std::array< RhoEtaPhi, k_cornerSize >
 
typedef HepGeom::Transform3D Tr3D
 

Public Member Functions

CCGFloat dEta () const
 
CCGFloat dPhi () const
 
CCGFloat dz () const
 
CCGFloat eta () const
 
std::shared_ptr< const IdealZPrismforPF () const
 
 IdealZPrism ()
 
 IdealZPrism (const IdealZPrism &idzp)
 
 IdealZPrism (const GlobalPoint &faceCenter, CornersMgr *mgr, const CCGFloat *parm, IdealZPrism::DEPTH depth)
 
IdealZPrismoperator= (const IdealZPrism &idzp)
 
void vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
 
CCGFloat z () const
 
 ~IdealZPrism () override
 
- Public Member Functions inherited from CaloCellGeometry
bool emptyCorners () const
 
virtual float etaPos () const
 
virtual float etaSpan () const
 
GlobalPoint const & getBackPoint () const
 
CornersVec const & getCorners () const
 Returns the corner points of this cell's volume. More...
 
RepCorners const & getCornersREP () const
 
virtual const GlobalPointgetPosition () const
 Returns the position of reference for this cell. More...
 
virtual GlobalPoint getPosition (CCGFloat) const
 
virtual GlobalPoint getPosition (const Pt3D &) const
 
virtual void getTransform (Tr3D &tr, Pt3DVec *lptr) const
 --------— only needed by specific utility; overloaded when needed -— More...
 
bool inside (const GlobalPoint &point) const
 Returns true if the specified point is inside this cell. More...
 
const CCGFloatparam () const
 
virtual float phiPos () const
 
virtual float phiSpan () const
 
RhoEtaPhi const & repPos () const
 
virtual float rhoPos () const
 
void setBackPoint (const GlobalPoint &pos)
 
virtual ~CaloCellGeometry ()
 

Static Public Member Functions

static void localCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
 
- Static Public Member Functions inherited from CaloCellGeometry
static const CCGFloatcheckParmPtr (const std::vector< CCGFloat > &vd, ParVecVec &pvv)
 
static const CCGFloatgetParmPtr (const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
 

Static Public Attributes

static constexpr uint32_t k_dEta = 0
 
static constexpr uint32_t k_dPhi = 1
 
static constexpr uint32_t k_dZ = 2
 
static constexpr uint32_t k_Eta = 3
 
static constexpr uint32_t k_Z = 4
 
- Static Public Attributes inherited from CaloCellGeometry
static constexpr unsigned int k_cornerSize = 8
 
static const CCGFloat k_ScaleFromDDDtoGeant
 

Private Member Functions

void initCorners (CornersVec &) override
 

Static Private Member Functions

static GlobalPoint etaPhiPerp (float eta, float phi, float perp)
 
static GlobalPoint etaPhiR (float eta, float phi, float rad)
 
static GlobalPoint etaPhiZ (float eta, float phi, float z)
 

Private Attributes

std::unique_ptr< IdealZPrismm_geoForPF
 

Additional Inherited Members

- Protected Member Functions inherited from CaloCellGeometry
 CaloCellGeometry (CornersVec::const_reference gp, CornersMgr *mgr, const CCGFloat *par)
 
 CaloCellGeometry (const CornersVec &cv, const CCGFloat *par)
 
 CaloCellGeometry (void)
 
void initSpan ()
 
void setCornerVec (const std::vector< GlobalPoint > &cor)
 
void setRefPoint (const GlobalPoint &pos)
 

Detailed Description

Prism class used for HF volumes. HF volumes are prisms with axes along the Z direction whose face shapes are set by

Required parameters for an ideal Z prism:

Total: 6 parameters

Internally, the "point of reference" is the center (eta/phi) of the front face of the prism. Therefore, the only internally stored parameters are eta and phi HALF-widths and the tower z thickness.

Author
J. Mans - Minnesota

Definition at line 26 of file IdealZPrism.h.

Member Typedef Documentation

◆ CCGFloat

Definition at line 30 of file IdealZPrism.h.

◆ Pt3D

Definition at line 31 of file IdealZPrism.h.

◆ Pt3DVec

Definition at line 32 of file IdealZPrism.h.

Member Enumeration Documentation

◆ DEPTH

Enumerator
None 
EM 
HADR 

Definition at line 28 of file IdealZPrism.h.

Constructor & Destructor Documentation

◆ IdealZPrism() [1/3]

IdealZPrism::IdealZPrism ( )

Definition at line 9 of file IdealZPrism.cc.

◆ IdealZPrism() [2/3]

IdealZPrism::IdealZPrism ( const IdealZPrism idzp)

Definition at line 27 of file IdealZPrism.cc.

References forPF(), and m_geoForPF.

27  : CaloCellGeometry(idzp) {
28  if (idzp.forPF())
29  m_geoForPF = std::make_unique<IdealZPrism>(*idzp.forPF());
30 }
std::unique_ptr< IdealZPrism > m_geoForPF
Definition: IdealZPrism.h:78
std::shared_ptr< const IdealZPrism > forPF() const
Definition: IdealZPrism.h:61

◆ IdealZPrism() [3/3]

IdealZPrism::IdealZPrism ( const GlobalPoint faceCenter,
CornersMgr mgr,
const CCGFloat parm,
IdealZPrism::DEPTH  depth 
)

Definition at line 41 of file IdealZPrism.cc.

References CaloCellGeometry::initSpan().

42  : CaloCellGeometry(faceCenter, mgr, parm),
43  m_geoForPF(depth == None ? nullptr : new IdealZPrism(correct(faceCenter, depth), mgr, parm, None)) {
44  initSpan();
45 }
std::unique_ptr< IdealZPrism > m_geoForPF
Definition: IdealZPrism.h:78

◆ ~IdealZPrism()

IdealZPrism::~IdealZPrism ( )
override

Definition at line 47 of file IdealZPrism.cc.

47 {}

Member Function Documentation

◆ dEta()

CCGFloat IdealZPrism::dEta ( ) const

Definition at line 49 of file IdealZPrism.cc.

References k_dEta, and CaloCellGeometry::param().

Referenced by initCorners(), localCorners(), and operator<<().

49 { return param()[IdealZPrism::k_dEta]; }
static constexpr uint32_t k_dEta
Definition: IdealZPrism.h:34
const CCGFloat * param() const

◆ dPhi()

CCGFloat IdealZPrism::dPhi ( ) const

Definition at line 51 of file IdealZPrism.cc.

References k_dPhi, and CaloCellGeometry::param().

Referenced by initCorners(), localCorners(), and operator<<().

51 { return param()[IdealZPrism::k_dPhi]; }
static constexpr uint32_t k_dPhi
Definition: IdealZPrism.h:35
const CCGFloat * param() const

◆ dz()

CCGFloat IdealZPrism::dz ( ) const

Definition at line 53 of file IdealZPrism.cc.

References k_dZ, and CaloCellGeometry::param().

Referenced by Electron.Electron::cutBasedId(), ntupleDataFormat.Track::dzPull(), initCorners(), localCorners(), and operator<<().

53 { return param()[IdealZPrism::k_dZ]; }
static constexpr uint32_t k_dZ
Definition: IdealZPrism.h:36
const CCGFloat * param() const

◆ eta()

CCGFloat IdealZPrism::eta ( void  ) const

◆ etaPhiPerp()

GlobalPoint IdealZPrism::etaPhiPerp ( float  eta,
float  phi,
float  perp 
)
staticprivate

Definition at line 65 of file IdealZPrism.cc.

References eta(), perp(), and phi.

65  {
66  return GlobalPoint(perp * cosf(phi), perp * sinf(phi), perp * sinhf(eta));
67 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
Definition: IdealZPrism.cc:55
T perp() const
Magnitude of transverse component.

◆ etaPhiR()

GlobalPoint IdealZPrism::etaPhiR ( float  eta,
float  phi,
float  rad 
)
staticprivate

Definition at line 61 of file IdealZPrism.cc.

References eta(), and phi.

61  {
62  return GlobalPoint(rad * cosf(phi) / coshf(eta), rad * sinf(phi) / coshf(eta), rad * tanhf(eta));
63 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
Definition: IdealZPrism.cc:55

◆ etaPhiZ()

GlobalPoint IdealZPrism::etaPhiZ ( float  eta,
float  phi,
float  z 
)
staticprivate

Definition at line 69 of file IdealZPrism.cc.

References eta(), phi, and z().

Referenced by initCorners(), and localCorners().

69  {
70  return GlobalPoint(z * cosf(phi) / sinhf(eta), z * sinf(phi) / sinhf(eta), z);
71 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
Definition: IdealZPrism.cc:55
CCGFloat z() const
Definition: IdealZPrism.cc:57

◆ forPF()

std::shared_ptr<const IdealZPrism> IdealZPrism::forPF ( ) const
inline

Definition at line 61 of file IdealZPrism.h.

References m_geoForPF.

Referenced by IdealZPrism(), and operator=().

61  {
62  static const auto do_not_delete = [](const void*) {};
63  auto cell = std::shared_ptr<const IdealZPrism>(m_geoForPF.get(), do_not_delete);
64  return cell;
65  }
std::unique_ptr< IdealZPrism > m_geoForPF
Definition: IdealZPrism.h:78

◆ initCorners()

void IdealZPrism::initCorners ( CaloCellGeometry::CornersVec co)
overrideprivatevirtual

Implements CaloCellGeometry.

Definition at line 105 of file IdealZPrism.cc.

References cms::cuda::co, dEta(), dPhi(), dz(), eta(), etaPhiZ(), CaloCellGeometry::getPosition(), AlCaHLTBitMon_ParallelJobs::p, phi, x, and y.

105  {
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 }
EZArrayFL< GlobalPoint > CornersVec
CCGFloat dEta() const
Definition: IdealZPrism.cc:49
CCGFloat dz() const
Definition: IdealZPrism.cc:53
CCGFloat dPhi() const
Definition: IdealZPrism.cc:51
static GlobalPoint etaPhiZ(float eta, float phi, float z)
Definition: IdealZPrism.cc:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
__host__ __device__ VT * co
Definition: prefixScan.h:47
CCGFloat eta() const
Definition: IdealZPrism.cc:55
CaloCellGeometry::CCGFloat CCGFloat
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.

◆ localCorners()

void IdealZPrism::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
)
static

Definition at line 73 of file IdealZPrism.cc.

References cms::cuda::assert(), dEta(), dPhi(), dz(), eta(), etaPhiZ(), mps_fire::i, k_dEta, k_dPhi, k_dZ, k_Eta, k_Z, AlCaHLTBitMon_ParallelJobs::p, x, y, and z().

Referenced by FWTGeoRecoGeometryESProducer::addHcalCaloGeometryForward(), HcalGeometry::localCorners(), and vocalCorners().

73  {
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 }
CCGFloat dEta() const
Definition: IdealZPrism.cc:49
static constexpr uint32_t k_dEta
Definition: IdealZPrism.h:34
CCGFloat dz() const
Definition: IdealZPrism.cc:53
CCGFloat dPhi() const
Definition: IdealZPrism.cc:51
static GlobalPoint etaPhiZ(float eta, float phi, float z)
Definition: IdealZPrism.cc:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static constexpr uint32_t k_dZ
Definition: IdealZPrism.h:36
assert(be >=bs)
CCGFloat eta() const
Definition: IdealZPrism.cc:55
static constexpr uint32_t k_Z
Definition: IdealZPrism.h:38
CaloCellGeometry::CCGFloat CCGFloat
static constexpr uint32_t k_Eta
Definition: IdealZPrism.h:37
static constexpr uint32_t k_dPhi
Definition: IdealZPrism.h:35
CaloCellGeometry::Pt3D Pt3D
Definition: IdealZPrism.h:31
CCGFloat z() const
Definition: IdealZPrism.cc:57

◆ operator=()

IdealZPrism & IdealZPrism::operator= ( const IdealZPrism idzp)

Definition at line 32 of file IdealZPrism.cc.

References forPF(), and m_geoForPF.

32  {
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 }
std::unique_ptr< IdealZPrism > m_geoForPF
Definition: IdealZPrism.h:78
std::shared_ptr< const IdealZPrism > forPF() const
Definition: IdealZPrism.h:61

◆ vocalCorners()

void IdealZPrism::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const
overridevirtual

Implements CaloCellGeometry.

Definition at line 59 of file IdealZPrism.cc.

References localCorners().

59 { localCorners(vec, pv, ref); }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: IdealZPrism.cc:73

◆ z()

CCGFloat IdealZPrism::z ( ) const

Definition at line 57 of file IdealZPrism.cc.

References k_Z, and CaloCellGeometry::param().

Referenced by etaPhiZ(), localCorners(), geometryXMLparser.Alignable::pos(), and ntupleDataFormat._HitObject::r3D().

57 { return param()[IdealZPrism::k_Z]; }
static constexpr uint32_t k_Z
Definition: IdealZPrism.h:38
const CCGFloat * param() const

Member Data Documentation

◆ k_dEta

constexpr uint32_t IdealZPrism::k_dEta = 0
static

Definition at line 34 of file IdealZPrism.h.

Referenced by dEta(), and localCorners().

◆ k_dPhi

constexpr uint32_t IdealZPrism::k_dPhi = 1
static

Definition at line 35 of file IdealZPrism.h.

Referenced by dPhi(), and localCorners().

◆ k_dZ

constexpr uint32_t IdealZPrism::k_dZ = 2
static

Definition at line 36 of file IdealZPrism.h.

Referenced by dz(), and localCorners().

◆ k_Eta

constexpr uint32_t IdealZPrism::k_Eta = 3
static

Definition at line 37 of file IdealZPrism.h.

Referenced by eta(), and localCorners().

◆ k_Z

constexpr uint32_t IdealZPrism::k_Z = 4
static

Definition at line 38 of file IdealZPrism.h.

Referenced by localCorners(), and z().

◆ m_geoForPF

std::unique_ptr<IdealZPrism> IdealZPrism::m_geoForPF
private

Definition at line 78 of file IdealZPrism.h.

Referenced by forPF(), IdealZPrism(), and operator=().