BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
create_rootgeom_Silicon_5stations_2026_detailed.C
Go to the documentation of this file.
1/*
2 * Detailed ROOT geometry for the configuration of FSD (Forward Silicon detector)
3 * for the next runs (5 Si-Stations (6-10-14-18-22 modules))
4 *
5 * Author: Baranov D.
6 * Date: 22.12.2025 (created)
7 *
8 * WARNING: all units is in cm!!!
9 */
10
11using namespace TMath;
12
13// Set Parameters of SILICON detector -------------------------------------------
14const Int_t NStations = 5; // stations in the detector
15const Int_t NMaxModules = 22; // max. number of modules in a station
16
17const Int_t NModulesInStations[NStations] = {6, 10, 14, 18, 22};
18
19//(X-Y-Z)Positions of stations (sensitive volumes) -----------------------------
20
21// hole center of lower half-planes
23 +0.6250, // st. 0
24 +0.7045, // st. 1
25 +0.9185, // st. 2
26 +1.0180, // st. 3
27 +1.15 // st. 4 (preliminary)
28};
29
30// hole center of lower half-planes
32 -0.0695, // st. 0
33 -0.0895, // st. 1
34 -0.0565, // st. 2
35 -0.0670, // st. 3
36 +0.0 // st. 4
37};
38
39// reference point (average measured z-position of lower half-planes)
41 +14.1370, // st. 0
42 +22.9015, // st. 1
43 +31.6785, // st. 2
44 +40.5235, // st. 3
45 +48.91 // st. 4
46};
47//------------------------------------------------------------------------------
48
49const Double_t z_mod_thick = 0.03; // thickness of silicon sensor
50
51const Double_t z_shift_up = +2.68; // z-shift from reference point to local basic point of upper half-planes
52const Double_t z_shift_low = -0.61; // z-shift from reference point to local basic point of lower half-planes
53
54// x-distance from hole center to the base
56 21.7, // st. 0
57 21.7, // st. 1
58 27.7, // st. 2
59 33.7, // st. 3
60 39.7 // st. 4
61};
62
63// y-distance from hole center to the base
65 12.99, // st. 0
66 16.29, // st. 1
67 16.29, // st. 2
68 16.29, // st. 3
69 22.24 // st. 4
70};
71
72// z-shift of the upper half-plane relative to the lower one (dist. between two ref. points)
74 +5.0800, // st. 0
75 +5.1255, // st. 1
76 +4.9800, // st. 2
77 +5.0115, // st. 3
78 +5.6100 // st. 4 (preliminary)
79};
80
81// x-shift of hole-center of the upper half-plane relative to the lower half-plane
83 +0.0165, // st. 0
84 +0.0100, // st. 1
85 +0.0325, // st. 2
86 +0.0820, // st. 3
87 +0.0000 // st. 4 (preliminary)
88};
89
90// y-shift of hole-center of the upper half-plane relative to the lower half-plane
92 -0.0155, // st. 0
93 -0.0730, // st. 1
94 -0.0645, // st. 2
95 +0.6580, // st. 3
96 +0.0000 // st. 4 (preliminary)
97};
98
100 {-x_dist_cent_base[0] + x_shift_hp[0] + 30.850 /*0*/, -x_dist_cent_base[0] + x_shift_hp[0] + 24.852 /*1*/,
101 -x_dist_cent_base[0] + x_shift_hp[0] + 12.556 /*2*/,
102
103 -x_dist_cent_base[0] + 30.859 /*3*/, -x_dist_cent_base[0] + 24.863 /*4*/,
104 -x_dist_cent_base[0] + 12.558 /*5*/}, // st. 0
105
106 {-x_dist_cent_base[1] + x_shift_hp[1] + 36.860 /*0*/, -x_dist_cent_base[1] + x_shift_hp[1] + 30.844 /*1*/,
107 -x_dist_cent_base[1] + x_shift_hp[1] + 24.860 /*2*/, -x_dist_cent_base[1] + x_shift_hp[1] + 12.550 /*3*/,
108 -x_dist_cent_base[1] + x_shift_hp[1] + 6.557 /*4*/,
109
110 -x_dist_cent_base[1] + 36.8425 /*5*/, -x_dist_cent_base[1] + 30.8505 /*6*/, -x_dist_cent_base[1] + 24.8450 /*7*/,
111 -x_dist_cent_base[1] + 12.5550 /*8*/, -x_dist_cent_base[1] + 6.5585 /*9*/}, // st. 1
112
113 {-x_dist_cent_base[2] + x_shift_hp[2] + 48.8465 /*0*/, -x_dist_cent_base[2] + x_shift_hp[2] + 42.8315 /*1*/,
114 -x_dist_cent_base[2] + x_shift_hp[2] + 36.8485 /*2*/, -x_dist_cent_base[2] + x_shift_hp[2] + 30.8425 /*3*/,
115 -x_dist_cent_base[2] + x_shift_hp[2] + 18.5555 /*4*/, -x_dist_cent_base[2] + x_shift_hp[2] + 12.5395 /*5*/,
116 -x_dist_cent_base[2] + x_shift_hp[2] + 6.5530 /*6*/,
117
118 -x_dist_cent_base[2] + 48.8535 /*7*/, -x_dist_cent_base[2] + 42.8470 /*8*/, -x_dist_cent_base[2] + 36.8420 /*9*/,
119 -x_dist_cent_base[2] + 30.8435 /*10*/, -x_dist_cent_base[2] + 18.5445 /*11*/,
120 -x_dist_cent_base[2] + 12.5435 /*12*/, -x_dist_cent_base[2] + 6.5475 /*13*/}, // st. 2
121
122 {-x_dist_cent_base[3] + x_shift_hp[3] + 60.8580 /*0*/, -x_dist_cent_base[3] + x_shift_hp[3] + 54.8485 /*1*/,
123 -x_dist_cent_base[3] + x_shift_hp[3] + 48.8545 /*2*/, -x_dist_cent_base[3] + x_shift_hp[3] + 42.8390 /*3*/,
124 -x_dist_cent_base[3] + x_shift_hp[3] + 36.8435 /*4*/, -x_dist_cent_base[3] + x_shift_hp[3] + 24.5520 /*5*/,
125 -x_dist_cent_base[3] + x_shift_hp[3] + 18.5450 /*6*/, -x_dist_cent_base[3] + x_shift_hp[3] + 12.5470 /*7*/,
126 -x_dist_cent_base[3] + x_shift_hp[3] + 6.5585 /*8*/,
127
128 -x_dist_cent_base[3] + 60.860 /*9*/, -x_dist_cent_base[3] + 54.547 /*10*/, -x_dist_cent_base[3] + 48.860 /*11*/,
129 -x_dist_cent_base[3] + 42.845 /*12*/, -x_dist_cent_base[3] + 36.847 /*13*/, -x_dist_cent_base[3] + 24.5445 /*14*/,
130 -x_dist_cent_base[3] + 18.557 /*15*/, -x_dist_cent_base[3] + 12.552 /*16*/,
131 -x_dist_cent_base[3] + 6.5525 /*17*/}, // st. 3
132
133 {-x_dist_cent_base[4] + x_shift_hp[4] + 72.85 /*0*/,
134 -x_dist_cent_base[4] + x_shift_hp[4] + 66.85 /*1*/,
135 -x_dist_cent_base[4] + x_shift_hp[4] + 60.85 /*2*/,
136 -x_dist_cent_base[4] + x_shift_hp[4] + 54.85 /*3*/,
137 -x_dist_cent_base[4] + x_shift_hp[4] + 48.85 /*4*/,
138 -x_dist_cent_base[4] + x_shift_hp[4] + 42.85 /*5*/,
139 -x_dist_cent_base[4] + x_shift_hp[4] + 30.55 /*6*/,
140 -x_dist_cent_base[4] + x_shift_hp[4] + 24.55 /*7*/,
141 -x_dist_cent_base[4] + x_shift_hp[4] + 18.55 /*8*/,
142 -x_dist_cent_base[4] + x_shift_hp[4] + 12.55 /*9*/,
143 -x_dist_cent_base[4] + x_shift_hp[4] + 6.55 /*10*/,
144
145 -x_dist_cent_base[4] + 72.85 /*11*/,
146 -x_dist_cent_base[4] + 66.85 /*12*/,
147 -x_dist_cent_base[4] + 60.85 /*13*/,
148 -x_dist_cent_base[4] + 54.85 /*14*/,
149 -x_dist_cent_base[4] + 48.85 /*15*/,
150 -x_dist_cent_base[4] + 42.85 /*16*/,
151 -x_dist_cent_base[4] + 30.55 /*17*/,
152 -x_dist_cent_base[4] + 24.55 /*18*/,
153 -x_dist_cent_base[4] + 18.55 /*19*/,
154 -x_dist_cent_base[4] + 12.55 /*20*/,
155 -x_dist_cent_base[4] + 6.55 /*21*/} // st. 4
156};
157
159 {+y_dist_cent_base[0] + y_shift_hp[0] - 13.112 /*0*/, +y_dist_cent_base[0] + y_shift_hp[0] - 10.113 /*1*/,
160 +y_dist_cent_base[0] + y_shift_hp[0] - 13.086 /*2*/,
161
162 -y_dist_cent_base[0] + 13.100 /*3*/, -y_dist_cent_base[0] + 10.110 /*4*/,
163 -y_dist_cent_base[0] + 13.098 /*5*/}, // st. 0
164
165 {+y_dist_cent_base[1] + y_shift_hp[1] - 16.425 /*0*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.424 /*1*/,
166 +y_dist_cent_base[1] + y_shift_hp[1] - 13.421 /*2*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.421 /*3*/,
167 +y_dist_cent_base[1] + y_shift_hp[1] - 16.420 /*4*/,
168
169 -y_dist_cent_base[1] + 16.432 /*5*/, -y_dist_cent_base[1] + 16.423 /*6*/, -y_dist_cent_base[1] + 13.428 /*7*/,
170 -y_dist_cent_base[1] + 16.425 /*8*/, -y_dist_cent_base[1] + 16.429 /*9*/}, // st. 1
171
172 {+y_dist_cent_base[2] + y_shift_hp[2] - 16.424 /*0*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*1*/,
173 +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*2*/, +y_dist_cent_base[2] + y_shift_hp[2] - 13.411 /*3*/,
174 +y_dist_cent_base[2] + y_shift_hp[2] - 16.431 /*4*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.420 /*5*/,
175 +y_dist_cent_base[2] + y_shift_hp[2] - 16.430 /*6*/,
176
177 -y_dist_cent_base[2] + 16.418 /*7*/, -y_dist_cent_base[2] + 16.427 /*8*/, -y_dist_cent_base[2] + 16.421 /*9*/,
178 -y_dist_cent_base[2] + 13.428 /*10*/, -y_dist_cent_base[2] + 16.413 /*11*/, -y_dist_cent_base[2] + 16.427 /*12*/,
179 -y_dist_cent_base[2] + 16.414 /*13*/}, // st. 2
180
181 {+y_dist_cent_base[3] + y_shift_hp[3] - 16.429 /*0*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.431 /*1*/,
182 +y_dist_cent_base[3] + y_shift_hp[3] - 16.431 /*2*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.432 /*3*/,
183 +y_dist_cent_base[3] + y_shift_hp[3] - 13.432 /*4*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.429 /*5*/,
184 +y_dist_cent_base[3] + y_shift_hp[3] - 16.422 /*6*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.423 /*7*/,
185 +y_dist_cent_base[3] + y_shift_hp[3] - 16.427 /*8*/,
186
187 -y_dist_cent_base[3] + 16.432 /*9*/, -y_dist_cent_base[3] + 16.437 /*10*/, -y_dist_cent_base[3] + 16.435 /*11*/,
188 -y_dist_cent_base[3] + 16.435 /*12*/, -y_dist_cent_base[3] + 13.437 /*13*/, -y_dist_cent_base[3] + 16.434 /*14*/,
189 -y_dist_cent_base[3] + 16.436 /*15*/, -y_dist_cent_base[3] + 16.431 /*16*/,
190 -y_dist_cent_base[3] + 16.428 /*17*/}, // st. 3
191
192 {+y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*0*/,
193 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*1*/,
194 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*2*/,
195 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*3*/,
196 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*4*/,
197 +y_dist_cent_base[4] + y_shift_hp[4] - 19.436 /*5*/,
198 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*6*/,
199 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*7*/,
200 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*8*/,
201 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*9*/,
202 +y_dist_cent_base[4] + y_shift_hp[4] - 22.436 /*10*/,
203
204 -y_dist_cent_base[4] + 22.436 /*11*/,
205 -y_dist_cent_base[4] + 22.436 /*12*/,
206 -y_dist_cent_base[4] + 22.436 /*13*/,
207 -y_dist_cent_base[4] + 22.436 /*14*/,
208 -y_dist_cent_base[4] + 22.436 /*15*/,
209 -y_dist_cent_base[4] + 19.436 /*16*/,
210 -y_dist_cent_base[4] + 22.436 /*17*/,
211 -y_dist_cent_base[4] + 22.436 /*18*/,
212 -y_dist_cent_base[4] + 22.436 /*19*/,
213 -y_dist_cent_base[4] + 22.436 /*20*/,
214 -y_dist_cent_base[4] + 22.436 /*21*/} // st. 4
215};
216
218 {+z_shift_hp[0] + z_shift_up - 2.6 /*0*/, +z_shift_hp[0] + z_shift_up - 1.45 /*1*/,
219 +z_shift_hp[0] + z_shift_up - 2.7 /*2*/,
220
221 +z_shift_low - z_mod_thick + 2.61 /*3*/, +z_shift_low - z_mod_thick + 1.4 /*4*/,
222 +z_shift_low - z_mod_thick + 2.78 /*5*/}, // st. 0
223
224 {+z_shift_hp[1] + z_shift_up - 1.41 /*0*/, +z_shift_hp[1] + z_shift_up - 2.585 /*1*/,
225 +z_shift_hp[1] + z_shift_up - 1.395 /*2*/, +z_shift_hp[1] + z_shift_up - 2.76 /*3*/,
226 +z_shift_hp[1] + z_shift_up - 1.585 /*4*/,
227
228 +z_shift_low - z_mod_thick + 1.425 /*5*/, +z_shift_low - z_mod_thick + 2.595 /*6*/,
229 +z_shift_low - z_mod_thick + 1.445 /*7*/, +z_shift_low - z_mod_thick + 2.73 /*8*/,
230 +z_shift_low - z_mod_thick + 1.51 /*9*/}, // st. 1
231
232 {+z_shift_hp[2] + z_shift_up - 2.595 /*0*/, +z_shift_hp[2] + z_shift_up - 1.395 /*1*/,
233 +z_shift_hp[2] + z_shift_up - 2.665 /*2*/, +z_shift_hp[2] + z_shift_up - 1.425 /*3*/,
234 +z_shift_hp[2] + z_shift_up - 2.735 /*4*/, +z_shift_hp[2] + z_shift_up - 1.56 /*5*/,
235 +z_shift_hp[2] + z_shift_up - 2.705 /*6*/,
236
237 +z_shift_low - z_mod_thick + 2.585 /*7*/, +z_shift_low - z_mod_thick + 1.435 /*8*/,
238 +z_shift_low - z_mod_thick + 2.595 /*9*/, +z_shift_low - z_mod_thick + 1.41 /*10*/,
239 +z_shift_low - z_mod_thick + 2.79 /*11*/, +z_shift_low - z_mod_thick + 1.6 /*12*/,
240 +z_shift_low - z_mod_thick + 2.83 /*13*/}, // st. 2
241
242 {+z_shift_hp[3] + z_shift_up - 1.41 /*0*/, +z_shift_hp[3] + z_shift_up - 2.59 /*1*/,
243 +z_shift_hp[3] + z_shift_up - 1.435 /*2*/, +z_shift_hp[3] + z_shift_up - 2.635 /*3*/,
244 +z_shift_hp[3] + z_shift_up - 1.4 /*4*/, +z_shift_hp[3] + z_shift_up - 2.775 /*5*/,
245 +z_shift_hp[3] + z_shift_up - 1.605 /*6*/, +z_shift_hp[3] + z_shift_up - 2.73 /*7*/,
246 +z_shift_hp[3] + z_shift_up - 1.6 /*8*/,
247
248 +z_shift_low - z_mod_thick + 1.45 /*9*/, +z_shift_low - z_mod_thick + 2.575 /*10*/,
249 +z_shift_low - z_mod_thick + 1.37 /*11*/, +z_shift_low - z_mod_thick + 2.585 /*12*/,
250 +z_shift_low - z_mod_thick + 1.42 /*13*/, +z_shift_low - z_mod_thick + 2.695 /*14*/,
251 +z_shift_low - z_mod_thick + 1.525 /*15*/, +z_shift_low - z_mod_thick + 2.68 /*16*/,
252 +z_shift_low - z_mod_thick + 1.515 /*17*/}, // st. 3
253
254 {+z_shift_hp[4] + z_shift_up - 2.82 /*0*/, +z_shift_hp[4] + z_shift_up - 1.6 /*1*/,
255 +z_shift_hp[4] + z_shift_up - 2.82 /*2*/, +z_shift_hp[4] + z_shift_up - 1.6 /*3*/,
256 +z_shift_hp[4] + z_shift_up - 2.82 /*4*/, +z_shift_hp[4] + z_shift_up - 1.6 /*5*/,
257 +z_shift_hp[4] + z_shift_up - 2.95 /*6*/, +z_shift_hp[4] + z_shift_up - 1.73 /*7*/,
258 +z_shift_hp[4] + z_shift_up - 2.95 /*8*/, +z_shift_hp[4] + z_shift_up - 1.73 /*9*/,
259 +z_shift_hp[4] + z_shift_up - 2.95 /*10*/,
260
261 +z_shift_low - z_mod_thick + 2.82 /*11*/, +z_shift_low - z_mod_thick + 1.6 /*12*/,
262 +z_shift_low - z_mod_thick + 2.82 /*13*/, +z_shift_low - z_mod_thick + 1.6 /*14*/,
263 +z_shift_low - z_mod_thick + 2.82 /*15*/, +z_shift_low - z_mod_thick + 1.6 /*16*/,
264 +z_shift_low - z_mod_thick + 2.95 /*17*/, +z_shift_low - z_mod_thick + 1.73 /*18*/,
265 +z_shift_low - z_mod_thick + 2.95 /*19*/, +z_shift_low - z_mod_thick + 1.73 /*20*/,
266 +z_shift_low - z_mod_thick + 2.95 /*21*/} // st. 4
267};
268
269// Geometry parameters of modules
277
295
296// rotations of modules around y-axis by 180 deg.
298 {true /*0*/, true /*1*/, false /*2*/, true /*3*/, true /*4*/, false /*5*/},
299 {true /*0*/, true /*1*/, true /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, false /*8*/,
300 false /*9*/},
301 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
302 true /*9*/, true /*10*/, false /*11*/, false /*12*/, false /*13*/},
303 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, false /*5*/, false /*6*/, false /*7*/, false /*8*/,
304 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, false /*14*/, false /*15*/, false /*16*/,
305 false /*17*/},
306 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, true /*5*/, false /*6*/, false /*7*/,
307 false /*8*/, false /*9*/, false /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/,
308 true /*16*/, false /*17*/, false /*18*/, false /*19*/, false /*20*/, false /*21*/}};
309
310// rotations of modules around x-axis by 180 deg.
312 {false /*0*/, false /*1*/, false /*2*/, true /*3*/, true /*4*/, true /*5*/},
313 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, true /*8*/,
314 true /*9*/},
315 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
316 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/},
317 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
318 false /*8*/, true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/, true /*16*/,
319 true /*17*/},
320 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
321 false /*8*/, false /*9*/, false /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/,
322 true /*16*/, true /*17*/, true /*18*/, true /*19*/, true /*20*/, true /*21*/}};
323
324/*
325//rotations of half-planes around y-axis (angles in degrees)
326const Int_t NMaxHalfPlanes = 2;
327const Double_t HalfPlanesYRotations[NStations][NMaxHalfPlanes] = {
328 {-0.205, -0.235}, // st.0 (upper [0] and lower [1] half-planes)
329 {-0.399, -0.173}, // st.1
330 {-0.151, -0.584}, // st.2
331 {-0.108, +0.367}, // st.3
332 {+0.000, +0.000} // st.4
333};
334*/
335
336//------------------------------------------------------------------------------
337
338// GeoManager
340
341// Module parameters ------------------------------------------------------------
343{
346}; // STANDARD_MODULE is (63x126)mm, LONG_MODULE is (63x186)mm
347const unsigned int NModuleSizes = 2;
348
349Double_t YGapBetweenPartsOfModule[NModuleSizes] = {0.0035 /*STANDARD_MODULE*/, 0.0035 /*LONG_MODULE*/}; // Mrs. Slit
350
351Double_t XModuleSize[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 6.3 /*LONG_MODULE*/};
352
353Double_t YModuleSizeUpperPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
354Double_t YModuleSizeLowerPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
355
362
363Double_t ZModuleSize[NModuleSizes] = {z_mod_thick /*STANDARD_MODULE*/, z_mod_thick /*LONG_MODULE*/};
364
365Double_t XBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // x-bevel for a angled cut
366Double_t YBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // y-bevel for a angled cut
367
372
377
378Double_t XLeftBorder[NModuleSizes] = {0.1145 /*STANDARD_MODULE*/, 0.1118 /*LONG_MODULE*/};
379Double_t XRightBorder[NModuleSizes] = {0.1118 /*STANDARD_MODULE*/, 0.1118 /*LONG_MODULE*/};
380Double_t YTopBorder[NModuleSizes] = {0.1143 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
381Double_t YMiddleBorderUpperPart[NModuleSizes] = {0.1121 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
382Double_t YMiddleBorderLowerPart[NModuleSizes] = {0.1147 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
383Double_t YBottomBorder[NModuleSizes] = {0.1148 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
384Double_t XYBevelBorder[NModuleSizes] = {0.1146 /*STANDARD_MODULE*/, 0.1146 /*LONG_MODULE*/};
385
386// Sensor zones ------------------------------------
391
397
404
406 ZModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
407 ZModuleSize[LONG_MODULE] /*LONG_MODULE*/
408};
409//-------------------------------------------------
410
411// Module frames -----------------------------------
413 XModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
414 XModuleSize[LONG_MODULE] /*LONG_MODULE*/
415};
416
418 YModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
419 YModuleSize[LONG_MODULE] /*LONG_MODULE*/
420};
421
422Double_t ZModuleFrameSize[NModuleSizes] = {0.18 /*STANDARD_MODULE*/, 0.18 /*LONG_MODULE*/};
423//-------------------------------------------------
424
425// Y-shift from center of the gap to the global x-axis (for y-alignment of the module)
430
431// X-shift from center of the module to the origin of the local x-axis
433 +XModuleSize[STANDARD_MODULE] * 0.5, /*STANDARD_MODULE*/
434 +XModuleSize[LONG_MODULE] * 0.5 /*LONG_MODULE*/
435};
436
437// Y-shift from center of the module to the origin of the local y-axis
442//------------------------------------------------------------------------------
443/*
444 ASCII module picture (view from target)
445
446 |<---- XModuleSize ---------->| ^
447 | | | Y-axis
448 ------------------------------ ---------
449 | | top border | | ^
450 ------------------------------ |
451 | | | | |
452 | l | rectangle | r | |
453 | e | sensor | i | |
454 | f | zone | g | |
455 | t | | h | |
456 | | | t | |
457 | | | | |
458 ------------------------------ |
459 | | middle (upper part) | |
460 ------ gap between parts ----- YModuleSize
461 | | middle (lower part) | |
462 ------------------------------ |
463 | | | | |
464 | b | bevel (or rect.) | r | |
465 | e | sensor | i | |
466 \ v \ zone | g | |
467 \ e \ | h | |
468 \ l \ | t | |
469 \ \ | | |
470 ------------------------- |
471 \ \ bottom | | v
472 ---------------------- ---------
473
474 * x-axis <----------------------------------(x0,y0) local point
475 */
476
477// media
485
486class FairGeoMedia;
487class FairGeoBuilder;
488
489// function declarations
490TGeoVolume* CreateStation(TString station_name);
491TGeoVolume* CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size);
492TGeoVolume* CreateModuleFrame(TString module_name, ModuleType module_type, ModuleSize module_size);
493TGeoVolume* CreateFrameForStation_StandardModule(TString frame_name, Int_t current_station_num);
494TGeoVolume* CreateFrameForStation_LongModule(TString frame_name, Int_t current_station_num);
495
496void DefineRequiredMedia(FairGeoMedia* geoMedia, FairGeoBuilder* geoBuild)
497{
498
499 // air medium
500 FairGeoMedium* mAir = geoMedia->getMedium("air");
501 if (!mAir)
502 Fatal("Main", "FairMedium air not found");
503 geoBuild->createMedium(mAir);
504 pMedAir = gGeoManager->GetMedium("air");
505 if (!pMedAir)
506 Fatal("Main", "Medium air not found");
507
508 // carbon medium
509 FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
510 if (!mCarbon)
511 Fatal("Main", "FairMedium carbon not found");
512 geoBuild->createMedium(mCarbon);
513 pMedCarbon = gGeoManager->GetMedium("carbon");
514 if (!pMedCarbon)
515 Fatal("Main", "Medium carbon not found");
516
517 // fiberglass medium
518 FairGeoMedium* mFiberGlass = geoMedia->getMedium("fiberglass");
519 if (!mFiberGlass)
520 Fatal("Main", "FairMedium fiberglass not found");
521 geoBuild->createMedium(mFiberGlass);
522 pMedFiberGlass = gGeoManager->GetMedium("fiberglass");
523 if (!pMedFiberGlass)
524 Fatal("Main", "Medium fiberglass not found");
525
526 // copper medium
527 FairGeoMedium* mCopper = geoMedia->getMedium("copper");
528 if (!mCopper)
529 Fatal("Main", "FairMedium copper not found");
530 geoBuild->createMedium(mCopper);
531 pMedCopper = gGeoManager->GetMedium("copper");
532 if (!pMedCopper)
533 Fatal("Main", "Medium copper not found");
534
535 // silicon medium
536 FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
537 if (!mSilicon)
538 Fatal("Main", "FairMedium silicon not found");
539 geoBuild->createMedium(mSilicon);
540 pMedSilicon = gGeoManager->GetMedium("silicon");
541 if (!pMedSilicon)
542 Fatal("Main", "Medium silicon not found");
543
544 // aluminium medium
545 FairGeoMedium* mAluminium = geoMedia->getMedium("aluminium");
546 if (!mAluminium)
547 Fatal("Main", "FairMedium aluminium not found");
548 geoBuild->createMedium(mAluminium);
549 pMedAluminium = gGeoManager->GetMedium("aluminium");
550 if (!pMedAluminium)
551 Fatal("Main", "Medium aluminium not found");
552
553 // polystyrene medium
554 FairGeoMedium* mPolystyrene = geoMedia->getMedium("polystyrene");
555 if (!mPolystyrene)
556 Fatal("Main", "FairMedium polystyrene not found");
557 geoBuild->createMedium(mPolystyrene);
558 pMedPolystyrene = gGeoManager->GetMedium("polystyrene");
559 if (!pMedPolystyrene)
560 Fatal("Main", "Medium polystyrene not found");
561}
562
564{
565 cout << "\n";
566 cout << "Module parameters information [STANDARD_MODULE]: ------------------" << "\n";
567 cout << " XModuleSize = " << XModuleSize[STANDARD_MODULE] << " cm" << "\n";
568 cout << " YModuleSize = " << YModuleSize[STANDARD_MODULE] << " cm" << " ( "
570 << YModuleSizeLowerPart[STANDARD_MODULE] << " )" << "\n";
571 cout << " YModuleSizeUpperPart = " << YModuleSizeUpperPart[STANDARD_MODULE] << " cm" << "\n";
572 cout << " YModuleSizeLowerPart = " << YModuleSizeLowerPart[STANDARD_MODULE] << " cm" << "\n";
573 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[STANDARD_MODULE] << " cm" << "\n";
574 cout << " ZModuleSize = " << ZModuleSize[STANDARD_MODULE] << " cm" << "\n";
575 cout << "\n";
576 cout << " XBevelSize = " << XBevelSize[STANDARD_MODULE] << " cm" << "\n";
577 cout << " YBevelSize = " << YBevelSize[STANDARD_MODULE] << " cm" << "\n";
578 cout << " BevelAngleDeg = " << BevelAngleDeg[STANDARD_MODULE] << " deg" << "\n";
579 cout << "\n";
580 cout << " XLeftBorder = " << XLeftBorder[STANDARD_MODULE] << " cm" << "\n";
581 cout << " XRightBorder = " << XRightBorder[STANDARD_MODULE] << " cm" << "\n";
582 cout << " YTopBorder = " << YTopBorder[STANDARD_MODULE] << " cm" << "\n";
583 cout << " YMiddleBorderUpperPart = " << YMiddleBorderUpperPart[STANDARD_MODULE] << " cm" << "\n";
584 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[STANDARD_MODULE] << " cm"
585 << " (gap between two parts)\n";
586 cout << " YMiddleBorderLowerPart = " << YMiddleBorderLowerPart[STANDARD_MODULE] << " cm" << "\n";
587 cout << " YBottomBorder = " << YBottomBorder[STANDARD_MODULE] << " cm" << "\n";
588 cout << " XYBevelBorder = " << XYBevelBorder[STANDARD_MODULE] << " cm" << "\n";
589 cout << "\n";
590 cout << " XSensorZoneSize = " << XSensorZoneSize[STANDARD_MODULE] << " cm" << "\n";
591 cout << " YSensorZoneSizeUpperPart = " << YSensorZoneSizeUpperPart[STANDARD_MODULE] << " cm" << "\n";
592 cout << " YSensorZoneSizeLowerPart = " << YSensorZoneSizeLowerPart[STANDARD_MODULE] << " cm" << "\n";
593 cout << " ZSensorZoneSize = " << ZSensorZoneSize[STANDARD_MODULE] << " cm" << "\n";
594
595 cout << "-------------------------------------------------------------\n";
596
597 cout << "\n";
598 cout << "Module parameters information [LONG_MODULE]: ------------------" << "\n";
599 cout << " XModuleSize = " << XModuleSize[LONG_MODULE] << " cm" << "\n";
600 cout << " YModuleSize = " << YModuleSize[LONG_MODULE] << " cm" << " ( " << YModuleSizeUpperPart[LONG_MODULE]
602 << "\n";
603 cout << " YModuleSizeUpperPart = " << YModuleSizeUpperPart[LONG_MODULE] << " cm" << "\n";
604 cout << " YModuleSizeLowerPart = " << YModuleSizeLowerPart[LONG_MODULE] << " cm" << "\n";
605 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[LONG_MODULE] << " cm" << "\n";
606 cout << " ZModuleSize = " << ZModuleSize[LONG_MODULE] << " cm" << "\n";
607 cout << "\n";
608 cout << " XBevelSize = " << XBevelSize[LONG_MODULE] << " cm" << "\n";
609 cout << " YBevelSize = " << YBevelSize[LONG_MODULE] << " cm" << "\n";
610 cout << " BevelAngleDeg = " << BevelAngleDeg[LONG_MODULE] << " deg" << "\n";
611 cout << "\n";
612 cout << " XLeftBorder = " << XLeftBorder[LONG_MODULE] << " cm" << "\n";
613 cout << " XRightBorder = " << XRightBorder[LONG_MODULE] << " cm" << "\n";
614 cout << " YTopBorder = " << YTopBorder[LONG_MODULE] << " cm" << "\n";
615 cout << " YMiddleBorderUpperPart = " << YMiddleBorderUpperPart[LONG_MODULE] << " cm" << "\n";
616 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[LONG_MODULE] << " cm"
617 << " (gap between two parts)\n";
618 cout << " YMiddleBorderLowerPart = " << YMiddleBorderLowerPart[LONG_MODULE] << " cm" << "\n";
619 cout << " YBottomBorder = " << YBottomBorder[LONG_MODULE] << " cm" << "\n";
620 cout << " XYBevelBorder = " << XYBevelBorder[LONG_MODULE] << " cm" << "\n";
621 cout << "\n";
622 cout << " XSensorZoneSize = " << XSensorZoneSize[LONG_MODULE] << " cm" << "\n";
623 cout << " YSensorZoneSizeUpperPart = " << YSensorZoneSizeUpperPart[LONG_MODULE] << " cm" << "\n";
624 cout << " YSensorZoneSizeLowerPart = " << YSensorZoneSizeLowerPart[LONG_MODULE] << " cm" << "\n";
625 cout << " ZSensorZoneSize = " << ZSensorZoneSize[LONG_MODULE] << " cm" << "\n";
626
627 cout << "-------------------------------------------------------------\n";
628}
629
631{
632 cout << "\n";
633 for (Int_t istation = 0; istation < NStations; ++istation) {
634 cout << "station " << istation << ":\n";
635 cout << " XStationPositions[" << istation << "] = " << XStationPositions[istation] << " cm\n";
636 cout << " YStationPositions[" << istation << "] = " << YStationPositions[istation] << " cm\n";
637 cout << " ZStationPositions[" << istation << "] = " << ZStationPositions[istation] << " cm\n";
638 cout << "\n";
639
640 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
641 cout << " module " << imodule << ":\n";
642 cout << " XModuleShifts[" << istation << "][" << imodule << "] = " << XModuleShifts[istation][imodule]
643 << " cm\n";
644 cout << " YModuleShifts[" << istation << "][" << imodule << "] = " << YModuleShifts[istation][imodule]
645 << " cm\n";
646 cout << " ZModuleShifts[" << istation << "][" << imodule << "] = " << ZModuleShifts[istation][imodule]
647 << " cm\n";
648 cout << "\n";
649
650 Double_t XGlobalModulePos = XModuleShifts[istation][imodule] + XStationPositions[istation];
651 Double_t YGlobalModulePos = YModuleShifts[istation][imodule] + YStationPositions[istation];
652 Double_t ZGlobalModulePos = ZModuleShifts[istation][imodule] + ZStationPositions[istation];
653
654 cout << " XGlobalModulePos = " << XGlobalModulePos << " cm\n";
655 cout << " YGlobalModulePos = " << YGlobalModulePos << " cm\n";
656 cout << " ZGlobalModulePos = " << ZGlobalModulePos << " cm\n";
657 cout << "\n";
658
659 cout << " ModulesTypes[" << istation << "][" << imodule << "] = ";
660 if (ModulesTypes[istation][imodule] == 0)
661 cout << "RIGHT_ANGLED_MODULE\n";
662 if (ModulesTypes[istation][imodule] == 1)
663 cout << "BEVEL_MODULE\n";
664 if (ModulesTypes[istation][imodule] == 2)
665 cout << "RIGHT_ANGLED_MODULE_HALF\n";
666 if (ModulesTypes[istation][imodule] == 3)
667 cout << "BEVEL_MODULE_HALF\n";
668 cout << " ModulesYRotations[" << istation << "][" << imodule << "] = ";
669 if (ModulesYRotations[istation][imodule] == false)
670 cout << "not rotated around Y\n";
671 if (ModulesYRotations[istation][imodule] == true)
672 cout << "rotated around Y\n";
673 cout << " ModulesXRotations[" << istation << "][" << imodule << "] = ";
674 if (ModulesXRotations[istation][imodule] == false)
675 cout << "not rotated around X\n";
676 if (ModulesXRotations[istation][imodule] == true)
677 cout << "rotated around X\n";
678 cout << "\n";
679 }
680 cout << "-------------------------------------------------------------\n";
681 }
682 cout << "-------------------------------------------------------------\n";
683}
684
686{
687
688 // ---- set working directory --------------------------------------------
689 TString gPath = gSystem->Getenv("VMCWORKDIR");
690
691 // ------- Geometry file name (output) ----------------------------------
692 const TString geoDetectorName = "Silicon";
693 const TString geoDetectorVersion = "5stations_2026_detailed";
694 const TString geoFileName = gPath + "/geometry/" + geoDetectorName + "_" + geoDetectorVersion + ".root";
695
696 // ---- global geometry parameters ---------------------------------------
697 FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
698 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
699
700 // ------- Load media from media file ----------------------------------
701 TString medFile = gPath + "/geometry/media.geo";
702 geoFace->setMediaFile(medFile);
703 geoFace->readMedia();
704 FairGeoMedia* geoMedia = geoFace->getMedia();
705 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
706
707 DefineRequiredMedia(geoMedia, geoBuild);
708 // -------------------------------------------------------------------------
709
710 // Print information about parameters of SILICON
713
714 // -------------- Create geometry and top volume -------------------------
715 gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
716 gGeoMan->SetName(geoDetectorName + "_geom");
717 TGeoVolume* top = new TGeoVolumeAssembly("TOP");
718 top->SetMedium(pMedAir);
719 gGeoMan->SetTopVolume(top);
720 // gGeoMan->SetTopVisible(1);
721 // --------------------------------------------------------------------------
722
723 // Define TOP Geometry
724 TGeoVolume* SILICON = new TGeoVolumeAssembly(geoDetectorName);
725 SILICON->SetMedium(pMedAir);
726
727 // Let's create SILICON stations filled with modules
728 for (Int_t istation = 0; istation < NStations; ++istation) {
729 // for(Int_t istation = 0; istation < 1; ++istation) {
730
731 // module size in a station
732 ModuleSize module_size = STANDARD_MODULE;
733
734 if (istation == 0)
735 module_size = LONG_MODULE;
736
737 if (istation == 4)
738 module_size = LONG_MODULE;
739
740 TGeoVolume* station = CreateStation(TString("station") + TString::Itoa(istation, 10) + TString("_Silicon"));
741
742 Int_t NModules = NModulesInStations[istation];
743
744 TGeoVolume* modules[NModules];
745 TGeoVolume* moduleFrames[NModules];
746
747 TGeoCombiTrans* modTransforms[NModules];
748
749 for (Int_t imodule = 0; imodule < NModules; ++imodule) {
750
751 TString module_name = TString("module") + TString::Itoa(imodule, 10) + TString("_") + station->GetName();
752 modules[imodule] = CreateModule(module_name, ModulesTypes[istation][imodule], module_size);
753
754 TString moduleFrame_name =
755 TString("moduleFrame") + TString::Itoa(imodule, 10) + TString("_") + station->GetName();
756 moduleFrames[imodule] = CreateModuleFrame(moduleFrame_name, ModulesTypes[istation][imodule], module_size);
757
758 modTransforms[imodule] = new TGeoCombiTrans();
759
760 if (ModulesYRotations[istation][imodule]) {
761 modTransforms[imodule]->RotateY(180.0);
762 modTransforms[imodule]->SetDx(XModuleShifts[istation][imodule]
763 - XShiftFromCenterToLocalX0[module_size]);
764 } else {
765 modTransforms[imodule]->SetDx(XModuleShifts[istation][imodule]
766 + XShiftFromCenterToLocalX0[module_size]);
767 }
768
769 if (ModulesXRotations[istation][imodule]) {
770 modTransforms[imodule]->RotateX(180.0);
771 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
772 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
773 {
774 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule]
775 - YModuleSizeUpperPart[module_size] * 0.5);
776 } else {
777 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule] + YShiftFromCenterToAxis[module_size]
778 - YShiftFromCenterToLocalY0[module_size]);
779 }
780 } else {
781 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
782 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
783 {
784 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule]
785 + YModuleSizeUpperPart[module_size] * 0.5);
786 } else {
787 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule] + YShiftFromCenterToAxis[module_size]
788 + YShiftFromCenterToLocalY0[module_size]);
789 }
790 }
791
792 Double_t z_module_shift =
793 +ZModuleSize[module_size] * 0.5; // To z-module position is at the beginning of the sensitive volume
794 modTransforms[imodule]->SetDz(ZModuleShifts[istation][imodule] + z_module_shift);
795
796 // Rotate half-planes
797 if (imodule < NModulesInStations[istation] / 2) { // modules of upper half-plane
798 modTransforms[imodule]->SetDx(modTransforms[imodule]->GetTranslation()[0] - x_shift_hp[istation]);
799 modTransforms[imodule]->SetDy(modTransforms[imodule]->GetTranslation()[1] - y_shift_hp[istation]);
800 modTransforms[imodule]->SetDz(modTransforms[imodule]->GetTranslation()[2] - z_shift_hp[istation]);
801
802 // modTransforms[imodule]->RotateY(HalfPlanesYRotations[istation][0]);
803
804 modTransforms[imodule]->SetDx(modTransforms[imodule]->GetTranslation()[0] + x_shift_hp[istation]);
805 modTransforms[imodule]->SetDy(modTransforms[imodule]->GetTranslation()[1] + y_shift_hp[istation]);
806 modTransforms[imodule]->SetDz(modTransforms[imodule]->GetTranslation()[2] + z_shift_hp[istation]);
807 } else { // modules of lower half-plane
808 modTransforms[imodule]->SetDz(ZModuleShifts[istation][imodule] + z_module_shift);
809 // modTransforms[imodule]->RotateY(HalfPlanesYRotations[istation][1]);
810 }
811
812 TGeoCombiTrans* modFrameTransform = new TGeoCombiTrans(*modTransforms[imodule]);
813
814 if (ModulesYRotations[istation][imodule] ^ ModulesXRotations[istation][imodule]) {
815 modFrameTransform->SetDz(modFrameTransform->GetTranslation()[2]
816 - (ZModuleSize[module_size] * 0.5 + ZModuleFrameSize[module_size] * 0.5));
817 } else {
818 modFrameTransform->SetDz(modFrameTransform->GetTranslation()[2]
819 + (ZModuleSize[module_size] * 0.5 + ZModuleFrameSize[module_size] * 0.5));
820 }
821
822 station->AddNode(modules[imodule], 0, modTransforms[imodule]);
823 station->AddNode(moduleFrames[imodule], 0, modFrameTransform);
824 }
825
826 // frames ---------------------------------------------------------------
827 TGeoVolume* frames;
828 if (module_size == STANDARD_MODULE)
829 frames =
830 CreateFrameForStation_StandardModule(TString("frames") += TString("_") + station->GetName(), istation);
831 if (module_size == LONG_MODULE)
832 frames = CreateFrameForStation_LongModule(TString("frames") += TString("_") + station->GetName(), istation);
833 //----------------------------------------------------------------------
834
835 TGeoCombiTrans* frames_transform =
836 new TGeoCombiTrans(TString("frames_transform") + TString("_") + station->GetName());
837
838 if (module_size == STANDARD_MODULE)
839 frames_transform->SetDz(-0.61 + 1.37);
840
841 if (module_size == LONG_MODULE)
842 frames_transform->SetDz(-0.61 + 1.57);
843
844 station->AddNode(frames, 0, frames_transform);
845
846 TGeoCombiTrans* station_transform = new TGeoCombiTrans();
847 station_transform->SetTranslation(XStationPositions[istation], YStationPositions[istation],
848 ZStationPositions[istation]);
849
850 SILICON->AddNode(station, 0, station_transform);
851 }
852
853 top->AddNode(SILICON, 0);
855
856 // --------------- Finish ----------------------------------------------
857 gGeoMan->CloseGeometry();
858 gGeoMan->CheckOverlaps(0.0001);
859 gGeoMan->PrintOverlaps();
860 gGeoMan->Test();
861
862 TFile* geoFile = new TFile(geoFileName, "RECREATE");
863 top->Write();
864 geoFile->Close();
865 top->Draw("ogl");
866}
867//------------------------------------------------------------------------------
868
870{
871
872 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
873 stationA->SetMedium(pMedAir);
874
875 return stationA;
876}
877
878TGeoVolume* CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size)
879{
880
881 // Shapes -------------------------------------------------------------------
882 // module shape
883 TGeoShape* moduleS = 0;
884
885 switch (module_type) {
886 case RIGHT_ANGLED_MODULE: {
887 moduleS = new TGeoBBox(TString("moduleS") + TString("_") + module_name, XModuleSize[module_size] * 0.5,
888 YModuleSize[module_size] * 0.5, ZModuleSize[module_size] * 0.5);
889 break;
890 }
892 moduleS = new TGeoBBox(TString("moduleS") + TString("_") + module_name, XModuleSize[module_size] * 0.5,
893 YModuleSizeUpperPart[module_size] * 0.5, ZModuleSize[module_size] * 0.5);
894 break;
895 }
896 case BEVEL_MODULE: {
897 moduleS = new TGeoXtru(2);
898 moduleS->SetName(TString("moduleS") + TString("_") + module_name);
899 Double_t x_pos[5] = {
900 +XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5,
901 +XModuleSize[module_size] * 0.5 - XBevelSize[module_size], +XModuleSize[module_size] * 0.5};
902 Double_t y_pos[5] = {+YModuleSize[module_size] * 0.5, +YModuleSize[module_size] * 0.5,
903 -YModuleSize[module_size] * 0.5, -YModuleSize[module_size] * 0.5,
904 -YModuleSize[module_size] * 0.5 + YBevelSize[module_size]};
905 ((TGeoXtru*)moduleS)->DefinePolygon(5, x_pos, y_pos);
906 ((TGeoXtru*)moduleS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
907 ((TGeoXtru*)moduleS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
908 break;
909 }
910 case BEVEL_MODULE_HALF: {
911 moduleS = new TGeoXtru(2);
912 moduleS->SetName(TString("moduleS") + TString("-") + module_name);
913 Double_t x_pos[5] = {
914 +XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5,
915 +XModuleSize[module_size] * 0.5 - XBevelSize[module_size], +XModuleSize[module_size] * 0.5};
916 Double_t y_pos[5] = {+YModuleSizeUpperPart[module_size] * 0.5, +YModuleSizeUpperPart[module_size] * 0.5,
917 -YModuleSizeUpperPart[module_size] * 0.5, -YModuleSizeUpperPart[module_size] * 0.5,
918 -YModuleSizeUpperPart[module_size] * 0.5 + YBevelSize[module_size]};
919 ((TGeoXtru*)moduleS)->DefinePolygon(5, x_pos, y_pos);
920 ((TGeoXtru*)moduleS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
921 ((TGeoXtru*)moduleS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
922 break;
923 }
924 default:
925 Error("CreateModule()", "Incorrect module type selected!!!");
926 }
927
928 // sensor zone shape (upper part of the module: rectangle zone)
929 TGeoShape* sensor_zone_upper_part_rectS = new TGeoBBox(
930 TString("sensor_zone_upper_part_rectS") + TString("_") + module_name, XSensorZoneSize[module_size] * 0.5,
931 YSensorZoneSizeUpperPart[module_size] * 0.5, ZSensorZoneSize[module_size] * 0.5);
932
933 // sensor zone shape (upper part of the module: bevel zone)
934 TGeoShape* sensor_zone_upper_part_bevelS = new TGeoXtru(2);
935 sensor_zone_upper_part_bevelS->SetName(TString("sensor_zone_upper_part_bevelS") + TString("_") + module_name);
936 // Calculate coordinates of the bottom and the top points of the inner bevel
937 {
938 // find x and y projections of the bevel border thickness
939 Double_t x_delta = XYBevelBorder[module_size] / TMath::Cos(BevelAngleRad[module_size]);
940 Double_t y_delta = XYBevelBorder[module_size] / TMath::Sin(BevelAngleRad[module_size]);
941
942 // find shifts of the sensitive zone from module borders via the equation of the straight line for the inner
943 // bevel
944 Double_t x_delta_top_BP = XLeftBorder[module_size];
945 Double_t y_delta_top_BP = TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]) * x_delta_top_BP
946 + (YBevelSize[module_size] + y_delta);
947
948 Double_t y_delta_bottom_BP = YMiddleBorderUpperPart[module_size];
949 Double_t x_delta_bottom_BP = (y_delta_bottom_BP - (YBevelSize[module_size] + y_delta))
950 / (TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]));
951 //----------------------------------------------------------------------
952
953 Double_t x_pos_sensor_zone_bevel[5] = {+XModuleSize[module_size] * 0.5 - XLeftBorder[module_size],
954 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
955 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
956 +XModuleSize[module_size] * 0.5 - x_delta_bottom_BP,
957 +XModuleSize[module_size] * 0.5 - XLeftBorder[module_size]};
958 Double_t y_pos_sensor_zone_bevel[5] = {
959 +YModuleSizeUpperPart[module_size] * 0.5 - YTopBorder[module_size],
960 +YModuleSizeUpperPart[module_size] * 0.5 - YTopBorder[module_size],
961 -YModuleSizeUpperPart[module_size] * 0.5 + YMiddleBorderUpperPart[module_size],
962 -YModuleSizeUpperPart[module_size] * 0.5 + YMiddleBorderUpperPart[module_size],
963 -YModuleSizeUpperPart[module_size] * 0.5 + y_delta_top_BP};
964
965 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefinePolygon(5, x_pos_sensor_zone_bevel, y_pos_sensor_zone_bevel);
966 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
967 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
968 }
969
970 // sensor zone shape (lower part of the module: rectangle zone)
971 TGeoShape* sensor_zone_lower_part_rectS = new TGeoBBox(
972 TString("sensor_zone_lower_part_rectS") + TString("_") + module_name, XSensorZoneSize[module_size] * 0.5,
973 YSensorZoneSizeLowerPart[module_size] * 0.5, ZSensorZoneSize[module_size] * 0.5);
974
975 // sensor zone shape (lower part of the module: bevel zone)
976 TGeoShape* sensor_zone_lower_part_bevelS = new TGeoXtru(2);
977 sensor_zone_lower_part_bevelS->SetName(TString("sensor_zone_lower_part_bevelS") + TString("_") + module_name);
978 // Calculate coordinates of the bottom and the top points of the inner bevel
979 {
980 // find x and y projections of the bevel border thickness
981 Double_t x_delta = XYBevelBorder[module_size] / TMath::Cos(BevelAngleRad[module_size]);
982 Double_t y_delta = XYBevelBorder[module_size] / TMath::Sin(BevelAngleRad[module_size]);
983
984 // find shifts of the sensitive zone from module borders via the equation of the straight line for the inner
985 // bevel
986 Double_t x_delta_top_BP = XLeftBorder[module_size];
987 Double_t y_delta_top_BP = TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]) * x_delta_top_BP
988 + (YBevelSize[module_size] + y_delta);
989
990 Double_t y_delta_bottom_BP = YBottomBorder[module_size];
991 Double_t x_delta_bottom_BP = (y_delta_bottom_BP - (YBevelSize[module_size] + y_delta))
992 / (TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]));
993 //----------------------------------------------------------------------
994
995 Double_t x_pos_sensor_zone_bevel[5] = {+XModuleSize[module_size] * 0.5 - XLeftBorder[module_size],
996 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
997 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
998 +XModuleSize[module_size] * 0.5 - x_delta_bottom_BP,
999 +XModuleSize[module_size] * 0.5 - XLeftBorder[module_size]};
1000 Double_t y_pos_sensor_zone_bevel[5] = {
1001 +YModuleSizeLowerPart[module_size] * 0.5 - YMiddleBorderLowerPart[module_size],
1002 +YModuleSizeLowerPart[module_size] * 0.5 - YMiddleBorderLowerPart[module_size],
1003 -YModuleSizeLowerPart[module_size] * 0.5 + YBottomBorder[module_size],
1004 -YModuleSizeLowerPart[module_size] * 0.5 + YBottomBorder[module_size],
1005 -YModuleSizeLowerPart[module_size] * 0.5 + y_delta_top_BP};
1006
1007 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefinePolygon(5, x_pos_sensor_zone_bevel, y_pos_sensor_zone_bevel);
1008 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
1009 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
1010 }
1011
1012 //--------------------------------------------------------------------------
1013
1014 // Volumes ------------------------------------------------------------------
1015
1016 TGeoVolume* moduleV = new TGeoVolume(module_name, moduleS);
1017
1018 // sensor zone volume (upper part of the module)
1019 TGeoVolume* sensor_zone_upper_part_rectV = new TGeoVolume(
1020 TString("Sensor_zone_upper_part_rectV") + TString("_") + module_name, sensor_zone_upper_part_rectS);
1021
1022 // sensor zone volume (lower part of the module)
1023 TGeoVolume* sensor_zone_upper_part_bevelV = new TGeoVolume(
1024 TString("Sensor_zone_upper_part_bevelV") + TString("_") + module_name, sensor_zone_upper_part_bevelS);
1025
1026 // sensor zone volume (lower part of the module: rectangle zone)
1027 TGeoVolume* sensor_zone_lower_part_rectV = new TGeoVolume(
1028 TString("Sensor_zone_lower_part_rectV") + TString("_") + module_name, sensor_zone_lower_part_rectS);
1029
1030 // sensor zone volume (lower part of the module: bevel zone)
1031 TGeoVolume* sensor_zone_lower_part_bevelV = new TGeoVolume(
1032 TString("Sensor_zone_lower_part_bevelV") + TString("_") + module_name, sensor_zone_lower_part_bevelS);
1033
1034 // volumes media
1035 TGeoMedium* silicon_medium = pMedSilicon;
1036 if (silicon_medium) {
1037 moduleV->SetMedium(silicon_medium);
1038 sensor_zone_upper_part_rectV->SetMedium(silicon_medium);
1039 sensor_zone_upper_part_bevelV->SetMedium(silicon_medium);
1040 sensor_zone_lower_part_rectV->SetMedium(silicon_medium);
1041 sensor_zone_lower_part_bevelV->SetMedium(silicon_medium);
1042 } else
1043 Fatal("Main", "Invalid medium for modules and sensor zones!");
1044
1045 // volumes visual property (transparency)
1046 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
1047 sensor_zone_upper_part_rectV->SetLineColor(TColor::GetColor("#e0b0ff"));
1048 sensor_zone_upper_part_bevelV->SetLineColor(TColor::GetColor("#e0b0ff"));
1049 sensor_zone_lower_part_rectV->SetLineColor(TColor::GetColor("#e0b0ff"));
1050 sensor_zone_lower_part_bevelV->SetLineColor(TColor::GetColor("#e0b0ff"));
1051 moduleV->SetTransparency(50);
1052
1053 switch (module_type) {
1054
1055 case RIGHT_ANGLED_MODULE: {
1056
1057 // position of the sensor zone in the upper part of the module
1058 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
1059 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
1060 - XLeftBorder[module_size]);
1061 sensor_zone_upper_part_pos->SetDy(
1062 +YSensorZoneSizeUpperPart[module_size] * 0.5 + YGapBetweenPartsOfModule[module_size] * 0.5
1063 + YMiddleBorderUpperPart[module_size] - YShiftFromCenterToAxis[module_size]);
1064 sensor_zone_upper_part_pos->SetDz(0.0);
1065
1066 // position of the sensor zone in the lower part of the module
1067 TGeoTranslation* sensor_zone_lower_part_pos = new TGeoTranslation();
1068 sensor_zone_lower_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
1069 - XLeftBorder[module_size]);
1070 sensor_zone_lower_part_pos->SetDy(
1071 -YSensorZoneSizeLowerPart[module_size] * 0.5 - YGapBetweenPartsOfModule[module_size] * 0.5
1072 - YMiddleBorderLowerPart[module_size] - YShiftFromCenterToAxis[module_size]);
1073 sensor_zone_lower_part_pos->SetDz(0.0);
1074
1075 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
1076 moduleV->AddNode(sensor_zone_lower_part_rectV, 0, sensor_zone_lower_part_pos);
1077 break;
1078 }
1079
1081 // position of the sensor zone in the upper part of the module
1082 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
1083 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
1084 - XLeftBorder[module_size]);
1085 sensor_zone_upper_part_pos->SetDy(+(YTopBorder[module_size] + YMiddleBorderUpperPart[module_size]) * 0.5
1086 - YTopBorder[module_size]);
1087 sensor_zone_upper_part_pos->SetDz(0.0);
1088
1089 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
1090 break;
1091 }
1092
1093 case BEVEL_MODULE: {
1094
1095 // position of the sensor zone in the upper part of the module
1096 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
1097 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
1098 - XLeftBorder[module_size]);
1099 sensor_zone_upper_part_pos->SetDy(
1100 +YSensorZoneSizeUpperPart[module_size] * 0.5 + YGapBetweenPartsOfModule[module_size] * 0.5
1101 + YMiddleBorderUpperPart[module_size] - YShiftFromCenterToAxis[module_size]);
1102 sensor_zone_upper_part_pos->SetDz(0.0);
1103
1104 // position of the sensor zone in the lower part of the module
1105 TGeoTranslation* sensor_zone_lower_part_bevel_pos = new TGeoTranslation();
1106 sensor_zone_lower_part_bevel_pos->SetDx(0.0);
1107 sensor_zone_lower_part_bevel_pos->SetDy(-YModuleSizeLowerPart[module_size] * 0.5
1108 - YGapBetweenPartsOfModule[module_size] * 0.5
1109 - YShiftFromCenterToAxis[module_size]);
1110 sensor_zone_lower_part_bevel_pos->SetDz(0.0);
1111
1112 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
1113 moduleV->AddNode(sensor_zone_lower_part_bevelV, 0, sensor_zone_lower_part_bevel_pos);
1114 break;
1115 }
1116
1117 case BEVEL_MODULE_HALF: {
1118
1119 // position of the sensor zone in the upper part of the module
1120 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
1121 sensor_zone_upper_part_pos->SetDx(0);
1122 sensor_zone_upper_part_pos->SetDy(0);
1123 sensor_zone_upper_part_pos->SetDz(0.0);
1124
1125 moduleV->AddNode(sensor_zone_upper_part_bevelV, 0, sensor_zone_upper_part_pos);
1126 break;
1127 }
1128
1129 default:
1130 Error("CreateModule()", "Incorrect module type selected!!!");
1131 }
1132
1133 return moduleV;
1134}
1135//------------------------------------------------------------------------------
1136
1137TGeoVolume* CreateModuleFrame(TString module_name, ModuleType module_type, ModuleSize module_size)
1138{
1139
1140 // Shapes -------------------------------------------------------------------
1141 // module shape
1142 TGeoShape* frameS = 0;
1143
1144 // frame margins for a basic si-module
1145 Double_t leftMargin = 0.1; // cm
1146 Double_t rightMargin = 0.4; // cm
1147 Double_t bottomMargin = 0.1; // cm
1148 Double_t topMargin = 5.0; // cm
1149
1150 switch (module_type) {
1151 case RIGHT_ANGLED_MODULE: {
1152 // frameS = new TGeoBBox("frameS", XModuleSize*0.5, YModuleSize*0.5, ZModuleFrameSize*0.5);
1153 frameS = new TGeoXtru(2);
1154 frameS->SetName(TString("frameS") += module_name);
1155 Double_t x_pos[12] = {
1156 +(XModuleSize[module_size] * 0.5 + leftMargin) /*0*/,
1157 +(XModuleSize[module_size] * 0.5 + leftMargin) /*1*/,
1158 +(XModuleSize[module_size] * 0.5 + leftMargin + 1.0) /*2*/,
1159 +(XModuleSize[module_size] * 0.5 + leftMargin + 1.0) /*3*/,
1160 +(XModuleSize[module_size] * 0.5 + leftMargin) /*4*/,
1161 +(XModuleSize[module_size] * 0.5 + leftMargin) /*5*/,
1162 -(XModuleSize[module_size] * 0.5 + rightMargin) /*6*/,
1163 -(XModuleSize[module_size] * 0.5 + rightMargin) /*7*/,
1164 -(XModuleSize[module_size] * 0.5 + rightMargin + 1.0) /*8*/,
1165 -(XModuleSize[module_size] * 0.5 + rightMargin + 1.0) /*9*/,
1166 -(XModuleSize[module_size] * 0.5 + rightMargin) /*10*/,
1167 -(XModuleSize[module_size] * 0.5 + rightMargin) /*11*/,
1168 };
1169 Double_t y_pos[12] = {
1170 -(YModuleSize[module_size] * 0.5 + bottomMargin) /*0*/,
1171 +(YModuleSize[module_size] * 0.5 - 1.6) /*1*/,
1172 +(YModuleSize[module_size] * 0.5 - 0.5) /*2*/,
1173 +(YModuleSize[module_size] * 0.5 + 5.0) /*3*/,
1174 +(YModuleSize[module_size] * 0.5 + 5.0) /*4*/,
1175 +(YModuleSize[module_size] * 0.5 + 9.0) /*5*/,
1176 +(YModuleSize[module_size] * 0.5 + 9.0) /*6*/,
1177 +(YModuleSize[module_size] * 0.5 + 5.0) /*7*/,
1178 +(YModuleSize[module_size] * 0.5 + 5.0) /*8*/,
1179 +(YModuleSize[module_size] * 0.5 - 0.5) /*9*/,
1180 +(YModuleSize[module_size] * 0.5 - 1.6) /*10*/,
1181 -(YModuleSize[module_size] * 0.5 + bottomMargin) /*11*/,
1182 };
1183 ((TGeoXtru*)frameS)->DefinePolygon(12, x_pos, y_pos);
1184 ((TGeoXtru*)frameS)->DefineSection(0, -ZModuleFrameSize[module_size] * 0.5);
1185 ((TGeoXtru*)frameS)->DefineSection(1, +ZModuleFrameSize[module_size] * 0.5);
1186 break;
1187 }
1189 // frameS = new TGeoBBox("frameS", XModuleSize*0.5, YModuleSizeUpperPart*0.5, ZModuleFrameSize*0.5);
1190 frameS = new TGeoXtru(2);
1191 frameS->SetName(TString("frameS") += module_name);
1192 Double_t x_pos[12] = {
1193 +(XModuleSize[module_size] * 0.5 + leftMargin) /*0*/,
1194 +(XModuleSize[module_size] * 0.5 + leftMargin) /*1*/,
1195 +(XModuleSize[module_size] * 0.5 + leftMargin + 1.0) /*2*/,
1196 +(XModuleSize[module_size] * 0.5 + leftMargin + 1.0) /*3*/,
1197 +(XModuleSize[module_size] * 0.5 + leftMargin) /*4*/,
1198 +(XModuleSize[module_size] * 0.5 + leftMargin) /*5*/,
1199 -(XModuleSize[module_size] * 0.5 + rightMargin) /*6*/,
1200 -(XModuleSize[module_size] * 0.5 + rightMargin) /*7*/,
1201 -(XModuleSize[module_size] * 0.5 + rightMargin + 1.0) /*8*/,
1202 -(XModuleSize[module_size] * 0.5 + rightMargin + 1.0) /*9*/,
1203 -(XModuleSize[module_size] * 0.5 + rightMargin) /*10*/,
1204 -(XModuleSize[module_size] * 0.5 + rightMargin) /*11*/,
1205 };
1206 Double_t y_pos[12] = {
1207 -(YModuleSizeUpperPart[module_size] * 0.5 + bottomMargin) /*0*/,
1208 +(YModuleSizeUpperPart[module_size] * 0.5 - 1.6) /*1*/,
1209 +(YModuleSizeUpperPart[module_size] * 0.5 - 0.5) /*2*/,
1210 +(YModuleSizeUpperPart[module_size] * 0.5 + 5.0) /*3*/,
1211 +(YModuleSizeUpperPart[module_size] * 0.5 + 5.0) /*4*/,
1212 +(YModuleSizeUpperPart[module_size] * 0.5 + 9.0) /*5*/,
1213 +(YModuleSizeUpperPart[module_size] * 0.5 + 9.0) /*6*/,
1214 +(YModuleSizeUpperPart[module_size] * 0.5 + 5.0) /*7*/,
1215 +(YModuleSizeUpperPart[module_size] * 0.5 + 5.0) /*8*/,
1216 +(YModuleSizeUpperPart[module_size] * 0.5 - 0.5) /*9*/,
1217 +(YModuleSizeUpperPart[module_size] * 0.5 - 1.6) /*10*/,
1218 -(YModuleSizeUpperPart[module_size] * 0.5 + bottomMargin) /*11*/,
1219 };
1220 ((TGeoXtru*)frameS)->DefinePolygon(12, x_pos, y_pos);
1221 ((TGeoXtru*)frameS)->DefineSection(0, -ZModuleFrameSize[module_size] * 0.5);
1222 ((TGeoXtru*)frameS)->DefineSection(1, +ZModuleFrameSize[module_size] * 0.5);
1223 break;
1224 }
1225 case BEVEL_MODULE: {
1226 frameS = new TGeoXtru(2);
1227 frameS->SetName(TString("frameS") += module_name);
1228 Double_t x_pos[13] = {
1229 +(XModuleSize[module_size] * 0.5 - XBevelSize[module_size] + leftMargin) /*0*/,
1230 +(XModuleSize[module_size] * 0.5 + leftMargin) /*1*/,
1231 +(XModuleSize[module_size] * 0.5 + leftMargin) /*2*/,
1232 +(XModuleSize[module_size] * 0.5 + leftMargin + 1.0) /*3*/,
1233 +(XModuleSize[module_size] * 0.5 + leftMargin + 1.0) /*4*/,
1234 +(XModuleSize[module_size] * 0.5 + leftMargin) /*5*/,
1235 +(XModuleSize[module_size] * 0.5 + leftMargin) /*6*/,
1236 -(XModuleSize[module_size] * 0.5 + rightMargin) /*7*/,
1237 -(XModuleSize[module_size] * 0.5 + rightMargin) /*8*/,
1238 -(XModuleSize[module_size] * 0.5 + rightMargin + 1.0) /*9*/,
1239 -(XModuleSize[module_size] * 0.5 + rightMargin + 1.0) /*10*/,
1240 -(XModuleSize[module_size] * 0.5 + rightMargin) /*11*/,
1241 -(XModuleSize[module_size] * 0.5 + rightMargin) /*12*/,
1242 };
1243 Double_t y_pos[13] = {
1244 -(YModuleSize[module_size] * 0.5 + bottomMargin) /*0*/,
1245 -(YModuleSize[module_size] * 0.5 - YBevelSize[module_size] + bottomMargin) /*1*/,
1246 +(YModuleSize[module_size] * 0.5 - 1.6) /*2*/,
1247 +(YModuleSize[module_size] * 0.5 - 0.5) /*3*/,
1248 +(YModuleSize[module_size] * 0.5 + 5.0) /*4*/,
1249 +(YModuleSize[module_size] * 0.5 + 5.0) /*5*/,
1250 +(YModuleSize[module_size] * 0.5 + 9.0) /*6*/,
1251 +(YModuleSize[module_size] * 0.5 + 9.0) /*7*/,
1252 +(YModuleSize[module_size] * 0.5 + 5.0) /*8*/,
1253 +(YModuleSize[module_size] * 0.5 + 5.0) /*9*/,
1254 +(YModuleSize[module_size] * 0.5 - 0.5) /*10*/,
1255 +(YModuleSize[module_size] * 0.5 - 1.6) /*11*/,
1256 -(YModuleSize[module_size] * 0.5 + bottomMargin) /*12*/,
1257 };
1258 ((TGeoXtru*)frameS)->DefinePolygon(13, x_pos, y_pos);
1259 ((TGeoXtru*)frameS)->DefineSection(0, -ZModuleFrameSize[module_size] * 0.5);
1260 ((TGeoXtru*)frameS)->DefineSection(1, +ZModuleFrameSize[module_size] * 0.5);
1261 break;
1262 }
1263 case BEVEL_MODULE_HALF: {
1264 frameS = new TGeoXtru(2);
1265 frameS->SetName(TString("frameS") += module_name);
1266 Double_t x_pos[13] = {
1267 +(XModuleSize[module_size] * 0.5 - XBevelSize[module_size] + leftMargin) /*0*/,
1268 +(XModuleSize[module_size] * 0.5 + leftMargin) /*1*/,
1269 +(XModuleSize[module_size] * 0.5 + leftMargin) /*2*/,
1270 +(XModuleSize[module_size] * 0.5 + leftMargin + 1.0) /*3*/,
1271 +(XModuleSize[module_size] * 0.5 + leftMargin + 1.0) /*4*/,
1272 +(XModuleSize[module_size] * 0.5 + leftMargin) /*5*/,
1273 +(XModuleSize[module_size] * 0.5 + leftMargin) /*6*/,
1274 -(XModuleSize[module_size] * 0.5 + rightMargin) /*7*/,
1275 -(XModuleSize[module_size] * 0.5 + rightMargin) /*8*/,
1276 -(XModuleSize[module_size] * 0.5 + rightMargin + 1.0) /*9*/,
1277 -(XModuleSize[module_size] * 0.5 + rightMargin + 1.0) /*10*/,
1278 -(XModuleSize[module_size] * 0.5 + rightMargin) /*11*/,
1279 -(XModuleSize[module_size] * 0.5 + rightMargin) /*12*/,
1280 };
1281 Double_t y_pos[13] = {
1282 -(YModuleSizeUpperPart[module_size] * 0.5 + bottomMargin) /*0*/,
1283 -(YModuleSizeUpperPart[module_size] * 0.5 - YBevelSize[module_size] + bottomMargin) /*1*/,
1284 +(YModuleSizeUpperPart[module_size] * 0.5 - 1.6) /*2*/,
1285 +(YModuleSizeUpperPart[module_size] * 0.5 - 0.5) /*3*/,
1286 +(YModuleSizeUpperPart[module_size] * 0.5 + 5.0) /*4*/,
1287 +(YModuleSizeUpperPart[module_size] * 0.5 + 5.0) /*5*/,
1288 +(YModuleSizeUpperPart[module_size] * 0.5 + 9.0) /*6*/,
1289 +(YModuleSizeUpperPart[module_size] * 0.5 + 9.0) /*7*/,
1290 +(YModuleSizeUpperPart[module_size] * 0.5 + 5.0) /*8*/,
1291 +(YModuleSizeUpperPart[module_size] * 0.5 + 5.0) /*9*/,
1292 +(YModuleSizeUpperPart[module_size] * 0.5 - 0.5) /*10*/,
1293 +(YModuleSizeUpperPart[module_size] * 0.5 - 1.6) /*11*/,
1294 -(YModuleSizeUpperPart[module_size] * 0.5 + bottomMargin) /*12*/,
1295 };
1296 ((TGeoXtru*)frameS)->DefinePolygon(13, x_pos, y_pos);
1297 ((TGeoXtru*)frameS)->DefineSection(0, -ZModuleFrameSize[module_size] * 0.5);
1298 ((TGeoXtru*)frameS)->DefineSection(1, +ZModuleFrameSize[module_size] * 0.5);
1299 break;
1300 }
1301 default:
1302 Error("CreateModule()", "Incorrect module type selected!!!");
1303 }
1304
1305 Double_t innerMargin = 0.5; // cm, frame inner margin from edge of sens.
1306
1307 // rectangle window of the frame
1308 TGeoShape* window_rectS = new TGeoBBox(
1309 TString("window_rectS") += module_name, (XModuleSize[module_size] - innerMargin * 2) * 0.5,
1310 (YModuleSize[module_size] * 0.5 - innerMargin * 2) * 0.5, (ZModuleFrameSize[module_size] + 0.001) * 0.5);
1311
1312 // bevel window of the frame
1313 TGeoShape* window_bevelS = new TGeoXtru(2);
1314 window_bevelS->SetName(TString("window_bevelS") += module_name);
1315 // Calculate coordinates of the bottom and the top points of the inner bevel
1316 {
1317 // find x and y projections of the bevel border thickness
1318 Double_t x_delta = innerMargin / TMath::Cos(BevelAngleRad[module_size]);
1319 Double_t y_delta = innerMargin / TMath::Sin(BevelAngleRad[module_size]);
1320
1321 // find shifts of the sensitive zone from module borders via the equation of the straight line for the inner
1322 // bevel
1323 Double_t x_delta_top_BP = innerMargin;
1324 Double_t y_delta_top_BP = TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]) * x_delta_top_BP
1325 + (YBevelSize[module_size] + y_delta);
1326
1327 Double_t y_delta_bottom_BP = innerMargin;
1328 Double_t x_delta_bottom_BP = (y_delta_bottom_BP - (YBevelSize[module_size] + y_delta))
1329 / (TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]));
1330 //----------------------------------------------------------------------
1331
1332 Double_t x_pos[5] = {
1333 +XModuleSize[module_size] * 0.5 - innerMargin, -XModuleSize[module_size] * 0.5 + innerMargin,
1334 -XModuleSize[module_size] * 0.5 + innerMargin, +XModuleSize[module_size] * 0.5 - x_delta_bottom_BP,
1335 +XModuleSize[module_size] * 0.5 - innerMargin};
1336 Double_t y_pos[5] = {
1337 +YModuleSize[module_size] * 0.25 - innerMargin, +YModuleSize[module_size] * 0.25 - innerMargin,
1338 -YModuleSize[module_size] * 0.25 + innerMargin, -YModuleSize[module_size] * 0.25 + innerMargin,
1339 -YModuleSize[module_size] * 0.25 + y_delta_top_BP};
1340
1341 ((TGeoXtru*)window_bevelS)->DefinePolygon(5, x_pos, y_pos);
1342 ((TGeoXtru*)window_bevelS)->DefineSection(0, -(ZModuleFrameSize[module_size] + 0.001) * 0.5);
1343 ((TGeoXtru*)window_bevelS)->DefineSection(1, +(ZModuleFrameSize[module_size] + 0.001) * 0.5);
1344 }
1345
1346 // translations
1347 TGeoTranslation* upper_window_frame_pos = new TGeoTranslation();
1348 upper_window_frame_pos->SetName(TString("upper_window_frame_pos") + module_name);
1349 upper_window_frame_pos->SetDx(0.0);
1350 upper_window_frame_pos->SetDy(+YSensorZoneSizeUpperPart[module_size] * 0.5
1351 + YGapBetweenPartsOfModule[module_size] * 0.5 + YMiddleBorderUpperPart[module_size]
1352 - YShiftFromCenterToAxis[module_size]);
1353 upper_window_frame_pos->SetDz(0.0);
1354 upper_window_frame_pos->RegisterYourself();
1355
1356 TGeoTranslation* lower_window_frame_pos = new TGeoTranslation();
1357 lower_window_frame_pos->SetName(TString("lower_window_frame_pos") + module_name);
1358 lower_window_frame_pos->SetDx(0.0);
1359 lower_window_frame_pos->SetDy(-YSensorZoneSizeLowerPart[module_size] * 0.5
1360 - YGapBetweenPartsOfModule[module_size] * 0.5 - YMiddleBorderLowerPart[module_size]
1361 - YShiftFromCenterToAxis[module_size]);
1362 lower_window_frame_pos->SetDz(0.0);
1363 lower_window_frame_pos->RegisterYourself();
1364
1365 TGeoTranslation* window_half_frame_pos = new TGeoTranslation();
1366 window_half_frame_pos->SetName(TString("window_half_frame_pos") + module_name);
1367 window_half_frame_pos->SetDx(0.0);
1368 window_half_frame_pos->SetDy(0.0);
1369 window_half_frame_pos->SetDz(0.0);
1370 window_half_frame_pos->RegisterYourself();
1371
1372 TGeoCompositeShape* frame_with_windowsS = new TGeoCompositeShape();
1373 frame_with_windowsS->SetName(TString("frame_with_windowsS") + module_name);
1374
1375 switch (module_type) {
1376
1377 case RIGHT_ANGLED_MODULE: {
1378 TString expression = "(frameS";
1379 expression += module_name;
1380 expression += "-window_rectS";
1381 expression += module_name;
1382 expression += ":upper_window_frame_pos";
1383 expression += module_name;
1384 expression += ")-window_rectS";
1385 expression += module_name;
1386 expression += ":lower_window_frame_pos";
1387 expression += module_name;
1388 frame_with_windowsS->MakeNode(expression);
1389 frame_with_windowsS->ComputeBBox();
1390 break;
1391 }
1392
1394 TString expression = "(frameS";
1395 expression += module_name;
1396 expression += ")-window_rectS";
1397 expression += module_name;
1398 expression += ":window_half_frame_pos";
1399 expression += module_name;
1400 frame_with_windowsS->MakeNode(expression);
1401 frame_with_windowsS->ComputeBBox();
1402 break;
1403 }
1404
1405 case BEVEL_MODULE: {
1406 TString expression = "(frameS";
1407 expression += module_name;
1408 expression += "-window_rectS";
1409 expression += module_name;
1410 expression += ":upper_window_frame_pos";
1411 expression += module_name;
1412 expression += ")-window_bevelS";
1413 expression += module_name;
1414 expression += ":lower_window_frame_pos";
1415 expression += module_name;
1416 frame_with_windowsS->MakeNode(expression);
1417 frame_with_windowsS->ComputeBBox();
1418 break;
1419 }
1420
1421 case BEVEL_MODULE_HALF: {
1422 TString expression = "(frameS";
1423 expression += module_name;
1424 expression += ")-window_bevelS";
1425 expression += module_name;
1426 expression += ":window_half_frame_pos";
1427 expression += module_name;
1428 frame_with_windowsS->MakeNode(expression);
1429 frame_with_windowsS->ComputeBBox();
1430 break;
1431 }
1432
1433 default:
1434 Error("CreateModule()", "Incorrect module type selected!!!");
1435 }
1436 //--------------------------------------------------------------------------
1437
1438 // Volumes ------------------------------------------------------------------
1439 // module frame volume
1440 TGeoVolume* frameV = new TGeoVolume(module_name, frame_with_windowsS);
1441
1442 // volumes media
1443 TGeoMedium* carbon_medium = pMedCarbon;
1444 if (carbon_medium) {
1445 frameV->SetMedium(carbon_medium);
1446 } else
1447 Fatal("Main", "Invalid medium for frameV!");
1448
1449 // volumes visual property (transparency)
1450 frameV->SetLineColor(TColor::GetColor("#cccccc"));
1451 frameV->SetTransparency(0);
1452
1453 return frameV;
1454}
1455//------------------------------------------------------------------------------
1456
1458{
1459 // distance between ref. points of half-planes
1460 Double_t z_ref_dist = z_shift_hp[current_station_num];
1461
1462 // calculate dist. between central z-poses of half-planes via z_ref_dist
1463 // all values are taken from the drawings
1464 // 1.37 cm = distance from basic surface to module surface
1465 // 0.61 cm = distance from basic surface to ref. point of lower h. plane
1466 // 2.68 cm = distance from basic surface to ref. point of upper h. plane
1467 Double_t half_dist_mods = 0.695; // half distance between modules
1468 Double_t half_plane_shift = z_ref_dist - ((1.37 + half_dist_mods) - 0.61) + (2.68 - (1.37 + half_dist_mods));
1469
1470 cout << "standart: z_ref_dist = " << z_ref_dist << "\n";
1471 cout << "standart: half_plane_shift = " << half_plane_shift << "\n";
1472
1473 // ONE SENSOR MODULE -------------------------------------------------------
1474 Double_t cut_from_height = 0;
1475 if (current_station_num == 0)
1476 cut_from_height = 6.0; // for signle modules of 63x63 mm^2
1477 //--------------------------------------------------------------------------
1478
1479 TGeoVolume* frames = new TGeoVolumeAssembly(frame_name);
1480 frames->SetMedium(pMedAir);
1481
1482 Int_t NModules = NModulesInStations[current_station_num];
1483
1484 // face shield ----------------------------------------------------------
1485 Double_t faceShield_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 8.6; // cm
1486 Double_t faceShield_YSize = 14.74 - cut_from_height; // cm
1487 Double_t faceShield_ZSize = 0.3; // cm
1488
1489 TGeoShape* faceShieldS = new TGeoXtru(2);
1490 faceShieldS->SetName(TString("faceShieldS") + TString("_") + frames->GetName());
1491
1492 {
1493 Double_t x_pos[8] = {faceShield_XSize * 0.5,
1494 faceShield_XSize * 0.5,
1495 -faceShield_XSize * 0.5,
1496 -faceShield_XSize * 0.5,
1497 -2.75,
1498 -2.3,
1499 2.3,
1500 2.75};
1501 Double_t y_pos[8] = {-faceShield_YSize * 0.5, faceShield_YSize * 0.5, faceShield_YSize * 0.5,
1502 -faceShield_YSize * 0.5, -faceShield_YSize * 0.5, -3.8 + cut_from_height * 0.5,
1503 -3.8 + cut_from_height * 0.5, -faceShield_YSize * 0.5};
1504 ((TGeoXtru*)faceShieldS)->DefinePolygon(8, x_pos, y_pos);
1505 ((TGeoXtru*)faceShieldS)->DefineSection(0, -faceShield_ZSize * 0.5);
1506 ((TGeoXtru*)faceShieldS)->DefineSection(1, +faceShield_ZSize * 0.5);
1507 }
1508
1509 TGeoVolume* faceShieldV = new TGeoVolume(TString("faceShieldV") + TString("_") + frames->GetName(), faceShieldS);
1510
1511 // volume medium
1512 TGeoMedium* faceShieldV_medium = pMedPolystyrene;
1513 if (faceShieldV_medium) {
1514 faceShieldV->SetMedium(faceShieldV_medium);
1515 } else
1516 Fatal("Main", "Invalid medium for faceShieldV!");
1517
1518 // volume visual property (transparency)
1519 faceShieldV->SetLineColor(TColor::GetColor("#ccffcc"));
1520 faceShieldV->SetTransparency(50);
1521
1522 TGeoCombiTrans* faceShield_transf[4];
1523
1524 faceShield_transf[0] = new TGeoCombiTrans();
1525 faceShield_transf[0]->SetDy(+faceShield_YSize * 0.5 - 0.95);
1526 faceShield_transf[0]->SetDz(+half_dist_mods - 1.35 /*half-thick of frame box*/
1527 - faceShield_ZSize * 0.5 /*face shield shift*/ + half_plane_shift);
1528
1529 faceShield_transf[1] = new TGeoCombiTrans();
1530 faceShield_transf[1]->SetDy(+faceShield_YSize * 0.5 - 0.95);
1531 faceShield_transf[1]->SetDz(+half_dist_mods + 1.35 /*half-thick of frame box*/
1532 + faceShield_ZSize * 0.5 /*face shield shift*/ + half_plane_shift);
1533
1534 faceShield_transf[2] = new TGeoCombiTrans();
1535 faceShield_transf[2]->RotateX(180.0);
1536 faceShield_transf[2]->SetDy(-faceShield_YSize * 0.5 + 0.95);
1537 faceShield_transf[2]->SetDz(+half_dist_mods - 1.35 /*half-thick of frame box*/
1538 - faceShield_ZSize * 0.5 /*face shield shift*/);
1539
1540 faceShield_transf[3] = new TGeoCombiTrans();
1541 faceShield_transf[3]->RotateX(180.0);
1542 faceShield_transf[3]->SetDy(-faceShield_YSize * 0.5 + 0.95);
1543 faceShield_transf[3]->SetDz(+half_dist_mods + 1.35 /*half-thick of frame box*/
1544 + faceShield_ZSize * 0.5 /*face shield shift*/);
1545
1546 frames->AddNode(faceShieldV, 0, faceShield_transf[0]);
1547 frames->AddNode(faceShieldV, 1, faceShield_transf[1]);
1548 frames->AddNode(faceShieldV, 2, faceShield_transf[2]);
1549 frames->AddNode(faceShieldV, 3, faceShield_transf[3]);
1550 //----------------------------------------------------------------------
1551
1552 // sidewall of shield ---------------------------------------------------
1553 Double_t sideShield_XSize = 0.95; // cm
1554 Double_t sideShield_YSize = 15.2 - cut_from_height; // cm
1555 Double_t sideShield_ZSize = 2.7; // cm
1556
1557 TGeoShape* sideShieldS = new TGeoBBox(TString("sideShieldS") + TString("_") + frames->GetName(),
1558 sideShield_XSize * 0.5, sideShield_YSize * 0.5, sideShield_ZSize * 0.5);
1559
1560 TGeoVolume* sideShieldV = new TGeoVolume(TString("sideShieldV") + TString("_") + frames->GetName(), sideShieldS);
1561
1562 // volume medium
1563 TGeoMedium* sideShieldV_medium = pMedAluminium;
1564 if (sideShieldV_medium) {
1565 sideShieldV->SetMedium(sideShieldV_medium);
1566 } else
1567 Fatal("Main", "Invalid medium for sideShieldV!");
1568
1569 // volume visual property (transparency)
1570 sideShieldV->SetLineColor(TColor::GetColor("#ffcccc"));
1571 sideShieldV->SetTransparency(50);
1572
1573 TGeoCombiTrans* sideShield_transf[4];
1574
1575 sideShield_transf[0] = new TGeoCombiTrans();
1576 sideShield_transf[0]->SetDx(+(faceShield_XSize * 0.5 - sideShield_XSize * 0.5));
1577 sideShield_transf[0]->SetDy(+faceShield_YSize * 0.5 - 0.95 + (sideShield_YSize - faceShield_YSize) * 0.5);
1578 sideShield_transf[0]->SetDz(+half_dist_mods + half_plane_shift);
1579
1580 sideShield_transf[1] = new TGeoCombiTrans();
1581 sideShield_transf[1]->SetDx(-(faceShield_XSize * 0.5 - sideShield_XSize * 0.5));
1582 sideShield_transf[1]->SetDy(+faceShield_YSize * 0.5 - 0.95 + (sideShield_YSize - faceShield_YSize) * 0.5);
1583 sideShield_transf[1]->SetDz(+half_dist_mods + half_plane_shift);
1584
1585 sideShield_transf[2] = new TGeoCombiTrans();
1586 sideShield_transf[2]->SetDx(+(faceShield_XSize * 0.5 - sideShield_XSize * 0.5));
1587 sideShield_transf[2]->SetDy(-faceShield_YSize * 0.5 + 0.95 - (sideShield_YSize - faceShield_YSize) * 0.5);
1588 sideShield_transf[2]->SetDz(+half_dist_mods);
1589
1590 sideShield_transf[3] = new TGeoCombiTrans();
1591 sideShield_transf[3]->SetDx(-(faceShield_XSize * 0.5 - sideShield_XSize * 0.5));
1592 sideShield_transf[3]->SetDy(-faceShield_YSize * 0.5 + 0.95 - (sideShield_YSize - faceShield_YSize) * 0.5);
1593 sideShield_transf[3]->SetDz(+half_dist_mods);
1594
1595 frames->AddNode(sideShieldV, 0, sideShield_transf[0]);
1596 frames->AddNode(sideShieldV, 1, sideShield_transf[1]);
1597 frames->AddNode(sideShieldV, 2, sideShield_transf[2]);
1598 frames->AddNode(sideShieldV, 3, sideShield_transf[3]);
1599 //----------------------------------------------------------------------
1600
1601 // horizontal plane of shield -------------------------------------------
1602 Double_t horizShield_XSize = faceShield_XSize * 0.5 - sideShield_XSize - 2.75 /*half-size of hole*/; // cm
1603 Double_t horizShield_YSize = 0.3; // cm
1604 Double_t horizShield_ZSize = 2.7; // cm
1605
1606 TGeoShape* horizShieldS = new TGeoBBox(TString("horizShieldS") + TString("_") + frames->GetName(),
1607 horizShield_XSize * 0.5, horizShield_YSize * 0.5, horizShield_ZSize * 0.5);
1608
1609 TGeoVolume* horizShieldV = new TGeoVolume(TString("horizShieldV") + TString("_") + frames->GetName(), horizShieldS);
1610
1611 // volume medium
1612 TGeoMedium* horizShieldV_medium = pMedPolystyrene;
1613 if (horizShieldV_medium) {
1614 horizShieldV->SetMedium(horizShieldV_medium);
1615 } else
1616 Fatal("Main", "Invalid medium for horizShieldV!");
1617
1618 // volume visual property (transparency)
1619 horizShieldV->SetLineColor(TColor::GetColor("#ccffcc"));
1620 horizShieldV->SetTransparency(50);
1621
1622 TGeoCombiTrans* horizShield_transf[4];
1623
1624 horizShield_transf[0] = new TGeoCombiTrans();
1625 horizShield_transf[0]->SetDx(+(faceShield_XSize * 0.5 - horizShield_XSize * 0.5 - sideShield_XSize));
1626 horizShield_transf[0]->SetDy(+(-0.95 + horizShield_YSize * 0.5));
1627 horizShield_transf[0]->SetDz(+half_dist_mods + half_plane_shift);
1628
1629 horizShield_transf[1] = new TGeoCombiTrans();
1630 horizShield_transf[1]->SetDx(-(faceShield_XSize * 0.5 - horizShield_XSize * 0.5 - sideShield_XSize));
1631 horizShield_transf[1]->SetDy(+(-0.95 + horizShield_YSize * 0.5));
1632 horizShield_transf[1]->SetDz(+half_dist_mods + half_plane_shift);
1633
1634 horizShield_transf[2] = new TGeoCombiTrans();
1635 horizShield_transf[2]->SetDx(+(faceShield_XSize * 0.5 - horizShield_XSize * 0.5 - sideShield_XSize));
1636 horizShield_transf[2]->SetDy(-(-0.95 + horizShield_YSize * 0.5));
1637 horizShield_transf[2]->SetDz(+half_dist_mods);
1638
1639 horizShield_transf[3] = new TGeoCombiTrans();
1640 horizShield_transf[3]->SetDx(-(faceShield_XSize * 0.5 - horizShield_XSize * 0.5 - sideShield_XSize));
1641 horizShield_transf[3]->SetDy(-(-0.95 + horizShield_YSize * 0.5));
1642 horizShield_transf[3]->SetDz(+half_dist_mods);
1643
1644 frames->AddNode(horizShieldV, 0, horizShield_transf[0]);
1645 frames->AddNode(horizShieldV, 1, horizShield_transf[1]);
1646 frames->AddNode(horizShieldV, 2, horizShield_transf[2]);
1647 frames->AddNode(horizShieldV, 3, horizShield_transf[3]);
1648 //----------------------------------------------------------------------
1649
1650 // plank of shield ------------------------------------------------------
1651 Double_t plankShield_XSize = faceShield_XSize; // cm
1652 Double_t plankShield_YSize = 1.5; // cm
1653 Double_t plankShield_ZSize = 0.3; // cm
1654
1655 TGeoShape* plankShieldS = new TGeoBBox(TString("plankShieldS") + TString("_") + frames->GetName(),
1656 plankShield_XSize * 0.5, plankShield_YSize * 0.5, plankShield_ZSize * 0.5);
1657
1658 TGeoVolume* plankShieldV = new TGeoVolume(TString("plankShieldV") + TString("_") + frames->GetName(), plankShieldS);
1659
1660 // volume medium
1661 TGeoMedium* plankShieldV_medium = pMedAluminium;
1662 if (plankShieldV_medium) {
1663 plankShieldV->SetMedium(plankShieldV_medium);
1664 } else
1665 Fatal("Main", "Invalid medium for plankShieldV!");
1666
1667 // volume visual property (transparency)
1668 plankShieldV->SetLineColor(TColor::GetColor("#ffcccc"));
1669 plankShieldV->SetTransparency(50);
1670
1671 TGeoCombiTrans* plankShield_transf[4];
1672
1673 plankShield_transf[0] = new TGeoCombiTrans();
1674 plankShield_transf[0]->SetDx(0.0);
1675 plankShield_transf[0]->SetDy(+(-0.95 + faceShield_YSize) - 0.05);
1676 plankShield_transf[0]->SetDz(+half_dist_mods
1677 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize * 0.5)
1678 + half_plane_shift);
1679
1680 plankShield_transf[1] = new TGeoCombiTrans();
1681 plankShield_transf[1]->SetDx(0.0);
1682 plankShield_transf[1]->SetDy(+(-0.95 + faceShield_YSize) - 0.05);
1683 plankShield_transf[1]->SetDz(+half_dist_mods
1684 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize * 0.5)
1685 + half_plane_shift);
1686
1687 plankShield_transf[2] = new TGeoCombiTrans();
1688 plankShield_transf[2]->SetDx(0.0);
1689 plankShield_transf[2]->SetDy(-(-0.95 + faceShield_YSize) + 0.05);
1690 plankShield_transf[2]->SetDz(+half_dist_mods
1691 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize * 0.5));
1692
1693 plankShield_transf[3] = new TGeoCombiTrans();
1694 plankShield_transf[3]->SetDx(0.0);
1695 plankShield_transf[3]->SetDy(-(-0.95 + faceShield_YSize) + 0.05);
1696 plankShield_transf[3]->SetDz(+half_dist_mods
1697 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize * 0.5));
1698
1699 frames->AddNode(plankShieldV, 0, plankShield_transf[0]);
1700 frames->AddNode(plankShieldV, 1, plankShield_transf[1]);
1701 frames->AddNode(plankShieldV, 2, plankShield_transf[2]);
1702 frames->AddNode(plankShieldV, 3, plankShield_transf[3]);
1703 //----------------------------------------------------------------------
1704
1705 // base rail
1706 Double_t baseRailMainPart_XSize = faceShield_XSize + 3.4 * 2 /*margin*/; // cm
1707 Double_t baseRailMainPart_YSize = 5.0; // cm
1708 Double_t baseRailMainPart_ZSize = 0.7; // cm
1709
1710 Double_t baseRailUpperPart_XSize = baseRailMainPart_XSize - 9.0 /*cut*/; // cm
1711 Double_t baseRailUpperPart_YSize = 1.0; // cm
1712 Double_t baseRailUpperPart_ZSize = 0.3; // cm
1713
1714 Double_t baseRailLowerPart_XSize = baseRailMainPart_XSize - 8.8 /*cut*/; // cm
1715 Double_t baseRailLowerPart_YSize = 0.7; // cm
1716 Double_t baseRailLowerPart_ZSize = 0.3; // cm
1717
1718 TGeoShape* baseRailMainPartS =
1719 new TGeoBBox(TString("baseRailMainPartS") + TString("_") + frames->GetName(), baseRailMainPart_XSize * 0.5,
1720 baseRailMainPart_YSize * 0.5, baseRailMainPart_ZSize * 0.5);
1721 TGeoShape* baseRailUpperPartS =
1722 new TGeoBBox(TString("baseRailUpperPartS") + TString("_") + frames->GetName(), baseRailUpperPart_XSize * 0.5,
1723 baseRailUpperPart_YSize * 0.5, baseRailUpperPart_ZSize * 0.5);
1724 TGeoShape* baseRailLowerPartS =
1725 new TGeoBBox(TString("baseRailLowerPartS") + TString("_") + frames->GetName(), baseRailLowerPart_XSize * 0.5,
1726 baseRailLowerPart_YSize * 0.5, baseRailLowerPart_ZSize * 0.5);
1727
1728 TGeoTranslation* baseRailMainPart_pos = new TGeoTranslation();
1729 baseRailMainPart_pos->SetName(TString("baseRailMainPart_pos") + TString("_") + frames->GetName());
1730 baseRailMainPart_pos->SetDx(0.0);
1731 baseRailMainPart_pos->SetDy(0.0);
1732 baseRailMainPart_pos->SetDz(0.0);
1733 baseRailMainPart_pos->RegisterYourself();
1734
1735 TGeoTranslation* baseRailUpperPart_pos = new TGeoTranslation();
1736 baseRailUpperPart_pos->SetName(TString("baseRailUpperPart_pos") + TString("_") + frames->GetName());
1737 baseRailUpperPart_pos->SetDx(0.0);
1738 baseRailUpperPart_pos->SetDy(+(baseRailMainPart_YSize * 0.5 + baseRailUpperPart_YSize * 0.5));
1739 baseRailUpperPart_pos->SetDz(baseRailMainPart_ZSize * 0.5 - baseRailUpperPart_ZSize * 0.5);
1740 baseRailUpperPart_pos->RegisterYourself();
1741
1742 TGeoTranslation* baseRailLowerPart_pos = new TGeoTranslation();
1743 baseRailLowerPart_pos->SetName(TString("baseRailLowerPart_pos") + TString("_") + frames->GetName());
1744 baseRailLowerPart_pos->SetDx(0.0);
1745 baseRailLowerPart_pos->SetDy(-(baseRailMainPart_YSize * 0.5 + baseRailLowerPart_YSize * 0.5));
1746 baseRailLowerPart_pos->SetDz(baseRailMainPart_ZSize * 0.5 - baseRailLowerPart_ZSize * 0.5);
1747 baseRailLowerPart_pos->RegisterYourself();
1748
1749 TGeoCompositeShape* baseRailS = new TGeoCompositeShape();
1750 baseRailS->SetName(TString("baseRailS") + TString("_") + frames->GetName());
1751 {
1752 TString expression = "baseRailMainPartS";
1753 expression += TString("_") + frames->GetName();
1754 expression += ":baseRailMainPart_pos";
1755 expression += TString("_") + frames->GetName();
1756 expression += "+baseRailUpperPartS";
1757 expression += TString("_") + frames->GetName();
1758 expression += ":baseRailUpperPart_pos";
1759 expression += TString("_") + frames->GetName();
1760 expression += "+baseRailLowerPartS";
1761 expression += TString("_") + frames->GetName();
1762 expression += ":baseRailLowerPart_pos";
1763 expression += TString("_") + frames->GetName();
1764 baseRailS->MakeNode(expression);
1765 baseRailS->ComputeBBox(); // need to compute a bounding box
1766 }
1767
1768 TGeoVolume* baseRailV = new TGeoVolume(TString("baseRailV") + TString("_") + frames->GetName(), baseRailS);
1769
1770 // volume medium
1771 TGeoMedium* baseRailV_medium = pMedAluminium;
1772 if (baseRailV_medium) {
1773 baseRailV->SetMedium(baseRailV_medium);
1774 } else
1775 Fatal("Main", "Invalid medium for baseRailV!");
1776
1777 // volume visual property (transparency)
1778 baseRailV->SetLineColor(TColor::GetColor("#ffcccc"));
1779 baseRailV->SetTransparency(50);
1780
1781 TGeoCombiTrans* baseRail_transf[2];
1782
1783 baseRail_transf[0] = new TGeoCombiTrans();
1784 baseRail_transf[0]->RotateY(180.0);
1785 baseRail_transf[0]->SetDx(0.0);
1786 baseRail_transf[0]->SetDy(+(14.5 + baseRailMainPart_YSize * 0.5 - cut_from_height));
1787 baseRail_transf[0]->SetDz(
1788 +half_dist_mods
1789 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + baseRailMainPart_ZSize * 0.5 - baseRailLowerPart_ZSize)
1790 + half_plane_shift);
1791
1792 baseRail_transf[1] = new TGeoCombiTrans();
1793 // baseRail_transf[1]->ReflectY(true); // replaced by RotateX(180) and RotateY(180)
1794 baseRail_transf[1]->RotateX(180.0);
1795 baseRail_transf[1]->RotateY(180.0);
1796 baseRail_transf[1]->SetDx(0.0);
1797 baseRail_transf[1]->SetDy(-(14.5 + baseRailMainPart_YSize * 0.5 - cut_from_height));
1798 baseRail_transf[1]->SetDz(
1799 +half_dist_mods
1800 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + baseRailMainPart_ZSize * 0.5 - baseRailLowerPart_ZSize)
1801 - 0);
1802
1803 frames->AddNode(baseRailV, 0, baseRail_transf[0]);
1804 frames->AddNode(baseRailV, 1, baseRail_transf[1]);
1805 //----------------------------------------------------------------------
1806
1807 // back rail ------------------------------------------------------------
1808 Double_t backRailMainPart_XSize = faceShield_XSize + -0.3 * 2 /*margin*/; // cm
1809 Double_t backRailMainPart_YSize = 3.0; // cm
1810 Double_t backRailMainPart_ZSize = 0.9; // cm, average 6..12 cm
1811
1812 Double_t backRailLowerPart_XSize = backRailMainPart_XSize - 1.4; // cm
1813 Double_t backRailLowerPart_YSize = 0.7; // cm
1814 Double_t backRailLowerPart_ZSize = 0.6; // cm
1815
1816 Double_t backRailSidePart_XSize = 1.2; // cm
1817 Double_t backRailSidePart_YSize = 3.0; // cm
1818 Double_t backRailSidePart_ZSize = 1.62; // cm
1819
1820 TGeoShape* backRailMainPartS =
1821 new TGeoBBox(TString("backRailMainPartS") + TString("_") + frames->GetName(), backRailMainPart_XSize * 0.5,
1822 backRailMainPart_YSize * 0.5, backRailMainPart_ZSize * 0.5);
1823 TGeoShape* backRailLowerPartS =
1824 new TGeoBBox(TString("backRailLowerPartS") + TString("_") + frames->GetName(), backRailLowerPart_XSize * 0.5,
1825 backRailLowerPart_YSize * 0.5, backRailLowerPart_ZSize * 0.5);
1826 TGeoShape* backRailSidePartS =
1827 new TGeoBBox(TString("backRailSidePartS") + TString("_") + frames->GetName(), backRailSidePart_XSize * 0.5,
1828 backRailSidePart_YSize * 0.5, backRailSidePart_ZSize * 0.5);
1829
1830 TGeoTranslation* backRailLowerPart_pos = new TGeoTranslation();
1831 backRailLowerPart_pos->SetName(TString("backRailLowerPart_pos") + TString("_") + frames->GetName());
1832 backRailLowerPart_pos->SetDx(0.0);
1833 backRailLowerPart_pos->SetDy(-(backRailMainPart_YSize * 0.5 + backRailLowerPart_YSize * 0.5));
1834 backRailLowerPart_pos->SetDz(backRailMainPart_ZSize * 0.5 - backRailLowerPart_ZSize * 0.5);
1835 backRailLowerPart_pos->RegisterYourself();
1836
1837 TGeoTranslation* backRailSidePart1_pos = new TGeoTranslation();
1838 backRailSidePart1_pos->SetName(TString("backRailSidePart1_pos") + TString("_") + frames->GetName());
1839 backRailSidePart1_pos->SetDx(+(backRailMainPart_XSize * 0.5 - backRailSidePart_XSize * 0.5));
1840 backRailSidePart1_pos->SetDy(0.0);
1841 backRailSidePart1_pos->SetDz(backRailMainPart_ZSize * 0.5 + backRailSidePart_ZSize * 0.5);
1842 backRailSidePart1_pos->RegisterYourself();
1843
1844 TGeoTranslation* backRailSidePart2_pos = new TGeoTranslation();
1845 backRailSidePart2_pos->SetName(TString("backRailSidePart2_pos") + TString("_") + frames->GetName());
1846 backRailSidePart2_pos->SetDx(-(backRailMainPart_XSize * 0.5 - backRailSidePart_XSize * 0.5));
1847 backRailSidePart2_pos->SetDy(0.0);
1848 backRailSidePart2_pos->SetDz(backRailMainPart_ZSize * 0.5 + backRailSidePart_ZSize * 0.5);
1849 backRailSidePart2_pos->RegisterYourself();
1850
1851 TGeoCompositeShape* backRailS = new TGeoCompositeShape();
1852 backRailS->SetName(TString("backRailS") + TString("_") + frames->GetName());
1853 {
1854 TString expression = "backRailMainPartS";
1855 expression += TString("_") + frames->GetName();
1856 expression += "+backRailLowerPartS";
1857 expression += TString("_") + frames->GetName();
1858 expression += ":backRailLowerPart_pos";
1859 expression += TString("_") + frames->GetName();
1860 expression += "+backRailSidePartS";
1861 expression += TString("_") + frames->GetName();
1862 expression += ":backRailSidePart1_pos";
1863 expression += TString("_") + frames->GetName();
1864 expression += "+backRailSidePartS";
1865 expression += TString("_") + frames->GetName();
1866 expression += ":backRailSidePart2_pos";
1867 expression += TString("_") + frames->GetName();
1868 backRailS->MakeNode(expression);
1869 backRailS->ComputeBBox(); // need to compute a bounding box
1870 }
1871
1872 TGeoVolume* backRailV = new TGeoVolume(TString("backRailV") + TString("_") + frames->GetName(), backRailS);
1873
1874 // volume medium
1875 TGeoMedium* backRailV_medium = pMedAluminium;
1876 if (backRailV_medium) {
1877 backRailV->SetMedium(backRailV_medium);
1878 } else
1879 Fatal("Main", "Invalid medium for backRailV!");
1880
1881 // volume visual property (transparency)
1882 backRailV->SetLineColor(TColor::GetColor("#ffcccc"));
1883 backRailV->SetTransparency(50);
1884
1885 TGeoCombiTrans* backRail_transf[2];
1886
1887 backRail_transf[0] = new TGeoCombiTrans();
1888 backRail_transf[0]->SetDx(0.0);
1889 backRail_transf[0]->SetDy(+(14.5 + backRailMainPart_YSize * 0.5 - cut_from_height));
1890 backRail_transf[0]->SetDz(+half_dist_mods
1891 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize
1892 + (backRailMainPart_ZSize * 0.5 - backRailLowerPart_ZSize))
1893 + half_plane_shift);
1894
1895 backRail_transf[1] = new TGeoCombiTrans();
1896 backRail_transf[1]->RotateX(180.0);
1897 backRail_transf[1]->SetDx(0.0);
1898 backRail_transf[1]->SetDy(-(14.5 + backRailMainPart_YSize * 0.5 - cut_from_height));
1899 backRail_transf[1]->SetDz(+half_dist_mods
1900 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize
1901 + (backRailMainPart_ZSize * 0.5 - backRailLowerPart_ZSize)));
1902
1903 frames->AddNode(backRailV, 0, backRail_transf[0]);
1904 frames->AddNode(backRailV, 1, backRail_transf[1]);
1905 //----------------------------------------------------------------------
1906
1907 // holding back rail ----------------------------------------------------
1908 Double_t holdBackRail_XSize = backRailMainPart_XSize;
1909 Double_t holdBackRail_YSize = 1.8; // cm
1910 Double_t holdBackRail_ZSize = 1.0;
1911
1912 TGeoShape* holdBackRailS = new TGeoXtru(2);
1913 holdBackRailS->SetName(TString("holdBackRailS") + TString("_") + frames->GetName());
1914 {
1915 Double_t x_pos[5] = {
1916 +0.0 /*0*/, +0.1 /*1*/, +holdBackRail_ZSize /*2*/, +holdBackRail_ZSize /*3*/, +0.0 /*4*/
1917 };
1918 Double_t y_pos[5] = {
1919 -holdBackRail_YSize /*0*/,
1920 -holdBackRail_YSize /*1*/,
1921 -holdBackRail_YSize * 0.5 /*2*/,
1922 -0.0 /*3*/,
1923 -0.0 /*4*/,
1924 };
1925 ((TGeoXtru*)holdBackRailS)->DefinePolygon(5, x_pos, y_pos);
1926 ((TGeoXtru*)holdBackRailS)->DefineSection(0, -holdBackRail_XSize * 0.5);
1927 ((TGeoXtru*)holdBackRailS)->DefineSection(1, +holdBackRail_XSize * 0.5);
1928 }
1929
1930 TGeoVolume* holdBackRailV =
1931 new TGeoVolume(TString("holdBackRailV") + TString("_") + frames->GetName(), holdBackRailS);
1932
1933 // volume medium
1934 TGeoMedium* holdBackRailV_medium = pMedAluminium;
1935 if (holdBackRailV_medium) {
1936 holdBackRailV->SetMedium(holdBackRailV_medium);
1937 } else
1938 Fatal("Main", "Invalid medium for holdBackRailV!");
1939
1940 // volume visual property (transparency)
1941 holdBackRailV->SetLineColor(TColor::GetColor("#ffcccc"));
1942 holdBackRailV->SetTransparency(10);
1943
1944 TGeoCombiTrans* holdBackRail_transf[2];
1945
1946 holdBackRail_transf[0] = new TGeoCombiTrans();
1947 holdBackRail_transf[0]->RotateY(90.0);
1948 holdBackRail_transf[0]->SetDx(0.0);
1949 holdBackRail_transf[0]->SetDy(+(14.5 + backRailMainPart_YSize - cut_from_height));
1950 holdBackRail_transf[0]->SetDz(
1951 +half_dist_mods - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize) + half_plane_shift);
1952
1953 holdBackRail_transf[1] = new TGeoCombiTrans();
1954 holdBackRail_transf[1]->RotateY(90.0);
1955 holdBackRail_transf[1]->RotateX(180.0);
1956 holdBackRail_transf[1]->SetDx(0.0);
1957 holdBackRail_transf[1]->SetDy(-(14.5 + backRailMainPart_YSize - cut_from_height));
1958 holdBackRail_transf[1]->SetDz(+half_dist_mods
1959 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize));
1960
1961 frames->AddNode(holdBackRailV, 0, holdBackRail_transf[0]);
1962 frames->AddNode(holdBackRailV, 1, holdBackRail_transf[1]);
1963 //----------------------------------------------------------------------
1964
1965 // back plane -----------------------------------------------------------
1966 Double_t backPlane_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 3.95 * 2 /*margin*/; // cm
1967 Double_t backPlane_YSize = 13.1; // cm
1968 Double_t backPlane_ZSize = 0.15; // cm
1969
1970 TGeoShape* backPlaneS = new TGeoBBox(TString("backPlaneS") + TString("_") + frames->GetName(),
1971 backPlane_XSize * 0.5, backPlane_YSize * 0.5, backPlane_ZSize * 0.5);
1972
1973 TGeoVolume* backPlaneV = new TGeoVolume(TString("backPlaneV") + TString("_") + frames->GetName(), backPlaneS);
1974
1975 // volume medium
1976 TGeoMedium* backPlaneV_medium = pMedAluminium;
1977 if (backPlaneV_medium) {
1978 backPlaneV->SetMedium(backPlaneV_medium);
1979 } else
1980 Fatal("Main", "Invalid medium for backPlaneV!");
1981
1982 // volume visual property (transparency)
1983 backPlaneV->SetLineColor(TColor::GetColor("#ffcccc"));
1984 backPlaneV->SetTransparency(10);
1985
1986 TGeoCombiTrans* backPlane_transf[2];
1987
1988 backPlane_transf[0] = new TGeoCombiTrans();
1989 backPlane_transf[0]->SetDx(0.0);
1990 backPlane_transf[0]->SetDy(+(16.75 + backPlane_YSize * 0.5 - cut_from_height));
1991 backPlane_transf[0]->SetDz(+half_dist_mods
1992 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize
1993 + holdBackRail_ZSize + backPlane_ZSize * 0.5)
1994 + half_plane_shift);
1995
1996 backPlane_transf[1] = new TGeoCombiTrans();
1997 backPlane_transf[1]->SetDx(0.0);
1998 backPlane_transf[1]->SetDy(-(16.75 + backPlane_YSize * 0.5 - cut_from_height));
1999 backPlane_transf[1]->SetDz(+half_dist_mods
2000 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize
2001 + holdBackRail_ZSize + backPlane_ZSize * 0.5));
2002
2003 frames->AddNode(backPlaneV, 0, backPlane_transf[0]);
2004 frames->AddNode(backPlaneV, 1, backPlane_transf[1]);
2005 //----------------------------------------------------------------------
2006
2007 // front plane ----------------------------------------------------------
2008 Double_t frontPlane_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 1.8 * 2 /*margin*/; // cm
2009 Double_t frontPlane_YSize = 10.8; // cm
2010 Double_t frontPlane_ZSize = 0.15; // cm
2011
2012 TGeoShape* frontPlaneS = new TGeoBBox(TString("frontPlaneS") + TString("_") + frames->GetName(),
2013 frontPlane_XSize * 0.5, frontPlane_YSize * 0.5, frontPlane_ZSize * 0.5);
2014
2015 TGeoVolume* frontPlaneV = new TGeoVolume(TString("frontPlaneV") + TString("_") + frames->GetName(), frontPlaneS);
2016
2017 // volume medium
2018 TGeoMedium* frontPlaneV_medium = pMedAluminium;
2019 if (frontPlaneV_medium) {
2020 frontPlaneV->SetMedium(frontPlaneV_medium);
2021 } else
2022 Fatal("Main", "Invalid medium for frontPlaneV!");
2023
2024 // volume visual property (transparency)
2025 frontPlaneV->SetLineColor(TColor::GetColor("#ffcccc"));
2026 frontPlaneV->SetTransparency(10);
2027
2028 TGeoCombiTrans* frontPlane_transf[2];
2029
2030 frontPlane_transf[0] = new TGeoCombiTrans();
2031 frontPlane_transf[0]->SetDx(0.0);
2032 frontPlane_transf[0]->SetDy(+(19.7 + frontPlane_YSize * 0.5 - cut_from_height));
2033 frontPlane_transf[0]->SetDz(
2034 +half_dist_mods
2035 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize + frontPlane_ZSize * 0.5)
2036 + half_plane_shift);
2037
2038 frontPlane_transf[1] = new TGeoCombiTrans();
2039 frontPlane_transf[1]->SetDx(0.0);
2040 frontPlane_transf[1]->SetDy(-(19.7 + frontPlane_YSize * 0.5 - cut_from_height));
2041 frontPlane_transf[1]->SetDz(
2042 +half_dist_mods
2043 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize + frontPlane_ZSize * 0.5));
2044
2045 frames->AddNode(frontPlaneV, 0, frontPlane_transf[0]);
2046 frames->AddNode(frontPlaneV, 1, frontPlane_transf[1]);
2047 //----------------------------------------------------------------------
2048
2049 // front plane with a window --------------------------------------------
2050 Double_t frontPlaneWithWindow_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 4.0 * 2 /*margin*/; // cm
2051 Double_t frontPlaneWithWindow_YSize = 18.3; // cm
2052 Double_t frontPlaneWithWindow_ZSize = 0.3; // cm
2053
2054 Double_t frontPlaneWindow_XSize = frontPlaneWithWindow_XSize - 3.0 * 2 /*margin*/; // cm
2055 Double_t frontPlaneWindow_YSize = 8.6; // cm
2056
2057 TGeoShape* frontPlaneWithWindowBlankS = new TGeoBBox(
2058 TString("frontPlaneWithWindowBlankS") + TString("_") + frames->GetName(), frontPlaneWithWindow_XSize * 0.5,
2059 frontPlaneWithWindow_YSize * 0.5, frontPlaneWithWindow_ZSize * 0.5);
2060 TGeoShape* frontPlaneWindowS =
2061 new TGeoBBox(TString("frontPlaneWindowS") + TString("_") + frames->GetName(), frontPlaneWindow_XSize * 0.5,
2062 frontPlaneWindow_YSize * 0.5, (frontPlaneWithWindow_ZSize + 0.001) * 0.5);
2063
2064 TGeoTranslation* frontPlaneWindow_pos = new TGeoTranslation();
2065 frontPlaneWindow_pos->SetName(TString("frontPlaneWindow_pos") + TString("_") + frames->GetName());
2066 frontPlaneWindow_pos->SetDx(0.0);
2067 frontPlaneWindow_pos->SetDy(-2.85 /*shift*/);
2068 frontPlaneWindow_pos->SetDz(0.0);
2069 frontPlaneWindow_pos->RegisterYourself();
2070
2071 TGeoCompositeShape* frontPlaneWithWindowS = new TGeoCompositeShape();
2072 frontPlaneWithWindowS->SetName(TString("frontPlaneWithWindowS") + TString("_") + frames->GetName());
2073 {
2074 TString expression = "frontPlaneWithWindowBlankS";
2075 expression += TString("_") + frames->GetName();
2076 expression += "-frontPlaneWindowS";
2077 expression += TString("_") + frames->GetName();
2078 expression += ":frontPlaneWindow_pos";
2079 expression += TString("_") + frames->GetName();
2080 frontPlaneWithWindowS->MakeNode(expression);
2081 frontPlaneWithWindowS->ComputeBBox(); // need to compute a bounding box
2082 }
2083
2084 TGeoVolume* frontPlaneWithWindowV =
2085 new TGeoVolume(TString("frontPlaneWithWindowV") + TString("_") + frames->GetName(), frontPlaneWithWindowS);
2086
2087 // volume medium
2088 TGeoMedium* frontPlaneWithWindowV_medium = pMedAluminium;
2089 if (frontPlaneWithWindowV_medium) {
2090 frontPlaneWithWindowV->SetMedium(frontPlaneWithWindowV_medium);
2091 } else
2092 Fatal("Main", "Invalid medium for frontPlaneWithWindowV!");
2093
2094 // volume visual property (transparency)
2095 frontPlaneWithWindowV->SetLineColor(TColor::GetColor("#ffcccc"));
2096 frontPlaneWithWindowV->SetTransparency(50);
2097
2098 TGeoCombiTrans* frontPlaneWithWindow_transf[2];
2099
2100 frontPlaneWithWindow_transf[0] = new TGeoCombiTrans();
2101 frontPlaneWithWindow_transf[0]->SetDx(0.0);
2102 frontPlaneWithWindow_transf[0]->SetDy(+(19.5 + frontPlaneWithWindow_YSize * 0.5 - cut_from_height));
2103 frontPlaneWithWindow_transf[0]->SetDz(
2104 +half_dist_mods + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + frontPlaneWithWindow_ZSize * 0.5)
2105 + half_plane_shift);
2106
2107 frontPlaneWithWindow_transf[1] = new TGeoCombiTrans();
2108 frontPlaneWithWindow_transf[1]->RotateX(180.0);
2109 frontPlaneWithWindow_transf[1]->SetDx(0.0);
2110 frontPlaneWithWindow_transf[1]->SetDy(-(19.5 + frontPlaneWithWindow_YSize * 0.5 - cut_from_height));
2111 frontPlaneWithWindow_transf[1]->SetDz(
2112 +half_dist_mods - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + frontPlaneWithWindow_ZSize * 0.5));
2113
2114 frames->AddNode(frontPlaneWithWindowV, 0, frontPlaneWithWindow_transf[0]);
2115 frames->AddNode(frontPlaneWithWindowV, 1, frontPlaneWithWindow_transf[1]);
2116 //----------------------------------------------------------------------
2117
2118 // PCB (Printed Circuit Board) ------------------------------------------
2119 Double_t pcb_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 4.865 /*margin*/; // cm
2120 Double_t pcb_YSize = 10.0; // cm
2121 Double_t pcb_ZSize = 0.2; // cm
2122
2123 TGeoShape* pcbS = new TGeoBBox(TString("pcbS") + TString("_") + frames->GetName(), frontPlane_XSize * 0.5,
2124 frontPlane_YSize * 0.5, frontPlane_ZSize * 0.5);
2125
2126 TGeoVolume* pcbV = new TGeoVolume(TString("pcbV") + TString("_") + frames->GetName(), pcbS);
2127
2128 // volume medium
2129 TGeoMedium* pcbV_medium = pMedFiberGlass;
2130 if (pcbV_medium) {
2131 pcbV->SetMedium(pcbV_medium);
2132 } else
2133 Fatal("Main", "Invalid medium for pcbV!");
2134
2135 // volume visual property (transparency)
2136 pcbV->SetLineColor(TColor::GetColor("#ccccff"));
2137 pcbV->SetTransparency(10);
2138
2139 TGeoCombiTrans* pcb_transf[2];
2140
2141 pcb_transf[0] = new TGeoCombiTrans();
2142 pcb_transf[0]->SetDx(0.0);
2143 pcb_transf[0]->SetDy(+(26.5 + pcb_YSize * 0.5 - cut_from_height));
2144 pcb_transf[0]->SetDz(+half_dist_mods + half_plane_shift);
2145
2146 pcb_transf[1] = new TGeoCombiTrans();
2147 pcb_transf[1]->SetDx(0.0);
2148 pcb_transf[1]->SetDy(-(26.5 + pcb_YSize * 0.5 - cut_from_height));
2149 pcb_transf[1]->SetDz(+half_dist_mods);
2150
2151 frames->AddNode(pcbV, 0, pcb_transf[0]);
2152 frames->AddNode(pcbV, 1, pcb_transf[1]);
2153 //----------------------------------------------------------------------
2154
2155 // upper side shield ----------------------------------------------------
2156 Double_t upperSideShield_XSize = 4.4; // cm
2157 Double_t upperSideShield_YSize = 12.3; // cm
2158 Double_t upperSideShield_ZSize = 0.8; // cm
2159
2160 Double_t upperSideShieldCut_XSize = 0.9; // cm
2161 Double_t upperSideShieldCut_YSize = 2.4; // cm
2162
2163 Double_t upperSideShieldWindow_XSize = 3.0; // cm
2164 Double_t upperSideShieldWindow_YSize = 7.0; // cm
2165
2166 TGeoShape* upperSideShieldBlankS = new TGeoXtru(2);
2167 upperSideShieldBlankS->SetName(TString("upperSideShieldBlankS") + TString("_") + frames->GetName());
2168 {
2169 Double_t x_pos[6] = {
2170 +upperSideShield_XSize * 0.5 /*0*/,
2171 +upperSideShield_XSize * 0.5 /*1*/,
2172 -upperSideShield_XSize * 0.5 /*2*/,
2173 -upperSideShield_XSize * 0.5 /*3*/,
2174 -upperSideShield_XSize * 0.5 + upperSideShieldCut_XSize /*4*/,
2175 -upperSideShield_XSize * 0.5 + upperSideShieldCut_XSize /*5*/
2176
2177 };
2178 Double_t y_pos[6] = {
2179 -upperSideShield_YSize * 0.5 /*0*/,
2180 +upperSideShield_YSize * 0.5 /*1*/,
2181 +upperSideShield_YSize * 0.5 /*2*/,
2182 -upperSideShield_YSize * 0.5 + upperSideShieldCut_YSize /*3*/,
2183 -upperSideShield_YSize * 0.5 + upperSideShieldCut_YSize /*4*/,
2184 -upperSideShield_YSize * 0.5 /*5*/
2185
2186 };
2187 ((TGeoXtru*)upperSideShieldBlankS)->DefinePolygon(6, x_pos, y_pos);
2188 ((TGeoXtru*)upperSideShieldBlankS)->DefineSection(0, -upperSideShield_ZSize * 0.5);
2189 ((TGeoXtru*)upperSideShieldBlankS)->DefineSection(1, +upperSideShield_ZSize * 0.5);
2190 }
2191
2192 TGeoShape* upperSideShieldWindowS = new TGeoBBox(
2193 TString("upperSideShieldWindowS") + TString("_") + frames->GetName(), upperSideShieldWindow_XSize * 0.5,
2194 upperSideShieldWindow_YSize * 0.5, (upperSideShield_ZSize + 0.001) * 0.5);
2195
2196 TGeoTranslation* upperSideShieldWindow_pos = new TGeoTranslation();
2197 upperSideShieldWindow_pos->SetName(TString("upperSideShieldWindow_pos") + TString("_") + frames->GetName());
2198 upperSideShieldWindow_pos->SetDx(0.0);
2199 upperSideShieldWindow_pos->SetDy(+1.65 /*shift*/);
2200 upperSideShieldWindow_pos->SetDz(0.0);
2201 upperSideShieldWindow_pos->RegisterYourself();
2202
2203 TGeoCompositeShape* upperSideShieldWithWindowS = new TGeoCompositeShape();
2204 upperSideShieldWithWindowS->SetName(TString("upperSideShieldWithWindowS") + TString("_") + frames->GetName());
2205 {
2206 TString expression = "upperSideShieldBlankS";
2207 expression += TString("_") + frames->GetName();
2208 expression += "-upperSideShieldWindowS";
2209 expression += TString("_") + frames->GetName();
2210 expression += ":upperSideShieldWindow_pos";
2211 expression += TString("_") + frames->GetName();
2212 upperSideShieldWithWindowS->MakeNode(expression);
2213 upperSideShieldWithWindowS->ComputeBBox(); // need to compute a bounding box
2214 }
2215
2216 TGeoVolume* upperSideShieldV =
2217 new TGeoVolume(TString("upperSideShieldV") + TString("_") + frames->GetName(), upperSideShieldWithWindowS);
2218
2219 // volume medium
2220 TGeoMedium* upperSideShieldV_medium = pMedAluminium;
2221 if (upperSideShieldV_medium) {
2222 upperSideShieldV->SetMedium(upperSideShieldV_medium);
2223 } else
2224 Fatal("Main", "Invalid medium for upperSideShieldV!");
2225
2226 // volume visual property (transparency)
2227 upperSideShieldV->SetLineColor(TColor::GetColor("#ffcccc"));
2228 upperSideShieldV->SetTransparency(50);
2229
2230 TGeoCombiTrans* upperSideShield_transf[4];
2231
2232 upperSideShield_transf[0] = new TGeoCombiTrans();
2233 upperSideShield_transf[0]->RotateY(90.0);
2234 upperSideShield_transf[0]->SetDx(+(frontPlaneWithWindow_XSize * 0.5 - upperSideShield_ZSize * 0.5));
2235 upperSideShield_transf[0]->SetDy(+(17.6 + upperSideShield_YSize * 0.5 - cut_from_height));
2236 upperSideShield_transf[0]->SetDz(+half_dist_mods - 0.65 /*shift*/ + half_plane_shift);
2237
2238 upperSideShield_transf[1] = new TGeoCombiTrans();
2239 upperSideShield_transf[1]->RotateY(90.0);
2240 upperSideShield_transf[1]->SetDx(-(frontPlaneWithWindow_XSize * 0.5 - upperSideShield_ZSize * 0.5));
2241 upperSideShield_transf[1]->SetDy(+(17.6 + upperSideShield_YSize * 0.5 - cut_from_height));
2242 upperSideShield_transf[1]->SetDz(+half_dist_mods - 0.65 /*shift*/ + half_plane_shift);
2243
2244 upperSideShield_transf[2] = new TGeoCombiTrans();
2245 upperSideShield_transf[2]->RotateY(-90.0);
2246 // upperSideShield_transf[2]->ReflectY(true); // replaced by RotateX(180) and RotateY(180)
2247 upperSideShield_transf[2]->RotateX(180.0);
2248 upperSideShield_transf[2]->RotateY(180.0);
2249 upperSideShield_transf[2]->SetDx(+(frontPlaneWithWindow_XSize * 0.5 - upperSideShield_ZSize * 0.5));
2250 upperSideShield_transf[2]->SetDy(-(17.6 + upperSideShield_YSize * 0.5 - cut_from_height));
2251 upperSideShield_transf[2]->SetDz(+half_dist_mods + 0.65 /*shift*/);
2252
2253 upperSideShield_transf[3] = new TGeoCombiTrans();
2254 upperSideShield_transf[3]->RotateY(-90.0);
2255 // upperSideShield_transf[3]->ReflectY(true); // replaced by RotateX(180) and RotateY(180)
2256 upperSideShield_transf[3]->RotateX(180.0);
2257 upperSideShield_transf[3]->RotateY(180.0);
2258 upperSideShield_transf[3]->SetDx(-(frontPlaneWithWindow_XSize * 0.5 - upperSideShield_ZSize * 0.5));
2259 upperSideShield_transf[3]->SetDy(-(17.6 + upperSideShield_YSize * 0.5 - cut_from_height));
2260 upperSideShield_transf[3]->SetDz(+half_dist_mods + 0.65 /*shift*/);
2261
2262 frames->AddNode(upperSideShieldV, 0, upperSideShield_transf[0]);
2263 frames->AddNode(upperSideShieldV, 1, upperSideShield_transf[1]);
2264 frames->AddNode(upperSideShieldV, 2, upperSideShield_transf[2]);
2265 frames->AddNode(upperSideShieldV, 3, upperSideShield_transf[3]);
2266 //----------------------------------------------------------------------
2267
2268 // upper side shield cover----------------------------------------------
2269 Double_t upperSideShieldCover_XSize = 4.4; // cm
2270 Double_t upperSideShieldCover_YSize = 8.5; // cm
2271 Double_t upperSideShieldCover_ZSize = 0.15; // cm
2272
2273 TGeoShape* upperSideShieldCoverS = new TGeoBBox(TString("upperSideShieldCoverS") + TString("_") + frames->GetName(),
2274 upperSideShieldCover_XSize * 0.5, upperSideShieldCover_YSize * 0.5,
2275 upperSideShieldCover_ZSize * 0.5);
2276
2277 TGeoVolume* upperSideShieldCoverV =
2278 new TGeoVolume(TString("upperSideShieldCoverV") + TString("_") + frames->GetName(), upperSideShieldCoverS);
2279
2280 // volume medium
2281 TGeoMedium* upperSideShieldCoverV_medium = pMedAluminium;
2282 if (upperSideShieldCoverV_medium) {
2283 upperSideShieldCoverV->SetMedium(upperSideShieldCoverV_medium);
2284 } else
2285 Fatal("Main", "Invalid medium for upperSideShieldCoverV!");
2286
2287 // volume visual property (transparency)
2288 upperSideShieldCoverV->SetLineColor(TColor::GetColor("#ffcccc"));
2289 upperSideShieldCoverV->SetTransparency(10);
2290
2291 TGeoCombiTrans* upperSideShieldCover_transf[4];
2292
2293 upperSideShieldCover_transf[0] = new TGeoCombiTrans();
2294 upperSideShieldCover_transf[0]->RotateY(90.0);
2295 upperSideShieldCover_transf[0]->SetDx(+(frontPlaneWithWindow_XSize * 0.5 + upperSideShieldCover_ZSize * 0.5));
2296 upperSideShieldCover_transf[0]->SetDy(+(20.7 + upperSideShieldCover_YSize * 0.5 - cut_from_height));
2297 upperSideShieldCover_transf[0]->SetDz(+half_dist_mods - 0.65 /*shift*/ + half_plane_shift);
2298
2299 upperSideShieldCover_transf[1] = new TGeoCombiTrans();
2300 upperSideShieldCover_transf[1]->RotateY(90.0);
2301 upperSideShieldCover_transf[1]->SetDx(-(frontPlaneWithWindow_XSize * 0.5 + upperSideShieldCover_ZSize * 0.5));
2302 upperSideShieldCover_transf[1]->SetDy(+(20.7 + upperSideShieldCover_YSize * 0.5 - cut_from_height));
2303 upperSideShieldCover_transf[1]->SetDz(+half_dist_mods - 0.65 /*shift*/ + half_plane_shift);
2304
2305 upperSideShieldCover_transf[2] = new TGeoCombiTrans();
2306 upperSideShieldCover_transf[2]->RotateY(90.0);
2307 upperSideShieldCover_transf[2]->SetDx(+(frontPlaneWithWindow_XSize * 0.5 + upperSideShieldCover_ZSize * 0.5));
2308 upperSideShieldCover_transf[2]->SetDy(-(20.7 + upperSideShieldCover_YSize * 0.5 - cut_from_height));
2309 upperSideShieldCover_transf[2]->SetDz(+half_dist_mods + 0.65 /*shift*/);
2310
2311 upperSideShieldCover_transf[3] = new TGeoCombiTrans();
2312 upperSideShieldCover_transf[3]->RotateY(90.0);
2313 upperSideShieldCover_transf[3]->SetDx(-(frontPlaneWithWindow_XSize * 0.5 + upperSideShieldCover_ZSize * 0.5));
2314 upperSideShieldCover_transf[3]->SetDy(-(20.7 + upperSideShieldCover_YSize * 0.5 - cut_from_height));
2315 upperSideShieldCover_transf[3]->SetDz(+half_dist_mods + 0.65 /*shift*/);
2316
2317 frames->AddNode(upperSideShieldCoverV, 0, upperSideShieldCover_transf[0]);
2318 frames->AddNode(upperSideShieldCoverV, 1, upperSideShieldCover_transf[1]);
2319 frames->AddNode(upperSideShieldCoverV, 2, upperSideShieldCover_transf[2]);
2320 frames->AddNode(upperSideShieldCoverV, 3, upperSideShieldCover_transf[3]);
2321 //--------------------------------------------------------------------------
2322
2323 return frames;
2324}
2325//------------------------------------------------------------------------------
2326
2328{
2329 // distance between ref. points of half-planes
2330 Double_t z_ref_dist = z_shift_hp[current_station_num];
2331
2332 // calculate dist. between central z-poses of half-planes via z_ref_dist
2333 // all values are taken from the drawings
2334 // 1.57 cm = distance from basic surface to module surface
2335 // 0.61 cm = distance from basic surface to ref. point of lower h. plane
2336 // 2.68 cm = distance from basic surface to ref. point of upper h. plane
2337 Double_t half_dist_mods = 0.69; // half distance between modules
2338 Double_t half_plane_shift = z_ref_dist - ((1.57 + half_dist_mods) - 0.61) + (2.68 - (1.57 + half_dist_mods));
2339
2340 cout << "long: z_ref_dist = " << z_ref_dist << "\n";
2341 cout << "long: half_plane_shift = " << half_plane_shift << "\n";
2342
2343 // FOR LONG MODULE ---------------------------------------------------------
2344 Double_t add_to_height = 6.0;
2345 //--------------------------------------------------------------------------
2346
2347 // ONE SENSOR MODULE -------------------------------------------------------
2348 if (current_station_num == 0)
2349 add_to_height = -3.0; // for signle modules of 63x93 mm^2
2350 //--------------------------------------------------------------------------
2351
2352 // TGeoVolume *frames = new TGeoVolumeAssembly(frame_name);
2353
2354 TGeoVolume* frames = new TGeoVolumeAssembly(frame_name);
2355 frames->SetMedium(pMedAir);
2356
2357 Int_t NModules = NModulesInStations[current_station_num];
2358
2359 // face shield ----------------------------------------------------------
2360 Double_t faceShield_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 8.6; // cm
2361 Double_t faceShield_YSize = 14.74 + add_to_height; // cm
2362 Double_t faceShield_ZSize = 0.3; // cm
2363
2364 TGeoShape* faceShieldS = new TGeoXtru(2);
2365 faceShieldS->SetName(TString("faceShieldS") + TString("_") + frames->GetName());
2366 {
2367 Double_t x_pos[8] = {faceShield_XSize * 0.5,
2368 faceShield_XSize * 0.5,
2369 -faceShield_XSize * 0.5,
2370 -faceShield_XSize * 0.5,
2371 -2.75,
2372 -2.3,
2373 2.3,
2374 2.75};
2375 Double_t y_pos[8] = {-faceShield_YSize * 0.5, faceShield_YSize * 0.5, faceShield_YSize * 0.5,
2376 -faceShield_YSize * 0.5, -faceShield_YSize * 0.5, -3.8 - add_to_height * 0.5,
2377 -3.8 - add_to_height * 0.5, -faceShield_YSize * 0.5};
2378 ((TGeoXtru*)faceShieldS)->DefinePolygon(8, x_pos, y_pos);
2379 ((TGeoXtru*)faceShieldS)->DefineSection(0, -faceShield_ZSize * 0.5);
2380 ((TGeoXtru*)faceShieldS)->DefineSection(1, +faceShield_ZSize * 0.5);
2381 }
2382
2383 TGeoVolume* faceShieldV = new TGeoVolume(TString("faceShieldV") + TString("_") + frames->GetName(), faceShieldS);
2384
2385 // volume medium
2386 TGeoMedium* faceShieldV_medium = pMedPolystyrene;
2387 if (faceShieldV_medium) {
2388 faceShieldV->SetMedium(faceShieldV_medium);
2389 } else
2390 Fatal("Main", "Invalid medium for faceShieldV!");
2391
2392 // volume visual property (transparency)
2393 faceShieldV->SetLineColor(TColor::GetColor("#ccffcc"));
2394 faceShieldV->SetTransparency(50);
2395
2396 TGeoCombiTrans* faceShield_transf[4];
2397
2398 faceShield_transf[0] = new TGeoCombiTrans();
2399 faceShield_transf[0]->SetDy(+faceShield_YSize * 0.5 - 0.95);
2400 faceShield_transf[0]->SetDz(+half_dist_mods - 1.35 /*half-thick of frame box*/
2401 - faceShield_ZSize * 0.5 /*face shield shift*/ + half_plane_shift);
2402
2403 faceShield_transf[1] = new TGeoCombiTrans();
2404 faceShield_transf[1]->SetDy(+faceShield_YSize * 0.5 - 0.95);
2405 faceShield_transf[1]->SetDz(+half_dist_mods + 1.35 /*half-thick of frame box*/
2406 + faceShield_ZSize * 0.5 /*face shield shift*/ + half_plane_shift);
2407
2408 faceShield_transf[2] = new TGeoCombiTrans();
2409 faceShield_transf[2]->RotateX(180.0);
2410 faceShield_transf[2]->SetDy(-faceShield_YSize * 0.5 + 0.95);
2411 faceShield_transf[2]->SetDz(+half_dist_mods - 1.35 /*half-thick of frame box*/
2412 - faceShield_ZSize * 0.5 /*face shield shift*/);
2413
2414 faceShield_transf[3] = new TGeoCombiTrans();
2415 faceShield_transf[3]->RotateX(180.0);
2416 faceShield_transf[3]->SetDy(-faceShield_YSize * 0.5 + 0.95);
2417 faceShield_transf[3]->SetDz(+half_dist_mods + 1.35 /*half-thick of frame box*/
2418 + faceShield_ZSize * 0.5 /*face shield shift*/);
2419
2420 frames->AddNode(faceShieldV, 0, faceShield_transf[0]);
2421 frames->AddNode(faceShieldV, 1, faceShield_transf[1]);
2422 frames->AddNode(faceShieldV, 2, faceShield_transf[2]);
2423 frames->AddNode(faceShieldV, 3, faceShield_transf[3]);
2424 //----------------------------------------------------------------------
2425
2426 // sidewall of shield ---------------------------------------------------
2427 Double_t sideShield_XSize = 0.95; // cm
2428 Double_t sideShield_YSize = 15.2 + add_to_height; // cm
2429 Double_t sideShield_ZSize = 2.7; // cm
2430
2431 TGeoShape* sideShieldS = new TGeoBBox(TString("sideShieldS") + TString("_") + frames->GetName(),
2432 sideShield_XSize * 0.5, sideShield_YSize * 0.5, sideShield_ZSize * 0.5);
2433
2434 TGeoVolume* sideShieldV = new TGeoVolume(TString("sideShieldV") + TString("_") + frames->GetName(), sideShieldS);
2435
2436 // volume medium
2437 TGeoMedium* sideShieldV_medium = pMedAluminium;
2438 if (sideShieldV_medium) {
2439 sideShieldV->SetMedium(sideShieldV_medium);
2440 } else
2441 Fatal("Main", "Invalid medium for sideShieldV!");
2442
2443 // volume visual property (transparency)
2444 sideShieldV->SetLineColor(TColor::GetColor("#ffcccc"));
2445 sideShieldV->SetTransparency(50);
2446
2447 TGeoCombiTrans* sideShield_transf[4];
2448
2449 sideShield_transf[0] = new TGeoCombiTrans();
2450 sideShield_transf[0]->SetDx(+(faceShield_XSize * 0.5 - sideShield_XSize * 0.5));
2451 sideShield_transf[0]->SetDy(+faceShield_YSize * 0.5 - 0.95 + (sideShield_YSize - faceShield_YSize) * 0.5);
2452 sideShield_transf[0]->SetDz(+half_dist_mods + half_plane_shift);
2453
2454 sideShield_transf[1] = new TGeoCombiTrans();
2455 sideShield_transf[1]->SetDx(-(faceShield_XSize * 0.5 - sideShield_XSize * 0.5));
2456 sideShield_transf[1]->SetDy(+faceShield_YSize * 0.5 - 0.95 + (sideShield_YSize - faceShield_YSize) * 0.5);
2457 sideShield_transf[1]->SetDz(+half_dist_mods + half_plane_shift);
2458
2459 sideShield_transf[2] = new TGeoCombiTrans();
2460 sideShield_transf[2]->SetDx(+(faceShield_XSize * 0.5 - sideShield_XSize * 0.5));
2461 sideShield_transf[2]->SetDy(-faceShield_YSize * 0.5 + 0.95 - (sideShield_YSize - faceShield_YSize) * 0.5);
2462 sideShield_transf[2]->SetDz(+half_dist_mods);
2463
2464 sideShield_transf[3] = new TGeoCombiTrans();
2465 sideShield_transf[3]->SetDx(-(faceShield_XSize * 0.5 - sideShield_XSize * 0.5));
2466 sideShield_transf[3]->SetDy(-faceShield_YSize * 0.5 + 0.95 - (sideShield_YSize - faceShield_YSize) * 0.5);
2467 sideShield_transf[3]->SetDz(+half_dist_mods);
2468
2469 frames->AddNode(sideShieldV, 0, sideShield_transf[0]);
2470 frames->AddNode(sideShieldV, 1, sideShield_transf[1]);
2471 frames->AddNode(sideShieldV, 2, sideShield_transf[2]);
2472 frames->AddNode(sideShieldV, 3, sideShield_transf[3]);
2473 //----------------------------------------------------------------------
2474
2475 // horizontal plane of shield -------------------------------------------
2476 Double_t horizShield_XSize = faceShield_XSize * 0.5 - sideShield_XSize - 2.75 /*half-size of hole*/; // cm
2477 Double_t horizShield_YSize = 0.3; // cm
2478 Double_t horizShield_ZSize = 2.7; // cm
2479
2480 TGeoShape* horizShieldS = new TGeoBBox(TString("horizShieldS") + TString("_") + frames->GetName(),
2481 horizShield_XSize * 0.5, horizShield_YSize * 0.5, horizShield_ZSize * 0.5);
2482
2483 TGeoVolume* horizShieldV = new TGeoVolume(TString("horizShieldV") + TString("_") + frames->GetName(), horizShieldS);
2484
2485 // volume medium
2486 TGeoMedium* horizShieldV_medium = pMedPolystyrene;
2487 if (horizShieldV_medium) {
2488 horizShieldV->SetMedium(horizShieldV_medium);
2489 } else
2490 Fatal("Main", "Invalid medium for horizShieldV!");
2491
2492 // volume visual property (transparency)
2493 horizShieldV->SetLineColor(TColor::GetColor("#ccffcc"));
2494 horizShieldV->SetTransparency(50);
2495
2496 TGeoCombiTrans* horizShield_transf[4];
2497
2498 horizShield_transf[0] = new TGeoCombiTrans();
2499 horizShield_transf[0]->SetDx(+(faceShield_XSize * 0.5 - horizShield_XSize * 0.5 - sideShield_XSize));
2500 horizShield_transf[0]->SetDy(+(-0.95 + horizShield_YSize * 0.5));
2501 horizShield_transf[0]->SetDz(+half_dist_mods + half_plane_shift);
2502
2503 horizShield_transf[1] = new TGeoCombiTrans();
2504 horizShield_transf[1]->SetDx(-(faceShield_XSize * 0.5 - horizShield_XSize * 0.5 - sideShield_XSize));
2505 horizShield_transf[1]->SetDy(+(-0.95 + horizShield_YSize * 0.5));
2506 horizShield_transf[1]->SetDz(+half_dist_mods + half_plane_shift);
2507
2508 horizShield_transf[2] = new TGeoCombiTrans();
2509 horizShield_transf[2]->SetDx(+(faceShield_XSize * 0.5 - horizShield_XSize * 0.5 - sideShield_XSize));
2510 horizShield_transf[2]->SetDy(-(-0.95 + horizShield_YSize * 0.5));
2511 horizShield_transf[2]->SetDz(+half_dist_mods);
2512
2513 horizShield_transf[3] = new TGeoCombiTrans();
2514 horizShield_transf[3]->SetDx(-(faceShield_XSize * 0.5 - horizShield_XSize * 0.5 - sideShield_XSize));
2515 horizShield_transf[3]->SetDy(-(-0.95 + horizShield_YSize * 0.5));
2516 horizShield_transf[3]->SetDz(+half_dist_mods);
2517
2518 frames->AddNode(horizShieldV, 0, horizShield_transf[0]);
2519 frames->AddNode(horizShieldV, 1, horizShield_transf[1]);
2520 frames->AddNode(horizShieldV, 2, horizShield_transf[2]);
2521 frames->AddNode(horizShieldV, 3, horizShield_transf[3]);
2522 //----------------------------------------------------------------------
2523
2524 // plank of shield ------------------------------------------------------
2525 Double_t plankShield_XSize = faceShield_XSize; // cm
2526 Double_t plankShield_YSize = 1.5; // cm
2527 Double_t plankShield_ZSize = 0.3; // cm
2528
2529 TGeoShape* plankShieldS = new TGeoBBox(TString("plankShieldS") + TString("_") + frames->GetName(),
2530 plankShield_XSize * 0.5, plankShield_YSize * 0.5, plankShield_ZSize * 0.5);
2531
2532 TGeoVolume* plankShieldV = new TGeoVolume(TString("plankShieldV") + TString("_") + frames->GetName(), plankShieldS);
2533
2534 // volume medium
2535 TGeoMedium* plankShieldV_medium = pMedAluminium;
2536 if (plankShieldV_medium) {
2537 plankShieldV->SetMedium(plankShieldV_medium);
2538 } else
2539 Fatal("Main", "Invalid medium for plankShieldV!");
2540
2541 // volume visual property (transparency)
2542 plankShieldV->SetLineColor(TColor::GetColor("#ffcccc"));
2543 plankShieldV->SetTransparency(50);
2544
2545 TGeoCombiTrans* plankShield_transf[4];
2546
2547 plankShield_transf[0] = new TGeoCombiTrans();
2548 plankShield_transf[0]->SetDx(0.0);
2549 plankShield_transf[0]->SetDy(+(-0.95 + faceShield_YSize) - 0.05);
2550 plankShield_transf[0]->SetDz(+half_dist_mods
2551 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize * 0.5)
2552 + half_plane_shift);
2553
2554 plankShield_transf[1] = new TGeoCombiTrans();
2555 plankShield_transf[1]->SetDx(0.0);
2556 plankShield_transf[1]->SetDy(+(-0.95 + faceShield_YSize) - 0.05);
2557 plankShield_transf[1]->SetDz(+half_dist_mods
2558 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize * 0.5)
2559 + half_plane_shift);
2560
2561 plankShield_transf[2] = new TGeoCombiTrans();
2562 plankShield_transf[2]->SetDx(0.0);
2563 plankShield_transf[2]->SetDy(-(-0.95 + faceShield_YSize) + 0.05);
2564 plankShield_transf[2]->SetDz(+half_dist_mods
2565 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize * 0.5));
2566
2567 plankShield_transf[3] = new TGeoCombiTrans();
2568 plankShield_transf[3]->SetDx(0.0);
2569 plankShield_transf[3]->SetDy(-(-0.95 + faceShield_YSize) + 0.05);
2570 plankShield_transf[3]->SetDz(+half_dist_mods
2571 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize * 0.5));
2572
2573 frames->AddNode(plankShieldV, 0, plankShield_transf[0]);
2574 frames->AddNode(plankShieldV, 1, plankShield_transf[1]);
2575 frames->AddNode(plankShieldV, 2, plankShield_transf[2]);
2576 frames->AddNode(plankShieldV, 3, plankShield_transf[3]);
2577 //----------------------------------------------------------------------
2578
2579 // base rail
2580 Double_t baseRailMainPart_XSize = faceShield_XSize + 3.4 * 2 /*margin*/; // cm
2581 Double_t baseRailMainPart_YSize = 5.0; // cm
2582 Double_t baseRailMainPart_ZSize = 0.7; // cm
2583
2584 Double_t baseRailUpperPart_XSize = baseRailMainPart_XSize - 9.0 /*cut*/; // cm
2585 Double_t baseRailUpperPart_YSize = 1.0; // cm
2586 Double_t baseRailUpperPart_ZSize = 0.3; // cm
2587
2588 Double_t baseRailLowerPart_XSize = baseRailMainPart_XSize - 8.8 /*cut*/; // cm
2589 Double_t baseRailLowerPart_YSize = 0.7; // cm
2590 Double_t baseRailLowerPart_ZSize = 0.3; // cm
2591
2592 TGeoShape* baseRailMainPartS =
2593 new TGeoBBox(TString("baseRailMainPartS") + TString("_") + frames->GetName(), baseRailMainPart_XSize * 0.5,
2594 baseRailMainPart_YSize * 0.5, baseRailMainPart_ZSize * 0.5);
2595 TGeoShape* baseRailUpperPartS =
2596 new TGeoBBox(TString("baseRailUpperPartS") + TString("_") + frames->GetName(), baseRailUpperPart_XSize * 0.5,
2597 baseRailUpperPart_YSize * 0.5, baseRailUpperPart_ZSize * 0.5);
2598 TGeoShape* baseRailLowerPartS =
2599 new TGeoBBox(TString("baseRailLowerPartS") + TString("_") + frames->GetName(), baseRailLowerPart_XSize * 0.5,
2600 baseRailLowerPart_YSize * 0.5, baseRailLowerPart_ZSize * 0.5);
2601
2602 TGeoTranslation* baseRailMainPart_pos = new TGeoTranslation();
2603 baseRailMainPart_pos->SetName(TString("baseRailMainPart_pos") + TString("_") + frames->GetName());
2604 baseRailMainPart_pos->SetDx(0.0);
2605 baseRailMainPart_pos->SetDy(0.0);
2606 baseRailMainPart_pos->SetDz(0.0);
2607 baseRailMainPart_pos->RegisterYourself();
2608
2609 TGeoTranslation* baseRailUpperPart_pos = new TGeoTranslation();
2610 baseRailUpperPart_pos->SetName(TString("baseRailUpperPart_pos") + TString("_") + frames->GetName());
2611 baseRailUpperPart_pos->SetDx(0.0);
2612 baseRailUpperPart_pos->SetDy(+(baseRailMainPart_YSize * 0.5 + baseRailUpperPart_YSize * 0.5));
2613 baseRailUpperPart_pos->SetDz(baseRailMainPart_ZSize * 0.5 - baseRailUpperPart_ZSize * 0.5);
2614 baseRailUpperPart_pos->RegisterYourself();
2615
2616 TGeoTranslation* baseRailLowerPart_pos = new TGeoTranslation();
2617 baseRailLowerPart_pos->SetName(TString("baseRailLowerPart_pos") + TString("_") + frames->GetName());
2618 baseRailLowerPart_pos->SetDx(0.0);
2619 baseRailLowerPart_pos->SetDy(-(baseRailMainPart_YSize * 0.5 + baseRailLowerPart_YSize * 0.5));
2620 baseRailLowerPart_pos->SetDz(baseRailMainPart_ZSize * 0.5 - baseRailLowerPart_ZSize * 0.5);
2621 baseRailLowerPart_pos->RegisterYourself();
2622
2623 TGeoCompositeShape* baseRailS = new TGeoCompositeShape();
2624 baseRailS->SetName(TString("baseRailS") + TString("_") + frames->GetName());
2625 {
2626 TString expression = "baseRailMainPartS";
2627 expression += TString("_") + frames->GetName();
2628 expression += ":baseRailMainPart_pos";
2629 expression += TString("_") + frames->GetName();
2630 expression += "+baseRailUpperPartS";
2631 expression += TString("_") + frames->GetName();
2632 expression += ":baseRailUpperPart_pos";
2633 expression += TString("_") + frames->GetName();
2634 expression += "+baseRailLowerPartS";
2635 expression += TString("_") + frames->GetName();
2636 expression += ":baseRailLowerPart_pos";
2637 expression += TString("_") + frames->GetName();
2638 baseRailS->MakeNode(expression);
2639 baseRailS->ComputeBBox(); // need to compute a bounding box
2640 }
2641
2642 TGeoVolume* baseRailV = new TGeoVolume(TString("baseRailV") + TString("_") + frames->GetName(), baseRailS);
2643
2644 // volume medium
2645 TGeoMedium* baseRailV_medium = pMedAluminium;
2646 if (baseRailV_medium) {
2647 baseRailV->SetMedium(baseRailV_medium);
2648 } else
2649 Fatal("Main", "Invalid medium for baseRailV!");
2650
2651 // volume visual property (transparency)
2652 baseRailV->SetLineColor(TColor::GetColor("#ffcccc"));
2653 baseRailV->SetTransparency(50);
2654
2655 TGeoCombiTrans* baseRail_transf[2];
2656
2657 baseRail_transf[0] = new TGeoCombiTrans();
2658 baseRail_transf[0]->RotateY(180.0);
2659 baseRail_transf[0]->SetDx(0.0);
2660 baseRail_transf[0]->SetDy(+(14.5 + baseRailMainPart_YSize * 0.5 + add_to_height));
2661 baseRail_transf[0]->SetDz(
2662 +half_dist_mods
2663 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + baseRailMainPart_ZSize * 0.5 - baseRailLowerPart_ZSize)
2664 + half_plane_shift);
2665
2666 baseRail_transf[1] = new TGeoCombiTrans();
2667 // baseRail_transf[1]->ReflectY(true); // replaced by RotateX(180) and RotateY(180)
2668 baseRail_transf[1]->RotateX(180.0);
2669 baseRail_transf[1]->RotateY(180.0);
2670 baseRail_transf[1]->SetDx(0.0);
2671 baseRail_transf[1]->SetDy(-(14.5 + baseRailMainPart_YSize * 0.5 + add_to_height));
2672 baseRail_transf[1]->SetDz(+half_dist_mods
2673 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + baseRailMainPart_ZSize * 0.5
2674 - baseRailLowerPart_ZSize));
2675
2676 frames->AddNode(baseRailV, 0, baseRail_transf[0]);
2677 frames->AddNode(baseRailV, 1, baseRail_transf[1]);
2678 //----------------------------------------------------------------------
2679
2680 // back rail ------------------------------------------------------------
2681 Double_t backRailMainPart_XSize = faceShield_XSize + -0.3 * 2 /*margin*/; // cm
2682 Double_t backRailMainPart_YSize = 3.0; // cm
2683 Double_t backRailMainPart_ZSize = 0.9; // cm, average 6..12 cm
2684
2685 Double_t backRailLowerPart_XSize = backRailMainPart_XSize - 1.4; // cm
2686 Double_t backRailLowerPart_YSize = 0.7; // cm
2687 Double_t backRailLowerPart_ZSize = 0.6; // cm
2688
2689 Double_t backRailSidePart_XSize = 1.2; // cm
2690 Double_t backRailSidePart_YSize = 3.0; // cm
2691 Double_t backRailSidePart_ZSize = 1.62; // cm
2692
2693 TGeoShape* backRailMainPartS =
2694 new TGeoBBox(TString("backRailMainPartS") + TString("_") + frames->GetName(), backRailMainPart_XSize * 0.5,
2695 backRailMainPart_YSize * 0.5, backRailMainPart_ZSize * 0.5);
2696 TGeoShape* backRailLowerPartS =
2697 new TGeoBBox(TString("backRailLowerPartS") + TString("_") + frames->GetName(), backRailLowerPart_XSize * 0.5,
2698 backRailLowerPart_YSize * 0.5, backRailLowerPart_ZSize * 0.5);
2699 TGeoShape* backRailSidePartS =
2700 new TGeoBBox(TString("backRailSidePartS") + TString("_") + frames->GetName(), backRailSidePart_XSize * 0.5,
2701 backRailSidePart_YSize * 0.5, backRailSidePart_ZSize * 0.5);
2702
2703 TGeoTranslation* backRailLowerPart_pos = new TGeoTranslation();
2704 backRailLowerPart_pos->SetName(TString("backRailLowerPart_pos") + TString("_") + frames->GetName());
2705 backRailLowerPart_pos->SetDx(0.0);
2706 backRailLowerPart_pos->SetDy(-(backRailMainPart_YSize * 0.5 + backRailLowerPart_YSize * 0.5));
2707 backRailLowerPart_pos->SetDz(backRailMainPart_ZSize * 0.5 - backRailLowerPart_ZSize * 0.5);
2708 backRailLowerPart_pos->RegisterYourself();
2709
2710 TGeoTranslation* backRailSidePart1_pos = new TGeoTranslation();
2711 backRailSidePart1_pos->SetName(TString("backRailSidePart1_pos") + TString("_") + frames->GetName());
2712 backRailSidePart1_pos->SetDx(+(backRailMainPart_XSize * 0.5 - backRailSidePart_XSize * 0.5));
2713 backRailSidePart1_pos->SetDy(0.0);
2714 backRailSidePart1_pos->SetDz(backRailMainPart_ZSize * 0.5 + backRailSidePart_ZSize * 0.5);
2715 backRailSidePart1_pos->RegisterYourself();
2716
2717 TGeoTranslation* backRailSidePart2_pos = new TGeoTranslation();
2718 backRailSidePart2_pos->SetName(TString("backRailSidePart2_pos") + TString("_") + frames->GetName());
2719 backRailSidePart2_pos->SetDx(-(backRailMainPart_XSize * 0.5 - backRailSidePart_XSize * 0.5));
2720 backRailSidePart2_pos->SetDy(0.0);
2721 backRailSidePart2_pos->SetDz(backRailMainPart_ZSize * 0.5 + backRailSidePart_ZSize * 0.5);
2722 backRailSidePart2_pos->RegisterYourself();
2723
2724 TGeoCompositeShape* backRailS = new TGeoCompositeShape();
2725 backRailS->SetName(TString("backRailS") + TString("_") + frames->GetName());
2726 {
2727 TString expression = "backRailMainPartS";
2728 expression += TString("_") + frames->GetName();
2729 expression += "+backRailLowerPartS";
2730 expression += TString("_") + frames->GetName();
2731 expression += ":backRailLowerPart_pos";
2732 expression += TString("_") + frames->GetName();
2733 expression += "+backRailSidePartS";
2734 expression += TString("_") + frames->GetName();
2735 expression += ":backRailSidePart1_pos";
2736 expression += TString("_") + frames->GetName();
2737 expression += "+backRailSidePartS";
2738 expression += TString("_") + frames->GetName();
2739 expression += ":backRailSidePart2_pos";
2740 expression += TString("_") + frames->GetName();
2741 backRailS->MakeNode(expression);
2742 backRailS->ComputeBBox(); // need to compute a bounding box
2743 }
2744
2745 TGeoVolume* backRailV = new TGeoVolume(TString("backRailV") + TString("_") + frames->GetName(), backRailS);
2746
2747 // volume medium
2748 TGeoMedium* backRailV_medium = pMedAluminium;
2749 if (backRailV_medium) {
2750 backRailV->SetMedium(backRailV_medium);
2751 } else
2752 Fatal("Main", "Invalid medium for backRailV!");
2753
2754 // volume visual property (transparency)
2755 backRailV->SetLineColor(TColor::GetColor("#ffcccc"));
2756 backRailV->SetTransparency(50);
2757
2758 TGeoCombiTrans* backRail_transf[2];
2759
2760 backRail_transf[0] = new TGeoCombiTrans();
2761 backRail_transf[0]->SetDx(0.0);
2762 backRail_transf[0]->SetDy(+(14.5 + backRailMainPart_YSize * 0.5 + add_to_height));
2763 backRail_transf[0]->SetDz(+half_dist_mods
2764 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize
2765 + (backRailMainPart_ZSize * 0.5 - backRailLowerPart_ZSize))
2766 + half_plane_shift);
2767
2768 backRail_transf[1] = new TGeoCombiTrans();
2769 backRail_transf[1]->RotateX(180.0);
2770 backRail_transf[1]->SetDx(0.0);
2771 backRail_transf[1]->SetDy(-(14.5 + backRailMainPart_YSize * 0.5 + add_to_height));
2772 backRail_transf[1]->SetDz(+half_dist_mods
2773 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize
2774 + (backRailMainPart_ZSize * 0.5 - backRailLowerPart_ZSize)));
2775
2776 frames->AddNode(backRailV, 0, backRail_transf[0]);
2777 frames->AddNode(backRailV, 1, backRail_transf[1]);
2778 //----------------------------------------------------------------------
2779
2780 // holding back rail ----------------------------------------------------
2781 Double_t holdBackRail_XSize = backRailMainPart_XSize;
2782 Double_t holdBackRail_YSize = 1.8; // cm
2783 Double_t holdBackRail_ZSize = 1.0;
2784
2785 TGeoShape* holdBackRailS = new TGeoXtru(2);
2786 holdBackRailS->SetName(TString("holdBackRailS") + TString("_") + frames->GetName());
2787 {
2788 Double_t x_pos[5] = {
2789 +0.0 /*0*/, +0.1 /*1*/, +holdBackRail_ZSize /*2*/, +holdBackRail_ZSize /*3*/, +0.0 /*4*/
2790 };
2791 Double_t y_pos[5] = {
2792 -holdBackRail_YSize /*0*/,
2793 -holdBackRail_YSize /*1*/,
2794 -holdBackRail_YSize * 0.5 /*2*/,
2795 -0.0 /*3*/,
2796 -0.0 /*4*/,
2797 };
2798 ((TGeoXtru*)holdBackRailS)->DefinePolygon(5, x_pos, y_pos);
2799 ((TGeoXtru*)holdBackRailS)->DefineSection(0, -holdBackRail_XSize * 0.5);
2800 ((TGeoXtru*)holdBackRailS)->DefineSection(1, +holdBackRail_XSize * 0.5);
2801 }
2802
2803 TGeoVolume* holdBackRailV =
2804 new TGeoVolume(TString("holdBackRailV") + TString("_") + frames->GetName(), holdBackRailS);
2805
2806 // volume medium
2807 TGeoMedium* holdBackRailV_medium = pMedAluminium;
2808 if (holdBackRailV_medium) {
2809 holdBackRailV->SetMedium(holdBackRailV_medium);
2810 } else
2811 Fatal("Main", "Invalid medium for holdBackRailV!");
2812
2813 // volume visual property (transparency)
2814 holdBackRailV->SetLineColor(TColor::GetColor("#ffcccc"));
2815 holdBackRailV->SetTransparency(10);
2816
2817 TGeoCombiTrans* holdBackRail_transf[2];
2818
2819 holdBackRail_transf[0] = new TGeoCombiTrans();
2820 holdBackRail_transf[0]->RotateY(90.0);
2821 holdBackRail_transf[0]->SetDx(0.0);
2822 holdBackRail_transf[0]->SetDy(+(14.5 + backRailMainPart_YSize + add_to_height));
2823 holdBackRail_transf[0]->SetDz(
2824 +half_dist_mods - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize) + half_plane_shift);
2825
2826 holdBackRail_transf[1] = new TGeoCombiTrans();
2827 holdBackRail_transf[1]->RotateY(90.0);
2828 holdBackRail_transf[1]->RotateX(180.0);
2829 holdBackRail_transf[1]->SetDx(0.0);
2830 holdBackRail_transf[1]->SetDy(-(14.5 + backRailMainPart_YSize + add_to_height));
2831 holdBackRail_transf[1]->SetDz(+half_dist_mods
2832 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize));
2833
2834 frames->AddNode(holdBackRailV, 0, holdBackRail_transf[0]);
2835 frames->AddNode(holdBackRailV, 1, holdBackRail_transf[1]);
2836 //----------------------------------------------------------------------
2837
2838 // back plane -----------------------------------------------------------
2839 Double_t backPlane_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 3.95 * 2 /*margin*/; // cm
2840 Double_t backPlane_YSize = 13.1; // cm
2841 Double_t backPlane_ZSize = 0.15; // cm
2842
2843 TGeoShape* backPlaneS = new TGeoBBox(TString("backPlaneS") + TString("_") + frames->GetName(),
2844 backPlane_XSize * 0.5, backPlane_YSize * 0.5, backPlane_ZSize * 0.5);
2845
2846 TGeoVolume* backPlaneV = new TGeoVolume(TString("backPlaneV") + TString("_") + frames->GetName(), backPlaneS);
2847
2848 // volume medium
2849 TGeoMedium* backPlaneV_medium = pMedAluminium;
2850 if (backPlaneV_medium) {
2851 backPlaneV->SetMedium(backPlaneV_medium);
2852 } else
2853 Fatal("Main", "Invalid medium for backPlaneV!");
2854
2855 // volume visual property (transparency)
2856 backPlaneV->SetLineColor(TColor::GetColor("#ffcccc"));
2857 backPlaneV->SetTransparency(10);
2858
2859 TGeoCombiTrans* backPlane_transf[2];
2860
2861 backPlane_transf[0] = new TGeoCombiTrans();
2862 backPlane_transf[0]->SetDx(0.0);
2863 backPlane_transf[0]->SetDy(+(16.75 + backPlane_YSize * 0.5 + add_to_height));
2864 backPlane_transf[0]->SetDz(+half_dist_mods
2865 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize
2866 + holdBackRail_ZSize + backPlane_ZSize * 0.5)
2867 + half_plane_shift);
2868
2869 backPlane_transf[1] = new TGeoCombiTrans();
2870 backPlane_transf[1]->SetDx(0.0);
2871 backPlane_transf[1]->SetDy(-(16.75 + backPlane_YSize * 0.5 + add_to_height));
2872 backPlane_transf[1]->SetDz(+half_dist_mods
2873 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize
2874 + holdBackRail_ZSize + backPlane_ZSize * 0.5));
2875
2876 frames->AddNode(backPlaneV, 0, backPlane_transf[0]);
2877 frames->AddNode(backPlaneV, 1, backPlane_transf[1]);
2878 //----------------------------------------------------------------------
2879
2880 // front plane ----------------------------------------------------------
2881 Double_t frontPlane_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 1.8 * 2 /*margin*/; // cm
2882 Double_t frontPlane_YSize = 10.8; // cm
2883 Double_t frontPlane_ZSize = 0.15; // cm
2884
2885 TGeoShape* frontPlaneS = new TGeoBBox(TString("frontPlaneS") + TString("_") + frames->GetName(),
2886 frontPlane_XSize * 0.5, frontPlane_YSize * 0.5, frontPlane_ZSize * 0.5);
2887
2888 TGeoVolume* frontPlaneV = new TGeoVolume(TString("frontPlaneV") + TString("_") + frames->GetName(), frontPlaneS);
2889
2890 // volume medium
2891 TGeoMedium* frontPlaneV_medium = pMedAluminium;
2892 if (frontPlaneV_medium) {
2893 frontPlaneV->SetMedium(frontPlaneV_medium);
2894 } else
2895 Fatal("Main", "Invalid medium for frontPlaneV!");
2896
2897 // volume visual property (transparency)
2898 frontPlaneV->SetLineColor(TColor::GetColor("#ffcccc"));
2899 frontPlaneV->SetTransparency(10);
2900
2901 TGeoCombiTrans* frontPlane_transf[2];
2902
2903 frontPlane_transf[0] = new TGeoCombiTrans();
2904 frontPlane_transf[0]->SetDx(0.0);
2905 frontPlane_transf[0]->SetDy(+(19.7 + frontPlane_YSize * 0.5 + add_to_height));
2906 frontPlane_transf[0]->SetDz(
2907 +half_dist_mods
2908 + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize + frontPlane_ZSize * 0.5)
2909 + half_plane_shift);
2910
2911 frontPlane_transf[1] = new TGeoCombiTrans();
2912 frontPlane_transf[1]->SetDx(0.0);
2913 frontPlane_transf[1]->SetDy(-(19.7 + frontPlane_YSize * 0.5 + add_to_height));
2914 frontPlane_transf[1]->SetDz(
2915 +half_dist_mods
2916 - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + plankShield_ZSize + frontPlane_ZSize * 0.5));
2917
2918 frames->AddNode(frontPlaneV, 0, frontPlane_transf[0]);
2919 frames->AddNode(frontPlaneV, 1, frontPlane_transf[1]);
2920 //----------------------------------------------------------------------
2921
2922 // front plane with a window --------------------------------------------
2923 Double_t frontPlaneWithWindow_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 4.0 * 2 /*margin*/; // cm
2924 Double_t frontPlaneWithWindow_YSize = 18.3; // cm
2925 Double_t frontPlaneWithWindow_ZSize = 0.3; // cm
2926
2927 Double_t frontPlaneWindow_XSize = frontPlaneWithWindow_XSize - 3.0 * 2 /*margin*/; // cm
2928 Double_t frontPlaneWindow_YSize = 8.6; // cm
2929
2930 TGeoShape* frontPlaneWithWindowBlankS = new TGeoBBox(
2931 TString("frontPlaneWithWindowBlankS") + TString("_") + frames->GetName(), frontPlaneWithWindow_XSize * 0.5,
2932 frontPlaneWithWindow_YSize * 0.5, frontPlaneWithWindow_ZSize * 0.5);
2933 TGeoShape* frontPlaneWindowS =
2934 new TGeoBBox(TString("frontPlaneWindowS") + TString("_") + frames->GetName(), frontPlaneWindow_XSize * 0.5,
2935 frontPlaneWindow_YSize * 0.5, (frontPlaneWithWindow_ZSize + 0.001) * 0.5);
2936
2937 TGeoTranslation* frontPlaneWindow_pos = new TGeoTranslation();
2938 frontPlaneWindow_pos->SetName(TString("frontPlaneWindow_pos") + TString("_") + frames->GetName());
2939 frontPlaneWindow_pos->SetDx(0.0);
2940 frontPlaneWindow_pos->SetDy(-2.85 /*shift*/);
2941 frontPlaneWindow_pos->SetDz(0.0);
2942 frontPlaneWindow_pos->RegisterYourself();
2943
2944 TGeoCompositeShape* frontPlaneWithWindowS = new TGeoCompositeShape();
2945 frontPlaneWithWindowS->SetName(TString("frontPlaneWithWindowS") + TString("_") + frames->GetName());
2946 {
2947 TString expression = "frontPlaneWithWindowBlankS";
2948 expression += TString("_") + frames->GetName();
2949 expression += "-frontPlaneWindowS";
2950 expression += TString("_") + frames->GetName();
2951 expression += ":frontPlaneWindow_pos";
2952 expression += TString("_") + frames->GetName();
2953 frontPlaneWithWindowS->MakeNode(expression);
2954 frontPlaneWithWindowS->ComputeBBox(); // need to compute a bounding box
2955 }
2956
2957 TGeoVolume* frontPlaneWithWindowV =
2958 new TGeoVolume(TString("frontPlaneWithWindowV") + TString("_") + frames->GetName(), frontPlaneWithWindowS);
2959
2960 // volume medium
2961 TGeoMedium* frontPlaneWithWindowV_medium = pMedAluminium;
2962 if (frontPlaneWithWindowV_medium) {
2963 frontPlaneWithWindowV->SetMedium(frontPlaneWithWindowV_medium);
2964 } else
2965 Fatal("Main", "Invalid medium for frontPlaneWithWindowV!");
2966
2967 // volume visual property (transparency)
2968 frontPlaneWithWindowV->SetLineColor(TColor::GetColor("#ffcccc"));
2969 frontPlaneWithWindowV->SetTransparency(50);
2970
2971 TGeoCombiTrans* frontPlaneWithWindow_transf[2];
2972
2973 frontPlaneWithWindow_transf[0] = new TGeoCombiTrans();
2974 frontPlaneWithWindow_transf[0]->SetDx(0.0);
2975 frontPlaneWithWindow_transf[0]->SetDy(+(19.5 + frontPlaneWithWindow_YSize * 0.5 + add_to_height));
2976 frontPlaneWithWindow_transf[0]->SetDz(
2977 +half_dist_mods + (1.35 /*half-thick of frame box*/ + faceShield_ZSize + frontPlaneWithWindow_ZSize * 0.5)
2978 + half_plane_shift);
2979
2980 frontPlaneWithWindow_transf[1] = new TGeoCombiTrans();
2981 frontPlaneWithWindow_transf[1]->RotateX(180.0);
2982 frontPlaneWithWindow_transf[1]->SetDx(0.0);
2983 frontPlaneWithWindow_transf[1]->SetDy(-(19.5 + frontPlaneWithWindow_YSize * 0.5 + add_to_height));
2984 frontPlaneWithWindow_transf[1]->SetDz(
2985 +half_dist_mods - (1.35 /*half-thick of frame box*/ + faceShield_ZSize + frontPlaneWithWindow_ZSize * 0.5));
2986
2987 frames->AddNode(frontPlaneWithWindowV, 0, frontPlaneWithWindow_transf[0]);
2988 frames->AddNode(frontPlaneWithWindowV, 1, frontPlaneWithWindow_transf[1]);
2989 //----------------------------------------------------------------------
2990
2991 // PCB (Printed Circuit Board) ------------------------------------------
2992 Double_t pcb_XSize = (NModules / 2.0) * 6.3 - (NModules / 2.0) * 0.3 + 4.865 /*margin*/; // cm
2993 Double_t pcb_YSize = 10.0; // cm
2994 Double_t pcb_ZSize = 0.2; // cm
2995
2996 TGeoShape* pcbS = new TGeoBBox(TString("pcbS") + TString("_") + frames->GetName(), frontPlane_XSize * 0.5,
2997 frontPlane_YSize * 0.5, frontPlane_ZSize * 0.5);
2998
2999 TGeoVolume* pcbV = new TGeoVolume(TString("pcbV") + TString("_") + frames->GetName(), pcbS);
3000
3001 // volume medium
3002 TGeoMedium* pcbV_medium = pMedFiberGlass;
3003 if (pcbV_medium) {
3004 pcbV->SetMedium(pcbV_medium);
3005 } else
3006 Fatal("Main", "Invalid medium for pcbV!");
3007
3008 // volume visual property (transparency)
3009 pcbV->SetLineColor(TColor::GetColor("#ccccff"));
3010 pcbV->SetTransparency(10);
3011
3012 TGeoCombiTrans* pcb_transf[2];
3013
3014 pcb_transf[0] = new TGeoCombiTrans();
3015 pcb_transf[0]->SetDx(0.0);
3016 pcb_transf[0]->SetDy(+(26.5 + pcb_YSize * 0.5 + add_to_height));
3017 pcb_transf[0]->SetDz(+half_dist_mods + half_plane_shift);
3018
3019 pcb_transf[1] = new TGeoCombiTrans();
3020 pcb_transf[1]->SetDx(0.0);
3021 pcb_transf[1]->SetDy(-(26.5 + pcb_YSize * 0.5 + add_to_height));
3022 pcb_transf[1]->SetDz(+half_dist_mods);
3023
3024 frames->AddNode(pcbV, 0, pcb_transf[0]);
3025 frames->AddNode(pcbV, 1, pcb_transf[1]);
3026 //----------------------------------------------------------------------
3027
3028 // upper side shield ----------------------------------------------------
3029 Double_t upperSideShield_XSize = 4.4; // cm
3030 Double_t upperSideShield_YSize = 12.3; // cm
3031 Double_t upperSideShield_ZSize = 0.8; // cm
3032
3033 Double_t upperSideShieldCut_XSize = 0.9; // cm
3034 Double_t upperSideShieldCut_YSize = 2.4; // cm
3035
3036 Double_t upperSideShieldWindow_XSize = 3.0; // cm
3037 Double_t upperSideShieldWindow_YSize = 7.0; // cm
3038
3039 TGeoShape* upperSideShieldBlankS = new TGeoXtru(2);
3040 upperSideShieldBlankS->SetName(TString("upperSideShieldBlankS") + TString("_") + frames->GetName());
3041 {
3042 Double_t x_pos[6] = {
3043 +upperSideShield_XSize * 0.5 /*0*/,
3044 +upperSideShield_XSize * 0.5 /*1*/,
3045 -upperSideShield_XSize * 0.5 /*2*/,
3046 -upperSideShield_XSize * 0.5 /*3*/,
3047 -upperSideShield_XSize * 0.5 + upperSideShieldCut_XSize /*4*/,
3048 -upperSideShield_XSize * 0.5 + upperSideShieldCut_XSize /*5*/
3049
3050 };
3051 Double_t y_pos[6] = {
3052 -upperSideShield_YSize * 0.5 /*0*/,
3053 +upperSideShield_YSize * 0.5 /*1*/,
3054 +upperSideShield_YSize * 0.5 /*2*/,
3055 -upperSideShield_YSize * 0.5 + upperSideShieldCut_YSize /*3*/,
3056 -upperSideShield_YSize * 0.5 + upperSideShieldCut_YSize /*4*/,
3057 -upperSideShield_YSize * 0.5 /*5*/
3058
3059 };
3060 ((TGeoXtru*)upperSideShieldBlankS)->DefinePolygon(6, x_pos, y_pos);
3061 ((TGeoXtru*)upperSideShieldBlankS)->DefineSection(0, -upperSideShield_ZSize * 0.5);
3062 ((TGeoXtru*)upperSideShieldBlankS)->DefineSection(1, +upperSideShield_ZSize * 0.5);
3063 }
3064
3065 TGeoShape* upperSideShieldWindowS = new TGeoBBox(
3066 TString("upperSideShieldWindowS") + TString("_") + frames->GetName(), upperSideShieldWindow_XSize * 0.5,
3067 upperSideShieldWindow_YSize * 0.5, (upperSideShield_ZSize + 0.001) * 0.5);
3068
3069 TGeoTranslation* upperSideShieldWindow_pos = new TGeoTranslation();
3070 upperSideShieldWindow_pos->SetName(TString("upperSideShieldWindow_pos") + TString("_") + frames->GetName());
3071 upperSideShieldWindow_pos->SetDx(0.0);
3072 upperSideShieldWindow_pos->SetDy(+1.65 /*shift*/);
3073 upperSideShieldWindow_pos->SetDz(0.0);
3074 upperSideShieldWindow_pos->RegisterYourself();
3075
3076 TGeoCompositeShape* upperSideShieldWithWindowS = new TGeoCompositeShape();
3077 upperSideShieldWithWindowS->SetName(TString("upperSideShieldWithWindowS") + TString("_") + frames->GetName());
3078 {
3079 TString expression = "upperSideShieldBlankS";
3080 expression += TString("_") + frames->GetName();
3081 expression += "-upperSideShieldWindowS";
3082 expression += TString("_") + frames->GetName();
3083 expression += ":upperSideShieldWindow_pos";
3084 expression += TString("_") + frames->GetName();
3085 upperSideShieldWithWindowS->MakeNode(expression);
3086 upperSideShieldWithWindowS->ComputeBBox(); // need to compute a bounding box
3087 }
3088
3089 TGeoVolume* upperSideShieldV =
3090 new TGeoVolume(TString("upperSideShieldV") + TString("_") + frames->GetName(), upperSideShieldWithWindowS);
3091
3092 // volume medium
3093 TGeoMedium* upperSideShieldV_medium = pMedAluminium;
3094 if (upperSideShieldV_medium) {
3095 upperSideShieldV->SetMedium(upperSideShieldV_medium);
3096 } else
3097 Fatal("Main", "Invalid medium for upperSideShieldV!");
3098
3099 // volume visual property (transparency)
3100 upperSideShieldV->SetLineColor(TColor::GetColor("#ffcccc"));
3101 upperSideShieldV->SetTransparency(50);
3102
3103 TGeoCombiTrans* upperSideShield_transf[4];
3104
3105 upperSideShield_transf[0] = new TGeoCombiTrans();
3106 upperSideShield_transf[0]->RotateY(90.0);
3107 upperSideShield_transf[0]->SetDx(+(frontPlaneWithWindow_XSize * 0.5 - upperSideShield_ZSize * 0.5));
3108 upperSideShield_transf[0]->SetDy(+(17.6 + upperSideShield_YSize * 0.5 + add_to_height));
3109 upperSideShield_transf[0]->SetDz(+half_dist_mods - 0.65 /*shift*/ + half_plane_shift);
3110
3111 upperSideShield_transf[1] = new TGeoCombiTrans();
3112 upperSideShield_transf[1]->RotateY(90.0);
3113 upperSideShield_transf[1]->SetDx(-(frontPlaneWithWindow_XSize * 0.5 - upperSideShield_ZSize * 0.5));
3114 upperSideShield_transf[1]->SetDy(+(17.6 + upperSideShield_YSize * 0.5 + add_to_height));
3115 upperSideShield_transf[1]->SetDz(+half_dist_mods - 0.65 /*shift*/ + half_plane_shift);
3116
3117 upperSideShield_transf[2] = new TGeoCombiTrans();
3118 upperSideShield_transf[2]->RotateY(-90.0);
3119 // upperSideShield_transf[2]->ReflectY(true); // replaced by RotateX(180) and RotateY(180)
3120 upperSideShield_transf[2]->RotateX(180.0);
3121 upperSideShield_transf[2]->RotateY(180.0);
3122 upperSideShield_transf[2]->SetDx(+(frontPlaneWithWindow_XSize * 0.5 - upperSideShield_ZSize * 0.5));
3123 upperSideShield_transf[2]->SetDy(-(17.6 + upperSideShield_YSize * 0.5 + add_to_height));
3124 upperSideShield_transf[2]->SetDz(+half_dist_mods + 0.65 /*shift*/);
3125
3126 upperSideShield_transf[3] = new TGeoCombiTrans();
3127 upperSideShield_transf[3]->RotateY(-90.0);
3128 // upperSideShield_transf[3]->ReflectY(true); // replaced by RotateX(180) and RotateY(180)
3129 upperSideShield_transf[3]->RotateX(180.0);
3130 upperSideShield_transf[3]->RotateY(180.0);
3131 upperSideShield_transf[3]->SetDx(-(frontPlaneWithWindow_XSize * 0.5 - upperSideShield_ZSize * 0.5));
3132 upperSideShield_transf[3]->SetDy(-(17.6 + upperSideShield_YSize * 0.5 + add_to_height));
3133 upperSideShield_transf[3]->SetDz(+half_dist_mods + 0.65 /*shift*/);
3134
3135 frames->AddNode(upperSideShieldV, 0, upperSideShield_transf[0]);
3136 frames->AddNode(upperSideShieldV, 1, upperSideShield_transf[1]);
3137 frames->AddNode(upperSideShieldV, 2, upperSideShield_transf[2]);
3138 frames->AddNode(upperSideShieldV, 3, upperSideShield_transf[3]);
3139 //----------------------------------------------------------------------
3140
3141 // upper side shield cover----------------------------------------------
3142 Double_t upperSideShieldCover_XSize = 4.4; // cm
3143 Double_t upperSideShieldCover_YSize = 8.5; // cm
3144 Double_t upperSideShieldCover_ZSize = 0.15; // cm
3145
3146 TGeoShape* upperSideShieldCoverS = new TGeoBBox(TString("upperSideShieldCoverS") + TString("_") + frames->GetName(),
3147 upperSideShieldCover_XSize * 0.5, upperSideShieldCover_YSize * 0.5,
3148 upperSideShieldCover_ZSize * 0.5);
3149
3150 TGeoVolume* upperSideShieldCoverV =
3151 new TGeoVolume(TString("upperSideShieldCoverV") + TString("_") + frames->GetName(), upperSideShieldCoverS);
3152
3153 // volume medium
3154 TGeoMedium* upperSideShieldCoverV_medium = pMedAluminium;
3155 if (upperSideShieldCoverV_medium) {
3156 upperSideShieldCoverV->SetMedium(upperSideShieldCoverV_medium);
3157 } else
3158 Fatal("Main", "Invalid medium for upperSideShieldCoverV!");
3159
3160 // volume visual property (transparency)
3161 upperSideShieldCoverV->SetLineColor(TColor::GetColor("#ffcccc"));
3162 upperSideShieldCoverV->SetTransparency(10);
3163
3164 TGeoCombiTrans* upperSideShieldCover_transf[4];
3165
3166 upperSideShieldCover_transf[0] = new TGeoCombiTrans();
3167 upperSideShieldCover_transf[0]->RotateY(90.0);
3168 upperSideShieldCover_transf[0]->SetDx(+(frontPlaneWithWindow_XSize * 0.5 + upperSideShieldCover_ZSize * 0.5));
3169 upperSideShieldCover_transf[0]->SetDy(+(20.7 + upperSideShieldCover_YSize * 0.5 + add_to_height));
3170 upperSideShieldCover_transf[0]->SetDz(+half_dist_mods - 0.65 /*shift*/ + half_plane_shift);
3171
3172 upperSideShieldCover_transf[1] = new TGeoCombiTrans();
3173 upperSideShieldCover_transf[1]->RotateY(90.0);
3174 upperSideShieldCover_transf[1]->SetDx(-(frontPlaneWithWindow_XSize * 0.5 + upperSideShieldCover_ZSize * 0.5));
3175 upperSideShieldCover_transf[1]->SetDy(+(20.7 + upperSideShieldCover_YSize * 0.5 + add_to_height));
3176 upperSideShieldCover_transf[1]->SetDz(+half_dist_mods - 0.65 /*shift*/ + half_plane_shift);
3177
3178 upperSideShieldCover_transf[2] = new TGeoCombiTrans();
3179 upperSideShieldCover_transf[2]->RotateY(90.0);
3180 upperSideShieldCover_transf[2]->SetDx(+(frontPlaneWithWindow_XSize * 0.5 + upperSideShieldCover_ZSize * 0.5));
3181 upperSideShieldCover_transf[2]->SetDy(-(20.7 + upperSideShieldCover_YSize * 0.5 + add_to_height));
3182 upperSideShieldCover_transf[2]->SetDz(+half_dist_mods + 0.65 /*shift*/);
3183
3184 upperSideShieldCover_transf[3] = new TGeoCombiTrans();
3185 upperSideShieldCover_transf[3]->RotateY(90.0);
3186 upperSideShieldCover_transf[3]->SetDx(-(frontPlaneWithWindow_XSize * 0.5 + upperSideShieldCover_ZSize * 0.5));
3187 upperSideShieldCover_transf[3]->SetDy(-(20.7 + upperSideShieldCover_YSize * 0.5 + add_to_height));
3188 upperSideShieldCover_transf[3]->SetDz(+half_dist_mods + 0.65 /*shift*/);
3189
3190 frames->AddNode(upperSideShieldCoverV, 0, upperSideShieldCover_transf[0]);
3191 frames->AddNode(upperSideShieldCoverV, 1, upperSideShieldCover_transf[1]);
3192 frames->AddNode(upperSideShieldCoverV, 2, upperSideShieldCover_transf[2]);
3193 frames->AddNode(upperSideShieldCoverV, 3, upperSideShieldCover_transf[3]);
3194 //--------------------------------------------------------------------------
3195
3196 return frames;
3197}
bool Bool_t
int Int_t
double Double_t
constexpr Bool_t kTRUE
void Error(const char *location, const char *msgfmt,...)
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TGeoManager * gGeoManager
#define gROOT
R__EXTERN TSystem * gSystem
static Int_t GetColor(const char *hexcolor)
void Close(Option_t *option="") override
void SetDz(Double_t dz) override
const Double_t * GetTranslation() const override
void RotateY(Double_t angle) override
void SetDy(Double_t dy) override
void SetDx(Double_t dx) override
void RotateX(Double_t angle) override
void SetTranslation(const TGeoTranslation &tr)
void ComputeBBox() override
void MakeNode(const char *expression)
virtual void RegisterYourself()
void SetDy(Double_t dy) override
void SetDz(Double_t dz) override
void SetDx(Double_t dx) override
void SetVisContainers(Bool_t flag=kTRUE) override
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
void Draw(Option_t *option="") override
void SetTransparency(Char_t transparency=0)
virtual void SetMedium(TGeoMedium *medium)
void SetLineColor(Color_t lcolor) override
const char * GetName() const override
virtual void SetName(const char *name)
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
static TString Itoa(Int_t value, Int_t base)
const Double_t YStationPositions[NStations]
const Double_t ZStationPositions[NStations]
const Double_t XStationPositions[NStations]
const Int_t NModulesInStations[NStations]
Double_t ZModuleSize[NModuleSizes]
const Double_t x_dist_cent_base[NStations]
Double_t BevelAngleRad[NModuleSizes]
const Double_t x_shift_hp[NStations]
ModuleType
@ BEVEL_MODULE
@ RIGHT_ANGLED_MODULE_HALF
@ RIGHT_ANGLED_MODULE
const Double_t y_dist_cent_base[NStations]
Double_t YModuleSizeUpperPart[NModuleSizes]
Double_t YBevelSize[NModuleSizes]
const Double_t y_shift_hp[NStations]
ModuleSize
@ STANDARD_MODULE
const Bool_t ModulesYRotations[NStations][NMaxModules]
Double_t YModuleSize[NModuleSizes]
Double_t YModuleSizeLowerPart[NModuleSizes]
Double_t BevelAngleDeg[NModuleSizes]
Double_t YGapBetweenPartsOfModule[NModuleSizes]
Double_t XModuleSize[NModuleSizes]
const ModuleType ModulesTypes[NStations][NMaxModules]
const Double_t z_shift_hp[NStations]
const Bool_t ModulesXRotations[NStations][NMaxModules]
Double_t XBevelSize[NModuleSizes]
Double_t ZModuleFrameSize[NModuleSizes]
Double_t XShiftFromCenterToLocalX0[NModuleSizes]
Double_t YModuleFrameSize[NModuleSizes]
Double_t YSensorZoneSizeUpperPart[NModuleSizes]
Double_t YSensorZoneSizeLowerPart[NModuleSizes]
Double_t XModuleFrameSize[NModuleSizes]
Double_t YShiftFromCenterToAxis[NModuleSizes]
Double_t YShiftFromCenterToLocalY0[NModuleSizes]
TGeoVolume * CreateModuleFrame(TString module_name, ModuleType module_type, ModuleSize module_size)
TGeoVolume * CreateFrameForStation_LongModule(TString frame_name, Int_t current_station_num)
TGeoVolume * CreateFrameForStation_StandardModule(TString frame_name, Int_t current_station_num)
TGeoVolume * CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size)
TGeoVolume * CreateStation(TString station_name)
void DefineRequiredMedia(FairGeoMedia *geoMedia, FairGeoBuilder *geoBuild)
Double_t ATan(Double_t)
constexpr Double_t PiOver2()
Double_t Cos(Double_t)
Double_t Sin(Double_t)
Double_t Tan(Double_t)
constexpr Double_t RadToDeg()