CMS 3D CMS Logo

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