CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloCellGeometry.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOGEOMETRY_CALOCELLGEOMETRY_H
2 #define GEOMETRY_CALOGEOMETRY_CALOCELLGEOMETRY_H 1
3 
7 #include <CLHEP/Geometry/Point3D.h>
8 #include <CLHEP/Geometry/Transform3D.h>
9 #include <vector>
10 #include <string>
11 #include <cassert>
12 
14 
15 
16 
52 {
53 public:
54 
55  typedef float CCGFloat ;
56  typedef HepGeom::Transform3D Tr3D ;
57  typedef HepGeom::Point3D<CCGFloat> Pt3D ;
58  typedef std::vector<Pt3D> Pt3DVec ;
59 
62 
64  typedef std::vector<ParVec> ParVecVec ;
66 
67  enum CornersSize { k_cornerSize = 8 };
68 
70 
71  virtual ~CaloCellGeometry() ;
72 
74  const CornersVec& getCorners() const { assert(not m_corners.uninitialized()); return m_corners; }
75 
77  const GlobalPoint& getPosition() const {return m_refPoint;}
78  const GlobalPoint& getBackPoint() const {return m_backPoint;}
79 
80  float etaPos() const { return m_eta;}
81  float phiPos() const { return m_phi;}
82 
83  float etaSpan() const { return m_dEta;}
84  float phiSpan() const { return m_dPhi;}
85 
86 
88  bool inside( const GlobalPoint & point ) const ;
89 
90  bool emptyCorners() const { return m_corners.empty() ;}
91 
92  const CCGFloat* param() const { return m_parms ;}
93 
94  static const CCGFloat* checkParmPtr( const std::vector<CCGFloat>& vd ,
95  ParVecVec& pvv ) ;
96 
97  static const CCGFloat* getParmPtr( const std::vector<CCGFloat>& vd ,
98  ParMgr* mgr ,
99  ParVecVec& pvv ) ;
100 
101 
103  virtual void getTransform( Tr3D& tr, Pt3DVec* lptr ) const ;
104  //------------------------------------------------------------------------
105 
106  virtual void vocalCorners( Pt3DVec& vec ,
107  const CCGFloat* pv ,
108  Pt3D& ref ) const = 0 ;
109 
110 protected:
111 
113  CornersMgr* mgr,
114  const CCGFloat* par ) ;
115 
117  const CCGFloat* par ) ;
118 
119  CaloCellGeometry( void );
120 
121  // MUST be called by children constructors
122  void initSpan() {
124  m_dEta = std::abs(getCorners()[0].eta()-
125  getCorners()[2].eta());
126  m_dPhi = std::abs(getCorners()[0].phi() -
127  getCorners()[2].phi());
128  initBack();
129  }
130 
131  virtual void initCorners(CornersVec&) = 0;
132 private:
133  void initBack() {
134  // from CaloTower code
135  CornersVec const & cv = getCorners();
136  m_backPoint = GlobalPoint(0.25 * (cv[4].x() + cv[5].x() + cv[6].x() + cv[7].x()),
137  0.25 * (cv[4].y() + cv[5].y() + cv[6].y() + cv[7].y()),
138  0.25 * (cv[4].z() + cv[5].z() + cv[6].z() + cv[7].z()));
139  }
140 
141 
145  const CCGFloat* m_parms ;
146  float m_eta, m_phi;
147  float m_dEta;
148  float m_dPhi;
149 
150 };
151 
152 std::ostream& operator<<( std::ostream& s, const CaloCellGeometry& cell ) ;
153 
154 #endif
EZArrayFL< GlobalPoint > CornersVec
bool emptyCorners() const
EZArrayFL< CCGFloat > ParVec
float etaSpan() const
const GlobalPoint & getBackPoint() const
std::vector< ParVec > ParVecVec
float phiPos() const
assert(m_qm.get())
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const CCGFloat * m_parms
HepGeom::Transform3D Tr3D
std::vector< Pt3D > Pt3DVec
T eta() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
EZMgrFL< GlobalPoint > CornersMgr
float float float z
MgrType::const_reference const_reference
Definition: EZArrayFL.h:29
const CCGFloat * param() const
std::vector< DeviationSensor2D * > vd
GlobalPoint m_backPoint
virtual void getTransform(Tr3D &tr, Pt3DVec *lptr) const
--------— only needed by specific utility; overloaded when needed -—
virtual ~CaloCellGeometry()
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CaloCellGeometry::CCGFloat CCGFloat
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
GlobalPoint m_refPoint
static const CCGFloat k_ScaleFromDDDtoGeant
virtual void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const =0
dictionary cv
Definition: cuy.py:362
float phiSpan() const
CaloCellGeometry::Pt3D Pt3D
bool inside(const GlobalPoint &point) const
Returns true if the specified point is inside this cell.
virtual void initCorners(CornersVec &)=0
bool empty() const
Definition: EZArrayFL.h:79
CaloCellGeometry::Pt3DVec Pt3DVec
HepGeom::Point3D< CCGFloat > Pt3D
Definition: EZMgrFL.h:8
CaloCellGeometry::Tr3D Tr3D
bool uninitialized() const
Definition: EZArrayFL.h:77
float etaPos() const
Definition: DDAxes.h:10
const CornersVec & getCorners() const
Returns the corner points of this cell&#39;s volume.
const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
EZMgrFL< CCGFloat > ParMgr
static const CCGFloat * checkParmPtr(const std::vector< CCGFloat > &vd, ParVecVec &pvv)
Definition: DDAxes.h:10