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
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< 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
 
 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
 
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 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 32 of file IdealObliquePrism.h.

Definition at line 33 of file IdealObliquePrism.h.

Definition at line 34 of file IdealObliquePrism.h.

Constructor & Destructor Documentation

IdealObliquePrism::IdealObliquePrism ( )

Definition at line 8 of file IdealObliquePrism.cc.

8  :
10 {}
IdealObliquePrism::IdealObliquePrism ( const IdealObliquePrism idop)

Definition at line 12 of file IdealObliquePrism.cc.

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

Definition at line 25 of file IdealObliquePrism.cc.

References CaloCellGeometry::initSpan().

28  : CaloCellGeometry ( faceCenter, mgr, parm )
29 {initSpan();}
IdealObliquePrism::~IdealObliquePrism ( )
override

Definition at line 31 of file IdealObliquePrism.cc.

32 {}

Member Function Documentation

CCGFloat IdealObliquePrism::dEta ( ) const

Definition at line 35 of file IdealObliquePrism.cc.

References k_dEta, and CaloCellGeometry::param().

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

36 {
38 }
const CCGFloat * param() const
static constexpr uint32_t k_dEta
CCGFloat IdealObliquePrism::dPhi ( ) const

Definition at line 41 of file IdealObliquePrism.cc.

References k_dPhi, and CaloCellGeometry::param().

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

42 {
44 }
const CCGFloat * param() const
static constexpr uint32_t k_dPhi
CCGFloat IdealObliquePrism::dz ( ) const

Definition at line 47 of file IdealObliquePrism.cc.

References k_dZ, and CaloCellGeometry::param().

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

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

Definition at line 53 of file IdealObliquePrism.cc.

References k_Eta, and CaloCellGeometry::param().

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

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

Definition at line 73 of file IdealObliquePrism.cc.

Referenced by initCorners(), and localCorners().

74 {
75  return GlobalPoint( perp*cosf(phi) ,
76  perp*sinf(phi) ,
77  perp*sinhf(eta) ) ;
78 }
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 81 of file IdealObliquePrism.cc.

Referenced by initCorners(), and localCorners().

82 {
83  return GlobalPoint( z*cosf(phi)/sinhf(eta) ,
84  z*sinf(phi)/sinhf(eta) ,
85  z ) ;
86 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
CCGFloat z() const
void IdealObliquePrism::initCorners ( CaloCellGeometry::CornersVec co)
overrideprivatevirtual

Implements CaloCellGeometry.

Definition at line 139 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().

140 {
141  if( co.uninitialized() )
142  {
143  CornersVec& corners ( co ) ;
144  if( dz()>0 )
145  {
146  /* In this case, the faces are parallel to the zaxis.
147  This implies that all corners will have the same
148  cylindrical radius.
149  */
150  const GlobalPoint p ( getPosition() ) ;
151  const CCGFloat r_near ( p.perp()/cos(dPhi()) ) ;
152  const CCGFloat r_far ( r_near*( ( p.mag() + 2*dz() )/p.mag() ) ) ;
153  const CCGFloat eta ( p.eta() ) ;
154  const CCGFloat phi ( p.phi() ) ;
155  corners[ 0 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_near ) ; // (+,+,near)
156  corners[ 1 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_near ) ; // (+,-,near)
157  corners[ 2 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_near ) ; // (-,-,near)
158  corners[ 3 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_near ) ; // (-,+,near)
159  corners[ 4 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_far ) ; // (+,+,far)
160  corners[ 5 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_far ) ; // (+,-,far)
161  corners[ 6 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_far ) ; // (-,-,far)
162  corners[ 7 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_far ) ; // (-,+,far)
163  }
164  else
165  {
166  /* In this case, the faces are perpendicular to the zaxis.
167  This implies that all corners will have the same
168  z-dimension.
169  */
170  const GlobalPoint p ( getPosition() ) ;
171  const CCGFloat z_near ( p.z() ) ;
172  const CCGFloat mag ( p.mag() ) ;
173  const CCGFloat z_far ( z_near*( 1 - 2*dz()/mag ) ) ; // negative to correct sign
174  const CCGFloat eta ( p.eta() ) ;
175  const CCGFloat phi ( p.phi() ) ;
176 
177  corners[ 0 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_near ) ; // (+,+,near)
178  corners[ 1 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_near ) ; // (+,-,near)
179  corners[ 2 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_near ) ; // (-,-,near)
180  corners[ 3 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_near ) ; // (-,+,near)
181  corners[ 4 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_far ) ; // (+,+,far)
182  corners[ 5 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_far ) ; // (+,-,far)
183  corners[ 6 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_far ) ; // (-,-,far)
184  corners[ 7 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_far ) ; // (-,+,far)
185 
186  }
187  }
188 }
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:77
CCGFloat dz() const
void IdealObliquePrism::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
)
static

Definition at line 88 of file IdealObliquePrism.cc.

References 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().

91 {
92  assert( 8 == lc.size() ) ;
93  assert( nullptr != pv ) ;
94 
99  const CCGFloat z ( pv[IdealObliquePrism::k_Z] ) ;
100 
101  std::vector<GlobalPoint> gc ( 8, GlobalPoint(0,0,0) ) ;
102 
103  const GlobalPoint p ( etaPhiZ( eta, 0, z ) ) ;
104 
105  if( 0 < dz )
106  {
107  const CCGFloat r_near ( p.perp()/cos( dPhi ) ) ;
108  const CCGFloat r_far ( r_near*( ( p.mag() + 2*dz )/p.mag() ) ) ;
109  gc[ 0 ] = etaPhiPerp( eta + dEta , +dPhi , r_near ) ; // (+,+,near)
110  gc[ 1 ] = etaPhiPerp( eta + dEta , -dPhi , r_near ) ; // (+,-,near)
111  gc[ 2 ] = etaPhiPerp( eta - dEta , -dPhi , r_near ) ; // (-,-,near)
112  gc[ 3 ] = etaPhiPerp( eta - dEta , +dPhi , r_near ) ; // (-,+,near)
113  gc[ 4 ] = etaPhiPerp( eta + dEta , +dPhi , r_far ) ; // (+,+,far)
114  gc[ 5 ] = etaPhiPerp( eta + dEta , -dPhi , r_far ) ; // (+,-,far)
115  gc[ 6 ] = etaPhiPerp( eta - dEta , -dPhi , r_far ) ; // (-,-,far)
116  gc[ 7 ] = etaPhiPerp( eta - dEta , +dPhi , r_far ) ; // (-,+,far)
117  }
118  else
119  {
120  const CCGFloat z_near ( z ) ;
121  const CCGFloat z_far ( z*( 1 - 2*dz/p.mag() ) ) ;
122  gc[ 0 ] = etaPhiZ( eta + dEta , +dPhi , z_near ) ; // (+,+,near)
123  gc[ 1 ] = etaPhiZ( eta + dEta , -dPhi , z_near ) ; // (+,-,near)
124  gc[ 2 ] = etaPhiZ( eta - dEta , -dPhi , z_near ) ; // (-,-,near)
125  gc[ 3 ] = etaPhiZ( eta - dEta , +dPhi , z_near ) ; // (-,+,near)
126  gc[ 4 ] = etaPhiZ( eta + dEta , +dPhi , z_far ) ; // (+,+,far)
127  gc[ 5 ] = etaPhiZ( eta + dEta , -dPhi , z_far ) ; // (+,-,far)
128  gc[ 6 ] = etaPhiZ( eta - dEta , -dPhi , z_far ) ; // (-,-,far)
129  gc[ 7 ] = etaPhiZ( eta - dEta , +dPhi , z_far ) ; // (-,+,far)
130  }
131  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
132  {
133  lc[i] = Pt3D( gc[i].x(), gc[i].y(), gc[i].z() ) ;
134  }
135 
136  ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
137 }
static GlobalPoint etaPhiZ(float eta, float phi, float z)
CCGFloat dEta() const
static constexpr uint32_t k_Eta
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
CaloCellGeometry::Pt3D Pt3D
static constexpr uint32_t k_dPhi
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
def pv(vc)
Definition: MetAnalyzer.py:7
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 19 of file IdealObliquePrism.cc.

20 {
21  if( &idop != this ) CaloCellGeometry::operator=( idop ) ;
22  return *this ;
23 }
void IdealObliquePrism::vocalCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
) const
overridevirtual

Implements CaloCellGeometry.

Definition at line 65 of file IdealObliquePrism.cc.

References localCorners().

68 {
69  localCorners( vec, pv, ref ) ;
70 }
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
def pv(vc)
Definition: MetAnalyzer.py:7
CCGFloat IdealObliquePrism::z ( ) const

Definition at line 59 of file IdealObliquePrism.cc.

References k_Z, and CaloCellGeometry::param().

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

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

Member Data Documentation

constexpr uint32_t IdealObliquePrism::k_dEta = 0
static

Definition at line 36 of file IdealObliquePrism.h.

Referenced by dEta(), and localCorners().

constexpr uint32_t IdealObliquePrism::k_dPhi = 1
static

Definition at line 37 of file IdealObliquePrism.h.

Referenced by dPhi(), and localCorners().

constexpr uint32_t IdealObliquePrism::k_dZ = 2
static

Definition at line 38 of file IdealObliquePrism.h.

Referenced by dz(), and localCorners().

constexpr uint32_t IdealObliquePrism::k_Eta = 3
static

Definition at line 39 of file IdealObliquePrism.h.

Referenced by eta(), and localCorners().

constexpr uint32_t IdealObliquePrism::k_Z = 4
static

Definition at line 40 of file IdealObliquePrism.h.

Referenced by localCorners(), and z().