CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PreshowerStrip.cc
Go to the documentation of this file.
2 #include <iostream>
3 
4 
7 {
9  if( co.uninitialized() )
10  {
11  CornersVec& corners ( setCorners() ) ;
12 
13  const GlobalPoint& ctr ( getPosition() ) ;
14  const float x ( ctr.x() ) ;
15  const float y ( ctr.y() ) ;
16  const float z ( ctr.z() ) ;
17 
18  corners[ 0 ] = GlobalPoint( x - dx(), y - dy(), z - dz() ) ;
19  corners[ 1 ] = GlobalPoint( x - dx(), y + dy(), z - dz() ) ;
20  corners[ 2 ] = GlobalPoint( x + dx(), y + dy(), z - dz() ) ;
21  corners[ 3 ] = GlobalPoint( x + dx(), y - dy(), z - dz() ) ;
22  corners[ 4 ] = GlobalPoint( x - dx(), y - dy(), z + dz() ) ;
23  corners[ 5 ] = GlobalPoint( x - dx(), y + dy(), z + dz() ) ;
24  corners[ 6 ] = GlobalPoint( x + dx(), y + dy(), z + dz() ) ;
25  corners[ 7 ] = GlobalPoint( x + dx(), y - dy(), z + dz() ) ;
26  }
27  return co ;
28 }
29 
30 std::ostream& operator<<( std::ostream& s, const PreshowerStrip& cell )
31 {
32  s << "Center: " << cell.getPosition() << std::endl ;
33  s << "dx = " << cell.dx() << ", dy = " << cell.dy() << ", dz = " << cell.dz() << std::endl ;
34 /* const CaloCellGeometry::CornerVec& corners ( cell.getCorners() ) ;
35  for( unsigned int ci ( 0 ) ; ci != corners.size(); ci++ )
36  {
37  s << "Corner: " << corners[ci] << std::endl;
38  }*/
39  return s;
40 }
41 
42 std::vector<HepGeom::Point3D<double> >
43 PreshowerStrip::localCorners( const double* pv,
44  HepGeom::Point3D<double> & ref )
45 {
46  assert( 0 != pv ) ;
47 
48  const double dx ( pv[0] ) ;
49  const double dy ( pv[1] ) ;
50  const double dz ( pv[2] ) ;
51 
52  std::vector<HepGeom::Point3D<double> > lc ( 8, HepGeom::Point3D<double> (0,0,0) ) ;
53 
54  lc[0] = HepGeom::Point3D<double> ( -dx, -dy, -dz ) ;
55  lc[1] = HepGeom::Point3D<double> ( -dx, dy, -dz ) ;
56  lc[2] = HepGeom::Point3D<double> ( dx, dy, -dz ) ;
57  lc[3] = HepGeom::Point3D<double> ( dx, -dy, -dz ) ;
58  lc[4] = HepGeom::Point3D<double> ( -dx, -dy, dz ) ;
59  lc[5] = HepGeom::Point3D<double> ( -dx, dy, dz ) ;
60  lc[6] = HepGeom::Point3D<double> ( dx, dy, dz ) ;
61  lc[7] = HepGeom::Point3D<double> ( dx, -dy, dz ) ;
62 
63  ref = HepGeom::Point3D<double> (0,0,0) ;
64 
65  return lc ;
66 }
const double dx() const
virtual const CornersVec & getCorners() const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:57
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
double double double z
A base class to handle the shape of preshower strips.
T z() const
Definition: PV3DBase.h:58
const double dy() const
const double dz() const
CornersVec & setCorners() const
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
bool uninitialized() const
Definition: EZArrayFL.h:74
string s
Definition: asciidump.py:422
Definition: DDAxes.h:10
const GlobalPoint & getPosition() const
T x() const
Definition: PV3DBase.h:56
virtual const CornersVec & getCorners() const =0