CMS 3D CMS Logo

CaloGeometryLoader.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_ECALGEOMETRYLOADER_H
2 #define GEOMETRY_ECALGEOMETRYLOADER_H
3 
10 
11 #include "DD4hep/DD4hepUnits.h"
12 #include "CLHEP/Geometry/Transform3D.h"
13 #include <string>
14 #include <vector>
15 
21 template <class T>
23 public:
24  using ParmVec = std::vector<double>;
25  using PtrType = std::unique_ptr<CaloSubdetectorGeometry>;
28 
29  static constexpr double k_ScaleFromDDD = 0.1;
30  static constexpr double k_ScaleFromDD4hep = (1.0 / dd4hep::cm);
31 
32  virtual ~CaloGeometryLoader() = default;
33 
34  CaloGeometryLoader() = default;
35 
36  PtrType load(const DDCompactView* cpv, const Alignments* alignments = nullptr, const Alignments* globals = nullptr);
37  PtrType load(const cms::DDCompactView* cpv,
38  const Alignments* alignments = nullptr,
39  const Alignments* globals = nullptr);
40 
41 private:
42  void makeGeometry(const DDCompactView* cpv, T* geom, const Alignments* alignments, const Alignments* globals);
43  void makeGeometry(const cms::DDCompactView* cpv, T* geom, const Alignments* alignments, const Alignments* globals);
44 
45  void fillNamedParams(const DDFilteredView& fv, T* geom);
46  void fillNamedParams(const cms::DDFilteredView& fv, T* geom);
47 
48  void fillGeom(T* geom, const ParmVec& pv, const HepGeom::Transform3D& tr, const DetId& id, const double& scale);
49 
50  unsigned int getDetIdForDDDNode(const DDFilteredView& fv);
51  unsigned int getDetIdForDD4hepNode(const cms::DDFilteredView& fv);
52 
53  typename T::NumberingScheme m_scheme;
54 };
55 
56 #endif
std::unique_ptr< CaloSubdetectorGeometry > PtrType
PtrType load(const DDCompactView *cpv, const Alignments *alignments=nullptr, const Alignments *globals=nullptr)
static constexpr double k_ScaleFromDD4hep
unsigned int getDetIdForDDDNode(const DDFilteredView &fv)
CaloSubdetectorGeometry::ParVecVec ParVecVec
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
void fillGeom(T *geom, const ParmVec &pv, const HepGeom::Transform3D &tr, const DetId &id, const double &scale)
virtual ~CaloGeometryLoader()=default
std::vector< double > ParmVec
T::NumberingScheme m_scheme
CaloCellGeometry::ParVec ParVec
CaloGeometryLoader()=default
static constexpr double k_ScaleFromDDD
Definition: DetId.h:17
CaloCellGeometry::ParVecVec ParVecVec
void fillNamedParams(const DDFilteredView &fv, T *geom)
void makeGeometry(const DDCompactView *cpv, T *geom, const Alignments *alignments, const Alignments *globals)
long double T
unsigned int getDetIdForDD4hepNode(const cms::DDFilteredView &fv)