CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalPreshowerGeometryLoaderFromDDD.cc
Go to the documentation of this file.
2 
4 #include "Geometry/CaloEventSetup/interface/CaloGeometryLoader.icc"
5 
7 
9 
10 #include <iostream>
11 #include <vector>
12 
14 
17 
18 template <>
19 void
21  const EcalPGL::ParmVec& pv ,
22  const HepGeom::Transform3D& tr ,
23  const DetId& id )
24 {
25  std::vector<CCGFloat> vv ;
26  vv.reserve( pv.size() + 1 ) ;
27  for( unsigned int i ( 0 ) ; i != pv.size() ; ++i )
28  {
29  vv.push_back( k_ScaleFromDDDtoGeant*pv[i] ) ;
30  }
31 
32  const Pt3D cor1 ( vv[0], vv[1], vv[2] ) ;
33  const Pt3D cor2 ( -vv[0], vv[1], vv[2] ) ;
34  const Pt3D cor3 ( vv[0], -vv[1], vv[2] ) ;
35 
36  const CCGFloat z1 ( Pt3D( tr*cor1 ).z() ) ;
37  const CCGFloat z2 ( Pt3D( tr*cor2 ).z() ) ;
38  const CCGFloat z3 ( Pt3D( tr*cor3 ).z() ) ;
39 
40  const CCGFloat y1 ( Pt3D( tr*cor3 ).y() ) ;
41 // const CCGFloat y3 ( Pt3D( tr*cor3 ).y() ) ;
42 
43  const CCGFloat x1 ( Pt3D( tr*cor3 ).x() ) ;
44 // const CCGFloat x2 ( Pt3D( tr*cor3 ).x() ) ;
45 
46  const CCGFloat zdif ( 0.00001 > fabs( z1 - z2 ) ?
47  ( 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.push_back( tilt ) ;
53 
54  const CCGFloat* pP ( CaloCellGeometry::getParmPtr( vv,
55  geom->parMgr(),
56  geom->parVecVec() ) ) ;
57 
58  const Pt3D ctr ( tr*Pt3D(0,0,0) ) ;
59 
60  const GlobalPoint refPoint ( ctr.x(), ctr.y(), ctr.z() ) ;
61 
62  geom->newCell( refPoint, refPoint, refPoint,
63  pP,
64  id );
65 }
66 
67 template <>
68 void
70  EcalPreshowerGeometry* /*geom*/ )
71 {
72  // nothing yet for preshower
73 }
74 
int i
Definition: DBlmapReader.cc:9
std::vector< double > ParmVec
double double double z
virtual void newCell(const GlobalPoint &f1, const GlobalPoint &f2, const GlobalPoint &f3, const CCGFloat *parm, const DetId &detId)
CaloCellGeometry::CCGFloat CCGFloat
static const CCGFloat * getParmPtr(const std::vector< CCGFloat > &vd, ParMgr *mgr, ParVecVec &pvv)
void fillNamedParams(DDFilteredView fv, T *geom)
CaloCellGeometry::Pt3D Pt3D
Definition: DetId.h:20
HepGeom::Point3D< CCGFloat > Pt3D
void fillGeom(T *geom, const ParmVec &pv, const HepGeom::Transform3D &tr, const DetId &id)
static const double k_ScaleFromDDDtoGeant
x
Definition: VDTMath.h:216
CaloGeometryLoader< EcalPreshowerGeometry > EcalPGL