CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TruncatedPyramid.h
Go to the documentation of this file.
1 #ifndef TruncatedPyramid_h
2 #define TruncatedPyramid_h
3 
5 #include <CLHEP/Geometry/Point3D.h>
6 #include <CLHEP/Geometry/Plane3D.h>
7 #include <CLHEP/Geometry/Vector3D.h>
8 #include <CLHEP/Geometry/Transform3D.h>
9 #include <vector>
10 
11 
26 {
27  public:
28 
29  typedef std::vector< HepGeom::Plane3D<double> > BoundaryVec ;
30 
32  const GlobalPoint& fCtr ,
33  const GlobalPoint& bCtr ,
34  const GlobalPoint& cor1 ,
35  const double* parV ) :
36  CaloCellGeometry ( fCtr, cMgr, parV ) ,
37  m_axis ( ( bCtr - fCtr ).unit() ) ,
38  m_corOne ( new HepGeom::Point3D<double> ( cor1.x(), cor1.y(), cor1.z() ) )
39  {}
40 
42  const double* par ) :
43  CaloCellGeometry ( corn, par ) ,
44  m_axis ( makeAxis() ) ,
45  m_corOne ( new HepGeom::Point3D<double> ( corn[0].x(),
46  corn[0].y(),
47  corn[0].z() ) ) {}
48 
49  virtual ~TruncatedPyramid() { delete m_corOne ; }
50 
56  const GlobalPoint getPosition( float depth ) const
57  { return CaloCellGeometry::getPosition() + depth*m_axis ; }
58 
59  virtual const CornersVec& getCorners() const ;
60 
61  // Return thetaAxis polar angle of axis of the crystal
62  float getThetaAxis() const { return m_axis.theta() ; }
63 
64  // Return phiAxis azimuthal angle of axis of the crystal
65  float getPhiAxis() const { return m_axis.phi() ; }
66 
67  const GlobalVector& axis() const { return m_axis ; }
68 
69 
70  // for geometry creation in other classes
71  static void createCorners( const std::vector<double>& pv ,
72  const HepGeom::Transform3D& tr ,
73  CornersVec& co ) ;
74 
75  virtual std::vector<HepGeom::Point3D<double> > vocalCorners( const double* pv,
76  HepGeom::Point3D<double> & ref ) const
77  { return localCorners( pv, ref ) ; }
78 
79  static std::vector<HepGeom::Point3D<double> > localCorners( const double* pv,
80  HepGeom::Point3D<double> & ref ) ;
81  static std::vector<HepGeom::Point3D<double> > localCornersReflection( const double* pv,
82  HepGeom::Point3D<double> & ref ) ;
83 
84  static std::vector<HepGeom::Point3D<double> > localCornersSwap( const double* pv,
85  HepGeom::Point3D<double> & ref ) ;
86 
87  virtual HepGeom::Transform3D getTransform( std::vector<HepGeom::Point3D<double> >* lptr ) const ;
88 
89  private:
90 
91 
93  {
94  return GlobalVector( backCtr() -
96  }
97 
98  const GlobalPoint backCtr() const
99  {
100  return GlobalPoint( 0.25*( getCorners()[4].x() + getCorners()[5].x() +
101  getCorners()[6].x() + getCorners()[7].x() ),
102  0.25*( getCorners()[4].y() + getCorners()[5].y() +
103  getCorners()[6].y() + getCorners()[7].y() ),
104  0.25*( getCorners()[4].z() + getCorners()[5].z() +
105  getCorners()[6].z() + getCorners()[7].z() ) ) ;
106  }
107 
109 
110  mutable HepGeom::Point3D<double> * m_corOne ;
111 };
112 
113 std::ostream& operator<<( std::ostream& s, const TruncatedPyramid& cell ) ;
114 
115 #endif
const GlobalPoint backCtr() const
EZArrayFL< GlobalPoint > CornersVec
static std::vector< HepGeom::Point3D< double > > localCornersSwap(const double *pv, HepGeom::Point3D< double > &ref)
TruncatedPyramid(const CornersMgr *cMgr, const GlobalPoint &fCtr, const GlobalPoint &bCtr, const GlobalPoint &cor1, const double *parV)
static std::vector< HepGeom::Point3D< double > > localCornersReflection(const double *pv, HepGeom::Point3D< double > &ref)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
static void createCorners(const std::vector< double > &pv, const HepGeom::Transform3D &tr, CornersVec &co)
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
const GlobalVector & axis() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:69
TruncatedPyramid(const CornersVec &corn, const double *par)
virtual HepGeom::Transform3D getTransform(std::vector< HepGeom::Point3D< double > > *lptr) const
const GlobalPoint getPosition(float depth) const
Definition: DDAxes.h:10
string unit
Definition: csvLumiCalc.py:46
HepGeom::Point3D< double > * m_corOne
Vector3DBase unit() const
Definition: Vector3DBase.h:57
virtual const CornersVec & getCorners() const
float getPhiAxis() const
Definition: EZMgrFL.h:8
A base class to handle the particular shape of Ecal Xtals. Taken from ORCA Calorimetry Code...
GlobalVector m_axis
virtual ~TruncatedPyramid()
std::vector< HepGeom::Plane3D< double > > BoundaryVec
static std::vector< HepGeom::Point3D< double > > localCorners(const double *pv, HepGeom::Point3D< double > &ref)
string s
Definition: asciidump.py:422
virtual std::vector< HepGeom::Point3D< double > > vocalCorners(const double *pv, HepGeom::Point3D< double > &ref) const
GlobalVector makeAxis()
const GlobalPoint & getPosition() const
float getThetaAxis() const
Global3DVector GlobalVector
Definition: GlobalVector.h:10
const double par[8 *NPar][4]