CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions
IdealObliquePrism Class Reference

#include <IdealObliquePrism.h>

Inheritance diagram for IdealObliquePrism:
CaloCellGeometry

Public Types

typedef CaloCellGeometry::CCGFloat CCGFloat
 
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
< CCGFloat
Pt3D
 
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
 
 IdealObliquePrism ()
 
 IdealObliquePrism (const IdealObliquePrism &idop)
 
 IdealObliquePrism (const GlobalPoint &faceCenter, CornersMgr *mgr, const CCGFloat *parm)
 
IdealObliquePrismoperator= (const IdealObliquePrism &idop)
 
void vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const override
 
CCGFloat z () const
 
 ~IdealObliquePrism () 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 etaPhiZ (float eta, float phi, float z)
 

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

Oblique prism class used for HCAL (HB, HE, HO) volumes.

Required parameters for an ideal oblique prism:

Total: 6+1 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 widths, the axis tower thickness, and the parallel/perpendicular setting. The parallel/perpendicular setting is encoded in the sign of the thickness. (positive = parallel to z-axis, negative = perpendicular)

Author
J. Mans - Minnesota

Definition at line 28 of file IdealObliquePrism.h.

Member Typedef Documentation

Definition at line 30 of file IdealObliquePrism.h.

Definition at line 31 of file IdealObliquePrism.h.

Definition at line 32 of file IdealObliquePrism.h.

Constructor & Destructor Documentation

IdealObliquePrism::IdealObliquePrism ( )

Definition at line 8 of file IdealObliquePrism.cc.

IdealObliquePrism::IdealObliquePrism ( const IdealObliquePrism idop)

Definition at line 10 of file IdealObliquePrism.cc.

10 : CaloCellGeometry(idop) { *this = idop; }
IdealObliquePrism::IdealObliquePrism ( const GlobalPoint faceCenter,
CornersMgr mgr,
const CCGFloat parm 
)

Definition at line 18 of file IdealObliquePrism.cc.

References CaloCellGeometry::initSpan().

19  : CaloCellGeometry(faceCenter, mgr, parm) {
20  initSpan();
21 }
IdealObliquePrism::~IdealObliquePrism ( )
override

Definition at line 23 of file IdealObliquePrism.cc.

23 {}

Member Function Documentation

CCGFloat IdealObliquePrism::dEta ( ) const

Definition at line 25 of file IdealObliquePrism.cc.

References k_dEta, and CaloCellGeometry::param().

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

25 { return param()[IdealObliquePrism::k_dEta]; }
const CCGFloat * param() const
static constexpr uint32_t k_dEta
CCGFloat IdealObliquePrism::dPhi ( ) const

Definition at line 27 of file IdealObliquePrism.cc.

References k_dPhi, and CaloCellGeometry::param().

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

27 { return param()[IdealObliquePrism::k_dPhi]; }
const CCGFloat * param() const
static constexpr uint32_t k_dPhi
CCGFloat IdealObliquePrism::dz ( ) const

Definition at line 29 of file IdealObliquePrism.cc.

References k_dZ, and CaloCellGeometry::param().

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

29 { return param()[IdealObliquePrism::k_dZ]; }
const CCGFloat * param() const
static constexpr uint32_t k_dZ
CCGFloat IdealObliquePrism::eta ( void  ) const

Definition at line 31 of file IdealObliquePrism.cc.

References k_Eta, and CaloCellGeometry::param().

Referenced by Particle.Particle::__str__(), initCorners(), Jet.Jet::jetID(), localCorners(), and Jet.Jet::puJetId().

31 { return param()[IdealObliquePrism::k_Eta]; }
static constexpr uint32_t k_Eta
const CCGFloat * param() const
GlobalPoint IdealObliquePrism::etaPhiPerp ( float  eta,
float  phi,
float  perp 
)
staticprivate

Definition at line 37 of file IdealObliquePrism.cc.

Referenced by initCorners(), and localCorners().

37  {
38  return GlobalPoint(perp * cosf(phi), perp * sinf(phi), perp * sinhf(eta));
39 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
T perp() const
Magnitude of transverse component.
GlobalPoint IdealObliquePrism::etaPhiZ ( float  eta,
float  phi,
float  z 
)
staticprivate

Definition at line 41 of file IdealObliquePrism.cc.

Referenced by initCorners(), and localCorners().

41  {
42  return GlobalPoint(z * cosf(phi) / sinhf(eta), z * sinf(phi) / sinhf(eta), z);
43 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
CCGFloat z() const
void IdealObliquePrism::initCorners ( CaloCellGeometry::CornersVec co)
overrideprivatevirtual

Implements CaloCellGeometry.

Definition at line 89 of file IdealObliquePrism.cc.

References funct::cos(), dEta(), dPhi(), dz(), eta(), PV3DBase< T, PVType, FrameType >::eta(), etaPhiPerp(), etaPhiZ(), CaloCellGeometry::getPosition(), PV3DBase< T, PVType, FrameType >::mag(), mag(), AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), EZArrayFL< T >::uninitialized(), and PV3DBase< T, PVType, FrameType >::z().

89  {
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 }
EZArrayFL< GlobalPoint > CornersVec
static GlobalPoint etaPhiZ(float eta, float phi, float z)
CCGFloat dEta() const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
CCGFloat eta() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CaloCellGeometry::CCGFloat CCGFloat
static GlobalPoint etaPhiPerp(float eta, float phi, float perp)
CCGFloat dPhi() const
bool uninitialized() const
Definition: EZArrayFL.h:63
CCGFloat dz() const
void IdealObliquePrism::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
)
static

Definition at line 45 of file IdealObliquePrism.cc.

References cms::cuda::assert(), funct::cos(), dEta(), dPhi(), dz(), eta(), etaPhiPerp(), etaPhiZ(), mps_fire::i, k_dEta, k_dPhi, k_dZ, k_Eta, k_Z, PV3DBase< T, PVType, FrameType >::mag(), AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::perp(), x, y, and z().

Referenced by FWTGeoRecoGeometryESProducer::addCaloTowerGeometry(), FWTGeoRecoGeometryESProducer::addHcalCaloGeometryBarrel(), FWTGeoRecoGeometryESProducer::addHcalCaloGeometryEndcap(), FWTGeoRecoGeometryESProducer::addHcalCaloGeometryOuter(), CaloTowerGeometry::localCorners(), HcalGeometry::localCorners(), and vocalCorners().

45  {
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 }
static GlobalPoint etaPhiZ(float eta, float phi, float z)
CCGFloat dEta() const
static constexpr uint32_t k_Eta
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
assert(be >=bs)
CCGFloat eta() const
CaloCellGeometry::Pt3D Pt3D
static constexpr uint32_t k_dPhi
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CaloCellGeometry::CCGFloat CCGFloat
static constexpr uint32_t k_Z
static GlobalPoint etaPhiPerp(float eta, float phi, float perp)
CCGFloat dPhi() const
CCGFloat z() const
static constexpr uint32_t k_dEta
CCGFloat dz() const
static constexpr uint32_t k_dZ
IdealObliquePrism & IdealObliquePrism::operator= ( const IdealObliquePrism idop)

Definition at line 12 of file IdealObliquePrism.cc.

12  {
13  if (&idop != this)
14  CaloCellGeometry::operator=(idop);
15  return *this;
16 }
void IdealObliquePrism::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const
overridevirtual

Implements CaloCellGeometry.

Definition at line 35 of file IdealObliquePrism.cc.

References localCorners().

35 { localCorners(vec, pv, ref); }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
CCGFloat IdealObliquePrism::z ( ) const

Definition at line 33 of file IdealObliquePrism.cc.

References k_Z, and CaloCellGeometry::param().

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

33 { return param()[IdealObliquePrism::k_Z]; }
const CCGFloat * param() const
static constexpr uint32_t k_Z

Member Data Documentation

constexpr uint32_t IdealObliquePrism::k_dEta = 0
static

Definition at line 34 of file IdealObliquePrism.h.

Referenced by dEta(), and localCorners().

constexpr uint32_t IdealObliquePrism::k_dPhi = 1
static

Definition at line 35 of file IdealObliquePrism.h.

Referenced by dPhi(), and localCorners().

constexpr uint32_t IdealObliquePrism::k_dZ = 2
static

Definition at line 36 of file IdealObliquePrism.h.

Referenced by dz(), and localCorners().

constexpr uint32_t IdealObliquePrism::k_Eta = 3
static

Definition at line 37 of file IdealObliquePrism.h.

Referenced by eta(), and localCorners().

constexpr uint32_t IdealObliquePrism::k_Z = 4
static

Definition at line 38 of file IdealObliquePrism.h.

Referenced by localCorners(), and z().