CMS 3D CMS Logo

EcalPreshowerGeometryLoaderFromDDD.cc
Go to the documentation of this file.
4 
6 
7 template <>
9  const EcalPGL::ParmVec& pv,
10  const HepGeom::Transform3D& tr,
11  const DetId& id,
12  const double& scale);
13 template <>
15 template <>
17 
18 #include "Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc"
19 
23 
24 template <>
26  const EcalPGL::ParmVec& pv,
27  const HepGeom::Transform3D& tr,
28  const DetId& id,
29  const double& scale) {
30  std::vector<CCGFloat> vv;
31  vv.reserve(pv.size() + 1);
32  for (unsigned int i(0); i != pv.size(); ++i) {
33  vv.emplace_back(scale * pv[i]);
34  }
35 
36  const Pt3D cor1(vv[0], vv[1], vv[2]);
37  const Pt3D cor2(-vv[0], vv[1], vv[2]);
38  const Pt3D cor3(vv[0], -vv[1], vv[2]);
39 
40  const CCGFloat z1(Pt3D(tr * cor1).z());
41  const CCGFloat z2(Pt3D(tr * cor2).z());
42  const CCGFloat z3(Pt3D(tr * cor3).z());
43 
44  const CCGFloat y1(Pt3D(tr * cor3).y());
45  const CCGFloat x1(Pt3D(tr * cor3).x());
46 
47  const CCGFloat zdif(0.00001 > fabs(z1 - z2) ? (y1 > 0 ? +1.0 : -1.0) * (z1 - z3)
48  : (x1 > 0 ? +1.0 : -1.0) * (z1 - z2));
49 
50  const CCGFloat tilt(asin(0.5 * zdif / (vv[1] > vv[0] ? vv[1] : vv[0])));
51 
52  vv.emplace_back(tilt);
53 
54  const CCGFloat* pP(CaloCellGeometry::getParmPtr(vv, geom->parMgr(), geom->parVecVec()));
55 
56  const Pt3D ctr(tr * Pt3D(0, 0, 0));
57 
58  const GlobalPoint refPoint(ctr.x(), ctr.y(), ctr.z());
59 
60  geom->newCell(refPoint, refPoint, refPoint, pP, id);
61 }
62 
63 template <>
64 void EcalPGL::fillNamedParams(const DDFilteredView& /*fv*/, EcalPreshowerGeometry* /*geom*/) {
65  // nothing yet for preshower
66 }
67 
68 template <>
70  // nothing yet for preshower
71 }
void fillGeom(T *geom, const ParmVec &pv, const HepGeom::Transform3D &tr, const DetId &id, const double &scale)
std::vector< double > ParmVec
CaloCellGeometry::Pt3D Pt3D
CaloCellGeometry::CCGFloat CCGFloat
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
CaloGeometryLoader< EcalPreshowerGeometry > EcalPGL
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:17
HepGeom::Point3D< CCGFloat > Pt3D
void fillNamedParams(const DDFilteredView &fv, T *geom)
CaloCellGeometry::CCGFloat CCGFloat