25 #define SURFACEINSTALLER_DATA UserData
26 #define DD4HEP_USE_SURFACEINSTALL_HELPER DD4hep_SiTrackerBarrelSurfacePlugin
30 template <>
void Installer<UserData>::handle_arguments(
int argc,
char** argv) {
31 for(
int i=0; i<argc; ++i) {
32 char* ptr = ::strchr(argv[i],
'=');
34 std::string name( argv[i] , ptr ) ;
36 if( name==
"dimension" ) data.dimension = value ;
37 std::cout <<
"DD4hep_SiTrackerBarrelSurfacePlugin: argument[" << i <<
"] = " << name
38 <<
" = " << value << std::endl;
44 template <
typename UserData>
51 if ( !comp_shape.
isValid() || !mod_shape.isValid() ) {
52 invalidInstaller(
"Components and/or modules are not boxes -- invalid shapes");
54 else if ( !handleUsingCache(component,comp_vol) ) {
55 const double* trans = placementTranslation(component);
56 double half_module_thickness = mod_shape->GetDZ();
57 double sensitive_z_position = trans[2];
58 double outer_thickness = half_module_thickness + sensitive_z_position;
59 double inner_thickness = half_module_thickness - sensitive_z_position;
62 Vector3D u(-1.,0.,0.),
v(0.,-1.,0.), n(0.,0.,1.), o(0.,0.,0.);
66 if( data.dimension == 1 ) {
67 type.setProperty( Type::Measurement1D ,
true ) ;
68 }
else if( data.dimension != 2 ) {
69 throw std::runtime_error(
"**** dd4hep_SiTrackerBarrelSurfacePlugin: no or wrong "
70 "'dimension' argument given - has to be 1 or 2") ;
72 VolPlane surf(comp_vol, type, inner_thickness, outer_thickness, u,
v, n, o);
73 addSurface(component,surf);