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
 
float etaPos () const
 
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
 
float phiPos () const
 
float phiSpan () const
 
RhoEtaPhi const & repPos () const
 
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

Definition at line 32 of file IdealZPrism.h.

Definition at line 33 of file IdealZPrism.h.

Definition at line 34 of file IdealZPrism.h.

Member Enumeration Documentation

Enumerator
None 
EM 
HADR 

Definition at line 30 of file IdealZPrism.h.

Constructor & Destructor Documentation

IdealZPrism::IdealZPrism ( )
IdealZPrism::IdealZPrism ( const IdealZPrism idzp)

Definition at line 26 of file IdealZPrism.cc.

References forPF(), and m_geoForPF.

27  : CaloCellGeometry( idzp )
28 {
29  if (idzp.forPF()) m_geoForPF.reset(new IdealZPrism(*idzp.forPF()));
30 }
std::shared_ptr< const IdealZPrism > forPF() const
Definition: IdealZPrism.h:73
std::unique_ptr< IdealZPrism > m_geoForPF
Definition: IdealZPrism.h:98
IdealZPrism::IdealZPrism ( const GlobalPoint faceCenter,
CornersMgr mgr,
const CCGFloat parm,
IdealZPrism::DEPTH  depth 
)

Definition at line 42 of file IdealZPrism.cc.

References CaloCellGeometry::initSpan().

46  : CaloCellGeometry ( faceCenter, mgr, parm ),
47  m_geoForPF(depth==None ? nullptr : new IdealZPrism(correct(faceCenter,depth), mgr, parm, None ))
48 {initSpan();}
std::unique_ptr< IdealZPrism > m_geoForPF
Definition: IdealZPrism.h:98
IdealZPrism::~IdealZPrism ( )
override

Definition at line 50 of file IdealZPrism.cc.

51 {}

Member Function Documentation

CCGFloat IdealZPrism::dEta ( ) const

Definition at line 54 of file IdealZPrism.cc.

References k_dEta, and CaloCellGeometry::param().

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

55 {
56  return param()[IdealZPrism::k_dEta] ;
57 }
static constexpr uint32_t k_dEta
Definition: IdealZPrism.h:36
const CCGFloat * param() const
CCGFloat IdealZPrism::dPhi ( ) const

Definition at line 60 of file IdealZPrism.cc.

References k_dPhi, and CaloCellGeometry::param().

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

61 {
62  return param()[IdealZPrism::k_dPhi] ;
63 }
const CCGFloat * param() const
static constexpr uint32_t k_dPhi
Definition: IdealZPrism.h:37
CCGFloat IdealZPrism::dz ( ) const

Definition at line 66 of file IdealZPrism.cc.

References k_dZ, and CaloCellGeometry::param().

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

67 {
68  return param()[IdealZPrism::k_dZ] ;
69 }
static constexpr uint32_t k_dZ
Definition: IdealZPrism.h:38
const CCGFloat * param() const
CCGFloat IdealZPrism::eta ( void  ) const

Definition at line 72 of file IdealZPrism.cc.

References k_Eta, and CaloCellGeometry::param().

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

73 {
74  return param()[IdealZPrism::k_Eta] ;
75 }
const CCGFloat * param() const
static constexpr uint32_t k_Eta
Definition: IdealZPrism.h:39
GlobalPoint IdealZPrism::etaPhiPerp ( float  eta,
float  phi,
float  perp 
)
staticprivate

Definition at line 102 of file IdealZPrism.cc.

Referenced by forPF().

105 {
106  return GlobalPoint( perp*cosf( phi ) ,
107  perp*sinf( phi ) ,
108  perp*sinhf( eta ) );
109 }
CCGFloat eta() const
Definition: IdealZPrism.cc:72
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T perp() const
Magnitude of transverse component.
GlobalPoint IdealZPrism::etaPhiR ( float  eta,
float  phi,
float  rad 
)
staticprivate

Definition at line 92 of file IdealZPrism.cc.

Referenced by forPF().

95 {
96  return GlobalPoint( rad*cosf( phi )/coshf( eta ) ,
97  rad*sinf( phi )/coshf( eta ) ,
98  rad*tanhf( eta ) ) ;
99 }
CCGFloat eta() const
Definition: IdealZPrism.cc:72
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint IdealZPrism::etaPhiZ ( float  eta,
float  phi,
float  z 
)
staticprivate

Definition at line 112 of file IdealZPrism.cc.

Referenced by forPF(), initCorners(), and localCorners().

115 {
116  return GlobalPoint( z*cosf( phi )/sinhf( eta ) ,
117  z*sinf( phi )/sinhf( eta ) ,
118  z ) ;
119 }
CCGFloat eta() const
Definition: IdealZPrism.cc:72
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat z() const
Definition: IdealZPrism.cc:78
std::shared_ptr<const IdealZPrism> IdealZPrism::forPF ( ) const
inline

Definition at line 73 of file IdealZPrism.h.

References eta(), etaPhiPerp(), etaPhiR(), etaPhiZ(), initCorners(), m_geoForPF, perp(), phi, and z().

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

73  {
74  static const auto do_not_delete = [](const void*){};
75  auto cell = std::shared_ptr<const IdealZPrism>(m_geoForPF.get(),do_not_delete);
76  return cell;
77  }
std::unique_ptr< IdealZPrism > m_geoForPF
Definition: IdealZPrism.h:98
void IdealZPrism::initCorners ( CaloCellGeometry::CornersVec co)
overrideprivatevirtual

Implements CaloCellGeometry.

Definition at line 159 of file IdealZPrism.cc.

References dEta(), dPhi(), dz(), eta(), PV3DBase< T, PVType, FrameType >::eta(), etaPhiZ(), CaloCellGeometry::getPosition(), AlCaHLTBitMon_ParallelJobs::p, phi, PV3DBase< T, PVType, FrameType >::phi(), EZArrayFL< T >::uninitialized(), x, y, and PV3DBase< T, PVType, FrameType >::z().

Referenced by forPF().

160 {
161  if( co.uninitialized() )
162  {
163  CornersVec& corners ( co ) ;
164 
165  const GlobalPoint p ( getPosition() ) ;
166  const CCGFloat z_near ( p.z() ) ;
167  const CCGFloat z_far ( z_near + 2*dz()*p.z()/fabs( p.z() ) ) ;
168  const CCGFloat eta ( p.eta() ) ;
169  const CCGFloat phi ( p.phi() ) ;
170 
171  corners[ 0 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_near ); // (+,+,near)
172  corners[ 1 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_near ); // (+,-,near)
173  corners[ 2 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_near ); // (-,-,near)
174  corners[ 3 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_near ); // (-,+,near)
175  corners[ 4 ] = GlobalPoint( corners[0].x(), corners[0].y(), z_far ); // (+,+,far)
176  corners[ 5 ] = GlobalPoint( corners[1].x(), corners[1].y(), z_far ); // (+,-,far)
177  corners[ 6 ] = GlobalPoint( corners[2].x(), corners[2].y(), z_far ); // (-,-,far)
178  corners[ 7 ] = GlobalPoint( corners[3].x(), corners[3].y(), z_far ); // (-,+,far)
179  }
180 }
EZArrayFL< GlobalPoint > CornersVec
CCGFloat eta() const
Definition: IdealZPrism.cc:72
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
static GlobalPoint etaPhiZ(float eta, float phi, float z)
Definition: IdealZPrism.cc:112
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat dz() const
Definition: IdealZPrism.cc:66
CaloCellGeometry::CCGFloat CCGFloat
CCGFloat dEta() const
Definition: IdealZPrism.cc:54
CCGFloat dPhi() const
Definition: IdealZPrism.cc:60
bool uninitialized() const
Definition: EZArrayFL.h:77
void IdealZPrism::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
)
static

Definition at line 122 of file IdealZPrism.cc.

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

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

125 {
126  assert( 8 == lc.size() ) ;
127  assert( nullptr != pv ) ;
128 
129  const CCGFloat dEta ( pv[IdealZPrism::k_dEta] ) ;
130  const CCGFloat dPhi ( pv[IdealZPrism::k_dPhi] ) ;
131  const CCGFloat dz ( pv[IdealZPrism::k_dZ] ) ;
132  const CCGFloat eta ( pv[IdealZPrism::k_Eta] ) ;
133  const CCGFloat z ( pv[IdealZPrism::k_Z] ) ;
134 
135  std::vector<GlobalPoint> gc ( 8, GlobalPoint(0,0,0) ) ;
136 
137  const GlobalPoint p ( etaPhiZ( eta, 0, z ) ) ;
138 
139  const float z_near ( z ) ;
140  const float z_far ( z*( 1 - 2*dz/p.mag() ) ) ;
141  gc[ 0 ] = etaPhiZ( eta + dEta , +dPhi , z_near ) ; // (+,+,near)
142  gc[ 1 ] = etaPhiZ( eta + dEta , -dPhi , z_near ) ; // (+,-,near)
143  gc[ 2 ] = etaPhiZ( eta - dEta , -dPhi , z_near ) ; // (-,-,near)
144  gc[ 3 ] = etaPhiZ( eta - dEta , +dPhi , z_near ) ; // (-,+,far)
145  gc[ 4 ] = GlobalPoint( gc[0].x(), gc[0].y(), z_far ); // (+,+,far)
146  gc[ 5 ] = GlobalPoint( gc[1].x(), gc[1].y(), z_far ); // (+,-,far)
147  gc[ 6 ] = GlobalPoint( gc[2].x(), gc[2].y(), z_far ); // (-,-,far)
148  gc[ 7 ] = GlobalPoint( gc[3].x(), gc[3].y(), z_far ); // (-,+,far)
149 
150  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
151  {
152  lc[i] = Pt3D( gc[i].x(), gc[i].y(), gc[i].z() ) ;
153  }
154 
155  ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
156 }
static constexpr uint32_t k_dEta
Definition: IdealZPrism.h:36
CCGFloat eta() const
Definition: IdealZPrism.cc:72
static GlobalPoint etaPhiZ(float eta, float phi, float z)
Definition: IdealZPrism.cc:112
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static constexpr uint32_t k_dZ
Definition: IdealZPrism.h:38
CCGFloat dz() const
Definition: IdealZPrism.cc:66
static constexpr uint32_t k_Z
Definition: IdealZPrism.h:40
def pv(vc)
Definition: MetAnalyzer.py:7
CaloCellGeometry::CCGFloat CCGFloat
static constexpr uint32_t k_Eta
Definition: IdealZPrism.h:39
static constexpr uint32_t k_dPhi
Definition: IdealZPrism.h:37
CCGFloat dEta() const
Definition: IdealZPrism.cc:54
CaloCellGeometry::Pt3D Pt3D
Definition: IdealZPrism.h:33
CCGFloat dPhi() const
Definition: IdealZPrism.cc:60
CCGFloat z() const
Definition: IdealZPrism.cc:78
IdealZPrism & IdealZPrism::operator= ( const IdealZPrism idzp)

Definition at line 33 of file IdealZPrism.cc.

References forPF(), and m_geoForPF.

34 {
35  if( &idzp != this ) {
36  CaloCellGeometry::operator=( idzp ) ;
37  if (idzp.forPF()) m_geoForPF.reset(new IdealZPrism(*idzp.forPF()));
38  }
39  return *this ;
40 }
std::shared_ptr< const IdealZPrism > forPF() const
Definition: IdealZPrism.h:73
std::unique_ptr< IdealZPrism > m_geoForPF
Definition: IdealZPrism.h:98
void IdealZPrism::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const
overridevirtual

Implements CaloCellGeometry.

Definition at line 84 of file IdealZPrism.cc.

References localCorners().

87 {
88  localCorners( vec, pv, ref ) ;
89 }
def pv(vc)
Definition: MetAnalyzer.py:7
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
Definition: IdealZPrism.cc:122
CCGFloat IdealZPrism::z ( ) const

Definition at line 78 of file IdealZPrism.cc.

References k_Z, and CaloCellGeometry::param().

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

79 {
80  return param()[IdealZPrism::k_Z] ;
81 }
const CCGFloat * param() const
static constexpr uint32_t k_Z
Definition: IdealZPrism.h:40

Member Data Documentation

constexpr uint32_t IdealZPrism::k_dEta = 0
static

Definition at line 36 of file IdealZPrism.h.

Referenced by dEta(), and localCorners().

constexpr uint32_t IdealZPrism::k_dPhi = 1
static

Definition at line 37 of file IdealZPrism.h.

Referenced by dPhi(), and localCorners().

constexpr uint32_t IdealZPrism::k_dZ = 2
static

Definition at line 38 of file IdealZPrism.h.

Referenced by dz(), and localCorners().

constexpr uint32_t IdealZPrism::k_Eta = 3
static

Definition at line 39 of file IdealZPrism.h.

Referenced by eta(), and localCorners().

constexpr uint32_t IdealZPrism::k_Z = 4
static

Definition at line 40 of file IdealZPrism.h.

Referenced by localCorners(), and z().

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

Definition at line 98 of file IdealZPrism.h.

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