BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
create_rootgeom_Silicon_Run9.C
Go to the documentation of this file.
1/*
2 * Basic ROOT geometry for the configuration of FSD (Forward Silicon detector)
3 * in RUN-9 (only sensor volumes)
4 *
5 * Author: Baranov D.
6 * Date: 18.04.2025 (created)
7 *
8 * WARNING: all units is in cm!!!
9 */
10
11using namespace TMath;
12
13// Set Parameters of SILICON detector -------------------------------------------
14const Int_t NStations = 4; // stations in the detector
15const Int_t NMaxModules = 22; // max. number of modules in a station
16
17const Int_t NModulesInStations[NStations] = {6, 10, 14, 18};
18
19//(X-Y-Z)Positions of stations (sensitive volumes) -----------------------------
20
21// hole center of lower half-planes
23 +0.6250, // st. 0
24 +0.7045, // st. 1
25 +0.9185, // st. 2
26 +1.0180 // st. 3
27};
28
29// hole center of lower half-planes
31 -0.0695, // st. 0
32 -0.0895, // st. 1
33 -0.0565, // st. 2
34 -0.0670 // st. 3
35};
36
37// reference point (average measured z-position of lower half-planes)
39 +14.1370, // st. 0
40 +22.9015, // st. 1
41 +31.6785, // st. 2
42 +40.5235 // st. 3
43};
44//------------------------------------------------------------------------------
45
46const Double_t z_mod_thick = 0.03; // thickness of silicon sensor
47
48const Double_t z_shift_up = +2.68; // z-shift from reference point to local basic point of upper half-planes
49const Double_t z_shift_low = -0.61; // z-shift from reference point to local basic point of lower half-planes
50
51// x-distance from hole center to the base
53 21.7, // st. 0
54 21.7, // st. 1
55 27.7, // st. 2
56 33.7 // st. 3
57};
58
59// y-distance from hole center to the base
61 12.99, // st. 0
62 16.29, // st. 1
63 16.29, // st. 2
64 16.29 // st. 3
65};
66
67// z-shift of the upper half-plane relative to the lower one (dist. between two ref. points)
69 +5.0800, // st. 0
70 +5.1255, // st. 1
71 +4.9800, // st. 2
72 +5.0115 // st. 3
73};
74
75// x-shift of hole-center of the upper half-plane relative to the lower half-plane
77 +0.0165, // st. 0
78 +0.0100, // st. 1
79 +0.0325, // st. 2
80 +0.0820 // st. 3
81};
82
83// y-shift of hole-center of the upper half-plane relative to the lower half-plane
85 -0.0155, // st. 0
86 -0.0730, // st. 1
87 -0.0645, // st. 2
88 +0.6580 // st. 3
89};
90
92 {-x_dist_cent_base[0] + x_shift_hp[0] + 30.850 /*0*/, -x_dist_cent_base[0] + x_shift_hp[0] + 24.852 /*1*/,
93 -x_dist_cent_base[0] + x_shift_hp[0] + 12.556 /*2*/,
94
95 -x_dist_cent_base[0] + 30.859 /*3*/, -x_dist_cent_base[0] + 24.863 /*4*/,
96 -x_dist_cent_base[0] + 12.558 /*5*/}, // st. 0
97
98 {-x_dist_cent_base[1] + x_shift_hp[1] + 36.860 /*0*/, -x_dist_cent_base[1] + x_shift_hp[1] + 30.844 /*1*/,
99 -x_dist_cent_base[1] + x_shift_hp[1] + 24.860 /*2*/, -x_dist_cent_base[1] + x_shift_hp[1] + 12.550 /*3*/,
100 -x_dist_cent_base[1] + x_shift_hp[1] + 6.557 /*4*/,
101
102 -x_dist_cent_base[1] + 36.8425 /*5*/, -x_dist_cent_base[1] + 30.8505 /*6*/, -x_dist_cent_base[1] + 24.8450 /*7*/,
103 -x_dist_cent_base[1] + 12.5550 /*8*/, -x_dist_cent_base[1] + 6.5585 /*9*/}, // st. 1
104
105 {-x_dist_cent_base[2] + x_shift_hp[2] + 48.8465 /*0*/, -x_dist_cent_base[2] + x_shift_hp[2] + 42.8315 /*1*/,
106 -x_dist_cent_base[2] + x_shift_hp[2] + 36.8485 /*2*/, -x_dist_cent_base[2] + x_shift_hp[2] + 30.8425 /*3*/,
107 -x_dist_cent_base[2] + x_shift_hp[2] + 18.5555 /*4*/, -x_dist_cent_base[2] + x_shift_hp[2] + 12.5395 /*5*/,
108 -x_dist_cent_base[2] + x_shift_hp[2] + 6.5530 /*6*/,
109
110 -x_dist_cent_base[2] + 48.8535 /*7*/, -x_dist_cent_base[2] + 42.8470 /*8*/, -x_dist_cent_base[2] + 36.8420 /*9*/,
111 -x_dist_cent_base[2] + 30.8435 /*10*/, -x_dist_cent_base[2] + 18.5445 /*11*/,
112 -x_dist_cent_base[2] + 12.5435 /*12*/, -x_dist_cent_base[2] + 6.5475 /*13*/}, // st. 2
113
114 {-x_dist_cent_base[3] + x_shift_hp[3] + 60.8580 /*0*/, -x_dist_cent_base[3] + x_shift_hp[3] + 54.8485 /*1*/,
115 -x_dist_cent_base[3] + x_shift_hp[3] + 48.8545 /*2*/, -x_dist_cent_base[3] + x_shift_hp[3] + 42.8390 /*3*/,
116 -x_dist_cent_base[3] + x_shift_hp[3] + 36.8435 /*4*/, -x_dist_cent_base[3] + x_shift_hp[3] + 24.5520 /*5*/,
117 -x_dist_cent_base[3] + x_shift_hp[3] + 18.5450 /*6*/, -x_dist_cent_base[3] + x_shift_hp[3] + 12.5470 /*7*/,
118 -x_dist_cent_base[3] + x_shift_hp[3] + 6.5585 /*8*/,
119
120 -x_dist_cent_base[3] + 60.860 /*9*/, -x_dist_cent_base[3] + 54.547 /*10*/, -x_dist_cent_base[3] + 48.860 /*11*/,
121 -x_dist_cent_base[3] + 42.845 /*12*/, -x_dist_cent_base[3] + 36.847 /*13*/, -x_dist_cent_base[3] + 24.5445 /*14*/,
122 -x_dist_cent_base[3] + 18.557 /*15*/, -x_dist_cent_base[3] + 12.552 /*16*/,
123 -x_dist_cent_base[3] + 6.5525 /*17*/} // st. 3
124};
125
127 {+y_dist_cent_base[0] + y_shift_hp[0] - 13.112 /*0*/, +y_dist_cent_base[0] + y_shift_hp[0] - 10.113 /*1*/,
128 +y_dist_cent_base[0] + y_shift_hp[0] - 13.086 /*2*/,
129
130 -y_dist_cent_base[0] + 13.100 /*3*/, -y_dist_cent_base[0] + 10.110 /*4*/,
131 -y_dist_cent_base[0] + 13.098 /*5*/}, // st. 0
132
133 {+y_dist_cent_base[1] + y_shift_hp[1] - 16.425 /*0*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.424 /*1*/,
134 +y_dist_cent_base[1] + y_shift_hp[1] - 13.421 /*2*/, +y_dist_cent_base[1] + y_shift_hp[1] - 16.421 /*3*/,
135 +y_dist_cent_base[1] + y_shift_hp[1] - 16.420 /*4*/,
136
137 -y_dist_cent_base[1] + 16.432 /*5*/, -y_dist_cent_base[1] + 16.423 /*6*/, -y_dist_cent_base[1] + 13.428 /*7*/,
138 -y_dist_cent_base[1] + 16.425 /*8*/, -y_dist_cent_base[1] + 16.429 /*9*/}, // st. 1
139
140 {+y_dist_cent_base[2] + y_shift_hp[2] - 16.424 /*0*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*1*/,
141 +y_dist_cent_base[2] + y_shift_hp[2] - 16.427 /*2*/, +y_dist_cent_base[2] + y_shift_hp[2] - 13.411 /*3*/,
142 +y_dist_cent_base[2] + y_shift_hp[2] - 16.431 /*4*/, +y_dist_cent_base[2] + y_shift_hp[2] - 16.420 /*5*/,
143 +y_dist_cent_base[2] + y_shift_hp[2] - 16.430 /*6*/,
144
145 -y_dist_cent_base[2] + 16.418 /*7*/, -y_dist_cent_base[2] + 16.427 /*8*/, -y_dist_cent_base[2] + 16.421 /*9*/,
146 -y_dist_cent_base[2] + 13.428 /*10*/, -y_dist_cent_base[2] + 16.413 /*11*/, -y_dist_cent_base[2] + 16.427 /*12*/,
147 -y_dist_cent_base[2] + 16.414 /*13*/}, // st. 2
148
149 {+y_dist_cent_base[3] + y_shift_hp[3] - 16.429 /*0*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.431 /*1*/,
150 +y_dist_cent_base[3] + y_shift_hp[3] - 16.431 /*2*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.432 /*3*/,
151 +y_dist_cent_base[3] + y_shift_hp[3] - 13.432 /*4*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.429 /*5*/,
152 +y_dist_cent_base[3] + y_shift_hp[3] - 16.422 /*6*/, +y_dist_cent_base[3] + y_shift_hp[3] - 16.423 /*7*/,
153 +y_dist_cent_base[3] + y_shift_hp[3] - 16.427 /*8*/,
154
155 -y_dist_cent_base[3] + 16.432 /*9*/, -y_dist_cent_base[3] + 16.437 /*10*/, -y_dist_cent_base[3] + 16.435 /*11*/,
156 -y_dist_cent_base[3] + 16.435 /*12*/, -y_dist_cent_base[3] + 13.437 /*13*/, -y_dist_cent_base[3] + 16.434 /*14*/,
157 -y_dist_cent_base[3] + 16.436 /*15*/, -y_dist_cent_base[3] + 16.431 /*16*/,
158 -y_dist_cent_base[3] + 16.428 /*17*/} // st. 3
159};
160
162 {+z_shift_hp[0] + z_shift_up - 2.6 /*0*/, +z_shift_hp[0] + z_shift_up - 1.45 /*1*/,
163 +z_shift_hp[0] + z_shift_up - 2.7 /*2*/,
164
165 +z_shift_low - z_mod_thick + 2.61 /*3*/, +z_shift_low - z_mod_thick + 1.4 /*4*/,
166 +z_shift_low - z_mod_thick + 2.78 /*5*/}, // st. 0
167
168 {+z_shift_hp[1] + z_shift_up - 1.41 /*0*/, +z_shift_hp[1] + z_shift_up - 2.585 /*1*/,
169 +z_shift_hp[1] + z_shift_up - 1.395 /*2*/, +z_shift_hp[1] + z_shift_up - 2.76 /*3*/,
170 +z_shift_hp[1] + z_shift_up - 1.585 /*4*/,
171
172 +z_shift_low - z_mod_thick + 1.425 /*5*/, +z_shift_low - z_mod_thick + 2.595 /*6*/,
173 +z_shift_low - z_mod_thick + 1.445 /*7*/, +z_shift_low - z_mod_thick + 2.73 /*8*/,
174 +z_shift_low - z_mod_thick + 1.51 /*9*/}, // st. 1
175
176 {+z_shift_hp[2] + z_shift_up - 2.595 /*0*/, +z_shift_hp[2] + z_shift_up - 1.395 /*1*/,
177 +z_shift_hp[2] + z_shift_up - 2.665 /*2*/, +z_shift_hp[2] + z_shift_up - 1.425 /*3*/,
178 +z_shift_hp[2] + z_shift_up - 2.735 /*4*/, +z_shift_hp[2] + z_shift_up - 1.56 /*5*/,
179 +z_shift_hp[2] + z_shift_up - 2.705 /*6*/,
180
181 +z_shift_low - z_mod_thick + 2.585 /*7*/, +z_shift_low - z_mod_thick + 1.435 /*8*/,
182 +z_shift_low - z_mod_thick + 2.595 /*9*/, +z_shift_low - z_mod_thick + 1.41 /*10*/,
183 +z_shift_low - z_mod_thick + 2.79 /*11*/, +z_shift_low - z_mod_thick + 1.6 /*12*/,
184 +z_shift_low - z_mod_thick + 2.83 /*13*/}, // st. 2
185
186 {+z_shift_hp[3] + z_shift_up - 1.41 /*0*/, +z_shift_hp[3] + z_shift_up - 2.59 /*1*/,
187 +z_shift_hp[3] + z_shift_up - 1.435 /*2*/, +z_shift_hp[3] + z_shift_up - 2.635 /*3*/,
188 +z_shift_hp[3] + z_shift_up - 1.4 /*4*/, +z_shift_hp[3] + z_shift_up - 2.775 /*5*/,
189 +z_shift_hp[3] + z_shift_up - 1.605 /*6*/, +z_shift_hp[3] + z_shift_up - 2.73 /*7*/,
190 +z_shift_hp[3] + z_shift_up - 1.6 /*8*/,
191
192 +z_shift_low - z_mod_thick + 1.45 /*9*/, +z_shift_low - z_mod_thick + 2.575 /*10*/,
193 +z_shift_low - z_mod_thick + 1.37 /*11*/, +z_shift_low - z_mod_thick + 2.585 /*12*/,
194 +z_shift_low - z_mod_thick + 1.42 /*13*/, +z_shift_low - z_mod_thick + 2.695 /*14*/,
195 +z_shift_low - z_mod_thick + 1.525 /*15*/, +z_shift_low - z_mod_thick + 2.68 /*16*/,
196 +z_shift_low - z_mod_thick + 1.515 /*17*/} // st. 3
197};
198
199// Geometry parameters of modules
207
220
221// rotations of modules around y-axis by 180 deg.
223 {true /*0*/, true /*1*/, false /*2*/, true /*3*/, true /*4*/, false /*5*/},
224 {true /*0*/, true /*1*/, true /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, false /*8*/,
225 false /*9*/},
226 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
227 true /*9*/, true /*10*/, false /*11*/, false /*12*/, false /*13*/},
228 {true /*0*/, true /*1*/, true /*2*/, true /*3*/, true /*4*/, false /*5*/, false /*6*/, false /*7*/, false /*8*/,
229 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, false /*14*/, false /*15*/, false /*16*/,
230 false /*17*/}};
231
232// rotations of modules around x-axis by 180 deg.
234 {false /*0*/, false /*1*/, false /*2*/, true /*3*/, true /*4*/, true /*5*/},
235 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, true /*5*/, true /*6*/, true /*7*/, true /*8*/,
236 true /*9*/},
237 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, true /*7*/, true /*8*/,
238 true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/},
239 {false /*0*/, false /*1*/, false /*2*/, false /*3*/, false /*4*/, false /*5*/, false /*6*/, false /*7*/,
240 false /*8*/, true /*9*/, true /*10*/, true /*11*/, true /*12*/, true /*13*/, true /*14*/, true /*15*/, true /*16*/,
241 true /*17*/}};
242
243/*
244//rotations of half-planes around y-axis (angles in degrees)
245const Int_t NMaxHalfPlanes = 2;
246const Double_t HalfPlanesYRotations[NStations][NMaxHalfPlanes] = {
247 {-0.205, -0.235}, // st.0 (upper [0] and lower [1] half-planes)
248 {-0.399, -0.173}, // st.1
249 {-0.151, -0.584}, // st.2
250 {-0.108, +0.367} // st.3
251};
252*/
253//------------------------------------------------------------------------------
254
255// GeoManager
257
258// Module parameters ------------------------------------------------------------
260{
263}; // STANDARD_MODULE is (63x126)mm, LONG_MODULE is (63x186)mm
264const unsigned int NModuleSizes = 2;
265
266Double_t YGapBetweenPartsOfModule[NModuleSizes] = {0.0035 /*STANDARD_MODULE*/, 0.0035 /*LONG_MODULE*/}; // Mrs. Slit
267
268Double_t XModuleSize[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 6.3 /*LONG_MODULE*/};
269
270Double_t YModuleSizeUpperPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
271Double_t YModuleSizeLowerPart[NModuleSizes] = {6.3 /*STANDARD_MODULE*/, 9.3 /*LONG_MODULE*/};
272
279
280Double_t ZModuleSize[NModuleSizes] = {z_mod_thick /*STANDARD_MODULE*/, z_mod_thick /*LONG_MODULE*/};
281
282Double_t XBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // x-bevel for a angled cut
283Double_t YBevelSize[NModuleSizes] = {3.82 /*STANDARD_MODULE*/, 3.82 /*LONG_MODULE*/}; // y-bevel for a angled cut
284
289
294
295Double_t XLeftBorder[NModuleSizes] = {0.1145 /*STANDARD_MODULE*/, 0.1118 /*LONG_MODULE*/};
296Double_t XRightBorder[NModuleSizes] = {0.1118 /*STANDARD_MODULE*/, 0.1118 /*LONG_MODULE*/};
297Double_t YTopBorder[NModuleSizes] = {0.1143 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
298Double_t YMiddleBorderUpperPart[NModuleSizes] = {0.1121 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
299Double_t YMiddleBorderLowerPart[NModuleSizes] = {0.1147 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
300Double_t YBottomBorder[NModuleSizes] = {0.1148 /*STANDARD_MODULE*/, 0.1148 /*LONG_MODULE*/};
301Double_t XYBevelBorder[NModuleSizes] = {0.1146 /*STANDARD_MODULE*/, 0.1146 /*LONG_MODULE*/};
302
303// Sensor zones ------------------------------------
308
314
321
323 ZModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
324 ZModuleSize[LONG_MODULE] /*LONG_MODULE*/
325};
326//-------------------------------------------------
327
328// Module frames -----------------------------------
330 XModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
331 XModuleSize[LONG_MODULE] /*LONG_MODULE*/
332};
333
335 YModuleSize[STANDARD_MODULE], /*STANDARD_MODULE*/
336 YModuleSize[LONG_MODULE] /*LONG_MODULE*/
337};
338
339Double_t ZModuleFrameSize[NModuleSizes] = {0.18 /*STANDARD_MODULE*/, 0.18 /*LONG_MODULE*/};
340//-------------------------------------------------
341
342// Y-shift from center of the gap to the global x-axis (for y-alignment of the module)
347
348// X-shift from center of the module to the origin of the local x-axis
350 +XModuleSize[STANDARD_MODULE] * 0.5, /*STANDARD_MODULE*/
351 +XModuleSize[LONG_MODULE] * 0.5 /*LONG_MODULE*/
352};
353
354// Y-shift from center of the module to the origin of the local y-axis
359//------------------------------------------------------------------------------
360/*
361 ASCII module picture (view from target)
362
363 |<---- XModuleSize ---------->| ^
364 | | | Y-axis
365 ------------------------------ ---------
366 | | top border | | ^
367 ------------------------------ |
368 | | | | |
369 | l | rectangle | r | |
370 | e | sensor | i | |
371 | f | zone | g | |
372 | t | | h | |
373 | | | t | |
374 | | | | |
375 ------------------------------ |
376 | | middle (upper part) | |
377 ------ gap between parts ----- YModuleSize
378 | | middle (lower part) | |
379 ------------------------------ |
380 | | | | |
381 | b | bevel (or rect.) | r | |
382 | e | sensor | i | |
383 \ v \ zone | g | |
384 \ e \ | h | |
385 \ l \ | t | |
386 \ \ | | |
387 ------------------------- |
388 \ \ bottom | | v
389 ---------------------- ---------
390
391 * x-axis <----------------------------------(x0,y0) local point
392 */
393
394// media
400
401class FairGeoMedia;
402class FairGeoBuilder;
403
404// function declarations
405TGeoVolume* CreateStation(TString station_name);
406TGeoVolume* CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size);
407
408void DefineRequiredMedia(FairGeoMedia* geoMedia, FairGeoBuilder* geoBuild)
409{
410
411 // air medium
412 FairGeoMedium* mAir = geoMedia->getMedium("air");
413 if (!mAir)
414 Fatal("Main", "FairMedium air not found");
415 geoBuild->createMedium(mAir);
416 pMedAir = gGeoManager->GetMedium("air");
417 if (!pMedAir)
418 Fatal("Main", "Medium air not found");
419
420 // carbon medium
421 FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
422 if (!mCarbon)
423 Fatal("Main", "FairMedium carbon not found");
424 geoBuild->createMedium(mCarbon);
425 pMedCarbon = gGeoManager->GetMedium("carbon");
426 if (!pMedCarbon)
427 Fatal("Main", "Medium carbon not found");
428
429 // fiberglass medium
430 FairGeoMedium* mFiberGlass = geoMedia->getMedium("fiberglass");
431 if (!mFiberGlass)
432 Fatal("Main", "FairMedium fiberglass not found");
433 geoBuild->createMedium(mFiberGlass);
434 pMedFiberGlass = gGeoManager->GetMedium("fiberglass");
435 if (!pMedFiberGlass)
436 Fatal("Main", "Medium fiberglass not found");
437
438 // copper medium
439 FairGeoMedium* mCopper = geoMedia->getMedium("copper");
440 if (!mCopper)
441 Fatal("Main", "FairMedium copper not found");
442 geoBuild->createMedium(mCopper);
443 pMedCopper = gGeoManager->GetMedium("copper");
444 if (!pMedCopper)
445 Fatal("Main", "Medium copper not found");
446
447 // silicon medium
448 FairGeoMedium* mSilicon = geoMedia->getMedium("silicon");
449 if (!mSilicon)
450 Fatal("Main", "FairMedium silicon not found");
451 geoBuild->createMedium(mSilicon);
452 pMedSilicon = gGeoManager->GetMedium("silicon");
453 if (!pMedSilicon)
454 Fatal("Main", "Medium silicon not found");
455}
456
458{
459 cout << "\n";
460 cout << "Module parameters information [STANDARD_MODULE]: ------------------" << "\n";
461 cout << " XModuleSize = " << XModuleSize[STANDARD_MODULE] << " cm" << "\n";
462 cout << " YModuleSize = " << YModuleSize[STANDARD_MODULE] << " cm" << " ( "
464 << YModuleSizeLowerPart[STANDARD_MODULE] << " )" << "\n";
465 cout << " YModuleSizeUpperPart = " << YModuleSizeUpperPart[STANDARD_MODULE] << " cm" << "\n";
466 cout << " YModuleSizeLowerPart = " << YModuleSizeLowerPart[STANDARD_MODULE] << " cm" << "\n";
467 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[STANDARD_MODULE] << " cm" << "\n";
468 cout << " ZModuleSize = " << ZModuleSize[STANDARD_MODULE] << " cm" << "\n";
469 cout << "\n";
470 cout << " XBevelSize = " << XBevelSize[STANDARD_MODULE] << " cm" << "\n";
471 cout << " YBevelSize = " << YBevelSize[STANDARD_MODULE] << " cm" << "\n";
472 cout << " BevelAngleDeg = " << BevelAngleDeg[STANDARD_MODULE] << " deg" << "\n";
473 cout << "\n";
474 cout << " XLeftBorder = " << XLeftBorder[STANDARD_MODULE] << " cm" << "\n";
475 cout << " XRightBorder = " << XRightBorder[STANDARD_MODULE] << " cm" << "\n";
476 cout << " YTopBorder = " << YTopBorder[STANDARD_MODULE] << " cm" << "\n";
477 cout << " YMiddleBorderUpperPart = " << YMiddleBorderUpperPart[STANDARD_MODULE] << " cm" << "\n";
478 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[STANDARD_MODULE] << " cm"
479 << " (gap between two parts)\n";
480 cout << " YMiddleBorderLowerPart = " << YMiddleBorderLowerPart[STANDARD_MODULE] << " cm" << "\n";
481 cout << " YBottomBorder = " << YBottomBorder[STANDARD_MODULE] << " cm" << "\n";
482 cout << " XYBevelBorder = " << XYBevelBorder[STANDARD_MODULE] << " cm" << "\n";
483 cout << "\n";
484 cout << " XSensorZoneSize = " << XSensorZoneSize[STANDARD_MODULE] << " cm" << "\n";
485 cout << " YSensorZoneSizeUpperPart = " << YSensorZoneSizeUpperPart[STANDARD_MODULE] << " cm" << "\n";
486 cout << " YSensorZoneSizeLowerPart = " << YSensorZoneSizeLowerPart[STANDARD_MODULE] << " cm" << "\n";
487 cout << " ZSensorZoneSize = " << ZSensorZoneSize[STANDARD_MODULE] << " cm" << "\n";
488
489 cout << "-------------------------------------------------------------\n";
490
491 cout << "\n";
492 cout << "Module parameters information [LONG_MODULE]: ------------------" << "\n";
493 cout << " XModuleSize = " << XModuleSize[LONG_MODULE] << " cm" << "\n";
494 cout << " YModuleSize = " << YModuleSize[LONG_MODULE] << " cm" << " ( " << YModuleSizeUpperPart[LONG_MODULE]
496 << "\n";
497 cout << " YModuleSizeUpperPart = " << YModuleSizeUpperPart[LONG_MODULE] << " cm" << "\n";
498 cout << " YModuleSizeLowerPart = " << YModuleSizeLowerPart[LONG_MODULE] << " cm" << "\n";
499 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[LONG_MODULE] << " cm" << "\n";
500 cout << " ZModuleSize = " << ZModuleSize[LONG_MODULE] << " cm" << "\n";
501 cout << "\n";
502 cout << " XBevelSize = " << XBevelSize[LONG_MODULE] << " cm" << "\n";
503 cout << " YBevelSize = " << YBevelSize[LONG_MODULE] << " cm" << "\n";
504 cout << " BevelAngleDeg = " << BevelAngleDeg[LONG_MODULE] << " deg" << "\n";
505 cout << "\n";
506 cout << " XLeftBorder = " << XLeftBorder[LONG_MODULE] << " cm" << "\n";
507 cout << " XRightBorder = " << XRightBorder[LONG_MODULE] << " cm" << "\n";
508 cout << " YTopBorder = " << YTopBorder[LONG_MODULE] << " cm" << "\n";
509 cout << " YMiddleBorderUpperPart = " << YMiddleBorderUpperPart[LONG_MODULE] << " cm" << "\n";
510 cout << " YGapBetweenPartsOfModule = " << YGapBetweenPartsOfModule[LONG_MODULE] << " cm"
511 << " (gap between two parts)\n";
512 cout << " YMiddleBorderLowerPart = " << YMiddleBorderLowerPart[LONG_MODULE] << " cm" << "\n";
513 cout << " YBottomBorder = " << YBottomBorder[LONG_MODULE] << " cm" << "\n";
514 cout << " XYBevelBorder = " << XYBevelBorder[LONG_MODULE] << " cm" << "\n";
515 cout << "\n";
516 cout << " XSensorZoneSize = " << XSensorZoneSize[LONG_MODULE] << " cm" << "\n";
517 cout << " YSensorZoneSizeUpperPart = " << YSensorZoneSizeUpperPart[LONG_MODULE] << " cm" << "\n";
518 cout << " YSensorZoneSizeLowerPart = " << YSensorZoneSizeLowerPart[LONG_MODULE] << " cm" << "\n";
519 cout << " ZSensorZoneSize = " << ZSensorZoneSize[LONG_MODULE] << " cm" << "\n";
520
521 cout << "-------------------------------------------------------------\n";
522}
523
525{
526 cout << "\n";
527 for (Int_t istation = 0; istation < NStations; ++istation) {
528 cout << "station " << istation << ":\n";
529 cout << " XStationPositions[" << istation << "] = " << XStationPositions[istation] << " cm\n";
530 cout << " YStationPositions[" << istation << "] = " << YStationPositions[istation] << " cm\n";
531 cout << " ZStationPositions[" << istation << "] = " << ZStationPositions[istation] << " cm\n";
532 cout << "\n";
533
534 for (Int_t imodule = 0; imodule < NModulesInStations[istation]; ++imodule) {
535 cout << " module " << imodule << ":\n";
536 cout << " XModuleShifts[" << istation << "][" << imodule << "] = " << XModuleShifts[istation][imodule]
537 << " cm\n";
538 cout << " YModuleShifts[" << istation << "][" << imodule << "] = " << YModuleShifts[istation][imodule]
539 << " cm\n";
540 cout << " ZModuleShifts[" << istation << "][" << imodule << "] = " << ZModuleShifts[istation][imodule]
541 << " cm\n";
542 cout << "\n";
543
544 Double_t XGlobalModulePos = XModuleShifts[istation][imodule] + XStationPositions[istation];
545 Double_t YGlobalModulePos = YModuleShifts[istation][imodule] + YStationPositions[istation];
546 Double_t ZGlobalModulePos = ZModuleShifts[istation][imodule] + ZStationPositions[istation];
547
548 cout << " XGlobalModulePos = " << XGlobalModulePos << " cm\n";
549 cout << " YGlobalModulePos = " << YGlobalModulePos << " cm\n";
550 cout << " ZGlobalModulePos = " << ZGlobalModulePos << " cm\n";
551 cout << "\n";
552
553 cout << " ModulesTypes[" << istation << "][" << imodule << "] = ";
554 if (ModulesTypes[istation][imodule] == 0)
555 cout << "RIGHT_ANGLED_MODULE\n";
556 if (ModulesTypes[istation][imodule] == 1)
557 cout << "BEVEL_MODULE\n";
558 if (ModulesTypes[istation][imodule] == 2)
559 cout << "RIGHT_ANGLED_MODULE_HALF\n";
560 if (ModulesTypes[istation][imodule] == 3)
561 cout << "BEVEL_MODULE_HALF\n";
562 cout << " ModulesYRotations[" << istation << "][" << imodule << "] = ";
563 if (ModulesYRotations[istation][imodule] == false)
564 cout << "not rotated around Y\n";
565 if (ModulesYRotations[istation][imodule] == true)
566 cout << "rotated around Y\n";
567 cout << " ModulesXRotations[" << istation << "][" << imodule << "] = ";
568 if (ModulesXRotations[istation][imodule] == false)
569 cout << "not rotated around X\n";
570 if (ModulesXRotations[istation][imodule] == true)
571 cout << "rotated around X\n";
572 cout << "\n";
573 }
574 cout << "-------------------------------------------------------------\n";
575 }
576 cout << "-------------------------------------------------------------\n";
577}
578
580{
581
582 // ---- set working directory --------------------------------------------
583 TString gPath = gSystem->Getenv("VMCWORKDIR");
584
585 // ------- Geometry file name (output) ----------------------------------
586 const TString geoDetectorName = "Silicon";
587 const TString geoDetectorVersion = "Run9";
588 const TString geoFileName = gPath + "/geometry/" + geoDetectorName + "_" + geoDetectorVersion + ".root";
589
590 // ---- global geometry parameters ---------------------------------------
591 FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
592 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
593
594 // ------- Load media from media file ----------------------------------
595 TString medFile = gPath + "/geometry/media.geo";
596 geoFace->setMediaFile(medFile);
597 geoFace->readMedia();
598 FairGeoMedia* geoMedia = geoFace->getMedia();
599 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
600
601 DefineRequiredMedia(geoMedia, geoBuild);
602 // -------------------------------------------------------------------------
603
604 // Print information about parameters of SILICON
607
608 // -------------- Create geometry and top volume -------------------------
609 gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
610 gGeoMan->SetName(geoDetectorName + "_geom");
611 TGeoVolume* top = new TGeoVolumeAssembly("TOP");
612 top->SetMedium(pMedAir);
613 gGeoMan->SetTopVolume(top);
614 // gGeoMan->SetTopVisible(1);
615 // --------------------------------------------------------------------------
616
617 // Define TOP Geometry
618 TGeoVolume* SILICON = new TGeoVolumeAssembly(geoDetectorName);
619 SILICON->SetMedium(pMedAir);
620
621 // Let's create SILICON stations filled with modules
622 for (Int_t istation = 0; istation < NStations; ++istation) {
623 // for(Int_t istation = 0; istation < 1; ++istation) {
624
625 // module size in a station
626 ModuleSize module_size = STANDARD_MODULE;
627
628 if (istation == 0)
629 module_size = LONG_MODULE;
630
631 TGeoVolume* station = CreateStation(TString("station") + TString::Itoa(istation, 10) + TString("_Silicon"));
632
633 Int_t NModules = NModulesInStations[istation];
634
635 TGeoVolume* modules[NModules];
636 TGeoCombiTrans* modTransforms[NModules];
637
638 for (Int_t imodule = 0; imodule < NModules; ++imodule) {
639
640 TString module_name = TString("module") + TString::Itoa(imodule, 10) + TString("_") + station->GetName();
641 modules[imodule] = CreateModule(module_name, ModulesTypes[istation][imodule], module_size);
642
643 modTransforms[imodule] = new TGeoCombiTrans();
644
645 if (ModulesYRotations[istation][imodule]) {
646 modTransforms[imodule]->RotateY(180.0);
647 modTransforms[imodule]->SetDx(XModuleShifts[istation][imodule]
648 - XShiftFromCenterToLocalX0[module_size]);
649 } else {
650 modTransforms[imodule]->SetDx(XModuleShifts[istation][imodule]
651 + XShiftFromCenterToLocalX0[module_size]);
652 }
653
654 if (ModulesXRotations[istation][imodule]) {
655 modTransforms[imodule]->RotateX(180.0);
656 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
657 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
658 {
659 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule]
660 - YModuleSizeUpperPart[module_size] * 0.5);
661 } else {
662 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule] + YShiftFromCenterToAxis[module_size]
663 - YShiftFromCenterToLocalY0[module_size]);
664 }
665 } else {
666 if (ModulesTypes[istation][imodule] == ModuleType::BEVEL_MODULE_HALF
667 || ModulesTypes[istation][imodule] == ModuleType::RIGHT_ANGLED_MODULE_HALF)
668 {
669 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule]
670 + YModuleSizeUpperPart[module_size] * 0.5);
671 } else {
672 modTransforms[imodule]->SetDy(YModuleShifts[istation][imodule] + YShiftFromCenterToAxis[module_size]
673 + YShiftFromCenterToLocalY0[module_size]);
674 }
675 }
676
677 Double_t z_module_shift =
678 +ZModuleSize[module_size] * 0.5; // To z-module position is at the beginning of the sensitive volume
679 modTransforms[imodule]->SetDz(ZModuleShifts[istation][imodule] + z_module_shift);
680
681 // Rotate half-planes
682 if (imodule < NModulesInStations[istation] / 2) { // modules of upper half-plane
683 modTransforms[imodule]->SetDx(modTransforms[imodule]->GetTranslation()[0] - x_shift_hp[istation]);
684 modTransforms[imodule]->SetDy(modTransforms[imodule]->GetTranslation()[1] - y_shift_hp[istation]);
685 modTransforms[imodule]->SetDz(modTransforms[imodule]->GetTranslation()[2] - z_shift_hp[istation]);
686
687 // modTransforms[imodule]->RotateY(HalfPlanesYRotations[istation][0]);
688
689 modTransforms[imodule]->SetDx(modTransforms[imodule]->GetTranslation()[0] + x_shift_hp[istation]);
690 modTransforms[imodule]->SetDy(modTransforms[imodule]->GetTranslation()[1] + y_shift_hp[istation]);
691 modTransforms[imodule]->SetDz(modTransforms[imodule]->GetTranslation()[2] + z_shift_hp[istation]);
692 } else { // modules of lower half-plane
693 modTransforms[imodule]->SetDz(ZModuleShifts[istation][imodule] + z_module_shift);
694 // modTransforms[imodule]->RotateY(HalfPlanesYRotations[istation][1]);
695 }
696
697 station->AddNode(modules[imodule], 0, modTransforms[imodule]);
698 }
699
700 TGeoCombiTrans* station_transform = new TGeoCombiTrans();
701 station_transform->SetTranslation(XStationPositions[istation], YStationPositions[istation],
702 ZStationPositions[istation]);
703
704 SILICON->AddNode(station, 0, station_transform);
705 }
706
707 top->AddNode(SILICON, 0);
709
710 // --------------- Finish ----------------------------------------------
711 gGeoMan->CloseGeometry();
712 gGeoMan->CheckOverlaps(0.0001);
713 gGeoMan->PrintOverlaps();
714 gGeoMan->Test();
715
716 TFile* geoFile = new TFile(geoFileName, "RECREATE");
717 top->Write();
718 geoFile->Close();
719 top->Draw("ogl");
720}
721//------------------------------------------------------------------------------
722
724{
725
726 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
727 stationA->SetMedium(pMedAir);
728
729 return stationA;
730}
731
732TGeoVolume* CreateModule(TString module_name, ModuleType module_type, ModuleSize module_size)
733{
734
735 // Shapes -------------------------------------------------------------------
736 // module shape
737 TGeoShape* moduleS = 0;
738
739 switch (module_type) {
740 case RIGHT_ANGLED_MODULE: {
741 moduleS = new TGeoBBox(TString("moduleS") + TString("_") + module_name, XModuleSize[module_size] * 0.5,
742 YModuleSize[module_size] * 0.5, ZModuleSize[module_size] * 0.5);
743 break;
744 }
746 moduleS = new TGeoBBox(TString("moduleS") + TString("_") + module_name, XModuleSize[module_size] * 0.5,
747 YModuleSizeUpperPart[module_size] * 0.5, ZModuleSize[module_size] * 0.5);
748 break;
749 }
750 case BEVEL_MODULE: {
751 moduleS = new TGeoXtru(2);
752 moduleS->SetName(TString("moduleS") + TString("_") + module_name);
753 Double_t x_pos[5] = {
754 +XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5,
755 +XModuleSize[module_size] * 0.5 - XBevelSize[module_size], +XModuleSize[module_size] * 0.5};
756 Double_t y_pos[5] = {+YModuleSize[module_size] * 0.5, +YModuleSize[module_size] * 0.5,
757 -YModuleSize[module_size] * 0.5, -YModuleSize[module_size] * 0.5,
758 -YModuleSize[module_size] * 0.5 + YBevelSize[module_size]};
759 ((TGeoXtru*)moduleS)->DefinePolygon(5, x_pos, y_pos);
760 ((TGeoXtru*)moduleS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
761 ((TGeoXtru*)moduleS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
762 break;
763 }
764 case BEVEL_MODULE_HALF: {
765 moduleS = new TGeoXtru(2);
766 moduleS->SetName(TString("moduleS") + TString("-") + module_name);
767 Double_t x_pos[5] = {
768 +XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5, -XModuleSize[module_size] * 0.5,
769 +XModuleSize[module_size] * 0.5 - XBevelSize[module_size], +XModuleSize[module_size] * 0.5};
770 Double_t y_pos[5] = {+YModuleSizeUpperPart[module_size] * 0.5, +YModuleSizeUpperPart[module_size] * 0.5,
771 -YModuleSizeUpperPart[module_size] * 0.5, -YModuleSizeUpperPart[module_size] * 0.5,
772 -YModuleSizeUpperPart[module_size] * 0.5 + YBevelSize[module_size]};
773 ((TGeoXtru*)moduleS)->DefinePolygon(5, x_pos, y_pos);
774 ((TGeoXtru*)moduleS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
775 ((TGeoXtru*)moduleS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
776 break;
777 }
778 default:
779 Error("CreateModule()", "Incorrect module type selected!!!");
780 }
781
782 // sensor zone shape (upper part of the module: rectangle zone)
783 TGeoShape* sensor_zone_upper_part_rectS = new TGeoBBox(
784 TString("sensor_zone_upper_part_rectS") + TString("_") + module_name, XSensorZoneSize[module_size] * 0.5,
785 YSensorZoneSizeUpperPart[module_size] * 0.5, ZSensorZoneSize[module_size] * 0.5);
786
787 // sensor zone shape (upper part of the module: bevel zone)
788 TGeoShape* sensor_zone_upper_part_bevelS = new TGeoXtru(2);
789 sensor_zone_upper_part_bevelS->SetName(TString("sensor_zone_upper_part_bevelS") + TString("_") + module_name);
790 // Calculate coordinates of the bottom and the top points of the inner bevel
791 {
792 // find x and y projections of the bevel border thickness
793 Double_t x_delta = XYBevelBorder[module_size] / TMath::Cos(BevelAngleRad[module_size]);
794 Double_t y_delta = XYBevelBorder[module_size] / TMath::Sin(BevelAngleRad[module_size]);
795
796 // find shifts of the sensitive zone from module borders via the equation of the straight line for the inner
797 // bevel
798 Double_t x_delta_top_BP = XLeftBorder[module_size];
799 Double_t y_delta_top_BP = TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]) * x_delta_top_BP
800 + (YBevelSize[module_size] + y_delta);
801
802 Double_t y_delta_bottom_BP = YMiddleBorderUpperPart[module_size];
803 Double_t x_delta_bottom_BP = (y_delta_bottom_BP - (YBevelSize[module_size] + y_delta))
804 / (TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]));
805 //----------------------------------------------------------------------
806
807 Double_t x_pos_sensor_zone_bevel[5] = {+XModuleSize[module_size] * 0.5 - XLeftBorder[module_size],
808 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
809 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
810 +XModuleSize[module_size] * 0.5 - x_delta_bottom_BP,
811 +XModuleSize[module_size] * 0.5 - XLeftBorder[module_size]};
812 Double_t y_pos_sensor_zone_bevel[5] = {
813 +YModuleSizeUpperPart[module_size] * 0.5 - YTopBorder[module_size],
814 +YModuleSizeUpperPart[module_size] * 0.5 - YTopBorder[module_size],
815 -YModuleSizeUpperPart[module_size] * 0.5 + YMiddleBorderUpperPart[module_size],
816 -YModuleSizeUpperPart[module_size] * 0.5 + YMiddleBorderUpperPart[module_size],
817 -YModuleSizeUpperPart[module_size] * 0.5 + y_delta_top_BP};
818
819 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefinePolygon(5, x_pos_sensor_zone_bevel, y_pos_sensor_zone_bevel);
820 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
821 ((TGeoXtru*)sensor_zone_upper_part_bevelS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
822 }
823
824 // sensor zone shape (lower part of the module: rectangle zone)
825 TGeoShape* sensor_zone_lower_part_rectS = new TGeoBBox(
826 TString("sensor_zone_lower_part_rectS") + TString("_") + module_name, XSensorZoneSize[module_size] * 0.5,
827 YSensorZoneSizeLowerPart[module_size] * 0.5, ZSensorZoneSize[module_size] * 0.5);
828
829 // sensor zone shape (lower part of the module: bevel zone)
830 TGeoShape* sensor_zone_lower_part_bevelS = new TGeoXtru(2);
831 sensor_zone_lower_part_bevelS->SetName(TString("sensor_zone_lower_part_bevelS") + TString("_") + module_name);
832 // Calculate coordinates of the bottom and the top points of the inner bevel
833 {
834 // find x and y projections of the bevel border thickness
835 Double_t x_delta = XYBevelBorder[module_size] / TMath::Cos(BevelAngleRad[module_size]);
836 Double_t y_delta = XYBevelBorder[module_size] / TMath::Sin(BevelAngleRad[module_size]);
837
838 // find shifts of the sensitive zone from module borders via the equation of the straight line for the inner
839 // bevel
840 Double_t x_delta_top_BP = XLeftBorder[module_size];
841 Double_t y_delta_top_BP = TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]) * x_delta_top_BP
842 + (YBevelSize[module_size] + y_delta);
843
844 Double_t y_delta_bottom_BP = YBottomBorder[module_size];
845 Double_t x_delta_bottom_BP = (y_delta_bottom_BP - (YBevelSize[module_size] + y_delta))
846 / (TMath::Tan(TMath::PiOver2() + BevelAngleRad[module_size]));
847 //----------------------------------------------------------------------
848
849 Double_t x_pos_sensor_zone_bevel[5] = {+XModuleSize[module_size] * 0.5 - XLeftBorder[module_size],
850 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
851 -XModuleSize[module_size] * 0.5 + XRightBorder[module_size],
852 +XModuleSize[module_size] * 0.5 - x_delta_bottom_BP,
853 +XModuleSize[module_size] * 0.5 - XLeftBorder[module_size]};
854 Double_t y_pos_sensor_zone_bevel[5] = {
855 +YModuleSizeLowerPart[module_size] * 0.5 - YMiddleBorderLowerPart[module_size],
856 +YModuleSizeLowerPart[module_size] * 0.5 - YMiddleBorderLowerPart[module_size],
857 -YModuleSizeLowerPart[module_size] * 0.5 + YBottomBorder[module_size],
858 -YModuleSizeLowerPart[module_size] * 0.5 + YBottomBorder[module_size],
859 -YModuleSizeLowerPart[module_size] * 0.5 + y_delta_top_BP};
860
861 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefinePolygon(5, x_pos_sensor_zone_bevel, y_pos_sensor_zone_bevel);
862 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefineSection(0, -ZModuleSize[module_size] * 0.5);
863 ((TGeoXtru*)sensor_zone_lower_part_bevelS)->DefineSection(1, +ZModuleSize[module_size] * 0.5);
864 }
865
866 //--------------------------------------------------------------------------
867
868 // Volumes ------------------------------------------------------------------
869
870 TGeoVolume* moduleV = new TGeoVolume(module_name, moduleS);
871
872 // sensor zone volume (upper part of the module)
873 TGeoVolume* sensor_zone_upper_part_rectV = new TGeoVolume(
874 TString("Sensor_zone_upper_part_rectV") + TString("_") + module_name, sensor_zone_upper_part_rectS);
875
876 // sensor zone volume (lower part of the module)
877 TGeoVolume* sensor_zone_upper_part_bevelV = new TGeoVolume(
878 TString("Sensor_zone_upper_part_bevelV") + TString("_") + module_name, sensor_zone_upper_part_bevelS);
879
880 // sensor zone volume (lower part of the module: rectangle zone)
881 TGeoVolume* sensor_zone_lower_part_rectV = new TGeoVolume(
882 TString("Sensor_zone_lower_part_rectV") + TString("_") + module_name, sensor_zone_lower_part_rectS);
883
884 // sensor zone volume (lower part of the module: bevel zone)
885 TGeoVolume* sensor_zone_lower_part_bevelV = new TGeoVolume(
886 TString("Sensor_zone_lower_part_bevelV") + TString("_") + module_name, sensor_zone_lower_part_bevelS);
887
888 // volumes media
889 TGeoMedium* silicon_medium = pMedSilicon;
890 if (silicon_medium) {
891 moduleV->SetMedium(silicon_medium);
892 sensor_zone_upper_part_rectV->SetMedium(silicon_medium);
893 sensor_zone_upper_part_bevelV->SetMedium(silicon_medium);
894 sensor_zone_lower_part_rectV->SetMedium(silicon_medium);
895 sensor_zone_lower_part_bevelV->SetMedium(silicon_medium);
896 } else
897 Fatal("Main", "Invalid medium for modules and sensor zones!");
898
899 // volumes visual property (transparency)
900 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
901 sensor_zone_upper_part_rectV->SetLineColor(TColor::GetColor("#e0b0ff"));
902 sensor_zone_upper_part_bevelV->SetLineColor(TColor::GetColor("#e0b0ff"));
903 sensor_zone_lower_part_rectV->SetLineColor(TColor::GetColor("#e0b0ff"));
904 sensor_zone_lower_part_bevelV->SetLineColor(TColor::GetColor("#e0b0ff"));
905 moduleV->SetTransparency(50);
906
907 switch (module_type) {
908
909 case RIGHT_ANGLED_MODULE: {
910
911 // position of the sensor zone in the upper part of the module
912 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
913 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
914 - XLeftBorder[module_size]);
915 sensor_zone_upper_part_pos->SetDy(
916 +YSensorZoneSizeUpperPart[module_size] * 0.5 + YGapBetweenPartsOfModule[module_size] * 0.5
917 + YMiddleBorderUpperPart[module_size] - YShiftFromCenterToAxis[module_size]);
918 sensor_zone_upper_part_pos->SetDz(0.0);
919
920 // position of the sensor zone in the lower part of the module
921 TGeoTranslation* sensor_zone_lower_part_pos = new TGeoTranslation();
922 sensor_zone_lower_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
923 - XLeftBorder[module_size]);
924 sensor_zone_lower_part_pos->SetDy(
925 -YSensorZoneSizeLowerPart[module_size] * 0.5 - YGapBetweenPartsOfModule[module_size] * 0.5
926 - YMiddleBorderLowerPart[module_size] - YShiftFromCenterToAxis[module_size]);
927 sensor_zone_lower_part_pos->SetDz(0.0);
928
929 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
930 moduleV->AddNode(sensor_zone_lower_part_rectV, 0, sensor_zone_lower_part_pos);
931 break;
932 }
933
935 // position of the sensor zone in the upper part of the module
936 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
937 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
938 - XLeftBorder[module_size]);
939 sensor_zone_upper_part_pos->SetDy(+(YTopBorder[module_size] + YMiddleBorderUpperPart[module_size]) * 0.5
940 - YTopBorder[module_size]);
941 sensor_zone_upper_part_pos->SetDz(0.0);
942
943 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
944 break;
945 }
946
947 case BEVEL_MODULE: {
948
949 // position of the sensor zone in the upper part of the module
950 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
951 sensor_zone_upper_part_pos->SetDx(+(XLeftBorder[module_size] + XRightBorder[module_size]) * 0.5
952 - XLeftBorder[module_size]);
953 sensor_zone_upper_part_pos->SetDy(
954 +YSensorZoneSizeUpperPart[module_size] * 0.5 + YGapBetweenPartsOfModule[module_size] * 0.5
955 + YMiddleBorderUpperPart[module_size] - YShiftFromCenterToAxis[module_size]);
956 sensor_zone_upper_part_pos->SetDz(0.0);
957
958 // position of the sensor zone in the lower part of the module
959 TGeoTranslation* sensor_zone_lower_part_bevel_pos = new TGeoTranslation();
960 sensor_zone_lower_part_bevel_pos->SetDx(0.0);
961 sensor_zone_lower_part_bevel_pos->SetDy(-YModuleSizeLowerPart[module_size] * 0.5
962 - YGapBetweenPartsOfModule[module_size] * 0.5
963 - YShiftFromCenterToAxis[module_size]);
964 sensor_zone_lower_part_bevel_pos->SetDz(0.0);
965
966 moduleV->AddNode(sensor_zone_upper_part_rectV, 0, sensor_zone_upper_part_pos);
967 moduleV->AddNode(sensor_zone_lower_part_bevelV, 0, sensor_zone_lower_part_bevel_pos);
968 break;
969 }
970
971 case BEVEL_MODULE_HALF: {
972
973 // position of the sensor zone in the upper part of the module
974 TGeoTranslation* sensor_zone_upper_part_pos = new TGeoTranslation();
975 sensor_zone_upper_part_pos->SetDx(0);
976 sensor_zone_upper_part_pos->SetDy(0);
977 sensor_zone_upper_part_pos->SetDz(0.0);
978
979 moduleV->AddNode(sensor_zone_upper_part_bevelV, 0, sensor_zone_upper_part_pos);
980 break;
981 }
982
983 default:
984 Error("CreateModule()", "Incorrect module type selected!!!");
985 }
986
987 return moduleV;
988}
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]
void create_rootgeom_Silicon_Run9()
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 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()