BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
create_rootgeom_GEMS_Run8_aligned.C
Go to the documentation of this file.
1/*
2 * Baranov D.
3 * 25.02.2020 (created)
4 * 18.01.2021 (updated)
5 * 02.03.2021 (updated): radius of hole in active zone (4.0 -> 6.0 cm)
6 * 12.12.2022 (updated): small GEM added
7 * Use this macro to create ROOT geometry for the FutureConfig2020 GEM configuration
8 *
9 */
10
11// Set Parameters of GEMS -------------------------------------------------------
12const Int_t NStations = 8; // stations in the detector
13const Int_t NMaxModules = 4; // max. number of modules in a station
14
15//(X-Y-Z)Positions of stations (sensitive volumes)
16const Double_t XStationPositions[NStations] = {+1.474 /*0*/, +2.614 /*1*/, +3.393 /*2*/, +4.699 /*3*/,
17 +6.337 /*4*/, +8.189 /*5*/, +9.893 /*6*/, +50.494 /*7*/};
18const Double_t YStationPositions[NStations] = {-0.086 /*0*/, -0.107 /*1*/, +0.003 /*2*/, -0.097 /*3*/,
19 -0.003 /*4*/, +0.0245 /*5*/, +0.022 /*6*/, -0.186 /*7*/};
20const Double_t ZStationPositions[NStations] = {+60.76 /*0*/, +92.242 /*1*/, +123.512 /*2*/, +154.692 /*3*/,
21 +185.989 /*4*/, +217.287 /*5*/, +248.401 /*6*/, +792.532 /*7*/};
22
23//(X-Y-Z)Shifts of modules in each station
25 {163.2 * 0.25, -163.2 * 0.25, 163.2 * 0.25, -163.2 * 0.25}, // st. 0
26 {163.2 * 0.25, -163.2 * 0.25, 163.2 * 0.25, -163.2 * 0.25}, // st. 1
27 {163.2 * 0.25, -163.2 * 0.25, 163.2 * 0.25, -163.2 * 0.25}, // st. 2
28 {163.2 * 0.25, -163.2 * 0.25, 163.2 * 0.25, -163.2 * 0.25}, // st. 3
29 {163.2 * 0.25, -163.2 * 0.25, 163.2 * 0.25, -163.2 * 0.25}, // st. 4
30 {163.2 * 0.25, -163.2 * 0.25, 163.2 * 0.25, -163.2 * 0.25}, // st. 5
31 {163.2 * 0.25, -163.2 * 0.25, 163.2 * 0.25, -163.2 * 0.25}, // st. 6
32 {0.0} // st. 7
33};
35 {+22.5, +22.5, -19.5, -19.5}, // st. 0
36 {+22.5, +22.5, -19.5, -19.5}, // st. 1
37 {+22.5, +22.5, -19.5, -19.5}, // st. 2
38 {+22.5, +22.5, -19.5, -19.5}, // st. 3
39 {+22.5, +22.5, -19.5, -19.5}, // st. 4
40 {+22.5, +22.5, -19.5, -19.5}, // st. 5
41 {+22.5, +22.5, -19.5, -19.5}, // st. 6
42 {0.0} // st. 7
43};
45 {+4.1, +4.1, 0.0, 0.0}, // st. 0
46 {0.0, 0.0, +4.1, +4.1}, // st. 1
47 {+4.1, +4.1, 0.0, 0.0}, // st. 2
48 {0.0, 0.0, +4.1, +4.1}, // st. 3
49 {+4.1, +4.1, 0.0, 0.0}, // st. 4
50 {0.0, 0.0, +4.1, +4.1}, // st. 5
51 {+4.1, +4.1, 0.0, 0.0}, // st. 6
52 {0.0} // st. 7
53};
54
55// alignment corrections --------------------------------------------------------
57 {2.28613e-01, 2.34606e-01, 3.70449e-01, 4.39267e-01, 2.67664e-01, 2.84859e-01, 3.41005e-01, 4.16753e-01},
58 {3.17030e-01, 2.45618e-01, 4.29878e-01, 4.29169e-01, 2.60443e-01, 1.79925e-01, 3.76252e-01, 3.71674e-01},
59 {1.25543e-01, 1.37935e-01, 2.77096e-01, 3.51704e-01, 2.16012e-01, 2.12139e-01, 2.88912e-01, 3.57699e-01},
60 {3.17647e-01, 2.36295e-01, 3.75431e-01, 3.80575e-01, 1.68884e-01, 8.80524e-02, 2.51805e-01, 2.56513e-01},
61 {-3.01883e-02, -2.87880e-02, 1.09744e-01, 1.90429e-01, 1.78162e-02, 1.32671e-02, 9.23760e-02, 1.67779e-01},
62 {1.43966e-01, 5.53303e-02, 2.48555e-01, 2.49193e-01, 3.88544e-02, -3.31393e-02, 7.96085e-02, 7.41273e-02},
63 {0., -5.63645e-04, 0.05, 8.74027e-04, 0., 3.60763e-03, 0.074, 1.49797e-01}};
65 {-2.40830e-01, -2.27117e-01, -4.41393e-01, -2.98662e-01, -1.47376e-01, -5.64919e-01, 3.60250e-02, -2.15290e-01},
66 {-4.83443e-01, -3.63780e-01, -3.52015e-01, -3.36903e-01, -1.14008e-01, -3.49136e-01, -2.14579e-01, -6.23524e-01},
67 {-1.91062e-01, -2.04515e-01, -3.79972e-01, -2.57092e-01, -1.01400e-01, -5.18137e-01, 5.39497e-02, -1.85679e-01},
68 {-4.55871e-01, -3.48696e-01, -2.33191e-01, -2.40044e-01, -5.37329e-02, -3.00596e-01, -1.98740e-01, -6.04983e-01},
69 {-2.31062e-01, -2.58276e-01, -4.03759e-01, -2.70196e-01, -8.53213e-02, -5.14891e-01, 3.15495e-02, -2.08464e-01},
70 {-2.58821e-01, -1.58621e-01, -9.84743e-02, -1.05756e-01, 1.54258e-01, -1.04935e-01, 1.83280e-02, -3.86622e-01},
71 {0., -5.86937e-03, -0.23, -1.45342e-01, 0., -3.98117e-01, 0.15, -1.04839e-01}};
72
74 {StsDX[0][0], StsDX[0][2], StsDX[0][4], StsDX[0][6]}, // st. 0
75 {StsDX[1][0], StsDX[1][2], StsDX[1][4], StsDX[1][6]}, // st. 1
76 {StsDX[2][0], StsDX[2][2], StsDX[2][4], StsDX[2][6]}, // st. 2
77 {StsDX[3][0], StsDX[3][2], StsDX[3][4], StsDX[3][6]}, // st. 3
78 {StsDX[4][0], StsDX[4][2], StsDX[4][4], StsDX[4][6]}, // st. 4
79 {StsDX[5][0], StsDX[5][2], StsDX[5][4], StsDX[5][6]}, // st. 5
80 {StsDX[6][0], StsDX[6][2], StsDX[6][4], StsDX[6][6]}, // st. 6
81 {0.0} // st. 7
82};
83
85 {StsDY[0][0], StsDY[0][2], StsDY[0][4], StsDY[0][6]}, // st. 0
86 {StsDY[1][0], StsDY[1][2], StsDY[1][4], StsDY[1][6]}, // st. 1
87 {StsDY[2][0], StsDY[2][2], StsDY[2][4], StsDY[2][6]}, // st. 2
88 {StsDY[3][0], StsDY[3][2], StsDY[3][4], StsDY[3][6]}, // st. 3
89 {StsDY[4][0], StsDY[4][2], StsDY[4][4], StsDY[4][6]}, // st. 4
90 {StsDY[5][0], StsDY[5][2], StsDY[5][4], StsDY[5][6]}, // st. 5
91 {StsDY[6][0], StsDY[6][2], StsDY[6][4], StsDY[6][6]}, // st. 6
92 {0.0} // st. 7
93};
94
96 {0.243654, 0.250775, 0.173749, 0.161366}, // st. 0
97 {-0.143876, -0.150758, 0.109959, 0.156433}, // st. 1
98 {-0.110145, -0.165981, -0.213889, -0.229543}, // st. 2
99 {0.103517, 0.036342, 0.086135, 0.0941369}, // st. 3
100 {-0.037648, -0.0941807, -0.180758, -0.176327}, // st. 4
101 {-0.0674491, -0.0367844, -0.0972473, -0.0584354}, // st. 5
102 {0, 0, 0, 0}, // st. 6
103 {0.0} // st. 7
104};
105//------------------------------------------------------------------------------
106
107// GEM plane sizes (66x41 type) -------------------------------------------------
111
115//------------------------------------------------------------------------------
116
117// GEM plane sizes (163x45 type) ------------------------------------------------
118const Double_t XModuleSize_Station163x45 = 163.2 * 0.5; // 81.6
121
125//------------------------------------------------------------------------------
126
127// GEM plane sizes (163x39 type) ------------------------------------------------
128const Double_t XModuleSize_Station163x39 = 163.2 * 0.5; // 81.6
130const Double_t ZModuleSize_Station163x39 = 0.9; // sensitive volume
131const Double_t ZGEMSize_Station163x39 = 4.1; // common thickness of GEM (including sens. vol)
132
136//------------------------------------------------------------------------------
137
138// GEM plane sizes (10x10 type) -------------------------------------------------
141const Double_t ZModuleSize_Station10x10 = 0.9; // sensitive volume
142const Double_t ZGEMSize_Station10x10 = 4.1; // common thickness of GEM (including sens. vol)
143
147//------------------------------------------------------------------------------
148
149// GeoManager
151
152// media
159
160class FairGeoMedia;
161class FairGeoBuilder;
162
163TGeoVolume* CreateStation(TString station_name);
164
165TGeoVolume* CreateModule_Station66x41(TString module_name, Double_t xsize, Double_t ysize, Double_t zsize);
167
169 Double_t xsize,
170 Double_t ysize,
171 Double_t zsize,
172 Double_t hole_radius);
174 Double_t dx,
175 Double_t dy,
176 Double_t dz,
177 Double_t hole_radius);
178
180 Double_t xsize,
181 Double_t ysize,
182 Double_t zsize,
183 Double_t hole_radius);
185 Double_t dx,
186 Double_t dy,
187 Double_t dz,
188 Double_t hole_radius);
189
190TGeoVolume* CreateModule_Station10x10(TString module_name, Double_t xsize, Double_t ysize, Double_t zsize);
191
192void DefineRequiredMedia(FairGeoMedia* geoMedia, FairGeoBuilder* geoBuild)
193{
194
195 // air medium
196 FairGeoMedium* mAir = geoMedia->getMedium("air");
197 if (!mAir)
198 Fatal("Main", "FairMedium air not found");
199 geoBuild->createMedium(mAir);
200 pMedAir = gGeoManager->GetMedium("air");
201 if (!pMedAir)
202 Fatal("Main", "Medium air not found");
203
204 // carbon medium
205 FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
206 if (!mCarbon)
207 Fatal("Main", "FairMedium carbon not found");
208 geoBuild->createMedium(mCarbon);
209 pMedCarbon = gGeoManager->GetMedium("carbon");
210 if (!pMedCarbon)
211 Fatal("Main", "Medium carbon not found");
212
213 // fiberglass medium
214 FairGeoMedium* mFiberGlass = geoMedia->getMedium("fiberglass");
215 if (!mFiberGlass)
216 Fatal("Main", "FairMedium fiberglass not found");
217 geoBuild->createMedium(mFiberGlass);
218 pMedFiberGlass = gGeoManager->GetMedium("fiberglass");
219 if (!pMedFiberGlass)
220 Fatal("Main", "Medium fiberglass not found");
221
222 // arco27020 medium
223 FairGeoMedium* mArCO27030 = geoMedia->getMedium("arco27030");
224 if (!mArCO27030)
225 Fatal("Main", "FairMedium arco27030 not found");
226 geoBuild->createMedium(mArCO27030);
227 pMedArCO27030 = gGeoManager->GetMedium("arco27030");
228 if (!pMedArCO27030)
229 Fatal("Main", "Medium arco27030 not found");
230
231 // ArC4H10_80_20 medium
232 FairGeoMedium* mArC4H10_80_20 = geoMedia->getMedium("ArC4H10_80_20");
233 if (!mArC4H10_80_20)
234 Fatal("Main", "FairMedium ArC4H10_80_20 not found");
235 geoBuild->createMedium(mArC4H10_80_20);
236 pMedArC4H10_80_20 = gGeoManager->GetMedium("ArC4H10_80_20");
238 Fatal("Main", "Medium ArC4H10_80_20 not found");
239}
240
242{
243
244 // ---- set working directory --------------------------------------------
245 TString gPath = gSystem->Getenv("VMCWORKDIR");
246
247 // ------- Geometry file name (output) ---------------------------------
248 const TString geoDetectorName = "GEMS";
249 const TString geoDetectorVersion = "Run8_aligned";
250 const TString geoFileName = gPath + "/geometry/" + geoDetectorName + "_" + geoDetectorVersion + ".root";
251
252 // ---- global geometry parameters ---------------------------------------
253 FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
254 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
255
256 // ------- Load media from media file ----------------------------------
257 TString medFile = gPath + "/geometry/media.geo";
258 geoFace->setMediaFile(medFile);
259 geoFace->readMedia();
260 FairGeoMedia* geoMedia = geoFace->getMedia();
261 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
262
263 DefineRequiredMedia(geoMedia, geoBuild);
264 // -------------------------------------------------------------------------
265
266 // -------------- Create geometry and top volume ------------------------
267 gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
268 gGeoMan->SetName(geoDetectorName + "_geom");
269 TGeoVolume* top = new TGeoVolumeAssembly("TOP");
270 top->SetMedium(pMedAir);
271 gGeoMan->SetTopVolume(top);
272 // gGeoMan->SetTopVisible(1);
273 // -------------------------------------------------------------------------
274
275 // Define TOP Geometry
276 TGeoVolume* GEMS = new TGeoVolumeAssembly(geoDetectorName);
277 GEMS->SetMedium(pMedAir);
278
279 for (Int_t istation = 0; istation < NStations; ++istation) {
280
281 Int_t stationNum = istation;
282 TGeoVolume* station = CreateStation(TString("station") + TString::Itoa(stationNum, 10));
283
284 // Applying alignment corrections to module shifts !!!!!!!!!!
285 for (Int_t imodule = 0; imodule < NMaxModules; ++imodule) {
286 XModuleShifts[istation][imodule] -= XAlignmentCorrections[istation][imodule];
287 YModuleShifts[istation][imodule] -= YAlignmentCorrections[istation][imodule];
288 ZModuleShifts[istation][imodule] += ZAlignmentCorrections[istation][imodule];
289 }
290
291 if (istation < 7) { // big GEMs
292
293 // upper part
294 TGeoVolume* module0 =
297 TGeoVolume* module1 =
300 TGeoVolume* frame0 =
303 TGeoVolume* frame1 =
306
307 // lower part
308 TGeoVolume* module2 =
311 TGeoVolume* module3 =
314 TGeoVolume* frame2 =
317 TGeoVolume* frame3 =
320
321 TGeoCombiTrans* module0_transform = new TGeoCombiTrans();
322 module0_transform->SetTranslation(XModuleShifts[stationNum][0], YModuleShifts[stationNum][0],
323 ZModuleShifts[stationNum][0] + ZModuleSize_Station163x45 * 0.5);
324
325 TGeoCombiTrans* module1_transform = new TGeoCombiTrans();
326 module1_transform->ReflectX(true);
327 module1_transform->SetTranslation(XModuleShifts[stationNum][1], YModuleShifts[stationNum][1],
328 ZModuleShifts[stationNum][1] + ZModuleSize_Station163x45 * 0.5);
329
330 TGeoCombiTrans* module2_transform = new TGeoCombiTrans();
331 module2_transform->ReflectY(true);
332 module2_transform->SetTranslation(XModuleShifts[stationNum][2], YModuleShifts[stationNum][2],
333 ZModuleShifts[stationNum][2] + ZModuleSize_Station163x45 * 0.5);
334
335 TGeoCombiTrans* module3_transform = new TGeoCombiTrans();
336 module3_transform->ReflectY(true);
337 module3_transform->ReflectX(true);
338 module3_transform->SetTranslation(XModuleShifts[stationNum][3], YModuleShifts[stationNum][3],
339 ZModuleShifts[stationNum][3] + ZModuleSize_Station163x45 * 0.5);
340
341 TGeoCombiTrans* station_transform = new TGeoCombiTrans();
342 station_transform->SetTranslation(XStationPositions[stationNum], YStationPositions[stationNum],
343 ZStationPositions[stationNum]);
344
345 station->AddNode(module0, 0, new TGeoCombiTrans(*module0_transform)); // module
346 station->AddNode(module1, 0, new TGeoCombiTrans(*module1_transform)); // module
347 station->AddNode(module2, 0, new TGeoCombiTrans(*module2_transform)); // module
348 station->AddNode(module3, 0, new TGeoCombiTrans(*module3_transform)); // module
349
350 // station->AddNode(frame0, 0, new TGeoCombiTrans(*module0_transform)); //frame
351 // station->AddNode(frame1, 0, new TGeoCombiTrans(*module1_transform)); //frame
352 // station->AddNode(frame2, 0, new TGeoCombiTrans(*module2_transform)); //frame
353 // station->AddNode(frame3, 0, new TGeoCombiTrans(*module3_transform)); //frame
354 }
355
356 if (istation == 7) { // small GEM
357 TGeoVolume* module0 =
358 CreateModule_Station10x10(TString("Sensor_module0_") + station->GetName(), XModuleSize_Station10x10,
360
361 TGeoCombiTrans* module0_transform = new TGeoCombiTrans();
362 module0_transform->SetTranslation(XModuleShifts[stationNum][0], YModuleShifts[stationNum][0],
363 ZModuleShifts[stationNum][0] + ZModuleSize_Station10x10 * 0.5);
364
365 station->AddNode(module0, 0, new TGeoCombiTrans(*module0_transform)); // module
366 }
367
368 TGeoCombiTrans* station_transform = new TGeoCombiTrans();
369 station_transform->SetTranslation(XStationPositions[stationNum], YStationPositions[stationNum],
370 ZStationPositions[stationNum]);
371
372 GEMS->AddNode(station, 0, station_transform);
373 }
374
375 top->AddNode(GEMS, 0);
377
378 // --------------- Finish -----------------------------------------------
379 gGeoMan->CloseGeometry();
380 gGeoMan->CheckOverlaps(0.0001);
381 gGeoMan->PrintOverlaps();
382 gGeoMan->Test();
383 // gGeoMan->RestoreMasterVolume();
384
385 TFile* geoFile = new TFile(geoFileName, "RECREATE");
386 top->Write();
387 geoFile->Close();
388 top->Draw("ogl");
389}
390
391//------------------------------------------------------------------------------
392
394{
395
396 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
397 stationA->SetMedium(pMedAir);
398
399 return stationA;
400}
401
403{
404
405 // module shape
406 TGeoShape* moduleS = new TGeoBBox("moduleS", xsize * 0.5, ysize * 0.5, zsize * 0.5);
407
408 // module volume
409 TGeoVolume* moduleV = new TGeoVolume(module_name, moduleS);
410
411 // medium
414 else
415 Fatal("Main", "Invalid medium for sensitive modules!");
416
417 // visual parameters
418 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
419 moduleV->SetTransparency(20);
420
421 return moduleV;
422}
423
425{
426
427 // frame shapes
428 TGeoShape* vertical_frameS =
429 new TGeoBBox("vertical_frameS", dx * 0.5, YModuleSize_Station66x41 * 0.5 + dy, dz * 0.5);
430 TGeoShape* horizontal_frameS =
431 new TGeoBBox("horizontal_frameS", XModuleSize_Station66x41 * 0.5, dy * 0.5, dz * 0.5);
432
433 // frame volumes
434 TGeoVolume* composite_frameV = new TGeoVolumeAssembly(frame_name);
435 TGeoVolume* vertical_frameV = new TGeoVolume(frame_name + "_vertical_frameV", vertical_frameS);
436 TGeoVolume* horizontal_frameV = new TGeoVolume(frame_name + "_horizontal_frameV", horizontal_frameS);
437
438 // media
439 TGeoMedium* frame_medium = pMedCarbon; // set medium
440 if (pMedCarbon) {
441 vertical_frameV->SetMedium(frame_medium);
442 horizontal_frameV->SetMedium(frame_medium);
443 } else
444 Fatal("Main", "Invalid medium for frames!");
445 if (pMedAir) {
446 composite_frameV->SetMedium(pMedAir);
447 } else
448 Fatal("Main", "Invalid medium for frames!");
449
450 // visual parameters
451 vertical_frameV->SetLineColor(TColor::GetColor("#9999ff"));
452 horizontal_frameV->SetLineColor(TColor::GetColor("#9999ff"));
453
454 // frame part positions in the frame
455 TGeoCombiTrans* left_vertical_frame_position = new TGeoCombiTrans();
456 left_vertical_frame_position->SetTranslation(XModuleSize_Station66x41 * 0.5 + dXFrame_Station66x41 * 0.5, 0.0, 0.0);
457
458 TGeoCombiTrans* right_vertical_frame_position = new TGeoCombiTrans();
459 right_vertical_frame_position->SetTranslation(-XModuleSize_Station66x41 * 0.5 - dXFrame_Station66x41 * 0.5, 0.0,
460 0.0);
461
462 TGeoCombiTrans* bottom_horizontal_frame_position = new TGeoCombiTrans();
463 bottom_horizontal_frame_position->SetTranslation(0.0, YModuleSize_Station66x41 * 0.5 + dYFrame_Station66x41 * 0.5,
464 0.0);
465
466 TGeoCombiTrans* lower_horizontal_frame_position = new TGeoCombiTrans();
467 lower_horizontal_frame_position->SetTranslation(0.0, -YModuleSize_Station66x41 * 0.5 - dYFrame_Station66x41 * 0.5,
468 0.0);
469
470 composite_frameV->AddNode(vertical_frameV, 0, left_vertical_frame_position);
471 composite_frameV->AddNode(vertical_frameV, 1, right_vertical_frame_position);
472 composite_frameV->AddNode(horizontal_frameV, 0, bottom_horizontal_frame_position);
473 composite_frameV->AddNode(horizontal_frameV, 1, lower_horizontal_frame_position);
474
475 return composite_frameV;
476}
477
479 Double_t xsize,
480 Double_t ysize,
481 Double_t zsize,
482 Double_t hole_radius)
483{
484
485 gRandom->SetSeed(0);
486 Int_t uniqueId = gRandom->Integer(100000);
487
488 // module shapes
489 TGeoShape* module_partS =
490 new TGeoBBox(TString("module_partS") + TString::Itoa(uniqueId, 10), xsize * 0.5, ysize * 0.5, zsize * 0.5);
491 TGeoShape* holeS =
492 new TGeoTube(TString("holeS") + TString::Itoa(uniqueId, 10), 0.0, hole_radius, zsize * 0.5 + 0.01);
493
494 TGeoTranslation* hole_module_trans = new TGeoTranslation(
495 TString("hole_module_trans_") + TString::Itoa(uniqueId, 10), -xsize * 0.5, -ysize * 0.5, 0.0);
496
497 hole_module_trans->RegisterYourself();
498
499 TString bool_expression_module = TString(module_partS->GetName()) + TString(" - ") + TString(holeS->GetName())
500 + TString(":") + TString(hole_module_trans->GetName());
501 TGeoCompositeShape* moduleS = new TGeoCompositeShape(bool_expression_module);
502
503 // module volume
504 TGeoVolume* moduleV = new TGeoVolume(module_name, moduleS);
505
506 // medium
509 else
510 Fatal("Main", "Invalid medium for sensitive modules!");
511
512 // visual parameters
513 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
514 moduleV->SetTransparency(20);
515
516 return moduleV;
517}
518//------------------------------------------------------------------------------
519
521 Double_t dx,
522 Double_t dy,
523 Double_t dz,
524 Double_t hole_radius)
525{
526
527 // frame shapes
528 TGeoShape* vertical_frameS =
529 new TGeoBBox("vertical_frameS", dx * 0.5, YModuleSize_Station163x45 * 0.5 + dy, dz * 0.5);
530 TGeoShape* horizontal_upper_frameS =
531 new TGeoBBox("horizontal_upper_frameS", XModuleSize_Station163x45 * 0.5, dy * 0.5, dz * 0.5);
532 TGeoShape* horizontal_bottom_frameS = new TGeoBBox(
533 "horizontal_upper_frameS", XModuleSize_Station163x45 * 0.5 - hole_radius * 0.5, dy * 0.5, dz * 0.5);
534
535 // frame volumes
536 TGeoVolume* composite_frameV = new TGeoVolumeAssembly(frame_name);
537 TGeoVolume* vertical_frameV = new TGeoVolume(frame_name + "_vertical_frameV", vertical_frameS);
538 TGeoVolume* horizontal_upper_frameV =
539 new TGeoVolume(frame_name + "_horizontal_upper_frameV", horizontal_upper_frameS);
540 TGeoVolume* horizontal_bottom_frameV =
541 new TGeoVolume(frame_name + "_horizontal_bottom_frameV", horizontal_bottom_frameS);
542
543 // media
544 TGeoMedium* frame_medium = pMedCarbon; // set medium
545 if (pMedCarbon) {
546 vertical_frameV->SetMedium(frame_medium);
547 horizontal_upper_frameV->SetMedium(frame_medium);
548 horizontal_bottom_frameV->SetMedium(frame_medium);
549 } else
550 Fatal("Main", "Invalid medium for frames!");
551 if (pMedAir) {
552 composite_frameV->SetMedium(pMedAir);
553 } else
554 Fatal("Main", "Invalid medium for frames!");
555
556 // visual parameters
557 vertical_frameV->SetLineColor(TColor::GetColor("#9999ff"));
558 horizontal_upper_frameV->SetLineColor(TColor::GetColor("#9999ff"));
559 horizontal_bottom_frameV->SetLineColor(TColor::GetColor("#9999ff"));
560
561 // frame part positions in the frame
562 TGeoCombiTrans* left_vertical_frame_position = new TGeoCombiTrans();
563 left_vertical_frame_position->SetTranslation(XModuleSize_Station163x45 * 0.5 + dXFrame_Station163x45 * 0.5, 0.0,
564 0.0);
565
566 TGeoCombiTrans* upper_horizontal_frame_position = new TGeoCombiTrans();
567 upper_horizontal_frame_position->SetTranslation(0.0, YModuleSize_Station163x45 * 0.5 + dYFrame_Station163x45 * 0.5,
568 0.0);
569
570 TGeoCombiTrans* bottom_horizontal_frame_position = new TGeoCombiTrans();
571 bottom_horizontal_frame_position->SetTranslation(
572 hole_radius * 0.5, -YModuleSize_Station163x45 * 0.5 - dYFrame_Station163x45 * 0.5, 0.0);
573
574 composite_frameV->AddNode(vertical_frameV, 0, left_vertical_frame_position);
575 composite_frameV->AddNode(horizontal_upper_frameV, 0, upper_horizontal_frame_position);
576 composite_frameV->AddNode(horizontal_bottom_frameV, 0, bottom_horizontal_frame_position);
577
578 return composite_frameV;
579}
580//------------------------------------------------------------------------------
581
583 Double_t xsize,
584 Double_t ysize,
585 Double_t zsize,
586 Double_t hole_radius)
587{
588
589 return CreateModule_Station163x45(module_name, xsize, ysize, zsize, hole_radius);
590}
591//------------------------------------------------------------------------------
592
594 Double_t dx,
595 Double_t dy,
596 Double_t dz,
597 Double_t hole_radius)
598{
599
600 // frame shapes
601 TGeoShape* vertical_frameS = new TGeoBBox(TString("vertical_frameS") += TString("_") + frame_name, dx * 0.5,
602 YModuleSize_Station163x39 * 0.5 + dy, dz * 0.5);
603 TGeoShape* horizontal_upper_frameS = new TGeoBBox(TString("horizontal_upper_frameS") += TString("_") + frame_name,
604 XModuleSize_Station163x39 * 0.5, dy * 0.5, dz * 0.5);
605 TGeoShape* horizontal_bottom_frameS =
606 new TGeoBBox(TString("horizontal_upper_frameS") += TString("_") + frame_name,
607 XModuleSize_Station163x39 * 0.5 - hole_radius * 0.5, dy * 0.5, dz * 0.5);
608
609 // frame volumes
610 TGeoVolume* composite_frameV = new TGeoVolumeAssembly(frame_name);
611 TGeoVolume* vertical_frameV = new TGeoVolume(frame_name + "_vertical_frameV", vertical_frameS);
612 TGeoVolume* horizontal_upper_frameV =
613 new TGeoVolume(frame_name + "_horizontal_upper_frameV", horizontal_upper_frameS);
614 TGeoVolume* horizontal_bottom_frameV =
615 new TGeoVolume(frame_name + "_horizontal_bottom_frameV", horizontal_bottom_frameS);
616
617 // media
618 TGeoMedium* frame_medium = pMedCarbon; // set medium
619 if (pMedCarbon) {
620 vertical_frameV->SetMedium(frame_medium);
621 horizontal_upper_frameV->SetMedium(frame_medium);
622 horizontal_bottom_frameV->SetMedium(frame_medium);
623 } else
624 Fatal("Main", "Invalid medium for frames!");
625 if (pMedAir) {
626 composite_frameV->SetMedium(pMedAir);
627 } else
628 Fatal("Main", "Invalid medium for frames!");
629
630 // visual parameters
631 vertical_frameV->SetLineColor(TColor::GetColor("#9999ff"));
632 horizontal_upper_frameV->SetLineColor(TColor::GetColor("#9999ff"));
633 horizontal_bottom_frameV->SetLineColor(TColor::GetColor("#9999ff"));
634
635 // frame part positions in the frame
636 TGeoCombiTrans* left_vertical_frame_position = new TGeoCombiTrans();
637 left_vertical_frame_position->SetTranslation(XModuleSize_Station163x39 * 0.5 + dXFrame_Station163x39 * 0.5, 0.0,
638 0.0);
639
640 TGeoCombiTrans* upper_horizontal_frame_position = new TGeoCombiTrans();
641 upper_horizontal_frame_position->SetTranslation(0.0, YModuleSize_Station163x39 * 0.5 + dYFrame_Station163x39 * 0.5,
642 0.0);
643
644 TGeoCombiTrans* bottom_horizontal_frame_position = new TGeoCombiTrans();
645 bottom_horizontal_frame_position->SetTranslation(
646 hole_radius * 0.5, -YModuleSize_Station163x39 * 0.5 - dYFrame_Station163x39 * 0.5, 0.0);
647
648 composite_frameV->AddNode(vertical_frameV, 0, left_vertical_frame_position);
649 composite_frameV->AddNode(horizontal_upper_frameV, 0, upper_horizontal_frame_position);
650 composite_frameV->AddNode(horizontal_bottom_frameV, 0, bottom_horizontal_frame_position);
651
652 return composite_frameV;
653}
654//------------------------------------------------------------------------------
655
657{
658
659 // module shape
660 TGeoShape* moduleS = new TGeoBBox("moduleS", xsize * 0.5, ysize * 0.5, zsize * 0.5);
661
662 // module volume
663 TGeoVolume* moduleV = new TGeoVolume(module_name, moduleS);
664
665 // medium
668 else
669 Fatal("Main", "Invalid medium for sensitive modules!");
670
671 // visual parameters
672 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
673 moduleV->SetTransparency(20);
674
675 return moduleV;
676}
677//------------------------------------------------------------------------------
int Int_t
double Double_t
constexpr Bool_t kTRUE
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TGeoManager * gGeoManager
#define gROOT
R__EXTERN TRandom * gRandom
R__EXTERN TSystem * gSystem
static Int_t GetColor(const char *hexcolor)
void Close(Option_t *option="") override
void ReflectX(Bool_t leftside, Bool_t rotonly=kFALSE) override
void SetTranslation(const TGeoTranslation &tr)
void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE) override
virtual void RegisterYourself()
const char * GetName() const 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 Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
static TString Itoa(Int_t value, Int_t base)
const Double_t dYFrame_Station163x45
const Double_t dXFrame_Station66x41
const Double_t dZFrame_Station66x41
TGeoMedium * pMedAir
const Double_t ZModuleSize_Station66x41
const Double_t YStationPositions[NStations]
const Double_t dYFrame_Station66x41
const Double_t ZModuleSize_Station163x45
const Double_t dXFrame_Station163x45
const Double_t YModuleSize_Station163x45
Double_t XModuleShifts[NStations][NMaxModules]
TGeoMedium * pMedCarbon
const Double_t dZFrame_Station163x45
TGeoManager * gGeoMan
const Int_t NMaxModules
const Double_t ZStationPositions[NStations]
Double_t ZModuleShifts[NStations][NMaxModules]
TGeoMedium * pMedArCO27030
const Int_t NStations
const Double_t YModuleSize_Station66x41
const Double_t XModuleSize_Station163x45
const Double_t XModuleSize_Station66x41
TGeoMedium * pMedFiberGlass
const Double_t XStationPositions[NStations]
Double_t YModuleShifts[NStations][NMaxModules]
TGeoMedium * pMedCopper
const Double_t StsDY[NStations][8]
const Double_t XAlignmentCorrections[NStations][NMaxModules]
const Double_t YAlignmentCorrections[NStations][NMaxModules]
const Double_t ZAlignmentCorrections[NStations][NMaxModules]
const Double_t StsDX[NStations][8]
const Double_t ZModuleSize_Station10x10
const Double_t dYFrame_Station10x10
const Double_t XModuleSize_Station10x10
const Double_t YModuleSize_Station10x10
const Double_t dYFrame_Station163x39
const Double_t ZGEMSize_Station10x10
const Double_t dXFrame_Station10x10
const Double_t dXFrame_Station163x39
const Double_t XModuleSize_Station163x39
const Double_t YModuleSize_Station163x39
const Double_t ZGEMSize_Station163x39
const Double_t ZModuleSize_Station163x39
const Double_t dZFrame_Station163x39
const Double_t dZFrame_Station10x10
void create_rootgeom_GEMS_Run8_aligned()
TGeoVolume * CreateModule_Station10x10(TString module_name, Double_t xsize, Double_t ysize, Double_t zsize)
TGeoVolume * CreateModule_Station66x41(TString module_name, Double_t xsize, Double_t ysize, Double_t zsize)
TGeoVolume * CreateFrameForModule_Station163x45(TString frame_name, Double_t dx, Double_t dy, Double_t dz, Double_t hole_radius)
TGeoVolume * CreateStation(TString station_name)
TGeoVolume * CreateModule_Station163x45(TString module_name, Double_t xsize, Double_t ysize, Double_t zsize, Double_t hole_radius)
TGeoVolume * CreateFrameForModule_Station163x39(TString frame_name, Double_t dx, Double_t dy, Double_t dz, Double_t hole_radius)
void DefineRequiredMedia(FairGeoMedia *geoMedia, FairGeoBuilder *geoBuild)
TGeoVolume * CreateFrameForModule_Station66x41(TString frame_name, Double_t dx, Double_t dy, Double_t dz)
TGeoVolume * CreateModule_Station163x39(TString module_name, Double_t xsize, Double_t ysize, Double_t zsize, Double_t hole_radius)
TGeoMedium * pMedArC4H10_80_20