27 int det_id = x_det.id();
28 bool reflect = x_det.reflect(
true);
29 string det_name = x_det.nameStr();
31 int numsides = dim.numsides();
32 double rmin = dim.rmin();
33 double rmax = dim.rmax()*std::cos(
M_PI/numsides);
34 double zmin = dim.zmin();
36 double totalThickness = layering.totalThickness();
42 double layerZ = -totalThickness/2;
44 endcapVol.setAttributes(description,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
48 double l_thick = layering.layer(l_num-1)->thickness();
49 string l_name =
_toString(layerType,
"layer%d");
50 int l_repeat = x_layer.repeat();
52 vector<PlacedVolume> sensitives;
55 double sliceZ = -l_thick/2;
58 string s_name =
_toString(s_num,
"slice%d");
59 double s_thick = x_slice.thickness();
63 s_vol.setVisAttributes(description.
visAttributes(x_slice.visStr()));
67 if ( x_slice.isSensitive() ) {
69 s_vol.setSensitiveDetector(sens);
70 sensitives.push_back(s_phv);
75 l_vol.setVisAttributes(description.
visAttributes(x_layer.visStr()));
76 if ( l_repeat <= 0 )
throw std::runtime_error(x_det.nameStr()+
"> Invalid repeat value");
77 for(
int j=0; j<l_repeat; ++j) {
78 string phys_lay =
_toString(l_num,
"layer%d");
83 layer_elt.setPlacement(pv);
84 for(
size_t ic=0; ic<sensitives.size(); ++ic) {
87 comp_elt.setPlacement(sens_pv);
95 double z_pos = zmin+totalThickness/2;
118 both_endcaps.setPlacement(pv);
119 both_endcaps.add(sdetA);
120 both_endcaps.add(sdetB);
128 endcap.setPlacement(pv);