CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public 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
 
enum  CornersSize { k_cornerSize = 8 }
 
typedef EZArrayFL< GlobalPointCornersVec
 
typedef EZMgrFL< CCGFloatParMgr
 
typedef EZArrayFL< CCGFloatParVec
 
typedef std::vector< ParVecParVecVec
 
typedef HepGeom::Point3D
< CCGFloat
Pt3D
 
typedef std::vector< Pt3DPt3DVec
 
typedef HepGeom::Transform3D Tr3D
 

Public Member Functions

CCGFloat dEta () const
 
CCGFloat dPhi () const
 
CCGFloat dz () const
 
CCGFloat eta () const
 
virtual const CornersVecgetCorners () const
 Returns the corner points of this cell's volume. More...
 
 IdealObliquePrism ()
 
 IdealObliquePrism (const IdealObliquePrism &idop)
 
 IdealObliquePrism (const GlobalPoint &faceCenter, const CornersMgr *mgr, const CCGFloat *parm)
 
IdealObliquePrismoperator= (const IdealObliquePrism &idop)
 
virtual void vocalCorners (Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const
 
CCGFloat z () const
 
virtual ~IdealObliquePrism ()
 
- Public Member Functions inherited from CaloCellGeometry
bool emptyCorners () const
 
float etaPos () const
 
float etaSpan () const
 
const GlobalPointgetPosition () const
 Returns the position of reference for this cell. More...
 
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
 
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 Private Member Functions

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

Additional Inherited Members

- Static Public Attributes inherited from CaloCellGeometry
static const CCGFloat k_ScaleFromDDDtoGeant
 
- Protected Member Functions inherited from CaloCellGeometry
 CaloCellGeometry (CornersVec::const_reference gp, const CornersMgr *mgr, const CCGFloat *par)
 
 CaloCellGeometry (const CornersVec &cv, const CCGFloat *par)
 
 CaloCellGeometry (void)
 
void initSpan () const
 
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)

Revision:
1.10
Author
J. Mans - Minnesota

Definition at line 29 of file IdealObliquePrism.h.

Member Typedef Documentation

Definition at line 33 of file IdealObliquePrism.h.

Definition at line 34 of file IdealObliquePrism.h.

Definition at line 35 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,
const CornersMgr mgr,
const CCGFloat parm 
)

Definition at line 25 of file IdealObliquePrism.cc.

References CaloCellGeometry::initSpan().

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

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 CaloCellGeometry::param().

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

36 {
37  return param()[0] ;
38 }
const CCGFloat * param() const
CCGFloat IdealObliquePrism::dPhi ( ) const

Definition at line 41 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

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

42 {
43  return param()[1] ;
44 }
const CCGFloat * param() const
CCGFloat IdealObliquePrism::dz ( ) const

Definition at line 47 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

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

48 {
49  return param()[2] ;
50 }
const CCGFloat * param() const
CCGFloat IdealObliquePrism::eta ( void  ) const

Definition at line 53 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

Referenced by getCorners(), and localCorners().

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

Definition at line 82 of file IdealObliquePrism.cc.

Referenced by getCorners(), and localCorners().

83 {
84  return GlobalPoint( perp*cosf(phi) ,
85  perp*sinf(phi) ,
86  perp*sinhf(eta) ) ;
87 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
T perp() const
Magnitude of transverse component.
Definition: DDAxes.h:10
GlobalPoint IdealObliquePrism::etaPhiZ ( float  eta,
float  phi,
float  z 
)
staticprivate

Definition at line 90 of file IdealObliquePrism.cc.

Referenced by getCorners(), and localCorners().

91 {
92  return GlobalPoint( z*cosf(phi)/sinhf(eta) ,
93  z*sinf(phi)/sinhf(eta) ,
94  z ) ;
95 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
CCGFloat z() const
Definition: DDAxes.h:10
const CaloCellGeometry::CornersVec & IdealObliquePrism::getCorners ( ) const
virtual

Returns the corner points of this cell's volume.

Implements CaloCellGeometry.

Definition at line 149 of file IdealObliquePrism.cc.

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

150 {
151  const CornersVec& co ( CaloCellGeometry::getCorners() ) ;
152  if( co.uninitialized() )
153  {
154  CornersVec& corners ( setCorners() ) ;
155  if( dz()>0 )
156  {
157  /* In this case, the faces are parallel to the zaxis.
158  This implies that all corners will have the same
159  cylindrical radius.
160  */
161  const GlobalPoint p ( getPosition() ) ;
162  const CCGFloat r_near ( p.perp()/cos(dPhi()) ) ;
163  const CCGFloat r_far ( r_near*( ( p.mag() + 2*dz() )/p.mag() ) ) ;
164  const CCGFloat eta ( p.eta() ) ;
165  const CCGFloat phi ( p.phi() ) ;
166  corners[ 0 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_near ) ; // (+,+,near)
167  corners[ 1 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_near ) ; // (+,-,near)
168  corners[ 2 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_near ) ; // (-,-,near)
169  corners[ 3 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_near ) ; // (-,+,near)
170  corners[ 4 ] = etaPhiPerp( eta + dEta() , phi + dPhi() , r_far ) ; // (+,+,far)
171  corners[ 5 ] = etaPhiPerp( eta + dEta() , phi - dPhi() , r_far ) ; // (+,-,far)
172  corners[ 6 ] = etaPhiPerp( eta - dEta() , phi - dPhi() , r_far ) ; // (-,-,far)
173  corners[ 7 ] = etaPhiPerp( eta - dEta() , phi + dPhi() , r_far ) ; // (-,+,far)
174  }
175  else
176  {
177  /* In this case, the faces are perpendicular to the zaxis.
178  This implies that all corners will have the same
179  z-dimension.
180  */
181  const GlobalPoint p ( getPosition() ) ;
182  const CCGFloat z_near ( p.z() ) ;
183  const CCGFloat mag ( p.mag() ) ;
184  const CCGFloat z_far ( z_near*( 1 - 2*dz()/mag ) ) ; // negative to correct sign
185  const CCGFloat eta ( p.eta() ) ;
186  const CCGFloat phi ( p.phi() ) ;
187 
188  corners[ 0 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_near ) ; // (+,+,near)
189  corners[ 1 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_near ) ; // (+,-,near)
190  corners[ 2 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_near ) ; // (-,-,near)
191  corners[ 3 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_near ) ; // (-,+,near)
192  corners[ 4 ] = etaPhiZ( eta + dEta(), phi + dPhi(), z_far ) ; // (+,+,far)
193  corners[ 5 ] = etaPhiZ( eta + dEta(), phi - dPhi(), z_far ) ; // (+,-,far)
194  corners[ 6 ] = etaPhiZ( eta - dEta(), phi - dPhi(), z_far ) ; // (-,-,far)
195  corners[ 7 ] = etaPhiZ( eta - dEta(), phi + dPhi(), z_far ) ; // (-,+,far)
196 
197  }
198  }
199  return co ;
200 }
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())
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
CornersVec & setCorners() const
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
CCGFloat dz() const
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell&#39;s volume.
Definition: DDAxes.h:10
void IdealObliquePrism::localCorners ( Pt3DVec vec,
const CCGFloat pv,
Pt3D ref 
)
static

Definition at line 97 of file IdealObliquePrism.cc.

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

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

100 {
101  assert( 8 == lc.size() ) ;
102  assert( 0 != pv ) ;
103 
104  const CCGFloat dEta ( pv[0] ) ;
105  const CCGFloat dPhi ( pv[1] ) ;
106  const CCGFloat dz ( pv[2] ) ;
107  const CCGFloat eta ( pv[3] ) ;
108  const CCGFloat z ( pv[4] ) ;
109 
110  std::vector<GlobalPoint> gc ( 8, GlobalPoint(0,0,0) ) ;
111 
112  const GlobalPoint p ( etaPhiZ( eta, 0, z ) ) ;
113 
114  if( 0 < dz )
115  {
116  const CCGFloat r_near ( p.perp()/cos( dPhi ) ) ;
117  const CCGFloat r_far ( r_near*( ( p.mag() + 2*dz )/p.mag() ) ) ;
118  gc[ 0 ] = etaPhiPerp( eta + dEta , +dPhi , r_near ) ; // (+,+,near)
119  gc[ 1 ] = etaPhiPerp( eta + dEta , -dPhi , r_near ) ; // (+,-,near)
120  gc[ 2 ] = etaPhiPerp( eta - dEta , -dPhi , r_near ) ; // (-,-,near)
121  gc[ 3 ] = etaPhiPerp( eta - dEta , +dPhi , r_near ) ; // (-,+,far)
122  gc[ 4 ] = etaPhiPerp( eta + dEta , +dPhi , r_far ) ; // (+,+,far)
123  gc[ 5 ] = etaPhiPerp( eta + dEta , -dPhi , r_far ) ; // (+,-,far)
124  gc[ 6 ] = etaPhiPerp( eta - dEta , -dPhi , r_far ) ; // (-,-,far)
125  gc[ 7 ] = etaPhiPerp( eta - dEta , +dPhi , r_far ) ; // (-,+,far)
126  }
127  else
128  {
129  const CCGFloat z_near ( z ) ;
130  const CCGFloat z_far ( z*( 1 - 2*dz/p.mag() ) ) ;
131  gc[ 0 ] = etaPhiZ( eta + dEta , +dPhi , z_near ) ; // (+,+,near)
132  gc[ 1 ] = etaPhiZ( eta + dEta , -dPhi , z_near ) ; // (+,-,near)
133  gc[ 2 ] = etaPhiZ( eta - dEta , -dPhi , z_near ) ; // (-,-,near)
134  gc[ 3 ] = etaPhiZ( eta - dEta , +dPhi , z_near ) ; // (-,+,far)
135  gc[ 4 ] = etaPhiZ( eta + dEta , +dPhi , z_far ) ; // (+,+,far)
136  gc[ 5 ] = etaPhiZ( eta + dEta , -dPhi , z_far ) ; // (+,-,far)
137  gc[ 6 ] = etaPhiZ( eta - dEta , -dPhi , z_far ) ; // (-,-,far)
138  gc[ 7 ] = etaPhiZ( eta - dEta , +dPhi , z_far ) ; // (-,+,far)
139  }
140  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
141  {
142  lc[i] = Pt3D( gc[i].x(), gc[i].y(), gc[i].z() ) ;
143  }
144 
145  ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
146 }
static GlobalPoint etaPhiZ(float eta, float phi, float z)
int i
Definition: DBlmapReader.cc:9
CCGFloat dEta() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
CCGFloat eta() const
CaloCellGeometry::Pt3D Pt3D
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
CCGFloat z() const
Definition: DDAxes.h:10
CCGFloat dz() const
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
virtual

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)
CCGFloat IdealObliquePrism::z ( ) const

Definition at line 59 of file IdealObliquePrism.cc.

References CaloCellGeometry::param().

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

60 {
61  return param()[4] ;
62 }
const CCGFloat * param() const