25 typedef vector<PlacedVolume> Placements;
28 int det_id = x_det.id();
29 string det_name = x_det.nameStr();
30 bool reflect = x_det.reflect(
false);
35 int m_id=0, c_id=0, n_sensor=0;
36 map<string,Volume> modules;
37 map<string, Placements> sensitives;
40 assembly.setVisAttributes(description.
invisible());
45 string m_nam = x_mod.nameStr();
51 double y1, y2, total_thickness=0.;
53 for(ci.reset(), total_thickness=0.0; ci; ++ci)
56 y1 = y2 = total_thickness / 2;
58 m_volume.setVisAttributes(description.
visAttributes(x_mod.visStr()));
60 for(ci.reset(), n_sensor=1, c_id=0, posY=-y1; ci; ++ci, ++c_id) {
62 double c_thick = c.thickness();
64 string c_name =
_toString(c_id,
"component%d");
65 Volume c_vol(c_name,
Trapezoid(x1,x2,c_thick/2e0,c_thick/2e0,z), c_mat);
67 c_vol.setVisAttributes(description.
visAttributes(c.visStr()));
68 pv = m_volume.placeVolume(c_vol,
Position(0,posY+c_thick/2,0));
69 if ( c.isSensitive() ) {
70 sdet.check(n_sensor > 2,
"SiTrackerEndcap2::fromCompact: "+c_name+
" Max of 2 modules allowed!");
72 c_vol.setSensitiveDetector(sens);
73 sensitives[m_nam].push_back(pv);
78 modules[m_nam] = m_volume;
83 int l_id = x_layer.id();
87 double r = x_ring.r();
88 double phi0 = x_ring.phi0(0);
89 double zstart = x_ring.zstart();
90 double dz = x_ring.dz(0);
91 int nmodules = x_ring.nmodules();
92 string m_nam = x_ring.moduleStr();
93 Volume m_vol = modules[m_nam];
94 double iphi = 2*
M_PI/nmodules;
96 Placements& sensVols = sensitives[m_nam];
98 for(
int k=0; k<nmodules; ++k) {
100 double x = -r*std::cos(phi);
101 double y = -r*std::sin(phi);
105 module.setPlacement(pv);
106 for(
size_t ic=0; ic<sensVols.size(); ++ic) {
109 comp_elt.setPlacement(sens_pv);
115 DetElement r_module(sdet,m_base+
"_neg",det_id);
116 r_module.setPlacement(pv);
117 for(
size_t ic=0; ic<sensVols.size(); ++ic) {
120 comp_elt.setPlacement(sens_pv);
131 sdet.setPlacement(pv);