CMS 3D CMS Logo

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

#include <IdealObliquePrism.h>

Inheritance diagram for calogeom::IdealObliquePrism:
CaloCellGeometry

Public Member Functions

double dEta () const
 
double dPhi () const
 
double dz () const
 
double eta () const
 
virtual const CornersVecgetCorners () const
 
 IdealObliquePrism (const GlobalPoint &faceCenter, const CornersMgr *mgr, const double *parm)
 
virtual std::vector
< HepGeom::Point3D< double > > 
vocalCorners (const double *pv, HepGeom::Point3D< double > &ref) const
 
double z () const
 
virtual ~IdealObliquePrism ()
 
- Public Member Functions inherited from CaloCellGeometry
bool emptyCorners () const
 
const GlobalPointgetPosition () const
 
virtual HepGeom::Transform3D getTransform (std::vector< HepGeom::Point3D< double > > *lptr) const
 
bool inside (const GlobalPoint &point) const
 
const double * param () const
 
virtual ~CaloCellGeometry ()
 

Static Public Member Functions

static std::vector
< HepGeom::Point3D< double > > 
localCorners (const double *pv, HepGeom::Point3D< double > &ref)
 
- Static Public Member Functions inherited from CaloCellGeometry
static const double * checkParmPtr (const std::vector< double > &vd, ParVecVec &pvv)
 
static const double * getParmPtr (const std::vector< double > &vd, ParMgr *mgr, ParVecVec &pvv)
 

Additional Inherited Members

- Public Types inherited from CaloCellGeometry
typedef EZMgrFL< GlobalPointCornersMgr
 
enum  CornersSize { k_cornerSize = 8 }
 
typedef EZArrayFL< GlobalPointCornersVec
 
typedef EZMgrFL< double > ParMgr
 
typedef EZArrayFL< double > ParVec
 
typedef std::vector< ParVecParVecVec
 
- Static Public Attributes inherited from CaloCellGeometry
static const float k_ScaleFromDDDtoGeant
 
- Protected Member Functions inherited from CaloCellGeometry
 CaloCellGeometry (CornersVec::const_reference gp, const CornersMgr *mgr, const double *par)
 
 CaloCellGeometry (const CornersVec &cv, const double *par)
 
CornersVecsetCorners () const
 

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)

Date:
2009/05/25 09:06:11
Revision:
1.8
Author
J. Mans - Minnesota

Definition at line 31 of file IdealObliquePrism.h.

Constructor & Destructor Documentation

calogeom::IdealObliquePrism::IdealObliquePrism ( const GlobalPoint faceCenter,
const CornersMgr mgr,
const double *  parm 
)
inline

Definition at line 35 of file IdealObliquePrism.h.

37  :
38  CaloCellGeometry ( faceCenter, mgr, parm ) {}
CaloCellGeometry(CornersVec::const_reference gp, const CornersMgr *mgr, const double *par)
virtual calogeom::IdealObliquePrism::~IdealObliquePrism ( )
inlinevirtual

Definition at line 40 of file IdealObliquePrism.h.

40 {}

Member Function Documentation

double calogeom::IdealObliquePrism::dEta ( ) const
inline

Definition at line 44 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

Referenced by getCorners(), localCorners(), and calogeom::operator<<().

44 { return param()[0] ; }
const double * param() const
double calogeom::IdealObliquePrism::dPhi ( ) const
inline

Definition at line 45 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

Referenced by getCorners(), localCorners(), and calogeom::operator<<().

45 { return param()[1] ; }
const double * param() const
double calogeom::IdealObliquePrism::dz ( ) const
inline

Definition at line 46 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

Referenced by getCorners(), localCorners(), and calogeom::operator<<().

46 { return param()[2] ; }
const double * param() const
double calogeom::IdealObliquePrism::eta ( void  ) const
inline

Definition at line 47 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

Referenced by getCorners(), and localCorners().

47 { return param()[3] ; }
const double * param() const
const CaloCellGeometry::CornersVec & calogeom::IdealObliquePrism::getCorners ( ) const
virtual

Implements CaloCellGeometry.

Definition at line 83 of file IdealObliquePrism.cc.

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

84  {
86  if( co.uninitialized() )
87  {
88  CornersVec& corners ( setCorners() ) ;
89  if( dz()>0 )
90  {
91  /* In this case, the faces are parallel to the zaxis.
92  This implies that all corners will have the same
93  cylindrical radius.
94  */
95  const GlobalPoint p ( getPosition() ) ;
96  const float r_near ( p.perp()/cos(dPhi()) ) ;
97  const float r_far ( r_near*( ( p.mag() + 2*dz() )/p.mag() ) ) ;
98  const float eta ( p.eta() ) ;
99  const float phi ( p.phi() ) ;
100  corners[ 0 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_near ) ; // (+,+,near)
101  corners[ 1 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_near ) ; // (+,-,near)
102  corners[ 2 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_near ) ; // (-,-,near)
103  corners[ 3 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_near ) ; // (-,+,near)
104  corners[ 4 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_far ) ; // (+,+,far)
105  corners[ 5 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_far ) ; // (+,-,far)
106  corners[ 6 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_far ) ; // (-,-,far)
107  corners[ 7 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_far ) ; // (-,+,far)
108  }
109  else
110  {
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 float z_near ( p.z() ) ;
117  const float mag ( p.mag() ) ;
118  const float z_far ( z_near*( 1 - 2*dz()/mag ) ) ; // negative to correct sign
119  const float eta ( p.eta() ) ;
120  const float 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  }
133  return co ;
134  }
EZArrayFL< GlobalPoint > CornersVec
static GlobalPoint etaPhiPerp(float eta, float phi, float perp)
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
static GlobalPoint etaPhiZ(float eta, float phi, float z)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CornersVec & setCorners() const
const GlobalPoint & getPosition() const
virtual const CornersVec & getCorners() const =0
Definition: DDAxes.h:10
std::vector< HepGeom::Point3D< double > > calogeom::IdealObliquePrism::localCorners ( const double *  pv,
HepGeom::Point3D< double > &  ref 
)
static

Definition at line 31 of file IdealObliquePrism.cc.

References funct::cos(), dEta(), dPhi(), dz(), eta(), calogeom::etaPhiPerp(), calogeom::etaPhiZ(), i, PV3DBase< T, PVType, FrameType >::mag(), L1TEmulatorMonitor_cff::p, PV3DBase< T, PVType, FrameType >::perp(), and z().

Referenced by CaloTowerGeometry::localCorners(), HcalGeometry::localCorners(), and vocalCorners().

33  {
34  assert( 0 != pv ) ;
35 
36  const double dEta ( pv[0] ) ;
37  const double dPhi ( pv[1] ) ;
38  const double dz ( pv[2] ) ;
39  const double eta ( pv[3] ) ;
40  const double z ( pv[4] ) ;
41 
42  std::vector<GlobalPoint> gc ( 8, GlobalPoint(0,0,0) ) ;
43  std::vector<HepGeom::Point3D<double> > lc ( 8, HepGeom::Point3D<double> ( 0,0,0) ) ;
44 
45  const GlobalPoint p ( etaPhiZ( eta, 0, z ) ) ;
46 
47  if( 0 < dz )
48  {
49  const float r_near ( p.perp()/cos( dPhi ) ) ;
50  const float r_far ( r_near*( ( p.mag() + 2*dz )/p.mag() ) ) ;
51  gc[ 0 ] = etaPhiPerp( eta + dEta , +dPhi , r_near ) ; // (+,+,near)
52  gc[ 1 ] = etaPhiPerp( eta + dEta , -dPhi , r_near ) ; // (+,-,near)
53  gc[ 2 ] = etaPhiPerp( eta - dEta , -dPhi , r_near ) ; // (-,-,near)
54  gc[ 3 ] = etaPhiPerp( eta - dEta , +dPhi , r_near ) ; // (-,+,far)
55  gc[ 4 ] = etaPhiPerp( eta + dEta , +dPhi , r_far ) ; // (+,+,far)
56  gc[ 5 ] = etaPhiPerp( eta + dEta , -dPhi , r_far ) ; // (+,-,far)
57  gc[ 6 ] = etaPhiPerp( eta - dEta , -dPhi , r_far ) ; // (-,-,far)
58  gc[ 7 ] = etaPhiPerp( eta - dEta , +dPhi , r_far ) ; // (-,+,far)
59  }
60  else
61  {
62  const float z_near ( z ) ;
63  const float z_far ( z*( 1 - 2*dz/p.mag() ) ) ;
64  gc[ 0 ] = etaPhiZ( eta + dEta , +dPhi , z_near ) ; // (+,+,near)
65  gc[ 1 ] = etaPhiZ( eta + dEta , -dPhi , z_near ) ; // (+,-,near)
66  gc[ 2 ] = etaPhiZ( eta - dEta , -dPhi , z_near ) ; // (-,-,near)
67  gc[ 3 ] = etaPhiZ( eta - dEta , +dPhi , z_near ) ; // (-,+,far)
68  gc[ 4 ] = etaPhiZ( eta + dEta , +dPhi , z_far ) ; // (+,+,far)
69  gc[ 5 ] = etaPhiZ( eta + dEta , -dPhi , z_far ) ; // (+,-,far)
70  gc[ 6 ] = etaPhiZ( eta - dEta , -dPhi , z_far ) ; // (-,-,far)
71  gc[ 7 ] = etaPhiZ( eta - dEta , +dPhi , z_far ) ; // (-,+,far)
72  }
73  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
74  {
75  lc[i] = HepGeom::Point3D<double> ( gc[i].x(), gc[i].y(), gc[i].z() ) ;
76  }
77 
78  ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
79  return lc ;
80  }
int i
Definition: DBlmapReader.cc:9
static GlobalPoint etaPhiPerp(float eta, float phi, float perp)
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static GlobalPoint etaPhiZ(float eta, float phi, float z)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual std::vector<HepGeom::Point3D<double> > calogeom::IdealObliquePrism::vocalCorners ( const double *  pv,
HepGeom::Point3D< double > &  ref 
) const
inlinevirtual

Implements CaloCellGeometry.

Definition at line 53 of file IdealObliquePrism.h.

References localCorners().

55  { return localCorners( pv, ref ) ; }
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
double calogeom::IdealObliquePrism::z ( ) const
inline

Definition at line 48 of file IdealObliquePrism.h.

References CaloCellGeometry::param().

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

48 { return param()[4] ; }
const double * param() const