CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
IdealZDCTrapezoid.cc
Go to the documentation of this file.
2 #include <math.h>
3 
7 
10 {
11 }
12 
14  : CaloCellGeometry( idzt )
15 {
16  *this = idzt ;
17 }
18 
21 {
22  if( &idzt != this ) CaloCellGeometry::operator=( idzt ) ;
23  return *this ;
24 }
25 
27  const CornersMgr* mgr ,
28  const CCGFloat* parm ) :
29  CaloCellGeometry ( faceCenter, mgr, parm )
30 {
31 }
32 
34 
35 CCGFloat
36 IdealZDCTrapezoid::an() const { return param()[0] ; }
37 
38 CCGFloat
40 {
41  return param()[1] ;
42 }
43 
44 CCGFloat
46 {
47  return param()[2] ;
48 }
49 
50 CCGFloat
52 {
53  return param()[3] ;
54 }
55 
56 CCGFloat
58 {
59  return tan( an() ) ;
60 }
61 
62 CCGFloat
64 {
65  return dy()*ta() ;
66 }
67 
68 void
70  const CCGFloat* pv ,
71  Pt3D& ref ) const
72 {
73  localCorners( vec, pv, ref ) ;
74 }
75 
76 void
78  const CCGFloat* pv ,
79  Pt3D& ref )
80 {
81  assert( 8 == lc.size() ) ;
82  assert( 0 != pv ) ;
83 
84  const CCGFloat an ( pv[0] ) ;
85  const CCGFloat dx ( pv[1] ) ;
86  const CCGFloat dy ( pv[2] ) ;
87  const CCGFloat dz ( pv[3] ) ;
88  const CCGFloat ta ( tan( an ) ) ;
89  const CCGFloat dt ( dy*ta ) ;
90 
91  lc[0] = Pt3D ( -dx, -dy, +dz+dt ) ;
92  lc[1] = Pt3D ( -dx, +dy, +dz-dt ) ;
93  lc[2] = Pt3D ( +dx, +dy, +dz-dt ) ;
94  lc[3] = Pt3D ( +dx, -dy, +dz+dt ) ;
95  lc[4] = Pt3D ( -dx, -dy, -dz+dt ) ;
96  lc[5] = Pt3D ( -dx, +dy, -dz-dt ) ;
97  lc[6] = Pt3D ( +dx, +dy, -dz-dt ) ;
98  lc[7] = Pt3D ( +dx, -dy, -dz+dt ) ;
99 
100  ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
101 }
102 
105 {
106  const CornersVec& co ( CaloCellGeometry::getCorners() ) ;
107  if( co.uninitialized() )
108  {
110  const GlobalPoint& p ( getPosition() ) ;
111  const CCGFloat zsign ( 0 < p.z() ? 1. : -1. ) ;
112  const Pt3D gf ( p.x(), p.y(), p.z() ) ;
113 
114  Pt3D lf ;
115  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
116  localCorners( lc, param(), lf ) ;
117  const Pt3D lb ( lf.x() , lf.y() , lf.z() - 2.*dz() ) ;
118  const Pt3D ls ( lf.x() - dx(), lf.y(), lf.z() ) ;
119 
120  const Pt3D gb ( gf.x() , gf.y() , gf.z() + 2.*zsign*dz() ) ;
121 
122  const Pt3D gs ( gf.x() - zsign*dx(),
123  gf.y() ,
124  gf.z() ) ;
125 
126  const HepGeom::Transform3D tr ( lf, lb, ls,
127  gf, gb, gs ) ;
128 
129  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
130  {
131  const Pt3D gl ( tr*lc[i] ) ;
132  corners[i] = GlobalPoint( gl.x(), gl.y(), gl.z() ) ;
133  }
134  }
135  return co ;
136 }
137 
138 std::ostream& operator<<( std::ostream& s, const IdealZDCTrapezoid& cell )
139 {
140  s << "Center: " << cell.getPosition() << std::endl ;
141  s << "TiltAngle = " << cell.an()*180./M_PI << " deg, dx = "
142  << cell.dx()
143  << ", dy = " << cell.dy() << ", dz = " << cell.dz() << std::endl ;
144  return s;
145 }
int i
Definition: DBlmapReader.cc:9
CCGFloat dy() const
virtual ~IdealZDCTrapezoid()
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:63
CCGFloat dx() const
std::vector< Pt3D > Pt3DVec
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const
virtual const CornersVec & getCorners() const
Returns the corner points of this cell&#39;s volume.
IdealZDCTrapezoid & operator=(const IdealZDCTrapezoid &idzt)
const CCGFloat * param() const
T z() const
Definition: PV3DBase.h:64
CCGFloat an() const
CCGFloat ta() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
CaloCellGeometry::CCGFloat CCGFloat
CaloCellGeometry::Pt3D Pt3D
#define M_PI
Definition: BFit3D.cc:3
static void localCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref)
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
Definition: EZMgrFL.h:8
CCGFloat dt() const
CCGFloat dz() const
CornersVec & setCorners() const
bool uninitialized() const
Definition: EZArrayFL.h:77
double gf
Definition: hdecay.h:34
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
T x() const
Definition: PV3DBase.h:62
CaloCellGeometry::Pt3D Pt3D
virtual const CornersVec & getCorners() const =0
Returns the corner points of this cell&#39;s volume.