23 std::string encoding ;
28 #define SURFACEINSTALLER_DATA UserData
29 #define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_CaloFaceEndcapSurfacePlugin
46 double thickness_inner ,
double thickness_outer,
51 _r(0),_phi0(0),_sym(0) {}
53 void setData(
double radius,
double phi0,
unsigned symmetry){
63 double ri = _r * cos( 2.*
M_PI / _sym ) ;
66 ( (point.
rho() < ri ) ||
67 (
volume()->GetShape()->Contains(
const_cast<double*
> (point.
const_array() ) ) ) ) ;
71 virtual std::vector< std::pair<dd4hep::rec::Vector3D, dd4hep::rec::Vector3D> >
getLines(
unsigned){
73 std::vector< std::pair<dd4hep::rec::Vector3D, dd4hep::rec::Vector3D> > lines ;
75 double alpha = ( _sym ? 2.*
M_PI / _sym : 0. ) ;
77 for(
unsigned i=0 ; i < _sym ; ++i){
78 double gam0 = i * alpha + _phi0 ;
79 double gam1 = (i+1) * alpha + _phi0 ;
90 template <>
void Installer<UserData>::handle_arguments(
int argc,
char** argv) {
91 for(
int i=0; i<argc; ++i) {
92 char* ptr = ::strchr(argv[i],
'=');
94 std::string name( argv[i] , ptr ) ;
97 printout(dd4hep::DEBUG,
"DD4hep_CaloFaceEndcapSurfacePlugin",
"argument[%d] = %s = %f" , i, name.c_str() , value ) ;
99 if( name==
"zpos" ) data.zpos = value ;
100 else if( name==
"radius" ) data.radius = value ;
101 else if( name==
"phi0" ) data.phi0 = value ;
102 else if( name==
"symmetry") data.symmetry = value ;
103 else if( name==
"systemID") data.systemID = value ;
104 else if( name==
"encoding") data.encoding = ptr ;
106 printout(dd4hep::WARNING,
"DD4hep_CaloFaceEndcapSurfacePlugin",
"unknown parameter: %s ", name.c_str() ) ;
113 template <
typename UserData>
119 double zpos = data.zpos ;
120 double symmetry = data.symmetry ;
121 double radius = data.radius ;
122 double phi0 = data.phi0 ;
124 if( symmetry ) radius /= cos(
M_PI / symmetry ) ;
127 double inner_thickness = 1e-6 ;
128 double outer_thickness = 1e-6 ;
130 printout(dd4hep::INFO,
"DD4hep_CaloFaceEndcapSurfacePlugin",
"install tracking surfaces for : %s ", component.
name() ) ;
136 bf[
"system"] = data.systemID ;
141 dd4hep::rec::Vector3D u(1.,0.,0.),
v(0.,1.,0.), n(0.,0.,1.), o(0., 0.5*radius , zpos );
143 CaloEndcapPlane surf_pz(comp_vol,Type(Type::Helper,
Type::Sensitive), inner_thickness, outer_thickness, u,
v, n, o);
145 surf_pz->setData( radius, phi0, symmetry ) ;
148 addSurface(component,surf_pz);
150 CaloEndcapPlane surf_nz(comp_vol,Type(Type::Helper,
Type::Sensitive), inner_thickness, outer_thickness, u,
v, n, -1*o );
153 surf_nz->setData( radius, phi0, symmetry ) ;
156 addSurface(component,surf_nz);