BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
create_rootgeom_Silicon_Run8.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*/}};
93
95 {+y_dist_cent_base[0] + y_shift_hp[0] - 13.112 /*0*/, +y_dist_cent_base[0] + y_shift_hp[0] - 10.113 /*1*/,
96 +y_dist_cent_base[0] + y_shift_hp[0] - 13.086 /*2*/,
97
98 -y_dist_cent_base[0] + 13.100 /*3*/, -y_dist_cent_base[0] + 10.110 /*4*/, -y_dist_cent_base[0] + 13.098 /*5*/},
99
100 {+y_dist_cent_base[1] + y_shift_hp[1] - 16.427 /*0*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.425 /*1*/,
101 +y_dist_cent_base[1] + y_shift_hp[1] - 13.423 /*2*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.423 /*3*/,
102 +y_dist_cent_base[1] + y_shift_hp[1] - 16.425 /*4*/,
103
104 -y_dist_cent_base[1] + 16.432 /*5*/, -y_dist_cent_base[1] + 16.423 /*6*/, -y_dist_cent_base[1] + 13.428 /*7*/,
105 -y_dist_cent_base[1] + 16.425 /*8*/, -y_dist_cent_base[1] + 16.429 /*9*/},
106
107 {+y_dist_cent_base[2] + y_shift_hp[2] - 16.424 /*0*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*1*/,
108 +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*2*/, +y_dist_cent_base[2] + y_shift_hp[2] - 13.411 /*3*/,
109 +y_dist_cent_base[2] + y_shift_hp[2] - 16.431 /*4*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.420 /*5*/,
110 +y_dist_cent_base[2] + y_shift_hp[2] - 16.430 /*6*/,
111
112 -y_dist_cent_base[2] + 16.420 /*7*/, -y_dist_cent_base[2] + 16.426 /*8*/, -y_dist_cent_base[2] + 16.427 /*9*/,
113 -y_dist_cent_base[2] + 13.428 /*10*/, -y_dist_cent_base[2] + 16.418 /*11*/, -y_dist_cent_base[2] + 16.426 /*12*/,
114 -y_dist_cent_base[2] + 16.417 /*13*/},
115
116 {+y_dist_cent_base[3] + y_shift_hp[3] - 16.414 /*0*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.414 /*1*/,
117 +y_dist_cent_base[3] + y_shift_hp[3] - 16.413 /*2*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.420 /*3*/,
118 +y_dist_cent_base[3] + y_shift_hp[3] - 13.417 /*4*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.426 /*5*/,
119 +y_dist_cent_base[3] + y_shift_hp[3] - 16.418 /*6*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.425 /*7*/,
120 +y_dist_cent_base[3] + y_shift_hp[3] - 16.427 /*8*/,
121
122 -y_dist_cent_base[3] + 16.430 /*9*/, -y_dist_cent_base[3] + 16.433 /*10*/, -y_dist_cent_base[3] + 16.433 /*11*/,
123 -y_dist_cent_base[3] + 16.430 /*12*/, -y_dist_cent_base[3] + 13.435 /*13*/, -y_dist_cent_base[3] + 16.430 /*14*/,
124 -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
127 {+z_shift_hp[0] + z_shift_up - 2.60 /*0*/, +z_shift_hp[0] + z_shift_up - 1.45 /*1*/,
128 +z_shift_hp[0] + z_shift_up - 2.70 /*2*/,
129
130 +z_shift_low - z_mod_thick + 2.61 /*3*/, +z_shift_low - z_mod_thick + 1.40 /*4*/,
131 +z_shift_low - z_mod_thick + 2.79 /*5*/},
132
133 {+z_shift_hp[1] + z_shift_up - 1.430 /*0*/, +z_shift_hp[1] + z_shift_up - 2.605 /*1*/,
134 +z_shift_hp[1] + z_shift_up - 1.435 /*2*/, +z_shift_hp[1] + z_shift_up - 2.750 /*3*/,
135 +z_shift_hp[1] + z_shift_up - 1.580 /*4*/,
136
137 +z_shift_low - z_mod_thick + 1.425 /*5*/, +z_shift_low - z_mod_thick + 2.595 /*6*/,
138 +z_shift_low - z_mod_thick + 1.445 /*7*/, +z_shift_low - z_mod_thick + 2.730 /*8*/,
139 +z_shift_low - z_mod_thick + 1.510 /*9*/},
140
141 {+z_shift_hp[2] + z_shift_up - 2.595 /*0*/, +z_shift_hp[2] + z_shift_up - 1.395 /*1*/,
142 +z_shift_hp[2] + z_shift_up - 2.665 /*2*/, +z_shift_hp[2] + z_shift_up - 1.425 /*3*/,
143 +z_shift_hp[2] + z_shift_up - 2.735 /*4*/, +z_shift_hp[2] + z_shift_up - 1.560 /*5*/,
144 +z_shift_hp[2] + z_shift_up - 2.705 /*6*/,
145
146 +z_shift_low - z_mod_thick + 2.580 /*7*/, +z_shift_low - z_mod_thick + 1.410 /*8*/,
147 +z_shift_low - z_mod_thick + 2.565 /*9*/, +z_shift_low - z_mod_thick + 1.390 /*10*/,
148 +z_shift_low - z_mod_thick + 2.755 /*11*/, +z_shift_low - z_mod_thick + 1.570 /*12*/,
149 +z_shift_low - z_mod_thick + 2.765 /*13*/},
150
151 {+z_shift_hp[3] + z_shift_up - 1.405 /*0*/, +z_shift_hp[3] + z_shift_up - 2.610 /*1*/,
152 +z_shift_hp[3] + z_shift_up - 1.460 /*2*/, +z_shift_hp[3] + z_shift_up - 2.605 /*3*/,
153 +z_shift_hp[3] + z_shift_up - 1.420 /*4*/, +z_shift_hp[3] + z_shift_up - 2.755 /*5*/,
154 +z_shift_hp[3] + z_shift_up - 1.580 /*6*/, +z_shift_hp[3] + z_shift_up - 2.760 /*7*/,
155 +z_shift_hp[3] + z_shift_up - 1.575 /*8*/,
156
157 +z_shift_low - z_mod_thick + 1.450 /*9*/, +z_shift_low - z_mod_thick + 2.575 /*10*/,
158 +z_shift_low - z_mod_thick + 1.445 /*11*/, +z_shift_low - z_mod_thick + 2.600 /*12*/,
159 +z_shift_low - z_mod_thick + 1.455 /*13*/, +z_shift_low - z_mod_thick + 2.745 /*14*/,
160 +z_shift_low - z_mod_thick + 1.575 /*15*/, +z_shift_low - z_mod_thick + 2.700 /*16*/,
161 +z_shift_low - z_mod_thick + 1.545 /*17*/}};
162
163// Geometry parameters of modules
171
184
185// rotations of modules around y-axis by 180 deg.
187 {true /*0*/, true /*1*/, false /*2*/, true /*3*/, true /*4*/, false /*5*/},
188 {true /*0*/, true /*1*/, true /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, false /*8*/,
189 false /*9*/},
190 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
191 true /*9*/, true /*10*/, false /*11*/, false /*12*/, false /*13*/},
192 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, false /*5*/, false /*6*/, false /*7*/, false /*8*/,
193 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, false /*14*/, false /*15*/, false /*16*/,
194 false /*17*/}};
195
196// rotations of modules around x-axis by 180 deg.
198 {false /*0*/, false /*1*/, false /*2*/, true /*3*/, true /*4*/, true /*5*/},
199 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, true /*8*/,
200 true /*9*/},
201 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
202 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/},
203 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
204 false /*8*/, true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/, true /*16*/,
205 true /*17*/}};
206
207/*
208//rotations of half-planes around y-axis (angles in degrees)
209const Int_t NMaxHalfPlanes = 2;
210const Double_t HalfPlanesYRotations[NStations][NMaxHalfPlanes] = {
211 {-0.205, -0.235}, // st.0 (upper [0] and lower [1] half-planes)
212 {-0.399, -0.173}, // st.1
213 {-0.151, -0.584}, // st.2
214 {-0.108, +0.367} // st.3
215};
216*/
217//------------------------------------------------------------------------------
218
219// GeoManager
221
222// Module parameters ------------------------------------------------------------
224{
227}; // STANDARD_MODULE is (63x126)mm, LONG_MODULE is (63x186)mm
228const unsigned int NModuleSizes = 2;
229
230Double_t YGapBetweenPartsOfModule[NModuleSizes] = {0.0035 /*STANDARD_MODULE*/, 0.0035 /*LONG_MODULE*/}; // Mrs. Slit
231
232Double_t XModuleSize[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 6.3 /*LONG_MODULE*/};
233
234Double_t YModuleSizeUpperPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
235Double_t YModuleSizeLowerPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
236
243
244Double_t ZModuleSize[NModuleSizes] = {z_mod_thick /*STANDARD_MODULE*/, z_mod_thick /*LONG_MODULE*/};
245
246Double_t XBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // x-bevel for a angled cut
247Double_t YBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // y-bevel for a angled cut
248
253
258
259Double_t XLeftBorder[NModuleSizes] = {0.1145 /*STANDARD_MODULE*/, 0.1118 /*LONG_MODULE*/};
260Double_t XRightBorder[NModuleSizes] = {0.1118 /*STANDARD_MODULE*/, 0.1118 /*LONG_MODULE*/};
261Double_t YTopBorder[NModuleSizes] = {0.1143 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
262Double_t YMiddleBorderUpperPart[NModuleSizes] = {0.1121 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
263Double_t YMiddleBorderLowerPart[NModuleSizes] = {0.1147 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
264Double_t YBottomBorder[NModuleSizes] = {0.1148 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
265Double_t XYBevelBorder[NModuleSizes] = {0.1146 /*STANDARD_MODULE*/, 0.1146 /*LONG_MODULE*/};
266
267// Sensor zones ------------------------------------
272
278
285
287 ZModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
288 ZModuleSize[LONG_MODULE] /*LONG_MODULE*/
289};
290//-------------------------------------------------
291
292// Module frames -----------------------------------
294 XModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
295 XModuleSize[LONG_MODULE] /*LONG_MODULE*/
296};
297
299 YModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
300 YModuleSize[LONG_MODULE] /*LONG_MODULE*/
301};
302
303Double_t ZModuleFrameSize[NModuleSizes] = {0.18 /*STANDARD_MODULE*/, 0.18 /*LONG_MODULE*/};
304//-------------------------------------------------
305
306// Y-shift from center of the gap to the global x-axis (for y-alignment of the module)
311
312// X-shift from center of the module to the origin of the local x-axis
314 +XModuleSize[STANDARD_MODULE] * 0.5, /*STANDARD_MODULE*/
315 +XModuleSize[LONG_MODULE] * 0.5 /*LONG_MODULE*/
316};
317
318// Y-shift from center of the module to the origin of the local y-axis
323//------------------------------------------------------------------------------
324/*
325 ASCII module picture (view from target)
326
327 |<---- XModuleSize ---------->| ^
328 | | | Y-axis
329 ------------------------------ ---------
330 | | top border | | ^
331 ------------------------------ |
332 | | | | |
333 | l | rectangle | r | |
334 | e | sensor | i | |
335 | f | zone | g | |
336 | t | | h | |
337 | | | t | |
338 | | | | |
339 ------------------------------ |
340 | | middle (upper part) | |
341 ------ gap between parts ----- YModuleSize
342 | | middle (lower part) | |
343 ------------------------------ |
344 | | | | |
345 | b | bevel (or rect.) | r | |
346 | e | sensor | i | |
347 \ v \ zone | g | |
348 \ e \ | h | |
349 \ l \ | t | |
350 \ \ | | |
351 ------------------------- |
352 \ \ bottom | | v
353 ---------------------- ---------
354
355 * x-axis <----------------------------------(x0,y0) local point
356 */
357
358// media
364
365class FairGeoMedia;
366class FairGeoBuilder;
367
368// function declarations
369TGeoVolume* CreateStation(TString station_name);
370TGeoVolume* CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size);
371
372void DefineRequiredMedia(FairGeoMedia* geoMedia, FairGeoBuilder* geoBuild)
373{
374
375 // air medium
376 FairGeoMedium* mAir = geoMedia->getMedium("air");
377 if (!mAir)
378 Fatal("Main", "FairMedium air not found");
379 geoBuild->createMedium(mAir);
380 pMedAir = gGeoManager->GetMedium("air");
381 if (!pMedAir)
382 Fatal("Main", "Medium air not found");
383
384 // carbon medium
385 FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
386 if (!mCarbon)
387 Fatal("Main", "FairMedium carbon not found");
388 geoBuild->createMedium(mCarbon);
389 pMedCarbon = gGeoManager->GetMedium("carbon");
390 if (!pMedCarbon)
391 Fatal("Main", "Medium carbon not found");
392
393 // fiberglass medium
394 FairGeoMedium* mFiberGlass = geoMedia->getMedium("fiberglass");
395 if (!mFiberGlass)
396 Fatal("Main", "FairMedium fiberglass not found");
397 geoBuild->createMedium(mFiberGlass);
398 pMedFiberGlass = gGeoManager->GetMedium("fiberglass");
399 if (!pMedFiberGlass)
400 Fatal("Main", "Medium fiberglass not found");
401
402 // copper medium
403 FairGeoMedium* mCopper = geoMedia->getMedium("copper");
404 if (!mCopper)
405 Fatal("Main", "FairMedium copper not found");
406 geoBuild->createMedium(mCopper);
407 pMedCopper = gGeoManager->GetMedium("copper");
408 if (!pMedCopper)
409 Fatal("Main", "Medium copper not found");
410
411 // silicon medium
412 FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
413 if (!mSilicon)
414 Fatal("Main", "FairMedium silicon not found");
415 geoBuild->createMedium(mSilicon);
416 pMedSilicon = gGeoManager->GetMedium("silicon");
417 if (!pMedSilicon)
418 Fatal("Main", "Medium silicon not found");
419}
420
422{
423 cout << "\n";
424 cout << "Module parameters information [STANDARD_MODULE]: ------------------" << "\n";
425 cout << " XModuleSize = " << XModuleSize[STANDARD_MODULE] << " cm" << "\n";
426 cout << " YModuleSize = " << YModuleSize[STANDARD_MODULE] << " cm" << " ( "
428 << YModuleSizeLowerPart[STANDARD_MODULE] << " )" << "\n";
429 cout << " YModuleSizeUpperPart = " << YModuleSizeUpperPart[STANDARD_MODULE] << " cm" << "\n";
430 cout << " YModuleSizeLowerPart = " << YModuleSizeLowerPart[STANDARD_MODULE] << " cm" << "\n";
431 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[STANDARD_MODULE] << " cm" << "\n";
432 cout << " ZModuleSize = " << ZModuleSize[STANDARD_MODULE] << " cm" << "\n";
433 cout << "\n";
434 cout << " XBevelSize = " << XBevelSize[STANDARD_MODULE] << " cm" << "\n";
435 cout << " YBevelSize = " << YBevelSize[STANDARD_MODULE] << " cm" << "\n";
436 cout << " BevelAngleDeg = " << BevelAngleDeg[STANDARD_MODULE] << " deg" << "\n";
437 cout << "\n";
438 cout << " XLeftBorder = " << XLeftBorder[STANDARD_MODULE] << " cm" << "\n";
439 cout << " XRightBorder = " << XRightBorder[STANDARD_MODULE] << " cm" << "\n";
440 cout << " YTopBorder = " << YTopBorder[STANDARD_MODULE] << " cm" << "\n";
441 cout << " YMiddleBorderUpperPart = " << YMiddleBorderUpperPart[STANDARD_MODULE] << " cm" << "\n";
442 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[STANDARD_MODULE] << " cm"
443 << " (gap between two parts)\n";
444 cout << " YMiddleBorderLowerPart = " << YMiddleBorderLowerPart[STANDARD_MODULE] << " cm" << "\n";
445 cout << " YBottomBorder = " << YBottomBorder[STANDARD_MODULE] << " cm" << "\n";
446 cout << " XYBevelBorder = " << XYBevelBorder[STANDARD_MODULE] << " cm" << "\n";
447 cout << "\n";
448 cout << " XSensorZoneSize = " << XSensorZoneSize[STANDARD_MODULE] << " cm" << "\n";
449 cout << " YSensorZoneSizeUpperPart = " << YSensorZoneSizeUpperPart[STANDARD_MODULE] << " cm" << "\n";
450 cout << " YSensorZoneSizeLowerPart = " << YSensorZoneSizeLowerPart[STANDARD_MODULE] << " cm" << "\n";
451 cout << " ZSensorZoneSize = " << ZSensorZoneSize[STANDARD_MODULE] << " cm" << "\n";
452
453 cout << "-------------------------------------------------------------\n";
454
455 cout << "\n";
456 cout << "Module parameters information [LONG_MODULE]: ------------------" << "\n";
457 cout << " XModuleSize = " << XModuleSize[LONG_MODULE] << " cm" << "\n";
458 cout << " YModuleSize = " << YModuleSize[LONG_MODULE] << " cm" << " ( " << YModuleSizeUpperPart[LONG_MODULE]
460 << "\n";
461 cout << " YModuleSizeUpperPart = " << YModuleSizeUpperPart[LONG_MODULE] << " cm" << "\n";
462 cout << " YModuleSizeLowerPart = " << YModuleSizeLowerPart[LONG_MODULE] << " cm" << "\n";
463 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[LONG_MODULE] << " cm" << "\n";
464 cout << " ZModuleSize = " << ZModuleSize[LONG_MODULE] << " cm" << "\n";
465 cout << "\n";
466 cout << " XBevelSize = " << XBevelSize[LONG_MODULE] << " cm" << "\n";
467 cout << " YBevelSize = " << YBevelSize[LONG_MODULE] << " cm" << "\n";
468 cout << " BevelAngleDeg = " << BevelAngleDeg[LONG_MODULE] << " deg" << "\n";
469 cout << "\n";
470 cout << " XLeftBorder = " << XLeftBorder[LONG_MODULE] << " cm" << "\n";
471 cout << " XRightBorder = " << XRightBorder[LONG_MODULE] << " cm" << "\n";
472 cout << " YTopBorder = " << YTopBorder[LONG_MODULE] << " cm" << "\n";
473 cout << " YMiddleBorderUpperPart = " << YMiddleBorderUpperPart[LONG_MODULE] << " cm" << "\n";
474 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[LONG_MODULE] << " cm"
475 << " (gap between two parts)\n";
476 cout << " YMiddleBorderLowerPart = " << YMiddleBorderLowerPart[LONG_MODULE] << " cm" << "\n";
477 cout << " YBottomBorder = " << YBottomBorder[LONG_MODULE] << " cm" << "\n";
478 cout << " XYBevelBorder = " << XYBevelBorder[LONG_MODULE] << " cm" << "\n";
479 cout << "\n";
480 cout << " XSensorZoneSize = " << XSensorZoneSize[LONG_MODULE] << " cm" << "\n";
481 cout << " YSensorZoneSizeUpperPart = " << YSensorZoneSizeUpperPart[LONG_MODULE] << " cm" << "\n";
482 cout << " YSensorZoneSizeLowerPart = " << YSensorZoneSizeLowerPart[LONG_MODULE] << " cm" << "\n";
483 cout << " ZSensorZoneSize = " << ZSensorZoneSize[LONG_MODULE] << " cm" << "\n";
484
485 cout << "-------------------------------------------------------------\n";
486}
487
489{
490 cout << "\n";
491 for (Int_t istation = 0; istation < NStations; ++istation) {
492 cout << "station " << istation << ":\n";
493 cout << " XStationPositions[" << istation << "] = " << XStationPositions[istation] << " cm\n";
494 cout << " YStationPositions[" << istation << "] = " << YStationPositions[istation] << " cm\n";
495 cout << " ZStationPositions[" << istation << "] = " << ZStationPositions[istation] << " cm\n";
496 cout << "\n";
497
498 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
499 cout << " module " << imodule << ":\n";
500 cout << " XModuleShifts[" << istation << "][" << imodule << "] = " << XModuleShifts[istation][imodule]
501 << " cm\n";
502 cout << " YModuleShifts[" << istation << "][" << imodule << "] = " << YModuleShifts[istation][imodule]
503 << " cm\n";
504 cout << " ZModuleShifts[" << istation << "][" << imodule << "] = " << ZModuleShifts[istation][imodule]
505 << " cm\n";
506 cout << "\n";
507
508 Double_t XGlobalModulePos = XModuleShifts[istation][imodule] + XStationPositions[istation];
509 Double_t YGlobalModulePos = YModuleShifts[istation][imodule] + YStationPositions[istation];
510 Double_t ZGlobalModulePos = ZModuleShifts[istation][imodule] + ZStationPositions[istation];
511
512 cout << " XGlobalModulePos = " << XGlobalModulePos << " cm\n";
513 cout << " YGlobalModulePos = " << YGlobalModulePos << " cm\n";
514 cout << " ZGlobalModulePos = " << ZGlobalModulePos << " cm\n";
515 cout << "\n";
516
517 cout << " ModulesTypes[" << istation << "][" << imodule << "] = ";
518 if (ModulesTypes[istation][imodule] == 0)
519 cout << "RIGHT_ANGLED_MODULE\n";
520 if (ModulesTypes[istation][imodule] == 1)
521 cout << "BEVEL_MODULE\n";
522 if (ModulesTypes[istation][imodule] == 2)
523 cout << "RIGHT_ANGLED_MODULE_HALF\n";
524 if (ModulesTypes[istation][imodule] == 3)
525 cout << "BEVEL_MODULE_HALF\n";
526 cout << " ModulesYRotations[" << istation << "][" << imodule << "] = ";
527 if (ModulesYRotations[istation][imodule] == false)
528 cout << "not rotated around Y\n";
529 if (ModulesYRotations[istation][imodule] == true)
530 cout << "rotated around Y\n";
531 cout << " ModulesXRotations[" << istation << "][" << imodule << "] = ";
532 if (ModulesXRotations[istation][imodule] == false)
533 cout << "not rotated around X\n";
534 if (ModulesXRotations[istation][imodule] == true)
535 cout << "rotated around X\n";
536 cout << "\n";
537 }
538 cout << "-------------------------------------------------------------\n";
539 }
540 cout << "-------------------------------------------------------------\n";
541}
542
544{
545
546 // ---- set working directory --------------------------------------------
547 TString gPath = gSystem->Getenv("VMCWORKDIR");
548
549 // ------- Geometry file name (output) ----------------------------------
550 const TString geoDetectorName = "Silicon";
551 const TString geoDetectorVersion = "Run8";
552 const TString geoFileName = gPath + "/geometry/" + geoDetectorName + "_" + geoDetectorVersion + ".root";
553
554 // ---- global geometry parameters ---------------------------------------
555 FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
556 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
557
558 // ------- Load media from media file ----------------------------------
559 TString medFile = gPath + "/geometry/media.geo";
560 geoFace->setMediaFile(medFile);
561 geoFace->readMedia();
562 FairGeoMedia* geoMedia = geoFace->getMedia();
563 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
564
565 DefineRequiredMedia(geoMedia, geoBuild);
566 // -------------------------------------------------------------------------
567
568 // Print information about parameters of SILICON
571
572 // -------------- Create geometry and top volume -------------------------
573 gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
574 gGeoMan->SetName(geoDetectorName + "_geom");
575 TGeoVolume* top = new TGeoVolumeAssembly("TOP");
576 top->SetMedium(pMedAir);
577 gGeoMan->SetTopVolume(top);
578 // gGeoMan->SetTopVisible(1);
579 // --------------------------------------------------------------------------
580
581 // Define TOP Geometry
582 TGeoVolume* SILICON = new TGeoVolumeAssembly(geoDetectorName);
583 SILICON->SetMedium(pMedAir);
584
585 // Let's create SILICON stations filled with modules
586 for (Int_t istation = 0; istation < NStations; ++istation) {
587 // for(Int_t istation = 0; istation < 1; ++istation) {
588
589 // module size in a station
590 ModuleSize module_size = STANDARD_MODULE;
591
592 if (istation == 0)
593 module_size = LONG_MODULE;
594
595 TGeoVolume* station = CreateStation(TString("station") + TString::Itoa(istation, 10) + TString("_Silicon"));
596
597 Int_t NModules = NModulesInStations[istation];
598
599 TGeoVolume* modules[NModules];
600 TGeoCombiTrans* modTransforms[NModules];
601
602 for (Int_t imodule = 0; imodule < NModules; ++imodule) {
603
604 TString module_name = TString("module") + TString::Itoa(imodule, 10) + TString("_") + station->GetName();
605 modules[imodule] = CreateModule(module_name, ModulesTypes[istation][imodule], module_size);
606
607 modTransforms[imodule] = new TGeoCombiTrans();
608
609 if (ModulesYRotations[istation][imodule]) {
610 modTransforms[imodule]->RotateY(180.0);
611 modTransforms[imodule]->SetDx(XModuleShifts[istation][imodule]
612 - XShiftFromCenterToLocalX0[module_size]);
613 } else {
614 modTransforms[imodule]->SetDx(XModuleShifts[istation][imodule]
615 + XShiftFromCenterToLocalX0[module_size]);
616 }
617
618 if (ModulesXRotations[istation][imodule]) {
619 modTransforms[imodule]->RotateX(180.0);
620 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
621 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
622 {
623 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule]
624 - YModuleSizeUpperPart[module_size] * 0.5);
625 } else {
626 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule] + YShiftFromCenterToAxis[module_size]
627 - YShiftFromCenterToLocalY0[module_size]);
628 }
629 } else {
630 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
631 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
632 {
633 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule]
634 + YModuleSizeUpperPart[module_size] * 0.5);
635 } else {
636 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule] + YShiftFromCenterToAxis[module_size]
637 + YShiftFromCenterToLocalY0[module_size]);
638 }
639 }
640
641 Double_t z_module_shift =
642 +ZModuleSize[module_size] * 0.5; // To z-module position is at the beginning of the sensitive volume
643 modTransforms[imodule]->SetDz(ZModuleShifts[istation][imodule] + z_module_shift);
644
645 // Rotate half-planes
646 if (imodule < NModulesInStations[istation] / 2) { // modules of upper half-plane
647 modTransforms[imodule]->SetDx(modTransforms[imodule]->GetTranslation()[0] - x_shift_hp[istation]);
648 modTransforms[imodule]->SetDy(modTransforms[imodule]->GetTranslation()[1] - y_shift_hp[istation]);
649 modTransforms[imodule]->SetDz(modTransforms[imodule]->GetTranslation()[2] - z_shift_hp[istation]);
650
651 // modTransforms[imodule]->RotateY(HalfPlanesYRotations[istation][0]);
652
653 modTransforms[imodule]->SetDx(modTransforms[imodule]->GetTranslation()[0] + x_shift_hp[istation]);
654 modTransforms[imodule]->SetDy(modTransforms[imodule]->GetTranslation()[1] + y_shift_hp[istation]);
655 modTransforms[imodule]->SetDz(modTransforms[imodule]->GetTranslation()[2] + z_shift_hp[istation]);
656 } else { // modules of lower half-plane
657 modTransforms[imodule]->SetDz(ZModuleShifts[istation][imodule] + z_module_shift);
658 // modTransforms[imodule]->RotateY(HalfPlanesYRotations[istation][1]);
659 }
660
661 station->AddNode(modules[imodule], 0, modTransforms[imodule]);
662 }
663
664 TGeoCombiTrans* station_transform = new TGeoCombiTrans();
665 station_transform->SetTranslation(XStationPositions[istation], YStationPositions[istation],
666 ZStationPositions[istation]);
667
668 SILICON->AddNode(station, 0, station_transform);
669 }
670
671 top->AddNode(SILICON, 0);
673
674 // --------------- Finish ----------------------------------------------
675 gGeoMan->CloseGeometry();
676 gGeoMan->CheckOverlaps(0.0001);
677 gGeoMan->PrintOverlaps();
678 gGeoMan->Test();
679
680 TFile* geoFile = new TFile(geoFileName, "RECREATE");
681 top->Write();
682 geoFile->Close();
683 top->Draw("ogl");
684}
685//------------------------------------------------------------------------------
686
688{
689
690 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
691 stationA->SetMedium(pMedAir);
692
693 return stationA;
694}
695
696TGeoVolume* CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size)
697{
698
699 // Shapes -------------------------------------------------------------------
700 // module shape
701 TGeoShape* moduleS = 0;
702
703 switch (module_type) {
704 case RIGHT_ANGLED_MODULE: {
705 moduleS = new TGeoBBox(TString("moduleS") + TString("_") + module_name, XModuleSize[module_size] * 0.5,
706 YModuleSize[module_size] * 0.5, ZModuleSize[module_size] * 0.5);
707 break;
708 }
710 moduleS = new TGeoBBox(TString("moduleS") + TString("_") + module_name, XModuleSize[module_size] * 0.5,
711 YModuleSizeUpperPart[module_size] * 0.5, ZModuleSize[module_size] * 0.5);
712 break;
713 }
714 case BEVEL_MODULE: {
715 moduleS = new TGeoXtru(2);
716 moduleS->SetName(TString("moduleS") + TString("_") + module_name);
717 Double_t x_pos[5] = {
718 +XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5,
719 +XModuleSize[module_size] * 0.5 - XBevelSize[module_size], +XModuleSize[module_size] * 0.5};
720 Double_t y_pos[5] = {+YModuleSize[module_size] * 0.5, +YModuleSize[module_size] * 0.5,
721 -YModuleSize[module_size] * 0.5, -YModuleSize[module_size] * 0.5,
722 -YModuleSize[module_size] * 0.5 + YBevelSize[module_size]};
723 ((TGeoXtru*)moduleS)->DefinePolygon(5, x_pos, y_pos);
724 ((TGeoXtru*)moduleS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
725 ((TGeoXtru*)moduleS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
726 break;
727 }
728 case BEVEL_MODULE_HALF: {
729 moduleS = new TGeoXtru(2);
730 moduleS->SetName(TString("moduleS") + TString("-") + module_name);
731 Double_t x_pos[5] = {
732 +XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5,
733 +XModuleSize[module_size] * 0.5 - XBevelSize[module_size], +XModuleSize[module_size] * 0.5};
734 Double_t y_pos[5] = {+YModuleSizeUpperPart[module_size] * 0.5, +YModuleSizeUpperPart[module_size] * 0.5,
735 -YModuleSizeUpperPart[module_size] * 0.5, -YModuleSizeUpperPart[module_size] * 0.5,
736 -YModuleSizeUpperPart[module_size] * 0.5 + YBevelSize[module_size]};
737 ((TGeoXtru*)moduleS)->DefinePolygon(5, x_pos, y_pos);
738 ((TGeoXtru*)moduleS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
739 ((TGeoXtru*)moduleS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
740 break;
741 }
742 default:
743 Error("CreateModule()", "Incorrect module type selected!!!");
744 }
745
746 // sensor zone shape (upper part of the module: rectangle zone)
747 TGeoShape* sensor_zone_upper_part_rectS = new TGeoBBox(
748 TString("sensor_zone_upper_part_rectS") + TString("_") + module_name, XSensorZoneSize[module_size] * 0.5,
749 YSensorZoneSizeUpperPart[module_size] * 0.5, ZSensorZoneSize[module_size] * 0.5);
750
751 // sensor zone shape (upper part of the module: bevel zone)
752 TGeoShape* sensor_zone_upper_part_bevelS = new TGeoXtru(2);
753 sensor_zone_upper_part_bevelS->SetName(TString("sensor_zone_upper_part_bevelS") + TString("_") + module_name);
754 // Calculate coordinates of the bottom and the top points of the inner bevel
755 {
756 // find x and y projections of the bevel border thickness
757 Double_t x_delta = XYBevelBorder[module_size] / TMath::Cos(BevelAngleRad[module_size]);
758 Double_t y_delta = XYBevelBorder[module_size] / TMath::Sin(BevelAngleRad[module_size]);
759
760 // find shifts of the sensitive zone from module borders via the equation of the straight line for the inner
761 // bevel
762 Double_t x_delta_top_BP = XLeftBorder[module_size];
763 Double_t y_delta_top_BP = TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]) * x_delta_top_BP
764 + (YBevelSize[module_size] + y_delta);
765
766 Double_t y_delta_bottom_BP = YMiddleBorderUpperPart[module_size];
767 Double_t x_delta_bottom_BP = (y_delta_bottom_BP - (YBevelSize[module_size] + y_delta))
768 / (TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]));
769 //----------------------------------------------------------------------
770
771 Double_t x_pos_sensor_zone_bevel[5] = {+XModuleSize[module_size] * 0.5 - XLeftBorder[module_size],
772 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
773 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
774 +XModuleSize[module_size] * 0.5 - x_delta_bottom_BP,
775 +XModuleSize[module_size] * 0.5 - XLeftBorder[module_size]};
776 Double_t y_pos_sensor_zone_bevel[5] = {
777 +YModuleSizeUpperPart[module_size] * 0.5 - YTopBorder[module_size],
778 +YModuleSizeUpperPart[module_size] * 0.5 - YTopBorder[module_size],
779 -YModuleSizeUpperPart[module_size] * 0.5 + YMiddleBorderUpperPart[module_size],
780 -YModuleSizeUpperPart[module_size] * 0.5 + YMiddleBorderUpperPart[module_size],
781 -YModuleSizeUpperPart[module_size] * 0.5 + y_delta_top_BP};
782
783 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefinePolygon(5, x_pos_sensor_zone_bevel, y_pos_sensor_zone_bevel);
784 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
785 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
786 }
787
788 // sensor zone shape (lower part of the module: rectangle zone)
789 TGeoShape* sensor_zone_lower_part_rectS = new TGeoBBox(
790 TString("sensor_zone_lower_part_rectS") + TString("_") + module_name, XSensorZoneSize[module_size] * 0.5,
791 YSensorZoneSizeLowerPart[module_size] * 0.5, ZSensorZoneSize[module_size] * 0.5);
792
793 // sensor zone shape (lower part of the module: bevel zone)
794 TGeoShape* sensor_zone_lower_part_bevelS = new TGeoXtru(2);
795 sensor_zone_lower_part_bevelS->SetName(TString("sensor_zone_lower_part_bevelS") + TString("_") + module_name);
796 // Calculate coordinates of the bottom and the top points of the inner bevel
797 {
798 // find x and y projections of the bevel border thickness
799 Double_t x_delta = XYBevelBorder[module_size] / TMath::Cos(BevelAngleRad[module_size]);
800 Double_t y_delta = XYBevelBorder[module_size] / TMath::Sin(BevelAngleRad[module_size]);
801
802 // find shifts of the sensitive zone from module borders via the equation of the straight line for the inner
803 // bevel
804 Double_t x_delta_top_BP = XLeftBorder[module_size];
805 Double_t y_delta_top_BP = TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]) * x_delta_top_BP
806 + (YBevelSize[module_size] + y_delta);
807
808 Double_t y_delta_bottom_BP = YBottomBorder[module_size];
809 Double_t x_delta_bottom_BP = (y_delta_bottom_BP - (YBevelSize[module_size] + y_delta))
810 / (TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]));
811 //----------------------------------------------------------------------
812
813 Double_t x_pos_sensor_zone_bevel[5] = {+XModuleSize[module_size] * 0.5 - XLeftBorder[module_size],
814 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
815 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
816 +XModuleSize[module_size] * 0.5 - x_delta_bottom_BP,
817 +XModuleSize[module_size] * 0.5 - XLeftBorder[module_size]};
818 Double_t y_pos_sensor_zone_bevel[5] = {
819 +YModuleSizeLowerPart[module_size] * 0.5 - YMiddleBorderLowerPart[module_size],
820 +YModuleSizeLowerPart[module_size] * 0.5 - YMiddleBorderLowerPart[module_size],
821 -YModuleSizeLowerPart[module_size] * 0.5 + YBottomBorder[module_size],
822 -YModuleSizeLowerPart[module_size] * 0.5 + YBottomBorder[module_size],
823 -YModuleSizeLowerPart[module_size] * 0.5 + y_delta_top_BP};
824
825 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefinePolygon(5, x_pos_sensor_zone_bevel, y_pos_sensor_zone_bevel);
826 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
827 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
828 }
829
830 //--------------------------------------------------------------------------
831
832 // Volumes ------------------------------------------------------------------
833
834 TGeoVolume* moduleV = new TGeoVolume(module_name, moduleS);
835
836 // sensor zone volume (upper part of the module)
837 TGeoVolume* sensor_zone_upper_part_rectV = new TGeoVolume(
838 TString("Sensor_zone_upper_part_rectV") + TString("_") + module_name, sensor_zone_upper_part_rectS);
839
840 // sensor zone volume (lower part of the module)
841 TGeoVolume* sensor_zone_upper_part_bevelV = new TGeoVolume(
842 TString("Sensor_zone_upper_part_bevelV") + TString("_") + module_name, sensor_zone_upper_part_bevelS);
843
844 // sensor zone volume (lower part of the module: rectangle zone)
845 TGeoVolume* sensor_zone_lower_part_rectV = new TGeoVolume(
846 TString("Sensor_zone_lower_part_rectV") + TString("_") + module_name, sensor_zone_lower_part_rectS);
847
848 // sensor zone volume (lower part of the module: bevel zone)
849 TGeoVolume* sensor_zone_lower_part_bevelV = new TGeoVolume(
850 TString("Sensor_zone_lower_part_bevelV") + TString("_") + module_name, sensor_zone_lower_part_bevelS);
851
852 // volumes media
853 TGeoMedium* silicon_medium = pMedSilicon;
854 if (silicon_medium) {
855 moduleV->SetMedium(silicon_medium);
856 sensor_zone_upper_part_rectV->SetMedium(silicon_medium);
857 sensor_zone_upper_part_bevelV->SetMedium(silicon_medium);
858 sensor_zone_lower_part_rectV->SetMedium(silicon_medium);
859 sensor_zone_lower_part_bevelV->SetMedium(silicon_medium);
860 } else
861 Fatal("Main", "Invalid medium for modules and sensor zones!");
862
863 // volumes visual property (transparency)
864 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
865 sensor_zone_upper_part_rectV->SetLineColor(TColor::GetColor("#e0b0ff"));
866 sensor_zone_upper_part_bevelV->SetLineColor(TColor::GetColor("#e0b0ff"));
867 sensor_zone_lower_part_rectV->SetLineColor(TColor::GetColor("#e0b0ff"));
868 sensor_zone_lower_part_bevelV->SetLineColor(TColor::GetColor("#e0b0ff"));
869 moduleV->SetTransparency(50);
870
871 switch (module_type) {
872
873 case RIGHT_ANGLED_MODULE: {
874
875 // position of the sensor zone in the upper part of the module
876 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
877 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
878 - XLeftBorder[module_size]);
879 sensor_zone_upper_part_pos->SetDy(
880 +YSensorZoneSizeUpperPart[module_size] * 0.5 + YGapBetweenPartsOfModule[module_size] * 0.5
881 + YMiddleBorderUpperPart[module_size] - YShiftFromCenterToAxis[module_size]);
882 sensor_zone_upper_part_pos->SetDz(0.0);
883
884 // position of the sensor zone in the lower part of the module
885 TGeoTranslation* sensor_zone_lower_part_pos = new TGeoTranslation();
886 sensor_zone_lower_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
887 - XLeftBorder[module_size]);
888 sensor_zone_lower_part_pos->SetDy(
889 -YSensorZoneSizeLowerPart[module_size] * 0.5 - YGapBetweenPartsOfModule[module_size] * 0.5
890 - YMiddleBorderLowerPart[module_size] - YShiftFromCenterToAxis[module_size]);
891 sensor_zone_lower_part_pos->SetDz(0.0);
892
893 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
894 moduleV->AddNode(sensor_zone_lower_part_rectV, 0, sensor_zone_lower_part_pos);
895 break;
896 }
897
899 // position of the sensor zone in the upper part of the module
900 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
901 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
902 - XLeftBorder[module_size]);
903 sensor_zone_upper_part_pos->SetDy(+(YTopBorder[module_size] + YMiddleBorderUpperPart[module_size]) * 0.5
904 - YTopBorder[module_size]);
905 sensor_zone_upper_part_pos->SetDz(0.0);
906
907 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
908 break;
909 }
910
911 case BEVEL_MODULE: {
912
913 // position of the sensor zone in the upper part of the module
914 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
915 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
916 - XLeftBorder[module_size]);
917 sensor_zone_upper_part_pos->SetDy(
918 +YSensorZoneSizeUpperPart[module_size] * 0.5 + YGapBetweenPartsOfModule[module_size] * 0.5
919 + YMiddleBorderUpperPart[module_size] - YShiftFromCenterToAxis[module_size]);
920 sensor_zone_upper_part_pos->SetDz(0.0);
921
922 // position of the sensor zone in the lower part of the module
923 TGeoTranslation* sensor_zone_lower_part_bevel_pos = new TGeoTranslation();
924 sensor_zone_lower_part_bevel_pos->SetDx(0.0);
925 sensor_zone_lower_part_bevel_pos->SetDy(-YModuleSizeLowerPart[module_size] * 0.5
926 - YGapBetweenPartsOfModule[module_size] * 0.5
927 - YShiftFromCenterToAxis[module_size]);
928 sensor_zone_lower_part_bevel_pos->SetDz(0.0);
929
930 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
931 moduleV->AddNode(sensor_zone_lower_part_bevelV, 0, sensor_zone_lower_part_bevel_pos);
932 break;
933 }
934
935 case BEVEL_MODULE_HALF: {
936
937 // position of the sensor zone in the upper part of the module
938 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
939 sensor_zone_upper_part_pos->SetDx(0);
940 sensor_zone_upper_part_pos->SetDy(0);
941 sensor_zone_upper_part_pos->SetDz(0.0);
942
943 moduleV->AddNode(sensor_zone_upper_part_bevelV, 0, sensor_zone_upper_part_pos);
944 break;
945 }
946
947 default:
948 Error("CreateModule()", "Incorrect module type selected!!!");
949 }
950
951 return moduleV;
952}
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
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)
TGeoMedium * pMedAir
const Double_t YStationPositions[NStations]
TGeoMedium * pMedCarbon
TGeoManager * gGeoMan
const Int_t NMaxModules
const Double_t ZStationPositions[NStations]
const Int_t NStations
TGeoMedium * pMedFiberGlass
const Double_t XStationPositions[NStations]
TGeoMedium * pMedCopper
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 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]
TGeoMedium * pMedSilicon
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 create_rootgeom_Silicon_Run8()
void PrintInfoAboutModuleParameters()
void DefineRequiredMedia(FairGeoMedia *geoMedia, FairGeoBuilder *geoBuild)
void PrintInformationAboutStations()
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()