BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
create_rootgeom_Silicon_Run8_aligned.C
Go to the documentation of this file.
1/*
2 * Baranov D.
3 * 13.01.2022 (created)
4 * 12.12.2022 (updated): new module type in the first station and
5 * positions have been corrected in accordance with
6 * the measurement scheme
7 *
8 * 18.01.2023 (updated): shifts to z-positions of modules have been added to compensate
9 * for rotations of half-planes around the Y-axis
10 *
11 * 20.01.2023 (updated): rotation angles around the Y-axis for each half-plane
12 * have been added
13 *
14 * Use this macro to create ROOT geometry for the RUN-8 config. of SILICON
15 * detector including 4 Si-Stations (6-10-14-18 modules)
16 *
17 * WARNING: all units is in cm!!!
18 *
19 */
20
21using namespace TMath;
22
23// Set Parameters of SILICON detector -------------------------------------------
24const Int_t NStations = 4; // stations in the detector
25const Int_t NMaxModules = 22; // max. number of modules in a station
26
27const Int_t NModulesInStations[NStations] = {6, 10, 14, 18};
28
29//(X-Y-Z)Positions of stations (sensitive volumes)
30const Double_t XStationPositions[NStations] = {+0.4025 /*0*/, +0.726 /*1*/, 0.8415 /*2*/,
31 +0.877 /*3*/}; // центр отверстия нижней п.плоскости
32const Double_t YStationPositions[NStations] = {-0.159 /*0*/, -0.165 /*1*/, -0.122 /*2*/,
33 -0.111 /*3*/}; // центр отверстия нижней п.плоскости
35 +14.2735 /*0*/, +23.022 /*1*/, 31.594 /*2*/,
36 40.407 /*3*/}; // реперная точка (средняя измеренная позиция по нижним п.плоскостям (ближним к мишени))
37
38const Double_t z_shift_up = +2.68; // см, z-смещение от реперной точки (точки измерения) до локальной СК базовой точки
39 // для верхних полуплоскостей
40const Double_t z_shift_low = -0.61; // см, z-смещение от реперной точки (точки измерения) до локальной СК базовой
41 // точки для нижних полуплоскостей
42
43const Double_t z_mod_thick = 0.03; // см
44
45const Double_t x_dist_cent_base[NStations] = {21.7 /*0*/, 21.7 /*1*/, 27.7 /*2*/,
46 33.7 /*3*/}; // x-расcтояние от центра полуплоскости до базы
47const Double_t y_dist_cent_base[NStations] = {12.99 /*0*/, 16.29 /*1*/, 16.29 /*2*/,
48 16.29 /*3*/}; // y-расстояние от центра полуплоскости до базы
49
51 +5.0 /*0*/, 5.134 /*1*/, 5.2825 /*2*/,
52 5.106 /*3*/}; // см, z-сдвиг верхней полуплоскости относительно нижней для разных станций
53
55 +0.1255 /*0*/, -0.0105 /*1*/, +0.013 /*2*/,
56 +0.239 /*3*/}; // см, x-сдвиг центра отверстия верхней полуплоскости относительно нижней
57
59 +0.1495 /*0*/, +0.0425 /*1*/, +0.0265 /*2*/,
60 +0.5025 /*3*/}; // см, y-сдвиг центра отверстия верхней полуплоскости относительно нижней
61
63 {-x_dist_cent_base[0] + x_shift_hp[0] + 30.850 /*0*/, -x_dist_cent_base[0] + x_shift_hp[0] + 24.852 /*1*/,
64 -x_dist_cent_base[0] + x_shift_hp[0] + 12.556 /*2*/,
65
66 -x_dist_cent_base[0] + 30.848 /*3*/, -x_dist_cent_base[0] + 24.845 /*4*/, -x_dist_cent_base[0] + 12.548 /*5*/},
67
68 {-x_dist_cent_base[1] + x_shift_hp[1] + 36.866 /*0*/, -x_dist_cent_base[1] + x_shift_hp[1] + 30.8505 /*1*/,
69 -x_dist_cent_base[1] + x_shift_hp[1] + 24.8645 /*2*/, -x_dist_cent_base[1] + x_shift_hp[1] + 12.5575 /*3*/,
70 -x_dist_cent_base[1] + x_shift_hp[1] + 6.5635 /*4*/,
71
72 -x_dist_cent_base[1] + 36.8425 /*5*/, -x_dist_cent_base[1] + 30.8505 /*6*/, -x_dist_cent_base[1] + 24.845 /*7*/,
73 -x_dist_cent_base[1] + 12.555 /*8*/, -x_dist_cent_base[1] + 6.585 /*9*/},
74
75 {-x_dist_cent_base[2] + x_shift_hp[2] + 48.8465 /*0*/, -x_dist_cent_base[2] + x_shift_hp[2] + 42.8315 /*1*/,
76 -x_dist_cent_base[2] + x_shift_hp[2] + 36.8485 /*2*/, -x_dist_cent_base[2] + x_shift_hp[2] + 30.8425 /*3*/,
77 -x_dist_cent_base[2] + x_shift_hp[2] + 18.5555 /*4*/, -x_dist_cent_base[2] + x_shift_hp[2] + 12.5395 /*5*/,
78 -x_dist_cent_base[2] + x_shift_hp[2] + 6.553 /*6*/,
79
80 -x_dist_cent_base[2] + 48.87 /*7*/, -x_dist_cent_base[2] + 42.859 /*8*/, -x_dist_cent_base[2] + 36.857 /*9*/,
81 -x_dist_cent_base[2] + 30.8515 /*10*/, -x_dist_cent_base[2] + 18.556 /*11*/, -x_dist_cent_base[2] + 12.555 /*12*/,
82 -x_dist_cent_base[2] + 6.5535 /*13*/},
83
84 {-x_dist_cent_base[3] + x_shift_hp[3] + 60.862 /*0*/, -x_dist_cent_base[3] + x_shift_hp[3] + 54.8545 /*1*/,
85 -x_dist_cent_base[3] + x_shift_hp[3] + 48.862 /*2*/, -x_dist_cent_base[3] + x_shift_hp[3] + 42.849 /*3*/,
86 -x_dist_cent_base[3] + x_shift_hp[3] + 36.851 /*4*/, -x_dist_cent_base[3] + x_shift_hp[3] + 24.5565 /*5*/,
87 -x_dist_cent_base[3] + x_shift_hp[3] + 18.549 /*6*/, -x_dist_cent_base[3] + x_shift_hp[3] + 12.5515 /*7*/,
88 -x_dist_cent_base[3] + x_shift_hp[3] + 6.651 /*8*/,
89
90 -x_dist_cent_base[3] + 60.8615 /*9*/, -x_dist_cent_base[3] + 54.85 /*10*/, -x_dist_cent_base[3] + 48.863 /*11*/,
91 -x_dist_cent_base[3] + 42.848 /*12*/, -x_dist_cent_base[3] + 36.849 /*13*/, -x_dist_cent_base[3] + 24.548 /*14*/,
92 -x_dist_cent_base[3] + 18.559 /*15*/, -x_dist_cent_base[3] + 12.5545 /*16*/, -x_dist_cent_base[3] + 6.553 /*17*/}};
94 {+y_dist_cent_base[0] + y_shift_hp[0] - 13.112 /*0*/, +y_dist_cent_base[0] + y_shift_hp[0] - 10.113 /*1*/,
95 +y_dist_cent_base[0] + y_shift_hp[0] - 13.086 /*2*/,
96
97 -y_dist_cent_base[0] + 13.100 /*3*/, -y_dist_cent_base[0] + 10.110 /*4*/, -y_dist_cent_base[0] + 13.098 /*5*/},
98
99 {+y_dist_cent_base[1] + y_shift_hp[1] - 16.427 /*0*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.425 /*1*/,
100 +y_dist_cent_base[1] + y_shift_hp[1] - 13.423 /*2*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.423 /*3*/,
101 +y_dist_cent_base[1] + y_shift_hp[1] - 16.425 /*4*/,
102
103 -y_dist_cent_base[1] + 16.432 /*5*/, -y_dist_cent_base[1] + 16.423 /*6*/, -y_dist_cent_base[1] + 13.428 /*7*/,
104 -y_dist_cent_base[1] + 16.425 /*8*/, -y_dist_cent_base[1] + 16.429 /*9*/},
105
106 {+y_dist_cent_base[2] + y_shift_hp[2] - 16.424 /*0*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*1*/,
107 +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*2*/, +y_dist_cent_base[2] + y_shift_hp[2] - 13.411 /*3*/,
108 +y_dist_cent_base[2] + y_shift_hp[2] - 16.431 /*4*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.420 /*5*/,
109 +y_dist_cent_base[2] + y_shift_hp[2] - 16.430 /*6*/,
110
111 -y_dist_cent_base[2] + 16.420 /*7*/, -y_dist_cent_base[2] + 16.426 /*8*/, -y_dist_cent_base[2] + 16.427 /*9*/,
112 -y_dist_cent_base[2] + 13.428 /*10*/, -y_dist_cent_base[2] + 16.418 /*11*/, -y_dist_cent_base[2] + 16.426 /*12*/,
113 -y_dist_cent_base[2] + 16.417 /*13*/},
114
115 {+y_dist_cent_base[3] + y_shift_hp[3] - 16.414 /*0*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.414 /*1*/,
116 +y_dist_cent_base[3] + y_shift_hp[3] - 16.413 /*2*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.420 /*3*/,
117 +y_dist_cent_base[3] + y_shift_hp[3] - 13.417 /*4*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.426 /*5*/,
118 +y_dist_cent_base[3] + y_shift_hp[3] - 16.418 /*6*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.425 /*7*/,
119 +y_dist_cent_base[3] + y_shift_hp[3] - 16.427 /*8*/,
120
121 -y_dist_cent_base[3] + 16.430 /*9*/, -y_dist_cent_base[3] + 16.433 /*10*/, -y_dist_cent_base[3] + 16.433 /*11*/,
122 -y_dist_cent_base[3] + 16.430 /*12*/, -y_dist_cent_base[3] + 13.435 /*13*/, -y_dist_cent_base[3] + 16.430 /*14*/,
123 -y_dist_cent_base[3] + 16.434 /*15*/, -y_dist_cent_base[3] + 16.419 /*16*/, -y_dist_cent_base[3] + 16.426 /*17*/}};
125 {+z_shift_hp[0] + z_shift_up - 2.60 /*0*/, +z_shift_hp[0] + z_shift_up - 1.45 /*1*/,
126 +z_shift_hp[0] + z_shift_up - 2.70 /*2*/,
127
128 +z_shift_low - z_mod_thick + 2.61 /*3*/, +z_shift_low - z_mod_thick + 1.40 /*4*/,
129 +z_shift_low - z_mod_thick + 2.79 /*5*/},
130
131 {+z_shift_hp[1] + z_shift_up - 1.430 /*0*/, +z_shift_hp[1] + z_shift_up - 2.605 /*1*/,
132 +z_shift_hp[1] + z_shift_up - 1.435 /*2*/, +z_shift_hp[1] + z_shift_up - 2.750 /*3*/,
133 +z_shift_hp[1] + z_shift_up - 1.580 /*4*/,
134
135 +z_shift_low - z_mod_thick + 1.425 /*5*/, +z_shift_low - z_mod_thick + 2.595 /*6*/,
136 +z_shift_low - z_mod_thick + 1.445 /*7*/, +z_shift_low - z_mod_thick + 2.730 /*8*/,
137 +z_shift_low - z_mod_thick + 1.510 /*9*/},
138
139 {+z_shift_hp[2] + z_shift_up - 2.595 /*0*/, +z_shift_hp[2] + z_shift_up - 1.395 /*1*/,
140 +z_shift_hp[2] + z_shift_up - 2.665 /*2*/, +z_shift_hp[2] + z_shift_up - 1.425 /*3*/,
141 +z_shift_hp[2] + z_shift_up - 2.735 /*4*/, +z_shift_hp[2] + z_shift_up - 1.560 /*5*/,
142 +z_shift_hp[2] + z_shift_up - 2.705 /*6*/,
143
144 +z_shift_low - z_mod_thick + 2.580 /*7*/, +z_shift_low - z_mod_thick + 1.410 /*8*/,
145 +z_shift_low - z_mod_thick + 2.565 /*9*/, +z_shift_low - z_mod_thick + 1.390 /*10*/,
146 +z_shift_low - z_mod_thick + 2.755 /*11*/, +z_shift_low - z_mod_thick + 1.570 /*12*/,
147 +z_shift_low - z_mod_thick + 2.765 /*13*/},
148
149 {+z_shift_hp[3] + z_shift_up - 1.405 /*0*/, +z_shift_hp[3] + z_shift_up - 2.610 /*1*/,
150 +z_shift_hp[3] + z_shift_up - 1.460 /*2*/, +z_shift_hp[3] + z_shift_up - 2.605 /*3*/,
151 +z_shift_hp[3] + z_shift_up - 1.420 /*4*/, +z_shift_hp[3] + z_shift_up - 2.755 /*5*/,
152 +z_shift_hp[3] + z_shift_up - 1.580 /*6*/, +z_shift_hp[3] + z_shift_up - 2.760 /*7*/,
153 +z_shift_hp[3] + z_shift_up - 1.575 /*8*/,
154
155 +z_shift_low - z_mod_thick + 1.450 /*9*/, +z_shift_low - z_mod_thick + 2.575 /*10*/,
156 +z_shift_low - z_mod_thick + 1.445 /*11*/, +z_shift_low - z_mod_thick + 2.600 /*12*/,
157 +z_shift_low - z_mod_thick + 1.455 /*13*/, +z_shift_low - z_mod_thick + 2.745 /*14*/,
158 +z_shift_low - z_mod_thick + 1.575 /*15*/, +z_shift_low - z_mod_thick + 2.700 /*16*/,
159 +z_shift_low - z_mod_thick + 1.545 /*17*/}};
160
161// alignment corrections --------------------------------------------------------
163 {2.68835e-01, 2.39831e-01, 2.52506e-01, 2.05206e-01, 2.11052e-01, 0.20737190},
164 {3.15120e-01, 2.74671e-01, 2.55372e-01, 2.83446e-01, 2.79317e-01, 3.48623e-01, 3.18654e-01, 3.00181e-01,
165 3.16157e-01, 3.80363e-01},
166 {1.65037e-01, 2.71806e-01, 2.66914e-01, 2.40166e-01, 2.59614e-01, 2.66288e-01, 2.83516e-01, 2.88311e-01,
167 2.61280e-01, 3.02609e-01, 2.96469e-01, 2.98769e-01, 2.66650e-01, 3.72627e-01},
168 {3.01013e-01, 3.62381e-01, 3.03249e-01, 3.06502e-01, 2.75747e-01, 2.95530e-01, 3.05152e-01, 3.42706e-01,
169 3.09787e-01, 2.24795e-01, 2.31845e-01, 2.59297e-01, 2.17342e-01, 2.20424e-01, 2.06861e-01, 2.49563e-01,
170 2.64846e-01, 2.02358e-01}};
171
173 {-0.272688, -0.300649, -0.343639, -0.313878, -0.331129, -0.299529},
174 {-0.342847, -0.343267, -0.328436, -0.354188, -0.332445, -0.349645, -0.332025, -0.294098, -0.249696, -0.217585},
175 {-0.398784, -0.342968, -0.325462, -0.325316, -0.338778, -0.338966, -0.324549, -0.339105, -0.314266, -0.301756,
176 -0.288295, -0.272864, -0.272913, -0.21294},
177 {-0.269827, -0.227419, -0.295412, -0.274608, -0.322856, -0.33417, -0.361013, -0.397192, -0.368905, -0.217688,
178 -0.240085, -0.266281, -0.285738, -0.269306, -0.292405, -0.297714, -0.323987, -0.379705}};
179
181 {-0.4, -0.3, -0.23, -0.27, -0.3, -0.23},
182 {-0.5, -0.4, -0.4, -0.28, -0.25, -0.45, -0.45, -0.3, -0.23, -0.2},
183 {-0.3, -0.5, -0.45, -0.4, -0.3, -0.2, -0.2, -0.25, -0.2, -0.3, -0.3, -0.4, -0.5, -0.27},
184 {-0.5, -0.6, -0.4, -0.5, -0.3, -0.35, -0.2, -0.1, -0.4, -0.6, -0.6, -0.6, -0.5, -0.35, -0.2, -0.1, 0.1, 0.}};
185//------------------------------------------------------------------------------
186
187// const Double_t ZModuleShifts[NStations][NMaxModules] = {
188// {+z_shift_hp[0]+z_shift_up - 2.60 + 0.105/*0*/, //the last value is a shift to compensate for a rotation of
189// half-plane around the Y-axis
190// +z_shift_hp[0]+z_shift_up - 1.45 + 0.084/*1*/,
191// +z_shift_hp[0]+z_shift_up - 2.70 + 0.063/*2*/,
192//
193// +z_shift_low - z_mod_thick + 2.61 + 0.121/*3*/,
194// +z_shift_low - z_mod_thick + 1.40 + 0.097/*4*/,
195// +z_shift_low - z_mod_thick + 2.79 + 0.072/*5*/},
196//
197// {+z_shift_hp[1]+z_shift_up - 1.430 + 0.247/*0*/,
198// +z_shift_hp[1]+z_shift_up - 2.605 + 0.206/*1*/,
199// +z_shift_hp[1]+z_shift_up - 1.435 + 0.164/*2*/,
200// +z_shift_hp[1]+z_shift_up - 2.750 + 0.122/*3*/,
201// +z_shift_hp[1]+z_shift_up - 1.580 + 0.081/*4*/,
202//
203// +z_shift_low - z_mod_thick + 1.425 + 0.107/*5*/,
204// +z_shift_low - z_mod_thick + 2.595 + 0.089/*6*/,
205// +z_shift_low - z_mod_thick + 1.445 + 0.071/*7*/,
206// +z_shift_low - z_mod_thick + 2.730 + 0.053/*8*/,
207// +z_shift_low - z_mod_thick + 1.510 + 0.035/*9*/},
208//
209// {+z_shift_hp[2]+z_shift_up - 2.595 + 0.128/*0*/,
210// +z_shift_hp[2]+z_shift_up - 1.395 + 0.112/*1*/,
211// +z_shift_hp[2]+z_shift_up - 2.665 + 0.096/*2*/,
212// +z_shift_hp[2]+z_shift_up - 1.425 + 0.080/*3*/,
213// +z_shift_hp[2]+z_shift_up - 2.735 + 0.063/*4*/,
214// +z_shift_hp[2]+z_shift_up - 1.560 + 0.043/*5*/,
215// +z_shift_hp[2]+z_shift_up - 2.705 + 0.031/*6*/,
216//
217// +z_shift_low - z_mod_thick + 2.580 + 0.484/*7*/,
218// +z_shift_low - z_mod_thick + 1.410 + 0.423/*8*/,
219// +z_shift_low - z_mod_thick + 2.565 + 0.362/*9*/,
220// +z_shift_low - z_mod_thick + 1.390 + 0.302/*10*/,
221// +z_shift_low - z_mod_thick + 2.755 + 0.241/*11*/,
222// +z_shift_low - z_mod_thick + 1.570 + 0.180/*12*/,
223// +z_shift_low - z_mod_thick + 2.765 + +0.119/*13*/},
224//
225// {+z_shift_hp[3]+z_shift_up - 1.405 + 0.112/*0*/,
226// +z_shift_hp[3]+z_shift_up - 2.610 + 0.101/*1*/,
227// +z_shift_hp[3]+z_shift_up - 1.460 + 0.090/*2*/,
228// +z_shift_hp[3]+z_shift_up - 2.605 + 0.078/*3*/,
229// +z_shift_hp[3]+z_shift_up - 1.420 + 0.067/*4*/,
230// +z_shift_hp[3]+z_shift_up - 2.755 + 0.056/*5*/,
231// +z_shift_hp[3]+z_shift_up - 1.580 + 0.044/*6*/,
232// +z_shift_hp[3]+z_shift_up - 2.760 + 0.033/*7*/,
233// +z_shift_hp[3]+z_shift_up - 1.575 + 0.022/*8*/,
234//
235// +z_shift_low - z_mod_thick + 1.450 - 0.381/*9*/,
236// +z_shift_low - z_mod_thick + 2.575 - 0.343/*10*/,
237// +z_shift_low - z_mod_thick + 1.445 - 0.305/*11*/,
238// +z_shift_low - z_mod_thick + 2.600 - 0.266/*12*/,
239// +z_shift_low - z_mod_thick + 1.455 - 0.228/*13*/,
240// +z_shift_low - z_mod_thick + 2.745 - 0.119/*14*/,
241// +z_shift_low - z_mod_thick + 1.575 - 0.151/*15*/,
242// +z_shift_low - z_mod_thick + 2.700 - 0.113/*16*/,
243// +z_shift_low - z_mod_thick + 1.545 - 0.075/*17*/}
244// };
245
246// Geometry parameters of modules
254
267
268// rotations of modules around y-axis by 180 deg.
270 {true /*0*/, true /*1*/, false /*2*/, true /*3*/, true /*4*/, false /*5*/},
271 {true /*0*/, true /*1*/, true /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, false /*8*/,
272 false /*9*/},
273 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
274 true /*9*/, true /*10*/, false /*11*/, false /*12*/, false /*13*/},
275 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, false /*5*/, false /*6*/, false /*7*/, false /*8*/,
276 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, false /*14*/, false /*15*/, false /*16*/,
277 false /*17*/}};
278
279// rotations of modules around x-axis by 180 deg.
281 {false /*0*/, false /*1*/, false /*2*/, true /*3*/, true /*4*/, true /*5*/},
282 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, true /*8*/,
283 true /*9*/},
284 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
285 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/},
286 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
287 false /*8*/, true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/, true /*16*/,
288 true /*17*/}};
289
290/*
291/rotations of half-planes around y-axis (angles in degrees)
292const Int_t NMaxHalfPlanes = 2;
293const Double_t HalfPlanesYRotations[NStations][NMaxHalfPlanes] = {
294 {-0.205, -0.235}, // st.0 (upper [0] and lower [1] half-planes)
295 {-0.399, -0.173}, // st.1
296 {-0.151, -0.584}, // st.2
297 {-0.108, +0.367} // st.3
298};
299*/
300//------------------------------------------------------------------------------
301
302// GeoManager
304
305// Module parameters ------------------------------------------------------------
307{
310}; // STANDARD_MODULE is (63x126)mm, LONG_MODULE is (63x186)mm
311const unsigned int NModuleSizes = 2;
312
313Double_t YGapBetweenPartsOfModule[NModuleSizes] = {0.0035 /*STANDARD_MODULE*/, 0.0035 /*LONG_MODULE*/}; // Mrs. Slit
314
315Double_t XModuleSize[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 6.3 /*LONG_MODULE*/};
316
317Double_t YModuleSizeUpperPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
318Double_t YModuleSizeLowerPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
319
326
327Double_t ZModuleSize[NModuleSizes] = {z_mod_thick /*STANDARD_MODULE*/, z_mod_thick /*LONG_MODULE*/};
328
329Double_t XBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // x-bevel for a angled cut
330Double_t YBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // y-bevel for a angled cut
331
336
341
342Double_t XLeftBorder[NModuleSizes] = {0.1145 /*STANDARD_MODULE*/, 0.1118 /*LONG_MODULE*/};
343Double_t XRightBorder[NModuleSizes] = {0.1118 /*STANDARD_MODULE*/, 0.1118 /*LONG_MODULE*/};
344Double_t YTopBorder[NModuleSizes] = {0.1143 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
345Double_t YMiddleBorderUpperPart[NModuleSizes] = {0.1121 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
346Double_t YMiddleBorderLowerPart[NModuleSizes] = {0.1147 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
347Double_t YBottomBorder[NModuleSizes] = {0.1148 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
348Double_t XYBevelBorder[NModuleSizes] = {0.1146 /*STANDARD_MODULE*/, 0.1146 /*LONG_MODULE*/};
349
350// Sensor zones ------------------------------------
355
361
368
370 ZModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
371 ZModuleSize[LONG_MODULE] /*LONG_MODULE*/
372};
373//-------------------------------------------------
374
375// Module frames -----------------------------------
377 XModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
378 XModuleSize[LONG_MODULE] /*LONG_MODULE*/
379};
380
382 YModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
383 YModuleSize[LONG_MODULE] /*LONG_MODULE*/
384};
385
386Double_t ZModuleFrameSize[NModuleSizes] = {0.18 /*STANDARD_MODULE*/, 0.18 /*LONG_MODULE*/};
387//-------------------------------------------------
388
389// Y-shift from center of the gap to the global x-axis (for y-alignment of the module)
394
395// X-shift from center of the module to the origin of the local x-axis
397 +XModuleSize[STANDARD_MODULE] * 0.5, /*STANDARD_MODULE*/
398 +XModuleSize[LONG_MODULE] * 0.5 /*LONG_MODULE*/
399};
400
401// Y-shift from center of the module to the origin of the local y-axis
406//------------------------------------------------------------------------------
407/*
408 ASCII module picture (view from target)
409
410 |<---- XModuleSize ---------->| ^
411 | | | Y-axis
412 ------------------------------ ---------
413 | | top border | | ^
414 ------------------------------ |
415 | | | | |
416 | l | rectangle | r | |
417 | e | sensor | i | |
418 | f | zone | g | |
419 | t | | h | |
420 | | | t | |
421 | | | | |
422 ------------------------------ |
423 | | middle (upper part) | |
424 ------ gap between parts ----- YModuleSize
425 | | middle (lower part) | |
426 ------------------------------ |
427 | | | | |
428 | b | bevel (or rect.) | r | |
429 | e | sensor | i | |
430 \ v \ zone | g | |
431 \ e \ | h | |
432 \ l \ | t | |
433 \ \ | | |
434 ------------------------- |
435 \ \ bottom | | v
436 ---------------------- ---------
437
438 * x-axis <----------------------------------(x0,y0) local point
439 */
440
441// media
447
448class FairGeoMedia;
449class FairGeoBuilder;
450
451// function declarations
452TGeoVolume* CreateStation(TString station_name);
453TGeoVolume* CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size);
454
455void DefineRequiredMedia(FairGeoMedia* geoMedia, FairGeoBuilder* geoBuild)
456{
457
458 // air medium
459 FairGeoMedium* mAir = geoMedia->getMedium("air");
460 if (!mAir)
461 Fatal("Main", "FairMedium air not found");
462 geoBuild->createMedium(mAir);
463 pMedAir = gGeoManager->GetMedium("air");
464 if (!pMedAir)
465 Fatal("Main", "Medium air not found");
466
467 // carbon medium
468 FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
469 if (!mCarbon)
470 Fatal("Main", "FairMedium carbon not found");
471 geoBuild->createMedium(mCarbon);
472 pMedCarbon = gGeoManager->GetMedium("carbon");
473 if (!pMedCarbon)
474 Fatal("Main", "Medium carbon not found");
475
476 // fiberglass medium
477 FairGeoMedium* mFiberGlass = geoMedia->getMedium("fiberglass");
478 if (!mFiberGlass)
479 Fatal("Main", "FairMedium fiberglass not found");
480 geoBuild->createMedium(mFiberGlass);
481 pMedFiberGlass = gGeoManager->GetMedium("fiberglass");
482 if (!pMedFiberGlass)
483 Fatal("Main", "Medium fiberglass not found");
484
485 // copper medium
486 FairGeoMedium* mCopper = geoMedia->getMedium("copper");
487 if (!mCopper)
488 Fatal("Main", "FairMedium copper not found");
489 geoBuild->createMedium(mCopper);
490 pMedCopper = gGeoManager->GetMedium("copper");
491 if (!pMedCopper)
492 Fatal("Main", "Medium copper not found");
493
494 // silicon medium
495 FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
496 if (!mSilicon)
497 Fatal("Main", "FairMedium silicon not found");
498 geoBuild->createMedium(mSilicon);
499 pMedSilicon = gGeoManager->GetMedium("silicon");
500 if (!pMedSilicon)
501 Fatal("Main", "Medium silicon not found");
502}
503
505{
506 cout << "\n";
507 cout << "Module parameters information [STANDARD_MODULE]: ------------------" << "\n";
508 cout << " XModuleSize = " << XModuleSize[STANDARD_MODULE] << " cm" << "\n";
509 cout << " YModuleSize = " << YModuleSize[STANDARD_MODULE] << " cm" << " ( "
511 << YModuleSizeLowerPart[STANDARD_MODULE] << " )" << "\n";
512 cout << " YModuleSizeUpperPart = " << YModuleSizeUpperPart[STANDARD_MODULE] << " cm" << "\n";
513 cout << " YModuleSizeLowerPart = " << YModuleSizeLowerPart[STANDARD_MODULE] << " cm" << "\n";
514 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[STANDARD_MODULE] << " cm" << "\n";
515 cout << " ZModuleSize = " << ZModuleSize[STANDARD_MODULE] << " cm" << "\n";
516 cout << "\n";
517 cout << " XBevelSize = " << XBevelSize[STANDARD_MODULE] << " cm" << "\n";
518 cout << " YBevelSize = " << YBevelSize[STANDARD_MODULE] << " cm" << "\n";
519 cout << " BevelAngleDeg = " << BevelAngleDeg[STANDARD_MODULE] << " deg" << "\n";
520 cout << "\n";
521 cout << " XLeftBorder = " << XLeftBorder[STANDARD_MODULE] << " cm" << "\n";
522 cout << " XRightBorder = " << XRightBorder[STANDARD_MODULE] << " cm" << "\n";
523 cout << " YTopBorder = " << YTopBorder[STANDARD_MODULE] << " cm" << "\n";
524 cout << " YMiddleBorderUpperPart = " << YMiddleBorderUpperPart[STANDARD_MODULE] << " cm" << "\n";
525 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[STANDARD_MODULE] << " cm"
526 << " (gap between two parts)\n";
527 cout << " YMiddleBorderLowerPart = " << YMiddleBorderLowerPart[STANDARD_MODULE] << " cm" << "\n";
528 cout << " YBottomBorder = " << YBottomBorder[STANDARD_MODULE] << " cm" << "\n";
529 cout << " XYBevelBorder = " << XYBevelBorder[STANDARD_MODULE] << " cm" << "\n";
530 cout << "\n";
531 cout << " XSensorZoneSize = " << XSensorZoneSize[STANDARD_MODULE] << " cm" << "\n";
532 cout << " YSensorZoneSizeUpperPart = " << YSensorZoneSizeUpperPart[STANDARD_MODULE] << " cm" << "\n";
533 cout << " YSensorZoneSizeLowerPart = " << YSensorZoneSizeLowerPart[STANDARD_MODULE] << " cm" << "\n";
534 cout << " ZSensorZoneSize = " << ZSensorZoneSize[STANDARD_MODULE] << " cm" << "\n";
535
536 cout << "-------------------------------------------------------------\n";
537
538 cout << "\n";
539 cout << "Module parameters information [LONG_MODULE]: ------------------" << "\n";
540 cout << " XModuleSize = " << XModuleSize[LONG_MODULE] << " cm" << "\n";
541 cout << " YModuleSize = " << YModuleSize[LONG_MODULE] << " cm" << " ( " << YModuleSizeUpperPart[LONG_MODULE]
543 << "\n";
544 cout << " YModuleSizeUpperPart = " << YModuleSizeUpperPart[LONG_MODULE] << " cm" << "\n";
545 cout << " YModuleSizeLowerPart = " << YModuleSizeLowerPart[LONG_MODULE] << " cm" << "\n";
546 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[LONG_MODULE] << " cm" << "\n";
547 cout << " ZModuleSize = " << ZModuleSize[LONG_MODULE] << " cm" << "\n";
548 cout << "\n";
549 cout << " XBevelSize = " << XBevelSize[LONG_MODULE] << " cm" << "\n";
550 cout << " YBevelSize = " << YBevelSize[LONG_MODULE] << " cm" << "\n";
551 cout << " BevelAngleDeg = " << BevelAngleDeg[LONG_MODULE] << " deg" << "\n";
552 cout << "\n";
553 cout << " XLeftBorder = " << XLeftBorder[LONG_MODULE] << " cm" << "\n";
554 cout << " XRightBorder = " << XRightBorder[LONG_MODULE] << " cm" << "\n";
555 cout << " YTopBorder = " << YTopBorder[LONG_MODULE] << " cm" << "\n";
556 cout << " YMiddleBorderUpperPart = " << YMiddleBorderUpperPart[LONG_MODULE] << " cm" << "\n";
557 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[LONG_MODULE] << " cm"
558 << " (gap between two parts)\n";
559 cout << " YMiddleBorderLowerPart = " << YMiddleBorderLowerPart[LONG_MODULE] << " cm" << "\n";
560 cout << " YBottomBorder = " << YBottomBorder[LONG_MODULE] << " cm" << "\n";
561 cout << " XYBevelBorder = " << XYBevelBorder[LONG_MODULE] << " cm" << "\n";
562 cout << "\n";
563 cout << " XSensorZoneSize = " << XSensorZoneSize[LONG_MODULE] << " cm" << "\n";
564 cout << " YSensorZoneSizeUpperPart = " << YSensorZoneSizeUpperPart[LONG_MODULE] << " cm" << "\n";
565 cout << " YSensorZoneSizeLowerPart = " << YSensorZoneSizeLowerPart[LONG_MODULE] << " cm" << "\n";
566 cout << " ZSensorZoneSize = " << ZSensorZoneSize[LONG_MODULE] << " cm" << "\n";
567
568 cout << "-------------------------------------------------------------\n";
569}
570
572{
573 cout << "\n";
574 for (Int_t istation = 0; istation < NStations; ++istation) {
575 cout << "station " << istation << ":\n";
576 cout << " XStationPositions[" << istation << "] = " << XStationPositions[istation] << " cm\n";
577 cout << " YStationPositions[" << istation << "] = " << YStationPositions[istation] << " cm\n";
578 cout << " ZStationPositions[" << istation << "] = " << ZStationPositions[istation] << " cm\n";
579 cout << "\n";
580
581 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
582 cout << " module " << imodule << ":\n";
583 cout << " XModuleShifts[" << istation << "][" << imodule << "] = " << XModuleShifts[istation][imodule]
584 << " cm\n";
585 cout << " YModuleShifts[" << istation << "][" << imodule << "] = " << YModuleShifts[istation][imodule]
586 << " cm\n";
587 cout << " ZModuleShifts[" << istation << "][" << imodule << "] = " << ZModuleShifts[istation][imodule]
588 << " cm\n";
589 cout << "\n";
590
591 Double_t XGlobalModulePos = XModuleShifts[istation][imodule] + XStationPositions[istation];
592 Double_t YGlobalModulePos = YModuleShifts[istation][imodule] + YStationPositions[istation];
593 Double_t ZGlobalModulePos = ZModuleShifts[istation][imodule] + ZStationPositions[istation];
594
595 cout << " XGlobalModulePos = " << XGlobalModulePos << " cm\n";
596 cout << " YGlobalModulePos = " << YGlobalModulePos << " cm\n";
597 cout << " ZGlobalModulePos = " << ZGlobalModulePos << " cm\n";
598 cout << "\n";
599
600 cout << " ModulesTypes[" << istation << "][" << imodule << "] = ";
601 if (ModulesTypes[istation][imodule] == 0)
602 cout << "RIGHT_ANGLED_MODULE\n";
603 if (ModulesTypes[istation][imodule] == 1)
604 cout << "BEVEL_MODULE\n";
605 if (ModulesTypes[istation][imodule] == 2)
606 cout << "RIGHT_ANGLED_MODULE_HALF\n";
607 if (ModulesTypes[istation][imodule] == 3)
608 cout << "BEVEL_MODULE_HALF\n";
609 cout << " ModulesYRotations[" << istation << "][" << imodule << "] = ";
610 if (ModulesYRotations[istation][imodule] == false)
611 cout << "not rotated around Y\n";
612 if (ModulesYRotations[istation][imodule] == true)
613 cout << "rotated around Y\n";
614 cout << " ModulesXRotations[" << istation << "][" << imodule << "] = ";
615 if (ModulesXRotations[istation][imodule] == false)
616 cout << "not rotated around X\n";
617 if (ModulesXRotations[istation][imodule] == true)
618 cout << "rotated around X\n";
619 cout << "\n";
620 }
621 cout << "-------------------------------------------------------------\n";
622 }
623 cout << "-------------------------------------------------------------\n";
624}
625
627{
628
629 // ---- set working directory --------------------------------------------
630 TString gPath = gSystem->Getenv("VMCWORKDIR");
631
632 // ------- Geometry file name (output) ----------------------------------
633 const TString geoDetectorName = "Silicon";
634 const TString geoDetectorVersion = "Run8_aligned";
635 const TString geoFileName = gPath + "/geometry/" + geoDetectorName + "_" + geoDetectorVersion + ".root";
636
637 // ---- global geometry parameters ---------------------------------------
638 FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
639 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
640
641 // ------- Load media from media file ----------------------------------
642 TString medFile = gPath + "/geometry/media.geo";
643 geoFace->setMediaFile(medFile);
644 geoFace->readMedia();
645 FairGeoMedia* geoMedia = geoFace->getMedia();
646 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
647
648 DefineRequiredMedia(geoMedia, geoBuild);
649 // -------------------------------------------------------------------------
650
651 // Print information about parameters of SILICON
654
655 // -------------- Create geometry and top volume -------------------------
656 gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
657 gGeoMan->SetName(geoDetectorName + "_geom");
658 TGeoVolume* top = new TGeoVolumeAssembly("TOP");
659 top->SetMedium(pMedAir);
660 gGeoMan->SetTopVolume(top);
661 // gGeoMan->SetTopVisible(1);
662 // --------------------------------------------------------------------------
663
664 // Define TOP Geometry
665 TGeoVolume* SILICON = new TGeoVolumeAssembly(geoDetectorName);
666 SILICON->SetMedium(pMedAir);
667
668 // Let's create SILICON stations filled with modules
669 for (Int_t istation = 0; istation < NStations; ++istation) {
670 // for(Int_t istation = 0; istation < 1; ++istation) {
671
672 // module size in a station
673 ModuleSize module_size = STANDARD_MODULE;
674
675 if (istation == 0)
676 module_size = LONG_MODULE;
677
678 TGeoVolume* station = CreateStation(TString("station") + TString::Itoa(istation, 10));
679
680 Int_t NModules = NModulesInStations[istation];
681
682 TGeoVolume* modules[NModules];
683 TGeoCombiTrans* modTransforms[NModules];
684
685 for (Int_t imodule = 0; imodule < NModules; ++imodule) {
686
687 TString module_name = TString("module") + TString::Itoa(imodule, 10) + TString("_") + station->GetName();
688 modules[imodule] = CreateModule(module_name, ModulesTypes[istation][imodule], module_size);
689
690 modTransforms[imodule] = new TGeoCombiTrans();
691
692 // Applying alignment corrections to module shifts
693 XModuleShifts[istation][imodule] -= XAlignmentCorrections[istation][imodule];
694 YModuleShifts[istation][imodule] -= YAlignmentCorrections[istation][imodule];
695 ZModuleShifts[istation][imodule] += ZAlignmentCorrections[istation][imodule];
696
697 if (ModulesYRotations[istation][imodule]) {
698 modTransforms[imodule]->RotateY(180.0);
699 modTransforms[imodule]->SetDx(XModuleShifts[istation][imodule]
700 - XShiftFromCenterToLocalX0[module_size]);
701 } else {
702 modTransforms[imodule]->SetDx(XModuleShifts[istation][imodule]
703 + XShiftFromCenterToLocalX0[module_size]);
704 }
705
706 if (ModulesXRotations[istation][imodule]) {
707 modTransforms[imodule]->RotateX(180.0);
708 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
709 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
710 {
711 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule]
712 - YModuleSizeUpperPart[module_size] * 0.5);
713 } else {
714 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule] + YShiftFromCenterToAxis[module_size]
715 - YShiftFromCenterToLocalY0[module_size]);
716 }
717 } else {
718 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
719 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
720 {
721 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule]
722 + YModuleSizeUpperPart[module_size] * 0.5);
723 } else {
724 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule] + YShiftFromCenterToAxis[module_size]
725 + YShiftFromCenterToLocalY0[module_size]);
726 }
727 }
728
729 Double_t z_module_shift =
730 +ZModuleSize[module_size] * 0.5; // To z-module position is at the beginning of the sensitive volume
731 modTransforms[imodule]->SetDz(ZModuleShifts[istation][imodule] + z_module_shift);
732
733 // Rotate half-planes
734 if (imodule < NModulesInStations[istation] / 2) { // modules of upper half-plane
735 modTransforms[imodule]->SetDx(modTransforms[imodule]->GetTranslation()[0] - x_shift_hp[istation]);
736 modTransforms[imodule]->SetDy(modTransforms[imodule]->GetTranslation()[1] - y_shift_hp[istation]);
737 modTransforms[imodule]->SetDz(modTransforms[imodule]->GetTranslation()[2] - z_shift_hp[istation]);
738
739 // modTransforms[imodule]->RotateY(HalfPlanesYRotations[istation][0]);
740
741 modTransforms[imodule]->SetDx(modTransforms[imodule]->GetTranslation()[0] + x_shift_hp[istation]);
742 modTransforms[imodule]->SetDy(modTransforms[imodule]->GetTranslation()[1] + y_shift_hp[istation]);
743 modTransforms[imodule]->SetDz(modTransforms[imodule]->GetTranslation()[2] + z_shift_hp[istation]);
744 } else { // modules of lower half-plane
745 modTransforms[imodule]->SetDz(ZModuleShifts[istation][imodule] + z_module_shift);
746 // modTransforms[imodule]->RotateY(HalfPlanesYRotations[istation][1]);
747 }
748
749 cout << "station = " << istation << "\n";
750 cout << "module = " << imodule << "\n";
751 cout << " modTransforms[imodule]->GetTranslation()[2] = " << modTransforms[imodule]->GetTranslation()[2]
752 << "\n";
753 cout << " ZStationPositions[istation] = " << ZStationPositions[istation] << "\n";
754 station->AddNode(modules[imodule], 0, modTransforms[imodule]);
755 }
756
757 TGeoCombiTrans* station_transform = new TGeoCombiTrans();
758 station_transform->SetTranslation(XStationPositions[istation], YStationPositions[istation],
759 ZStationPositions[istation]);
760
761 SILICON->AddNode(station, 0, station_transform);
762 }
763
764 top->AddNode(SILICON, 0);
766
767 // --------------- Finish -----------------------------------------------
768 gGeoMan->CloseGeometry();
769 gGeoMan->CheckOverlaps(0.0001);
770 gGeoMan->PrintOverlaps();
771 gGeoMan->Test();
772
773 TFile* geoFile = new TFile(geoFileName, "RECREATE");
774 top->Write();
775 geoFile->Close();
776 top->Draw("ogl");
777}
778//------------------------------------------------------------------------------
779
781{
782
783 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
784 stationA->SetMedium(pMedAir);
785
786 return stationA;
787}
788
789TGeoVolume* CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size)
790{
791
792 // Shapes -------------------------------------------------------------------
793 // module shape
794 TGeoShape* moduleS = 0;
795
796 switch (module_type) {
797 case RIGHT_ANGLED_MODULE: {
798 moduleS = new TGeoBBox("moduleS", XModuleSize[module_size] * 0.5, YModuleSize[module_size] * 0.5,
799 ZModuleSize[module_size] * 0.5);
800 break;
801 }
803 moduleS = new TGeoBBox("moduleS", XModuleSize[module_size] * 0.5, YModuleSizeUpperPart[module_size] * 0.5,
804 ZModuleSize[module_size] * 0.5);
805 break;
806 }
807 case BEVEL_MODULE: {
808 moduleS = new TGeoXtru(2);
809 moduleS->SetName("moduleS");
810 Double_t x_pos[5] = {
811 +XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5,
812 +XModuleSize[module_size] * 0.5 - XBevelSize[module_size], +XModuleSize[module_size] * 0.5};
813 Double_t y_pos[5] = {+YModuleSize[module_size] * 0.5, +YModuleSize[module_size] * 0.5,
814 -YModuleSize[module_size] * 0.5, -YModuleSize[module_size] * 0.5,
815 -YModuleSize[module_size] * 0.5 + YBevelSize[module_size]};
816 ((TGeoXtru*)moduleS)->DefinePolygon(5, x_pos, y_pos);
817 ((TGeoXtru*)moduleS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
818 ((TGeoXtru*)moduleS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
819 break;
820 }
821 case BEVEL_MODULE_HALF: {
822 moduleS = new TGeoXtru(2);
823 moduleS->SetName("moduleS");
824 Double_t x_pos[5] = {
825 +XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5,
826 +XModuleSize[module_size] * 0.5 - XBevelSize[module_size], +XModuleSize[module_size] * 0.5};
827 Double_t y_pos[5] = {+YModuleSizeUpperPart[module_size] * 0.5, +YModuleSizeUpperPart[module_size] * 0.5,
828 -YModuleSizeUpperPart[module_size] * 0.5, -YModuleSizeUpperPart[module_size] * 0.5,
829 -YModuleSizeUpperPart[module_size] * 0.5 + YBevelSize[module_size]};
830 ((TGeoXtru*)moduleS)->DefinePolygon(5, x_pos, y_pos);
831 ((TGeoXtru*)moduleS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
832 ((TGeoXtru*)moduleS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
833 break;
834 }
835 default:
836 Error("CreateModule()", "Incorrect module type selected!!!");
837 }
838
839 // sensor zone shape (upper part of the module: rectangle zone)
840 TGeoShape* sensor_zone_upper_part_rectS =
841 new TGeoBBox("sensor_zone_upper_part_rectS", XSensorZoneSize[module_size] * 0.5,
842 YSensorZoneSizeUpperPart[module_size] * 0.5, ZSensorZoneSize[module_size] * 0.5);
843
844 // sensor zone shape (upper part of the module: bevel zone)
845 TGeoShape* sensor_zone_upper_part_bevelS = new TGeoXtru(2);
846 sensor_zone_upper_part_bevelS->SetName("sensor_zone_upper_part_bevelS");
847 // Calculate coordinates of the bottom and the top points of the inner bevel
848 {
849 // find x and y projections of the bevel border thickness
850 Double_t x_delta = XYBevelBorder[module_size] / TMath::Cos(BevelAngleRad[module_size]);
851 Double_t y_delta = XYBevelBorder[module_size] / TMath::Sin(BevelAngleRad[module_size]);
852
853 // find shifts of the sensitive zone from module borders via the equation of the straight line for the inner
854 // bevel
855 Double_t x_delta_top_BP = XLeftBorder[module_size];
856 Double_t y_delta_top_BP = TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]) * x_delta_top_BP
857 + (YBevelSize[module_size] + y_delta);
858
859 Double_t y_delta_bottom_BP = YMiddleBorderUpperPart[module_size];
860 Double_t x_delta_bottom_BP = (y_delta_bottom_BP - (YBevelSize[module_size] + y_delta))
861 / (TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]));
862 //----------------------------------------------------------------------
863
864 Double_t x_pos_sensor_zone_bevel[5] = {+XModuleSize[module_size] * 0.5 - XLeftBorder[module_size],
865 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
866 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
867 +XModuleSize[module_size] * 0.5 - x_delta_bottom_BP,
868 +XModuleSize[module_size] * 0.5 - XLeftBorder[module_size]};
869 Double_t y_pos_sensor_zone_bevel[5] = {
870 +YModuleSizeUpperPart[module_size] * 0.5 - YTopBorder[module_size],
871 +YModuleSizeUpperPart[module_size] * 0.5 - YTopBorder[module_size],
872 -YModuleSizeUpperPart[module_size] * 0.5 + YMiddleBorderUpperPart[module_size],
873 -YModuleSizeUpperPart[module_size] * 0.5 + YMiddleBorderUpperPart[module_size],
874 -YModuleSizeUpperPart[module_size] * 0.5 + y_delta_top_BP};
875
876 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefinePolygon(5, x_pos_sensor_zone_bevel, y_pos_sensor_zone_bevel);
877 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
878 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
879 }
880
881 // sensor zone shape (lower part of the module: rectangle zone)
882 TGeoShape* sensor_zone_lower_part_rectS =
883 new TGeoBBox("sensor_zone_lower_part_rectS", XSensorZoneSize[module_size] * 0.5,
884 YSensorZoneSizeLowerPart[module_size] * 0.5, ZSensorZoneSize[module_size] * 0.5);
885
886 // sensor zone shape (lower part of the module: bevel zone)
887 TGeoShape* sensor_zone_lower_part_bevelS = new TGeoXtru(2);
888 sensor_zone_lower_part_bevelS->SetName("sensor_zone_lower_part_bevelS");
889 // Calculate coordinates of the bottom and the top points of the inner bevel
890 {
891 // find x and y projections of the bevel border thickness
892 Double_t x_delta = XYBevelBorder[module_size] / TMath::Cos(BevelAngleRad[module_size]);
893 Double_t y_delta = XYBevelBorder[module_size] / TMath::Sin(BevelAngleRad[module_size]);
894
895 // find shifts of the sensitive zone from module borders via the equation of the straight line for the inner
896 // bevel
897 Double_t x_delta_top_BP = XLeftBorder[module_size];
898 Double_t y_delta_top_BP = TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]) * x_delta_top_BP
899 + (YBevelSize[module_size] + y_delta);
900
901 Double_t y_delta_bottom_BP = YBottomBorder[module_size];
902 Double_t x_delta_bottom_BP = (y_delta_bottom_BP - (YBevelSize[module_size] + y_delta))
903 / (TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]));
904 //----------------------------------------------------------------------
905
906 Double_t x_pos_sensor_zone_bevel[5] = {+XModuleSize[module_size] * 0.5 - XLeftBorder[module_size],
907 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
908 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
909 +XModuleSize[module_size] * 0.5 - x_delta_bottom_BP,
910 +XModuleSize[module_size] * 0.5 - XLeftBorder[module_size]};
911 Double_t y_pos_sensor_zone_bevel[5] = {
912 +YModuleSizeLowerPart[module_size] * 0.5 - YMiddleBorderLowerPart[module_size],
913 +YModuleSizeLowerPart[module_size] * 0.5 - YMiddleBorderLowerPart[module_size],
914 -YModuleSizeLowerPart[module_size] * 0.5 + YBottomBorder[module_size],
915 -YModuleSizeLowerPart[module_size] * 0.5 + YBottomBorder[module_size],
916 -YModuleSizeLowerPart[module_size] * 0.5 + y_delta_top_BP};
917
918 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefinePolygon(5, x_pos_sensor_zone_bevel, y_pos_sensor_zone_bevel);
919 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
920 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
921 }
922
923 //--------------------------------------------------------------------------
924
925 // Volumes ------------------------------------------------------------------
926 // module volume
927 // TString module_name = "moduleV_";
928
929 TGeoVolume* moduleV = new TGeoVolume(module_name, moduleS);
930
931 // sensor zone volume (upper part of the module)
932 TGeoVolume* sensor_zone_upper_part_rectV =
933 new TGeoVolume("Sensor_zone_upper_part_rectV", sensor_zone_upper_part_rectS);
934
935 // sensor zone volume (lower part of the module)
936 TGeoVolume* sensor_zone_upper_part_bevelV =
937 new TGeoVolume("Sensor_zone_upper_part_bevelV", sensor_zone_upper_part_bevelS);
938
939 // sensor zone volume (lower part of the module: rectangle zone)
940 TGeoVolume* sensor_zone_lower_part_rectV =
941 new TGeoVolume("Sensor_zone_lower_part_rectV", sensor_zone_lower_part_rectS);
942
943 // sensor zone volume (lower part of the module: bevel zone)
944 TGeoVolume* sensor_zone_lower_part_bevelV =
945 new TGeoVolume("Sensor_zone_lower_part_bevelV", sensor_zone_lower_part_bevelS);
946
947 // volumes media
948 TGeoMedium* silicon_medium = pMedSilicon;
949 if (silicon_medium) {
950 moduleV->SetMedium(silicon_medium);
951 sensor_zone_upper_part_rectV->SetMedium(silicon_medium);
952 sensor_zone_upper_part_bevelV->SetMedium(silicon_medium);
953 sensor_zone_lower_part_rectV->SetMedium(silicon_medium);
954 sensor_zone_lower_part_bevelV->SetMedium(silicon_medium);
955 } else
956 Fatal("Main", "Invalid medium for modules and sensor zones!");
957
958 // volumes visual property (transparency)
959 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
960 sensor_zone_upper_part_rectV->SetLineColor(TColor::GetColor("#e0b0ff"));
961 sensor_zone_upper_part_bevelV->SetLineColor(TColor::GetColor("#e0b0ff"));
962 sensor_zone_lower_part_rectV->SetLineColor(TColor::GetColor("#e0b0ff"));
963 sensor_zone_lower_part_bevelV->SetLineColor(TColor::GetColor("#e0b0ff"));
964 moduleV->SetTransparency(50);
965
966 switch (module_type) {
967
968 case RIGHT_ANGLED_MODULE: {
969
970 // position of the sensor zone in the upper part of the module
971 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
972 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
973 - XLeftBorder[module_size]);
974 sensor_zone_upper_part_pos->SetDy(
975 +YSensorZoneSizeUpperPart[module_size] * 0.5 + YGapBetweenPartsOfModule[module_size] * 0.5
976 + YMiddleBorderUpperPart[module_size] - YShiftFromCenterToAxis[module_size]);
977 sensor_zone_upper_part_pos->SetDz(0.0);
978
979 // position of the sensor zone in the lower part of the module
980 TGeoTranslation* sensor_zone_lower_part_pos = new TGeoTranslation();
981 sensor_zone_lower_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
982 - XLeftBorder[module_size]);
983 sensor_zone_lower_part_pos->SetDy(
984 -YSensorZoneSizeLowerPart[module_size] * 0.5 - YGapBetweenPartsOfModule[module_size] * 0.5
985 - YMiddleBorderLowerPart[module_size] - YShiftFromCenterToAxis[module_size]);
986 sensor_zone_lower_part_pos->SetDz(0.0);
987
988 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
989 moduleV->AddNode(sensor_zone_lower_part_rectV, 0, sensor_zone_lower_part_pos);
990 break;
991 }
992
994 // position of the sensor zone in the upper part of the module
995 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
996 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
997 - XLeftBorder[module_size]);
998 sensor_zone_upper_part_pos->SetDy(+(YTopBorder[module_size] + YMiddleBorderUpperPart[module_size]) * 0.5
999 - YTopBorder[module_size]);
1000 sensor_zone_upper_part_pos->SetDz(0.0);
1001
1002 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
1003 break;
1004 }
1005
1006 case BEVEL_MODULE: {
1007
1008 // position of the sensor zone in the upper part of the module
1009 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
1010 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
1011 - XLeftBorder[module_size]);
1012 sensor_zone_upper_part_pos->SetDy(
1013 +YSensorZoneSizeUpperPart[module_size] * 0.5 + YGapBetweenPartsOfModule[module_size] * 0.5
1014 + YMiddleBorderUpperPart[module_size] - YShiftFromCenterToAxis[module_size]);
1015 sensor_zone_upper_part_pos->SetDz(0.0);
1016
1017 // position of the sensor zone in the lower part of the module
1018 TGeoTranslation* sensor_zone_lower_part_bevel_pos = new TGeoTranslation();
1019 sensor_zone_lower_part_bevel_pos->SetDx(0.0);
1020 sensor_zone_lower_part_bevel_pos->SetDy(-YModuleSizeLowerPart[module_size] * 0.5
1021 - YGapBetweenPartsOfModule[module_size] * 0.5
1022 - YShiftFromCenterToAxis[module_size]);
1023 sensor_zone_lower_part_bevel_pos->SetDz(0.0);
1024
1025 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
1026 moduleV->AddNode(sensor_zone_lower_part_bevelV, 0, sensor_zone_lower_part_bevel_pos);
1027 break;
1028 }
1029
1030 case BEVEL_MODULE_HALF: {
1031
1032 // position of the sensor zone in the upper part of the module
1033 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
1034 sensor_zone_upper_part_pos->SetDx(0);
1035 sensor_zone_upper_part_pos->SetDy(0);
1036 sensor_zone_upper_part_pos->SetDz(0.0);
1037
1038 moduleV->AddNode(sensor_zone_upper_part_bevelV, 0, sensor_zone_upper_part_pos);
1039 break;
1040 }
1041
1042 default:
1043 Error("CreateModule()", "Incorrect module type selected!!!");
1044 }
1045
1046 return moduleV;
1047}
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 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]
Double_t XModuleShifts[NStations][NMaxModules]
const Double_t ZStationPositions[NStations]
Double_t ZModuleShifts[NStations][NMaxModules]
TGeoMedium * pMedFiberGlass
const Double_t XStationPositions[NStations]
Double_t YModuleShifts[NStations][NMaxModules]
const Int_t NModulesInStations[NStations]
const Double_t XAlignmentCorrections[NStations][NMaxModules]
const Double_t YAlignmentCorrections[NStations][NMaxModules]
const Double_t ZAlignmentCorrections[NStations][NMaxModules]
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 z_mod_thick
const Double_t z_shift_low
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]
const Double_t z_shift_up
Double_t BevelAngleDeg[NModuleSizes]
Double_t YGapBetweenPartsOfModule[NModuleSizes]
Double_t XModuleSize[NModuleSizes]
const unsigned int 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 * CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size)
TGeoVolume * CreateStation(TString station_name)
void PrintInfoAboutModuleParameters()
void DefineRequiredMedia(FairGeoMedia *geoMedia, FairGeoBuilder *geoBuild)
void create_rootgeom_Silicon_Run8_aligned()
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()