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 {initSpan();}
31 
33 
34 CCGFloat
35 IdealZDCTrapezoid::an() const { return param()[0] ; }
36 
37 CCGFloat
39 {
40  return param()[1] ;
41 }
42 
43 CCGFloat
45 {
46  return param()[2] ;
47 }
48 
49 CCGFloat
51 {
52  return param()[3] ;
53 }
54 
55 CCGFloat
57 {
58  return tan( an() ) ;
59 }
60 
61 CCGFloat
63 {
64  return dy()*ta() ;
65 }
66 
67 void
69  const CCGFloat* pv ,
70  Pt3D& ref ) const
71 {
72  localCorners( vec, pv, ref ) ;
73 }
74 
75 void
77  const CCGFloat* pv ,
78  Pt3D& ref )
79 {
80  assert( 8 == lc.size() ) ;
81  assert( 0 != pv ) ;
82 
83  const CCGFloat an ( pv[0] ) ;
84  const CCGFloat dx ( pv[1] ) ;
85  const CCGFloat dy ( pv[2] ) ;
86  const CCGFloat dz ( pv[3] ) ;
87  const CCGFloat ta ( tan( an ) ) ;
88  const CCGFloat dt ( dy*ta ) ;
89 
90  lc[0] = Pt3D ( -dx, -dy, +dz+dt ) ;
91  lc[1] = Pt3D ( -dx, +dy, +dz-dt ) ;
92  lc[2] = Pt3D ( +dx, +dy, +dz-dt ) ;
93  lc[3] = Pt3D ( +dx, -dy, +dz+dt ) ;
94  lc[4] = Pt3D ( -dx, -dy, -dz+dt ) ;
95  lc[5] = Pt3D ( -dx, +dy, -dz-dt ) ;
96  lc[6] = Pt3D ( +dx, +dy, -dz-dt ) ;
97  lc[7] = Pt3D ( +dx, -dy, -dz+dt ) ;
98 
99  ref = 0.25*( lc[0] + lc[1] + lc[2] + lc[3] ) ;
100 }
101 
104 {
105  const CornersVec& co ( CaloCellGeometry::getCorners() ) ;
106  if( co.uninitialized() )
107  {
109  const GlobalPoint& p ( getPosition() ) ;
110  const CCGFloat zsign ( 0 < p.z() ? 1. : -1. ) ;
111  const Pt3D gf ( p.x(), p.y(), p.z() ) ;
112 
113  Pt3D lf ;
114  Pt3DVec lc ( 8, Pt3D(0,0,0) ) ;
115  localCorners( lc, param(), lf ) ;
116  const Pt3D lb ( lf.x() , lf.y() , lf.z() - 2.*dz() ) ;
117  const Pt3D ls ( lf.x() - dx(), lf.y(), lf.z() ) ;
118 
119  const Pt3D gb ( gf.x() , gf.y() , gf.z() + 2.*zsign*dz() ) ;
120 
121  const Pt3D gs ( gf.x() - zsign*dx(),
122  gf.y() ,
123  gf.z() ) ;
124 
125  const HepGeom::Transform3D tr ( lf, lb, ls,
126  gf, gb, gs ) ;
127 
128  for( unsigned int i ( 0 ) ; i != 8 ; ++i )
129  {
130  const Pt3D gl ( tr*lc[i] ) ;
131  corners[i] = GlobalPoint( gl.x(), gl.y(), gl.z() ) ;
132  }
133  }
134  return co ;
135 }
136 
137 std::ostream& operator<<( std::ostream& s, const IdealZDCTrapezoid& cell )
138 {
139  s << "Center: " << cell.getPosition() << std::endl ;
140  s << "TiltAngle = " << cell.an()*180./M_PI << " deg, dx = "
141  << cell.dx()
142  << ", dy = " << cell.dy() << ", dz = " << cell.dz() << std::endl ;
143  return s;
144 }
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)
void initSpan() const
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.