CMS 3D CMS Logo

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>
10 
11 #include <vector>
12 #include <array>
13 #include <string>
14 #include <cassert>
15 
51 public:
52  typedef float CCGFloat;
53  typedef HepGeom::Transform3D Tr3D;
54  typedef HepGeom::Point3D<CCGFloat> Pt3D;
55  typedef std::vector<Pt3D> Pt3DVec;
56 
59 
61  typedef std::vector<ParVec> ParVecVec;
63 
64  static constexpr unsigned int k_cornerSize = 8;
65 
66  using RepCorners = std::array<RhoEtaPhi, k_cornerSize>;
67 
69 
70  virtual ~CaloCellGeometry();
71 
73  CornersVec const& getCorners() const {
75  return m_corners;
76  }
77  RepCorners const& getCornersREP() const { return m_repCorners; }
78 
80  virtual const GlobalPoint& getPosition() const { return m_refPoint; }
81  virtual GlobalPoint getPosition(CCGFloat) const { return m_refPoint; }
82  virtual GlobalPoint getPosition(const Pt3D&) const { return m_refPoint; }
83 
84  GlobalPoint const& getBackPoint() const { return m_backPoint; }
85 
86  RhoEtaPhi const& repPos() const { return m_rep; }
87  virtual float rhoPos() const { return m_rep.rho(); }
88  virtual float etaPos() const { return m_rep.eta(); }
89  virtual float phiPos() const { return m_rep.phi(); }
90 
91  virtual float etaSpan() const { return m_dEta; }
92  virtual float phiSpan() const { return m_dPhi; }
93 
95  bool inside(const GlobalPoint& point) const;
96 
97  bool emptyCorners() const { return m_corners.empty(); }
98 
99  const CCGFloat* param() const { return m_parms; }
100 
101  static const CCGFloat* checkParmPtr(const std::vector<CCGFloat>& vd, ParVecVec& pvv);
102 
103  static const CCGFloat* getParmPtr(const std::vector<CCGFloat>& vd, ParMgr* mgr, ParVecVec& pvv);
104 
106  virtual void getTransform(Tr3D& tr, Pt3DVec* lptr) const;
107  //------------------------------------------------------------------------
109 
110  virtual void vocalCorners(Pt3DVec& vec, const CCGFloat* pv, Pt3D& ref) const = 0;
111 
112 protected:
114 
115  CaloCellGeometry(const CornersVec& cv, const CCGFloat* par);
116 
117  CaloCellGeometry(void);
118 
119  // MUST be called by children constructors
120  void initSpan() {
122  m_dEta = std::abs(getCorners()[0].eta() - getCorners()[2].eta());
123  m_dPhi = std::abs(getCorners()[0].phi() - getCorners()[2].phi());
124  initBack();
125  initReps();
126  }
127 
128  virtual void initCorners(CornersVec&) = 0;
129 
131  void setCornerVec(const std::vector<GlobalPoint>& cor) {
132  for (unsigned int k = 0; k < cor.size(); ++k)
133  m_corners[k] = cor[k];
134  }
135 
136 private:
137  void initBack() {
138  // from CaloTower code
139  CornersVec const& cv = getCorners();
140  m_backPoint = GlobalPoint(0.25 * (cv[4].x() + cv[5].x() + cv[6].x() + cv[7].x()),
141  0.25 * (cv[4].y() + cv[5].y() + cv[6].y() + cv[7].y()),
142  0.25 * (cv[4].z() + cv[5].z() + cv[6].z() + cv[7].z()));
143  }
144  void initReps() {
145  for (auto i = 0U; i < k_cornerSize; ++i)
146  m_repCorners[i] = {getCorners()[i].perp(), getCorners()[i].eta(), getCorners()[i].barePhi()};
147  }
148 
154  float m_dEta;
155  float m_dPhi;
156  std::array<RhoEtaPhi, k_cornerSize> m_repCorners;
157 };
158 
159 std::ostream& operator<<(std::ostream& s, const CaloCellGeometry& cell);
160 
161 #endif
CaloCellGeometry::Tr3D
HepGeom::Transform3D Tr3D
Definition: CaloCellGeometry.h:53
CaloCellGeometry::Pt3DVec
std::vector< Pt3D > Pt3DVec
Definition: CaloCellGeometry.h:55
CaloCellGeometry::getPosition
virtual GlobalPoint getPosition(CCGFloat) const
Definition: CaloCellGeometry.h:81
EZArrayFL.h
DDAxes::y
CaloCellGeometry::initCorners
virtual void initCorners(CornersVec &)=0
mps_fire.i
i
Definition: mps_fire.py:355
CaloCellGeometry::CCGFloat
float CCGFloat
Definition: CaloCellGeometry.h:52
CaloCellGeometry::initBack
void initBack()
Definition: CaloCellGeometry.h:137
CaloCellGeometry::etaSpan
virtual float etaSpan() const
Definition: CaloCellGeometry.h:91
cuy.cv
cv
Definition: cuy.py:364
CaloCellGeometry::setBackPoint
void setBackPoint(const GlobalPoint &pos)
Definition: CaloCellGeometry.h:108
CaloCellGeometry::k_cornerSize
static constexpr unsigned int k_cornerSize
Definition: CaloCellGeometry.h:64
CaloCellGeometry::m_dPhi
float m_dPhi
Definition: CaloCellGeometry.h:155
pos
Definition: PixelAliasList.h:18
CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloCellGeometry.cc:4
cms::cuda::assert
assert(be >=bs)
CaloCellGeometry::getCorners
CornersVec const & getCorners() const
Returns the corner points of this cell's volume.
Definition: CaloCellGeometry.h:73
vd
std::vector< DeviationSensor2D * > vd
Definition: DeviationsFromFileSensor2D.h:21
DDAxes::x
EZArrayFL< GlobalPoint >
CaloCellGeometry::ParMgr
EZMgrFL< CCGFloat > ParMgr
Definition: CaloCellGeometry.h:62
CaloCellGeometry::getCornersREP
RepCorners const & getCornersREP() const
Definition: CaloCellGeometry.h:77
CaloCellGeometry::vocalCorners
virtual void vocalCorners(Pt3DVec &vec, const CCGFloat *pv, Pt3D &ref) const =0
Pt3D
CaloCellGeometry::Pt3D Pt3D
Definition: CaloCellGeometry.cc:5
alignCSCRings.s
s
Definition: alignCSCRings.py:92
RhoEtaPhi
Definition: PtEtaPhiMass.h:38
PVValHelper::eta
Definition: PVValidationHelpers.h:69
EZArrayFL< GlobalPoint >::const_reference
MgrType::const_reference const_reference
Definition: EZArrayFL.h:26
DDAxes::z
Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: CaloCellGeometry.cc:7
CaloCellGeometry::inside
bool inside(const GlobalPoint &point) const
Returns true if the specified point is inside this cell.
Definition: CaloCellGeometry.cc:133
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
CaloCellGeometry::Pt3D
HepGeom::Point3D< CCGFloat > Pt3D
Definition: CaloCellGeometry.h:54
CaloCellGeometry::initSpan
void initSpan()
Definition: CaloCellGeometry.h:120
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
CaloCellGeometry::initReps
void initReps()
Definition: CaloCellGeometry.h:144
CaloCellGeometry::getPosition
virtual const GlobalPoint & getPosition() const
Returns the position of reference for this cell.
Definition: CaloCellGeometry.h:80
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
CaloCellGeometry::m_rep
RhoEtaPhi m_rep
Definition: CaloCellGeometry.h:153
RhoEtaPhi::rho
float rho() const
transverse momentum
Definition: PtEtaPhiMass.h:50
CaloCellGeometry::CornersMgr
EZMgrFL< GlobalPoint > CornersMgr
Definition: CaloCellGeometry.h:58
CaloCellGeometry
Definition: CaloCellGeometry.h:50
CaloCellGeometry::setCornerVec
void setCornerVec(const std::vector< GlobalPoint > &cor)
Definition: CaloCellGeometry.h:131
CaloCellGeometry::getPosition
virtual GlobalPoint getPosition(const Pt3D &) const
Definition: CaloCellGeometry.h:82
CaloCellGeometry::param
const CCGFloat * param() const
Definition: CaloCellGeometry.h:99
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
CaloCellGeometry::getTransform
virtual void getTransform(Tr3D &tr, Pt3DVec *lptr) const
--------— only needed by specific utility; overloaded when needed -—
Definition: CaloCellGeometry.cc:51
operator<<
std::ostream & operator<<(std::ostream &s, const CaloCellGeometry &cell)
Definition: CaloCellGeometry.cc:37
RhoEtaPhi::eta
float eta() const
momentum pseudorapidity
Definition: PtEtaPhiMass.h:52
CaloCellGeometry::getBackPoint
GlobalPoint const & getBackPoint() const
Definition: CaloCellGeometry.h:84
CaloCellGeometry::m_backPoint
GlobalPoint m_backPoint
Definition: CaloCellGeometry.h:150
CaloCellGeometry::m_corners
CornersVec m_corners
Definition: CaloCellGeometry.h:151
DDAxes::phi
CaloCellGeometry::checkParmPtr
static const CCGFloat * checkParmPtr(const std::vector< CCGFloat > &vd, ParVecVec &pvv)
Definition: CaloCellGeometry.cc:96
CaloCellGeometry::CornersVec
EZArrayFL< GlobalPoint > CornersVec
Definition: CaloCellGeometry.h:57
PtEtaPhiMass.h
RhoEtaPhi::phi
float phi() const
momentum azimuthal angle
Definition: PtEtaPhiMass.h:54
CaloCellGeometry::ParVecVec
std::vector< ParVec > ParVecVec
Definition: CaloCellGeometry.h:61
CaloCellGeometry::etaPos
virtual float etaPos() const
Definition: CaloCellGeometry.h:88
CaloCellGeometry::setRefPoint
void setRefPoint(const GlobalPoint &pos)
Definition: CaloCellGeometry.h:130
CaloCellGeometry::m_dEta
float m_dEta
Definition: CaloCellGeometry.h:154
CaloCellGeometry::rhoPos
virtual float rhoPos() const
Definition: CaloCellGeometry.h:87
CaloCellGeometry::RepCorners
std::array< RhoEtaPhi, k_cornerSize > RepCorners
Definition: CaloCellGeometry.h:66
CaloCellGeometry::ParVec
EZArrayFL< CCGFloat > ParVec
Definition: CaloCellGeometry.h:60
CaloCellGeometry::~CaloCellGeometry
virtual ~CaloCellGeometry()
Definition: CaloCellGeometry.cc:22
CaloCellGeometry::phiSpan
virtual float phiSpan() const
Definition: CaloCellGeometry.h:92
CaloCellGeometry::k_ScaleFromDDDtoGeant
static const CCGFloat k_ScaleFromDDDtoGeant
Definition: CaloCellGeometry.h:68
CaloCellGeometry::getParmPtr
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
Definition: CaloCellGeometry.cc:117
GlobalVector.h
CaloCellGeometry::repPos
RhoEtaPhi const & repPos() const
Definition: CaloCellGeometry.h:86
CaloCellGeometry::phiPos
virtual float phiPos() const
Definition: CaloCellGeometry.h:89
CaloCellGeometry::m_refPoint
GlobalPoint m_refPoint
Definition: CaloCellGeometry.h:149
CaloCellGeometry::m_repCorners
std::array< RhoEtaPhi, k_cornerSize > m_repCorners
Definition: CaloCellGeometry.h:156
Pt3DVec
CaloCellGeometry::Pt3DVec Pt3DVec
Definition: CaloCellGeometry.cc:6
EZMgrFL
Definition: EZMgrFL.h:8
CaloCellGeometry::m_parms
const CCGFloat * m_parms
Definition: CaloCellGeometry.h:152
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CaloCellGeometry::CaloCellGeometry
CaloCellGeometry(void)
Definition: CaloCellGeometry.cc:19
point
*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
GlobalPoint.h
EZArrayFL::empty
bool empty() const
Definition: EZArrayFL.h:65
EZArrayFL::uninitialized
bool uninitialized() const
Definition: EZArrayFL.h:63
CaloCellGeometry::emptyCorners
bool emptyCorners() const
Definition: CaloCellGeometry.h:97