14 const auto [alignPtr, globalPtr] = getAlignGlobal(iRecord);
21 const auto& pG = iRecord.
get(geometryToken_);
23 tvec = pG.getTranslation();
24 dvec = pG.getDimension();
25 ivec = pG.getIndexes();
26 dins = pG.getDenseIndices();
29 const auto& hcalTopology = iRecord.
get(additionalTokens_.topology);
41 const unsigned int nTrParm(hcg->numberOfTransformParms());
43 ptr->fillDefaultNamedParameters();
44 ptr->allocateCorners(hcalTopology.ncells() + hcalTopology.getHFSize());
47 for (
unsigned int i(0);
i < dins.size(); ++
i) {
50 dims.reserve(nPerShape);
52 const unsigned int indx(ivec.size() == 1 ? 0 :
i);
54 DimVec::const_iterator dsrc(dvec.begin() + ivec[indx] * nPerShape);
56 for (
unsigned int j(0);
j != nPerShape; ++
j) {
57 dims.emplace_back(*dsrc);
63 const DetId id(hcalTopology.denseId2detId(dins[
i]));
67 assert(
nullptr == globalPtr || iGlob < globalPtr->m_align.size());
69 const AlignTransform*
gt(
nullptr == globalPtr ?
nullptr : &globalPtr->m_align[iGlob]);
75 assert(
nullptr == alignPtr || iLoc < alignPtr->m_align.size());
77 const AlignTransform* at(
nullptr == alignPtr ?
nullptr : &alignPtr->m_align[iLoc]);
83 hcg->localCorners(lc, &dims.front(), dins[
i], lRef);
85 const Pt3D lBck(0.25 * (lc[4] + lc[5] + lc[6] + lc[7]));
86 const Pt3D lCor(lc[0]);
89 const unsigned int jj(
i * nTrParm);
92 const ROOT::Math::Translation3D tl(tvec[
jj], tvec[
jj + 1], tvec[
jj + 2]);
95 const ROOT::Math::Transform3D
rt(ea, tl);
98 double zx, zy,
zz,
dz;
99 rt.GetComponents(
xx,
xy,
xz,
dx, yx,
yy,
yz,
dy, zx, zy,
zz,
dz);
100 tr =
Tr3D(CLHEP::HepRep3x3(
xx,
xy,
xz, yx,
yy,
yz, zx, zy,
zz), CLHEP::Hep3Vector(
dx,
dy,
dz));
103 const Tr3D atr(
nullptr == at ? tr
104 : (
nullptr ==
gt ? at->transform() * tr : at->transform() *
gt->transform() * tr));
107 const Pt3D gRef(atr * lRef);
108 const GlobalPoint fCtr(gRef.x(), gRef.y(), gRef.z());
109 const Pt3D gBck(atr * lBck);
110 const GlobalPoint fBck(gBck.x(), gBck.y(), gBck.z());
111 const Pt3D gCor(atr * lCor);
112 const GlobalPoint fCor(gCor.x(), gCor.y(), gCor.z());
114 assert(hcalTopology.detId2denseId(
id) == dins[
i]);
116 ptr->newCell(fCtr, fBck, fCor, myParm,
id);
119 ptr->initializeParms();
128 const auto [alignPtr, globalPtr] = getAlignGlobal(iRecord);
135 const auto& pG = iRecord.
get(geometryToken_);
137 tvec = pG.getTranslation();
138 dvec = pG.getDimension();
139 ivec = pG.getIndexes();
140 dins = pG.getDenseIndices();
143 const auto& caloTopology = iRecord.
get(additionalTokens_.topology);
153 ptr->fillDefaultNamedParameters();
159 for (
unsigned int i(0);
i < dins.size(); ++
i) {
162 dims.reserve(nPerShape);
164 const unsigned int indx(ivec.size() == 1 ? 0 :
i);
166 DimVec::const_iterator dsrc(dvec.begin() + ivec[indx] * nPerShape);
168 for (
unsigned int j(0);
j != nPerShape; ++
j) {
169 dims.emplace_back(*dsrc);
175 const DetId id(caloTopology.detIdFromDenseIndex(dins[
i]));
179 assert(
nullptr == globalPtr || iGlob < globalPtr->m_align.size());
181 const AlignTransform*
gt(
nullptr == globalPtr ?
nullptr : &globalPtr->m_align[iGlob]);
187 assert(
nullptr == alignPtr || iLoc < alignPtr->m_align.size());
189 const AlignTransform* at(
nullptr == alignPtr ?
nullptr : &alignPtr->m_align[iLoc]);
199 const Pt3D lBck(0.25 * (lc[4] + lc[5] + lc[6] + lc[7]));
200 const Pt3D lCor(lc[0]);
203 const unsigned int jj(
i * nTrParm);
205 const ROOT::Math::Translation3D tl(tvec[
jj], tvec[
jj + 1], tvec[
jj + 2]);
208 const ROOT::Math::Transform3D
rt(ea, tl);
209 double xx,
xy,
xz,
dx, yx,
yy,
yz,
dy, zx, zy,
zz,
dz;
210 rt.GetComponents(
xx,
xy,
xz,
dx, yx,
yy,
yz,
dy, zx, zy,
zz,
dz);
211 tr =
Tr3D(CLHEP::HepRep3x3(
xx,
xy,
xz, yx,
yy,
yz, zx, zy,
zz), CLHEP::Hep3Vector(
dx,
dy,
dz));
214 const Tr3D atr(
nullptr == at ? tr
215 : (
nullptr ==
gt ? at->transform() * tr : at->transform() *
gt->transform() * tr));
218 const Pt3D gRef(atr * lRef);
219 const GlobalPoint fCtr(gRef.x(), gRef.y(), gRef.z());
220 const Pt3D gBck(atr * lBck);
221 const GlobalPoint fBck(gBck.x(), gBck.y(), gBck.z());
222 const Pt3D gCor(atr * lCor);
223 const GlobalPoint fCor(gCor.x(), gCor.y(), gCor.z());
225 assert(caloTopology.denseIndex(
id) == dins[
i]);
227 ptr->newCell(fCtr, fBck, fCor, myParm,
id);
230 ptr->initializeParms();