CMS 3D CMS Logo

moduleDB.cc
Go to the documentation of this file.
5 
6 template <>
9  const typename HGCalGeometry::AlignedRecord& iRecord) {
10  TrVec tvec;
11  DimVec dvec;
12  IVec ivec;
13  IVec dins;
14 
15  std::cout << "Reading HGCalGeometry " << calogeometryDBEPimpl::nameHGCal << "\n";
16  const auto& pG = iRecord.get(geometryToken_);
17 
18  tvec = pG.getTranslation();
19  dvec = pG.getDimension();
20  ivec = pG.getIndexes();
21  dins = pG.getDenseIndices();
22  //*********************************************************************************************
23  const auto& topology = iRecord.get(additionalTokens_.topology);
24 
25  assert(dvec.size() <= topology.totalGeomModules() * HGCalGeometry::k_NumberOfParametersPerShape);
27  PtrType ptr(hcg);
28 
29  ptr->allocateCorners(topology.ncells());
31 
32  const unsigned int nTrParm(ptr->numberOfTransformParms());
33  const unsigned int nPerShape(HGCalGeometry::k_NumberOfParametersPerShape);
34 
35  for (auto it : dins) {
36  DetId id = topology.encode(topology.geomDenseId2decId(it));
37  // get layer
38  int layer = ivec[it];
39 
40  // get transformation
41  const unsigned int jj(it * nTrParm);
42  Tr3D tr;
43  const ROOT::Math::Translation3D tl(tvec[jj], tvec[jj + 1], tvec[jj + 2]);
44  const ROOT::Math::EulerAngles ea(6 == nTrParm ? ROOT::Math::EulerAngles(tvec[jj + 3], tvec[jj + 4], tvec[jj + 5])
46  const ROOT::Math::Transform3D rt(ea, tl);
47  double xx, xy, xz, dx, yx, yy, yz, dy, zx, zy, zz, dz;
48  rt.GetComponents(xx, xy, xz, dx, yx, yy, yz, dy, zx, zy, zz, dz);
49  tr = Tr3D(CLHEP::HepRep3x3(xx, xy, xz, yx, yy, yz, zx, zy, zz), CLHEP::Hep3Vector(dx, dy, dz));
50 
51  // get parameters
52  DimVec dims;
53  dims.reserve(nPerShape);
54 
55  DimVec::const_iterator dsrc(dvec.begin() + layer * nPerShape);
56  for (unsigned int j(0); j != nPerShape; ++j) {
57  dims.emplace_back(*dsrc);
58  ++dsrc;
59  }
60 
61  std::vector<GlobalPoint> corners(FlatHexagon::ncorner_);
62 
63  FlatHexagon::createCorners(dims, tr, corners);
64 
65  const CCGFloat* myParm(CaloCellGeometry::getParmPtr(dims, ptr->parMgr(), ptr->parVecVec()));
66  GlobalPoint front(
68  (corners[0].x() + corners[1].x() + corners[2].x() + corners[3].x() + corners[4].x() + corners[5].x()),
70  (corners[0].y() + corners[1].y() + corners[2].y() + corners[3].y() + corners[4].y() + corners[5].y()),
72  (corners[0].z() + corners[1].z() + corners[2].z() + corners[3].z() + corners[4].z() + corners[5].z()));
73 
74  GlobalPoint back(
76  (corners[6].x() + corners[7].x() + corners[8].x() + corners[9].x() + corners[10].x() + corners[11].x()),
78  (corners[6].y() + corners[7].y() + corners[8].y() + corners[9].y() + corners[10].y() + corners[11].y()),
80  (corners[6].z() + corners[7].z() + corners[8].z() + corners[9].z() + corners[10].z() + corners[11].z()));
81 
82  if (front.mag2() > back.mag2()) { // front should always point to the center, so swap front and back
83  std::swap(front, back);
84  std::swap_ranges(
85  corners.begin(), corners.begin() + FlatHexagon::ncornerBy2_, corners.begin() + FlatHexagon::ncornerBy2_);
86  }
87 
88  ptr->newCell(front, back, corners[0], myParm, id);
89  }
90 
91  ptr->initializeParms(); // initializations; must happen after cells filled
92 
93  return ptr;
94 }
95 
97 
99 
CaloGeometryDBEP::Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: CaloGeometryDBEP.h:90
geometryCSVtoXML.zz
zz
Definition: geometryCSVtoXML.py:19
HGCalGeometry::k_NumberOfParametersPerShape
static constexpr unsigned int k_NumberOfParametersPerShape
Definition: HGCalGeometry.h:46
geometryCSVtoXML.yz
yz
Definition: geometryCSVtoXML.py:19
HGCalGeometryFromDBEP
CaloGeometryDBEP< HGCalGeometry, CaloGeometryDBReader > HGCalGeometryFromDBEP
Definition: moduleDB.cc:98
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hcal_runs.rt
rt
Definition: hcal_runs.py:76
CaloGeometryDBEP::TrVec
CaloSubdetectorGeometry::TrVec TrVec
Definition: CaloGeometryDBEP.h:93
CaloGeometryDBEP::CCGFloat
CaloCellGeometry::CCGFloat CCGFloat
Definition: CaloGeometryDBEP.h:87
cms::cuda::assert
assert(be >=bs)
HGCalGeometry::k_NumberOfShapes
static constexpr unsigned int k_NumberOfShapes
Definition: HGCalGeometry.h:47
CaloGeometryDBEP.h
PV3DBase::mag2
T mag2() const
Definition: PV3DBase.h:63
DetId
Definition: DetId.h:17
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
ecaldqm::topology
const CaloTopology * topology(nullptr)
FlatHexagon::ncorner_
static constexpr unsigned int ncorner_
Definition: FlatHexagon.h:81
vertices_cff.x
x
Definition: vertices_cff.py:29
Tr3D
CaloCellGeometry::Tr3D Tr3D
Definition: CaloCellGeometry.cc:7
Point3DBase< float, GlobalTag >
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
HGCalGeometry
Definition: HGCalGeometry.h:30
FlatHexagon::ncornerBy2_
static constexpr unsigned int ncornerBy2_
Definition: FlatHexagon.h:82
geometryCSVtoXML.xy
xy
Definition: geometryCSVtoXML.py:19
CaloGeometryDBEP::PtrType
std::unique_ptr< CaloSubdetectorGeometry > PtrType
Definition: CaloGeometryDBEP.h:92
HGCalGeometry.h
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
CaloGeometryDBEP::DimVec
CaloSubdetectorGeometry::DimVec DimVec
Definition: CaloGeometryDBEP.h:94
geometryCSVtoXML.xz
xz
Definition: geometryCSVtoXML.py:19
CaloGeometryDBEP::IVec
CaloSubdetectorGeometry::IVec IVec
Definition: CaloGeometryDBEP.h:95
PVValHelper::dy
Definition: PVValidationHelpers.h:49
CaloGeometryDBEP
Definition: CaloGeometryDBEP.h:85
align::EulerAngles
AlgebraicVector EulerAngles
Definition: Definitions.h:34
CaloGeometryDBHGCal.h
calogeometryDBEPimpl::nameHGCal
static constexpr auto nameHGCal
Definition: CaloGeometryDBHGCal.h:9
PVValHelper::dz
Definition: PVValidationHelpers.h:50
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
CaloGeometryDBEP::produceAligned
PtrType produceAligned(const typename T::AlignedRecord &iRecord)
Definition: CaloGeometryDBEP.h:116
findQualityFiles.jj
string jj
Definition: findQualityFiles.py:188
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
CaloCellGeometry::getParmPtr
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
Definition: CaloCellGeometry.cc:117
FlatHexagon::oneBySix_
static constexpr double oneBySix_
Definition: FlatHexagon.h:80
FlatHexagon::createCorners
static void createCorners(const std::vector< CCGFloat > &pv, const Tr3D &tr, std::vector< GlobalPoint > &co)
Definition: FlatHexagon.cc:134
HGCalGeometryRecord
Definition: HGCalGeometryRecord.h:11
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
PVValHelper::dx
Definition: PVValidationHelpers.h:48
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
CaloGeometryDBReader.h