BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
create_rootgeom_GEMS_RunSummer2016.C
Go to the documentation of this file.
1//---------------------------
2#include "../../gem/BmnGemStripConfiguration.h"
3#include "TFile.h"
4#include "TGeoBBox.h"
5#include "TGeoManager.h"
6#include "TGeoShape.h"
7#include "TMath.h"
8#include "TString.h"
9
10using namespace TMath;
11
12// GeoManager
14
15// Set Parameters of GEMS
16const Int_t nStations = 7;
17
18// Station Parameters
19
28
37
46
47/*
48Double_t XStationPositions[nStations];
49 XStationPositions[0] = +0.0;
50 XStationPositions[1] = +1.5;
51 XStationPositions[2] = -1.5;
52 XStationPositions[3] = +1.5;
53 XStationPositions[4] = -1.5;
54 XStationPositions[5] = +1.5;
55 XStationPositions[6] = +0.0;
56
57Double_t YStationPositions[nStations];
58 YStationPositions[0] = +0.0;
59 YStationPositions[1] = +0.0;
60 YStationPositions[2] = +0.0;
61 YStationPositions[3] = +0.0;
62 YStationPositions[4] = +0.0;
63 YStationPositions[5] = +0.0;
64 YStationPositions[6] = +0.0;
65
66Double_t ZStationPositions[nStations];
67 ZStationPositions[0] = 5.0+0.1; //start position of the sensitive volume (not frames!)
68 ZStationPositions[1] = 41.8+0.7;
69 ZStationPositions[2] = 62.8+0.7;
70 ZStationPositions[3] = 83.8+0.7;
71 ZStationPositions[4] = 104.8+0.7;
72 ZStationPositions[5] = 125.8+0.7;
73 ZStationPositions[6] = 146.8+1.5;
74*/
75
76// GEM plane sizes (10x10 type) -------------------------------------------------
79
80// Module Parameters (10x10 type)
87const Double_t Mylar_window_layer_Station10x10 = 0.1; // layer in front the of drift gap
88//------------------------------------------------------------------------------
89
90// GEM plane sizes (66x41 type) -------------------------------------------------
93
96
97// Module Parameters (66x41 type)
104//------------------------------------------------------------------------------
105
106// GEM plane sizes (163x45 type) ------------------------------------------------
107const Double_t OuterZoneSizes_Station163x45[2] = {163.2 * 0.5, 45.0}; // {xsize, ysize}
108const Double_t HotZoneSizes_rectangle_Station163x45[2] = {40.0, 15.0}; // {xsize, ysize}
109const Double_t HotZoneSizes_slope_Station163x45[3] = {37.99, 42.01, 15.0}; // {xmin_size, xmax_size, ysize}
110const Double_t HoleRadius_Station163x45 = 4.0; // cm (real hole without the circle frame)
111
112// Module Parameters (163x45 type)
119
120//------------------------------------------------------------------------------
121
122// media
128
129class FairGeoMedia;
130class FairGeoBuilder;
131
132void DefineRequiredMedia(FairGeoMedia* geoMedia, FairGeoBuilder* geoBuild)
133{
134
135 // air medium
136 FairGeoMedium* mAir = geoMedia->getMedium("air");
137 if (!mAir)
138 Fatal("Main", "FairMedium air not found");
139 geoBuild->createMedium(mAir);
140 pMedAir = gGeoManager->GetMedium("air");
141 if (!pMedAir)
142 Fatal("Main", "Medium air not found");
143
144 // carbon medium
145 FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
146 if (!mCarbon)
147 Fatal("Main", "FairMedium carbon not found");
148 geoBuild->createMedium(mCarbon);
149 pMedCarbon = gGeoManager->GetMedium("carbon");
150 if (!pMedCarbon)
151 Fatal("Main", "Medium carbon not found");
152
153 // fiberglass medium
154 FairGeoMedium* mFiberGlass = geoMedia->getMedium("fiberglass");
155 if (!mFiberGlass)
156 Fatal("Main", "FairMedium fiberglass not found");
157 geoBuild->createMedium(mFiberGlass);
158 pMedFiberGlass = gGeoManager->GetMedium("fiberglass");
159 if (!pMedFiberGlass)
160 Fatal("Main", "Medium fiberglass not found");
161
162 // arco27020 medium
163 FairGeoMedium* mArCO27030 = geoMedia->getMedium("arco27030");
164 if (!mArCO27030)
165 Fatal("Main", "FairMedium arco27030 not found");
166 geoBuild->createMedium(mArCO27030);
167 pMedArCO27030 = gGeoManager->GetMedium("arco27030");
168 if (!pMedArCO27030)
169 Fatal("Main", "Medium arco27030 not found");
170}
171
173{
174
175 // Load the necessary FairRoot libraries
176 gROOT->LoadMacro("$VMCWORKDIR/macro/run/bmnloadlibs.C");
177 bmnloadlibs(); // load libraries
178
179 // ---- set working directory --------------------------------------------
180 TString gPath = gSystem->Getenv("VMCWORKDIR");
181
182 // ------- Geometry file name (output) ----------------------------------
183 const TString geoDetectorName = "GEMS";
184 const TString geoDetectorVersion = "RunSummer2016";
185 const TString geoFileName = gPath + "/geometry/" + geoDetectorName + "_" + geoDetectorVersion + ".root";
186
187 // ---- global geometry parameters ---------------------------------------
188 FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
189 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
190
191 // ------- Load media from media file ----------------------------------
192 TString medFile = gPath + "/geometry/media.geo";
193 geoFace->setMediaFile(medFile);
194 geoFace->readMedia();
195 FairGeoMedia* geoMedia = geoFace->getMedia();
196 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
197
198 DefineRequiredMedia(geoMedia, geoBuild);
199 // -------------------------------------------------------------------------
200
201 // -------------- Create geometry and top volume -------------------------
202 gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
203 gGeoMan->SetName(geoDetectorName + "_geom");
204 TGeoVolume* top = new TGeoVolumeAssembly("TOP");
205 top->SetMedium(pMedAir);
206 gGeoMan->SetTopVolume(top);
207 // gGeoMan->SetTopVisible(1);
208 // --------------------------------------------------------------------------
209
210 // Define TOP Geometry
211 TGeoVolume* GEMS = new TGeoVolumeAssembly(geoDetectorName);
212 GEMS->SetMedium(pMedAir);
213
214 // station composing
215
218
220 kFALSE);
222 kTRUE);
224 kFALSE);
226 kTRUE);
228 kFALSE);
229
232
233 top->AddNode(GEMS, 0);
235
236 // --------------- Finish -----------------------------------------------
237 gGeoMan->CloseGeometry();
238 gGeoMan->CheckOverlaps(0.0001);
239 gGeoMan->PrintOverlaps();
240 gGeoMan->Test();
241
242 TFile* geoFile = new TFile(geoFileName, "RECREATE");
243 top->Write();
244 geoFile->Close();
245 top->Draw("ogl");
246}
247//------------------------------------------------------------------------------
248
250 TString station_name,
251 Double_t x_position,
252 Double_t y_position,
253 Double_t z_position)
254{
255 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
256 stationA->SetMedium(pMedAir);
257
258 // sensitive shapes
259 TGeoShape* moduleS = new TGeoBBox("moduleS", XModuleSize_Station10x10 * 0.5, YModuleSize_Station10x10 * 0.5,
261
262 // frame shapes
263 TGeoShape* vertical_outer_frameS =
264 new TGeoBBox("vertical_outer_frameS", dXOuterFrame_Station10x10 * 0.5,
266 TGeoShape* horizontal_outer_frameS = new TGeoBBox("horizontal_outer_frameS", XModuleSize_Station10x10 * 0.5,
268 TGeoShape* vertical_inner_frameS =
269 new TGeoBBox("vertical_inner_frameS", dXInnerFrame_Station10x10 * 0.5,
272 TGeoShape* horizontal_inner_frameS =
273 new TGeoBBox("horizontal_inner_frameS", (XModuleSize_Station10x10 + dXOuterFrame_Station10x10) * 0.5,
275
276 // sensitive volumes
277 TGeoVolume* moduleV = new TGeoVolume("module_Sensor", moduleS);
278 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
279
280 // frame volumes
281 TGeoVolume* vertical_outer_frameV = new TGeoVolume("vertical_outer_frame", vertical_outer_frameS);
282 TGeoVolume* horizontal_outer_frameV = new TGeoVolume("horizontal_outer_frame", horizontal_outer_frameS);
283 TGeoVolume* vertical_inner_frameV = new TGeoVolume("vertical_inner_frame", vertical_inner_frameS);
284 TGeoVolume* horizontal_inner_frameV = new TGeoVolume("horizontal_inner_frame", horizontal_inner_frameS);
285 TGeoVolume* composite_frameV = new TGeoVolumeAssembly("frame");
286 vertical_outer_frameV->SetLineColor(TColor::GetColor("#9999ff"));
287 horizontal_outer_frameV->SetLineColor(TColor::GetColor("#9999ff"));
288 vertical_inner_frameV->SetLineColor(TColor::GetColor("#9999ff"));
289 horizontal_inner_frameV->SetLineColor(TColor::GetColor("#9999ff"));
290
291 // media for sensitive volumes
292 TGeoMedium* sensitive_medium = pMedArCO27030; // set medium
293 if (sensitive_medium) {
294 moduleV->SetMedium(sensitive_medium);
295 } else
296 Fatal("Main", "Invalid medium for sensitive modules!");
297
298 // media for frames
299 TGeoMedium* frame_medium = pMedCarbon; // set medium
300 if (frame_medium) {
301 vertical_outer_frameV->SetMedium(frame_medium);
302 horizontal_outer_frameV->SetMedium(frame_medium);
303 vertical_inner_frameV->SetMedium(frame_medium);
304 horizontal_inner_frameV->SetMedium(frame_medium);
305 composite_frameV->SetMedium(frame_medium);
306 } else
307 Fatal("Main", "Invalid medium for frames!");
308
309 moduleV->SetTransparency(20);
310
311 // module positions in the station
312 TGeoCombiTrans* module_center_position = new TGeoCombiTrans();
313 module_center_position->SetTranslation(0.0, 0.0, 0.0);
314
315 // frame part positions in the frame
316 TGeoCombiTrans* left_outer_frame_position = new TGeoCombiTrans();
317 left_outer_frame_position->SetTranslation(XModuleSize_Station10x10 * 0.5 + dXOuterFrame_Station10x10 * 0.5,
318 dYOuterFrame_Station10x10 * 0.5, 0.0);
319
320 TGeoCombiTrans* top_outer_frame_position = new TGeoCombiTrans();
321 top_outer_frame_position->SetTranslation(0.0, YModuleSize_Station10x10 * 0.5 + dYOuterFrame_Station10x10 * 0.5,
322 0.0);
323
324 TGeoCombiTrans* right_inner_frame_position = new TGeoCombiTrans();
325 right_inner_frame_position->SetTranslation(
328
329 TGeoCombiTrans* bottom_inner_frame_position = new TGeoCombiTrans();
330 bottom_inner_frame_position->SetTranslation(dXOuterFrame_Station10x10 * 0.5,
332
333 // frame positions in the station
334 TGeoCombiTrans* comp_frame_center_position = new TGeoCombiTrans();
335 comp_frame_center_position->SetTranslation(module_center_position->GetTranslation());
336 comp_frame_center_position->SetDz((ZModuleSize_Station10x10 - dZSensitiveVolume_Station10x10) * 0.5
338
339 composite_frameV->AddNode(vertical_outer_frameV, 0, left_outer_frame_position);
340 composite_frameV->AddNode(horizontal_outer_frameV, 0, top_outer_frame_position);
341 composite_frameV->AddNode(vertical_inner_frameV, 0, right_inner_frame_position);
342 composite_frameV->AddNode(horizontal_inner_frameV, 0, bottom_inner_frame_position);
343
344 stationA->AddNode(moduleV, 0, module_center_position);
345 stationA->AddNode(composite_frameV, 0, comp_frame_center_position);
346
347 // Station position
348 Double_t station_shift = dZSensitiveVolume_Station10x10 * 0.5;
349 TGeoTranslation* station_pos = new TGeoTranslation(x_position, y_position, z_position + station_shift);
350
351 mother_volume->AddNode(stationA, 0, station_pos);
352}
353
355 TString station_name,
356 Double_t x_position,
357 Double_t y_position,
358 Double_t z_position,
359 Bool_t IsInverted)
360{
361 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
362 stationA->SetMedium(pMedAir);
363
364 // sensitive shapes
365 TGeoShape* moduleS = new TGeoBBox("moduleS", XModuleSize_Station66x41 * 0.5, YModuleSize_Station66x41 * 0.5,
367 TGeoShape* hot_zoneS = new TGeoBBox("hot_zoneS", XHotZoneSize_Station66x41 * 0.5, YHotZoneSize_Station66x41 * 0.5,
369
370 // frame shapes
371 TGeoShape* vertical_outer_frameS =
372 new TGeoBBox("vertical_outer_frameS", dXOuterFrame_Station66x41 * 0.5,
374 TGeoShape* horizontal_outer_frameS = new TGeoBBox("horizontal_outer_frameS", XModuleSize_Station66x41 * 0.5,
376 TGeoShape* vertical_inner_frameS =
377 new TGeoBBox("vertical_inner_frameS", dXInnerFrame_Station66x41 * 0.5,
379 TGeoShape* horizontal_inner_frameS =
380 new TGeoBBox("horizontal_inner_frameS",
383
384 // sensitive volumes
385 TGeoVolume* moduleV = new TGeoVolume("module_Sensor", moduleS);
386 TGeoVolume* hot_zoneV = new TGeoVolume("hot_zone_Sensor", hot_zoneS);
387 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
388 hot_zoneV->SetLineColor(TColor::GetColor("#e0b0ff"));
389
390 // frame volumes
391 TGeoVolume* vertical_outer_frameV = new TGeoVolume("vertical_outer_frame", vertical_outer_frameS);
392 TGeoVolume* horizontal_outer_frameV = new TGeoVolume("horizontal_outer_frame", horizontal_outer_frameS);
393 TGeoVolume* vertical_inner_frameV = new TGeoVolume("vertical_inner_frame", vertical_inner_frameS);
394 TGeoVolume* horizontal_inner_frameV = new TGeoVolume("horizontal_inner_frame", horizontal_inner_frameS);
395 TGeoVolume* composite_frameV = new TGeoVolumeAssembly("frame");
396 vertical_outer_frameV->SetLineColor(TColor::GetColor("#9999ff"));
397 horizontal_outer_frameV->SetLineColor(TColor::GetColor("#9999ff"));
398 vertical_inner_frameV->SetLineColor(TColor::GetColor("#9999ff"));
399 horizontal_inner_frameV->SetLineColor(TColor::GetColor("#9999ff"));
400
401 // media for sensitive volumes
402 TGeoMedium* sensitive_medium = pMedArCO27030; // set medium
403 if (sensitive_medium) {
404 moduleV->SetMedium(sensitive_medium);
405 hot_zoneV->SetMedium(sensitive_medium);
406 } else
407 Fatal("Main", "Invalid medium for sensitive modules!");
408
409 // media for frames
410 TGeoMedium* frame_medium = pMedCarbon; // set medium
411 if (frame_medium) {
412 vertical_outer_frameV->SetMedium(frame_medium);
413 horizontal_outer_frameV->SetMedium(frame_medium);
414 vertical_inner_frameV->SetMedium(frame_medium);
415 horizontal_inner_frameV->SetMedium(frame_medium);
416 composite_frameV->SetMedium(frame_medium);
417 } else
418 Fatal("Main", "Invalid medium for frames!");
419
420 moduleV->SetTransparency(20);
421
422 // hot zone position in the module
423 TGeoTranslation* hot_zone_trans =
426
427 // module positions in the station
428 TGeoCombiTrans* module_center_position = new TGeoCombiTrans();
429 if (IsInverted) {
430 module_center_position->ReflectY(true);
431 }
432
433 // frame part positions in the frame
434 TGeoCombiTrans* right_outer_frame_position = new TGeoCombiTrans();
435 right_outer_frame_position->SetTranslation(-(XModuleSize_Station66x41 + dXOuterFrame_Station66x41) * 0.5,
436 (dYOuterFrame_Station66x41) * 0.5, 0.0);
437
438 TGeoCombiTrans* top_outer_frame_position = new TGeoCombiTrans();
439 top_outer_frame_position->SetTranslation(0.0, YModuleSize_Station66x41 * 0.5 + dYOuterFrame_Station66x41 * 0.5,
440 0.0);
441
442 TGeoCombiTrans* left_inner_frame_position = new TGeoCombiTrans();
443 left_inner_frame_position->SetTranslation(XModuleSize_Station66x41 * 0.5 + dXInnerFrame_Station66x41 * 0.5,
444 dYOuterFrame_Station66x41 * 0.5, 0.0);
445
446 TGeoCombiTrans* bottom_inner_frame_position = new TGeoCombiTrans();
447 bottom_inner_frame_position->SetTranslation((dXInnerFrame_Station66x41 + dXOuterFrame_Station66x41) * 0.5
450
451 // frame positions in the station
452 TGeoCombiTrans* comp_frame_center_position = new TGeoCombiTrans();
453 if (IsInverted) {
454 comp_frame_center_position->ReflectY(true);
455 }
456 comp_frame_center_position->SetTranslation(module_center_position->GetTranslation());
457
458 // station assembling
459 moduleV->AddNode(hot_zoneV, 0, hot_zone_trans);
460
461 composite_frameV->AddNode(vertical_outer_frameV, 0, right_outer_frame_position);
462 composite_frameV->AddNode(horizontal_outer_frameV, 0, top_outer_frame_position);
463 composite_frameV->AddNode(vertical_inner_frameV, 0, left_inner_frame_position);
464 composite_frameV->AddNode(horizontal_inner_frameV, 0, bottom_inner_frame_position);
465
466 stationA->AddNode(moduleV, 0, module_center_position);
467
468 stationA->AddNode(composite_frameV, 0, comp_frame_center_position);
469
470 // Station position
471 Double_t station_shift = dZSensitiveVolume_Station66x41 * 0.5;
472 TGeoTranslation* station_pos = new TGeoTranslation(x_position, y_position, z_position + station_shift);
473
474 mother_volume->AddNode(stationA, 0, station_pos);
475}
476
478 TString station_name,
479 Double_t x_position,
480 Double_t y_position,
481 Double_t z_position,
482 Double_t hole_radius_with_frame,
483 Bool_t IsInverted)
484{
485 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
486 stationA->SetMedium(pMedAir);
487
488 Double_t XOuterZoneSize = OuterZoneSizes_Station163x45[0];
489 Double_t YOuterZoneSize = OuterZoneSizes_Station163x45[1];
490
491 Double_t XRectangleZoneSize = HotZoneSizes_rectangle_Station163x45[0];
492 Double_t YRectangleZoneSize = HotZoneSizes_rectangle_Station163x45[1];
493
494 Double_t XMinSlopeZoneSize = HotZoneSizes_slope_Station163x45[0];
495 Double_t XMaxSlopeZoneSize = HotZoneSizes_slope_Station163x45[1];
496 Double_t YSlopeZoneSize = HotZoneSizes_slope_Station163x45[2];
497
498 // module shape
499 TString part_module_name = "part_moduleS_" + station_name;
500 TGeoShape* part_moduleS = new TGeoBBox(part_module_name, XOuterZoneSize * 0.5, YOuterZoneSize * 0.5,
502
503 // part hot zone shapes (without the hole)
504 TString part_rectangle_inner_zone_name = "part_rectangle_inner_zoneS_" + station_name;
505 TGeoShape* part_rectangle_inner_zoneS =
506 new TGeoBBox(part_rectangle_inner_zone_name, XRectangleZoneSize * 0.5, YRectangleZoneSize * 0.5,
508
509 TString part_slope_inner_zone_name = "part_slope_inner_zoneS_" + station_name;
510 TGeoXtru* part_slope_inner_zoneS = new TGeoXtru(2); // origin centered
511 part_slope_inner_zoneS->SetName(part_slope_inner_zone_name);
512 Double_t x_pos[4] = {XMaxSlopeZoneSize * 0.5, XMaxSlopeZoneSize * 0.5 - (XMaxSlopeZoneSize - XMinSlopeZoneSize),
513 -XMaxSlopeZoneSize * 0.5, -XMaxSlopeZoneSize * 0.5};
514 Double_t y_pos[4] = {-YSlopeZoneSize * 0.5, YSlopeZoneSize * 0.5, YSlopeZoneSize * 0.5, -YSlopeZoneSize * 0.5};
515 part_slope_inner_zoneS->DefinePolygon(4, x_pos, y_pos);
516 part_slope_inner_zoneS->DefineSection(0, -dZSensitiveVolume_Station163x45 * 0.5);
517 part_slope_inner_zoneS->DefineSection(1, dZSensitiveVolume_Station163x45 * 0.5);
518
519 // hole shape
520 TString hole_name = "holeS_" + station_name;
521 // TGeoShape *holeS = new TGeoTubeSeg(hole_name, 0.0, hole_radius_with_frame, dZSensitiveVolume_Station163x45*0.5 +
522 // 0.1, -1.0, 91.0);
523 TGeoShape* holeS =
524 new TGeoTube(hole_name, 0.0, hole_radius_with_frame, dZSensitiveVolume_Station163x45 * 0.5 + 0.01);
525
526 // hole positions in the module and zones to extract the hole
527 TString hole_module_trans_name = "hole_module_trans_name_" + station_name;
528 TGeoTranslation* hole_module_trans =
529 new TGeoTranslation(hole_module_trans_name, -XOuterZoneSize * 0.5, -YOuterZoneSize * 0.5, 0);
530 hole_module_trans->RegisterYourself();
531
532 TString hole_rectangle_inner_zone_trans_name = "hole_rectangle_inner_zone_trans_name_" + station_name;
533 TGeoTranslation* hole_rectangle_inner_zone_trans = new TGeoTranslation(
534 hole_rectangle_inner_zone_trans_name, -XRectangleZoneSize * 0.5, -YRectangleZoneSize * 0.5, 0);
535 hole_rectangle_inner_zone_trans->RegisterYourself();
536
537 TString hole_slope_inner_zone_trans_name = "hole_slope_inner_zone_trans_name_" + station_name;
538 TGeoTranslation* hole_slope_inner_zone_trans =
539 new TGeoTranslation(hole_slope_inner_zone_trans_name, -XMaxSlopeZoneSize * 0.5, -YSlopeZoneSize * 0.5, 0);
540 hole_slope_inner_zone_trans->RegisterYourself();
541
542 // module and hot zone shapes
543 TString bool_expression_module = part_module_name + " - " + hole_name + ":" + hole_module_trans_name;
544 TGeoCompositeShape* moduleS = new TGeoCompositeShape(bool_expression_module);
545
546 TString bool_expression_rectangle_inner_zone =
547 part_rectangle_inner_zone_name + " - " + hole_name + ":" + hole_rectangle_inner_zone_trans_name;
548 TGeoCompositeShape* rectangle_inner_zoneS = new TGeoCompositeShape(bool_expression_rectangle_inner_zone);
549
550 TString bool_expression_slope_inner_zone =
551 part_slope_inner_zone_name + " - " + hole_name + ":" + hole_slope_inner_zone_trans_name;
552 TGeoCompositeShape* slope_inner_zoneS = new TGeoCompositeShape(bool_expression_slope_inner_zone);
553
554 // frame shapes
555 TGeoShape* vertical_frameS =
556 new TGeoBBox("vertical_frameS", dXOuterFrame_Station163x45 * 0.5,
559 TGeoShape* horizontal_long_frameS = new TGeoBBox("horizontal_long_frameS", XOuterZoneSize,
561 TGeoShape* horizontal_short_frameS = new TGeoBBox(
562 "horizontal_short_frameS", (XOuterZoneSize - hole_radius_with_frame + dXInnerFrame_Station163x45) * 0.5,
564 TGeoShape* circle_inner_frameS =
565 new TGeoTubeSeg("circle_inner_frameS", hole_radius_with_frame - dXInnerFrame_Station163x45,
566 hole_radius_with_frame, ZModuleSize_Station163x45 * 0.5, 0., -180.0);
567
568 // Volumes
569 TGeoVolume* module_with_slope_inner_zoneV = new TGeoVolume("module_Sensor", moduleS);
570 TGeoVolume* module_with_rect_inner_zoneV = new TGeoVolume("module_Sensor", moduleS);
571
572 TGeoVolume* rectangle_inner_zoneV = new TGeoVolume("inner_zone_Sensor", rectangle_inner_zoneS);
573 TGeoVolume* slope_inner_zoneV = new TGeoVolume("inner_zone_Sensor", slope_inner_zoneS);
574
575 TGeoVolume* vertical_frameV = new TGeoVolume("vertical_frame", vertical_frameS);
576 TGeoVolume* horizontal_long_frameV = new TGeoVolume("horizontal_long_frame", horizontal_long_frameS);
577 TGeoVolume* horizontal_short_frameV = new TGeoVolume("horizontal_short_frame", horizontal_short_frameS);
578 TGeoVolume* circle_inner_frameV = new TGeoVolume("circle_inner_frame", circle_inner_frameS);
579 TGeoVolume* composite_frameV = new TGeoVolumeAssembly("frame");
580
581 // media for sensitive volumes
582 TGeoMedium* sensitive_medium = pMedArCO27030; // set medium
583 if (sensitive_medium) {
584 module_with_slope_inner_zoneV->SetMedium(sensitive_medium);
585 module_with_rect_inner_zoneV->SetMedium(sensitive_medium);
586 rectangle_inner_zoneV->SetMedium(sensitive_medium);
587 slope_inner_zoneV->SetMedium(sensitive_medium);
588 } else
589 Fatal("Main", "Invalid medium for sensitive modules!");
590
591 // media for frames
592 TGeoMedium* frame_medium = pMedCarbon; // set medium
593 if (frame_medium) {
594 vertical_frameV->SetMedium(frame_medium);
595 horizontal_long_frameV->SetMedium(frame_medium);
596 horizontal_short_frameV->SetMedium(frame_medium);
597 circle_inner_frameV->SetMedium(frame_medium);
598 composite_frameV->SetMedium(frame_medium);
599 } else
600 Fatal("Main", "Invalid medium for frames!");
601
602 // volume visual properties
603 module_with_slope_inner_zoneV->SetTransparency(20);
604 module_with_rect_inner_zoneV->SetTransparency(20);
605 module_with_slope_inner_zoneV->SetLineColor(TColor::GetColor("#ff47ca"));
606 module_with_rect_inner_zoneV->SetLineColor(TColor::GetColor("#ff47ca"));
607 rectangle_inner_zoneV->SetLineColor(TColor::GetColor("#e0b0ff"));
608 slope_inner_zoneV->SetLineColor(TColor::GetColor("#e0b0ff"));
609 vertical_frameV->SetLineColor(TColor::GetColor("#9999ff"));
610 horizontal_long_frameV->SetLineColor(TColor::GetColor("#9999ff"));
611 horizontal_short_frameV->SetLineColor(TColor::GetColor("#9999ff"));
612 circle_inner_frameV->SetLineColor(TColor::GetColor("#9999ff"));
613
614 // hot zone positions in modules
615 TGeoTranslation* slope_inner_zone_position = new TGeoTranslation(-XOuterZoneSize * 0.5 + XMaxSlopeZoneSize * 0.5,
616 -YOuterZoneSize * 0.5 + YSlopeZoneSize * 0.5, 0);
617 TGeoTranslation* rect_inner_zone_position = new TGeoTranslation(
618 -XOuterZoneSize * 0.5 + XRectangleZoneSize * 0.5, -YOuterZoneSize * 0.5 + YRectangleZoneSize * 0.5, 0);
619
620 // module positions in the station
621 TGeoCombiTrans* left_module_position = new TGeoCombiTrans();
622 left_module_position->SetTranslation(XOuterZoneSize * 0.5, 0.0, 0.0);
623
624 TGeoCombiTrans* right_module_position = new TGeoCombiTrans();
625 right_module_position->RotateY(180.0);
626 right_module_position->SetTranslation(-XOuterZoneSize * 0.5, 0.0, 0.0);
627
628 // frame part positions in the frame
629 TGeoTranslation* left_frame_position =
630 new TGeoTranslation(XOuterZoneSize + dXOuterFrame_Station163x45 * 0.5,
632
633 TGeoTranslation* right_frame_position =
634 new TGeoTranslation(-(XOuterZoneSize + dXOuterFrame_Station163x45 * 0.5),
636
637 TGeoTranslation* top_long_frame_position =
638 new TGeoTranslation(0.0, YOuterZoneSize * 0.5 + dYOuterFrame_Station163x45 * 0.5, 0.0);
639
640 TGeoTranslation* right_bottom_short_frame_position = new TGeoTranslation(
641 -((XOuterZoneSize - hole_radius_with_frame - dXInnerFrame_Station163x45) * 0.5 + hole_radius_with_frame),
642 -dYInnerFrame_Station163x45 * 0.5 - YOuterZoneSize * 0.5, 0.0);
643
644 TGeoTranslation* left_bottom_short_frame_position = new TGeoTranslation(
645 ((XOuterZoneSize - hole_radius_with_frame - dXInnerFrame_Station163x45) * 0.5 + hole_radius_with_frame),
646 -dYInnerFrame_Station163x45 * 0.5 - YOuterZoneSize * 0.5, 0.0);
647
648 // frame positions in the station
649 TGeoCombiTrans* upper_frame_trans = new TGeoCombiTrans();
650 upper_frame_trans->SetTranslation(0.0, 0.0, 0.0);
651
652 // station assembling
653 module_with_slope_inner_zoneV->AddNode(slope_inner_zoneV, 0, slope_inner_zone_position);
654 module_with_rect_inner_zoneV->AddNode(rectangle_inner_zoneV, 0, rect_inner_zone_position);
655
656 if (IsInverted) {
657 stationA->AddNode(module_with_rect_inner_zoneV, 0, left_module_position);
658 stationA->AddNode(module_with_slope_inner_zoneV, 1, right_module_position);
659 } else {
660 stationA->AddNode(module_with_slope_inner_zoneV, 0, left_module_position);
661 stationA->AddNode(module_with_rect_inner_zoneV, 1, right_module_position);
662 }
663
664 // frames
665 composite_frameV->AddNode(vertical_frameV, 0, left_frame_position);
666 composite_frameV->AddNode(vertical_frameV, 1, right_frame_position);
667 composite_frameV->AddNode(horizontal_long_frameV, 0, top_long_frame_position);
668 composite_frameV->AddNode(horizontal_short_frameV, 0, left_bottom_short_frame_position);
669 composite_frameV->AddNode(horizontal_short_frameV, 1, right_bottom_short_frame_position);
670 composite_frameV->AddNode(circle_inner_frameV, 0, new TGeoTranslation(0, -YOuterZoneSize * 0.5, 0.0));
671
672 stationA->AddNode(composite_frameV, 0, upper_frame_trans);
673
674 // Station position
675 Double_t station_shift = 0.0;
676 station_shift = dZSensitiveVolume_Station163x45 * 0.5;
677 TGeoTranslation* station_pos = new TGeoTranslation(x_position, y_position, z_position + station_shift);
678
679 mother_volume->AddNode(stationA, 0, station_pos);
680}
681//------------------------------------------------------------------------------
bool Bool_t
int Int_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TGeoManager * gGeoManager
#define gROOT
R__EXTERN TSystem * gSystem
static Int_t GetColor(const char *hexcolor)
void Close(Option_t *option="") override
void SetDz(Double_t dz) override
const Double_t * GetTranslation() const override
void RotateY(Double_t angle) override
void SetTranslation(const TGeoTranslation &tr)
void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE) override
virtual void RegisterYourself()
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
Bool_t DefinePolygon(Int_t nvert, const Double_t *xv, const Double_t *yv)
virtual void DefineSection(Int_t snum, Double_t z, Double_t x0=0., Double_t y0=0., Double_t scale=1.)
virtual void SetName(const char *name)
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
const Double_t ZModuleSize_Station66x41
const Double_t ZModuleSize_Station163x45
TGeoMedium * pMedCarbon
TGeoManager * gGeoMan
TGeoMedium * pMedArCO27030
const Double_t YModuleSize_Station66x41
const Double_t XModuleSize_Station66x41
TGeoMedium * pMedFiberGlass
TGeoMedium * pMedCopper
const Int_t nStations
const Double_t OuterZoneSizes_Station163x45[2]
const Double_t HotZoneSizes_rectangle_Station163x45[2]
const Double_t HoleRadius_Station163x45
const Double_t HotZoneSizes_slope_Station163x45[3]
const Double_t ZModuleSize_Station10x10
const Double_t XModuleSize_Station10x10
const Double_t YModuleSize_Station10x10
const Double_t dXInnerFrame_Station66x41
const Double_t dYOuterFrame_Station163x45
const Double_t dXOuterFrame_Station163x45
const Double_t dZSensitiveVolume_Station10x10
const Double_t dYInnerFrame_Station163x45
const Double_t dYOuterFrame_Station10x10
const Double_t YHotZoneSize_Station66x41
const Double_t dZSensitiveVolume_Station66x41
const Double_t XHotZoneSize_Station66x41
const Double_t dXOuterFrame_Station66x41
const Double_t dYOuterFrame_Station66x41
const Double_t dXInnerFrame_Station10x10
const Double_t dYInnerFrame_Station66x41
const Double_t dYInnerFrame_Station10x10
const Double_t dXInnerFrame_Station163x45
const Double_t dZSensitiveVolume_Station163x45
const Double_t dXOuterFrame_Station10x10
const Double_t Mylar_window_layer_Station10x10
void CreateStation_One66x41Plane(TGeoVolume *mother_volume, TString station_name, Double_t x_position, Double_t y_position, Double_t z_position, Bool_t IsInverted)
void create_rootgeom_GEMS_RunSummer2016()
void DefineRequiredMedia(FairGeoMedia *geoMedia, FairGeoBuilder *geoBuild)
void CreateStation_SmallGEM10x10Plane(TGeoVolume *mother_volume, TString station_name, Double_t x_position, Double_t y_position, Double_t z_position)
void CreateStation_One163x45Plane(TGeoVolume *mother_volume, TString station_name, Double_t x_position, Double_t y_position, Double_t z_position, Double_t hole_radius_with_frame, Bool_t IsInverted)