BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
create_rootgeom_GEMS_v3.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 = 12;
17
18// Station Parameters
19/*
20const Double_t XStationPositions[nStations] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
21const Double_t YStationPositions[nStations] = {0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.};
22const Double_t ZStationPositions[nStations] = {30., 45., 60., 80., 100., 130., 160., 190., 230., 270., 315., 360.};
23*/
24
26XStationPositions[0] = BmnGemStripPositions_FullConfig::XStationPositions[0];
27XStationPositions[1] = BmnGemStripPositions_FullConfig::XStationPositions[1];
28XStationPositions[2] = BmnGemStripPositions_FullConfig::XStationPositions[2];
29XStationPositions[3] = BmnGemStripPositions_FullConfig::XStationPositions[3];
30XStationPositions[4] = BmnGemStripPositions_FullConfig::XStationPositions[4];
31XStationPositions[5] = BmnGemStripPositions_FullConfig::XStationPositions[5];
32XStationPositions[6] = BmnGemStripPositions_FullConfig::XStationPositions[6];
33XStationPositions[7] = BmnGemStripPositions_FullConfig::XStationPositions[7];
34XStationPositions[8] = BmnGemStripPositions_FullConfig::XStationPositions[8];
35XStationPositions[9] = BmnGemStripPositions_FullConfig::XStationPositions[9];
36XStationPositions[10] = BmnGemStripPositions_FullConfig::XStationPositions[10];
37XStationPositions[11] = BmnGemStripPositions_FullConfig::XStationPositions[11];
38
40YStationPositions[0] = BmnGemStripPositions_FullConfig::YStationPositions[0];
41YStationPositions[1] = BmnGemStripPositions_FullConfig::YStationPositions[1];
42YStationPositions[2] = BmnGemStripPositions_FullConfig::YStationPositions[2];
43YStationPositions[3] = BmnGemStripPositions_FullConfig::YStationPositions[3];
44YStationPositions[4] = BmnGemStripPositions_FullConfig::YStationPositions[4];
45YStationPositions[5] = BmnGemStripPositions_FullConfig::YStationPositions[5];
46YStationPositions[6] = BmnGemStripPositions_FullConfig::YStationPositions[6];
47YStationPositions[7] = BmnGemStripPositions_FullConfig::YStationPositions[7];
48YStationPositions[8] = BmnGemStripPositions_FullConfig::YStationPositions[8];
49YStationPositions[9] = BmnGemStripPositions_FullConfig::YStationPositions[9];
50YStationPositions[10] = BmnGemStripPositions_FullConfig::YStationPositions[10];
51YStationPositions[11] = BmnGemStripPositions_FullConfig::YStationPositions[11];
52
54ZStationPositions[0] = BmnGemStripPositions_FullConfig::ZStationPositions[0];
55ZStationPositions[1] = BmnGemStripPositions_FullConfig::ZStationPositions[1];
56ZStationPositions[2] = BmnGemStripPositions_FullConfig::ZStationPositions[2];
57ZStationPositions[3] = BmnGemStripPositions_FullConfig::ZStationPositions[3];
58ZStationPositions[4] = BmnGemStripPositions_FullConfig::ZStationPositions[4];
59ZStationPositions[5] = BmnGemStripPositions_FullConfig::ZStationPositions[5];
60ZStationPositions[6] = BmnGemStripPositions_FullConfig::ZStationPositions[6];
61ZStationPositions[7] = BmnGemStripPositions_FullConfig::ZStationPositions[7];
62ZStationPositions[8] = BmnGemStripPositions_FullConfig::ZStationPositions[8];
63ZStationPositions[9] = BmnGemStripPositions_FullConfig::ZStationPositions[9];
64ZStationPositions[10] = BmnGemStripPositions_FullConfig::ZStationPositions[10];
65ZStationPositions[11] = BmnGemStripPositions_FullConfig::ZStationPositions[11];
66
67// Beam Pipe Hole Parameters
68const Double_t BeamPipeMinRadius = 2.5; // radius of the hole in first GEM-station
69const Double_t BeamPipeMaxRadius = 5.0; // radius of the hole in last GEM-station
71
72// Zone sizes (station 0 and 1) - half (in the one quandrant)
73const Double_t XZoneSizes_Station0[4] = {30.0, 16.0, 12.0, 8.0}; // x sizes for 1, 2, 3, 4 zones
74const Double_t YZoneSizes_Station0[4] = {30.0, 12.0, 7.0, 3.0}; // y sizes for 1, 2, 3, 4 zones
75
76// Zone sizes (station 2 and 3) - half (in the one quandrant)
77const Double_t XZoneSizes_Station2[4] = {40.0, 20.0, 15.0, 10.0}; // x sizes for 1, 2, 3, 4 zones
78const Double_t YZoneSizes_Station2[4] = {40.0, 15.0, 9.0, 4.0}; // y sizes for 1, 2, 3, 4 zones
79
80// Prototype station sizes (station 4)
83
86
87// Two modules station sizes (station 5, 6, 7)
88const Double_t OuterZoneSizes_Station5[2] = {163.2 / 2, 45.0}; // {xsize, ysize}
89const Double_t HotZoneSizes_rectangle_Station5[2] = {40.0, 15.0}; // {xsize, ysize}
90const Double_t HotZoneSizes_slope_Station5[3] = {37.99, 42.01, 15.0}; // {xmin_size, xmax_size, ysize}
91
92// Two modules station sizes (station 8, 9, 10, 11)
93const Double_t OuterZoneSizes_Station8[2] = {200.0 / 2, 45.0}; // {xsize, ysize}
94const Double_t HotZoneSizes_rectangle_Station8[2] = {50.0, 20.0}; // {xsize, ysize}
96 47.14, 52.5, 20.0}; // {xmin_size, xmax_size, ysize} //ЗДЕСЬ!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
97
98// Module Parameters
106
109
114
115// Position of GEM-Detector
118
119// Add spacers or not?
121
122// media
128
129class FairGeoMedia;
130class FairGeoBuilder;
131
132void DefineRequiredMedia(FairGeoMedia* geoMedia, FairGeoBuilder* geoBuild)
133{
134 // air medium
135 FairGeoMedium* mAir = geoMedia->getMedium("air");
136 if (!mAir)
137 Fatal("Main", "FairMedium air not found");
138 geoBuild->createMedium(mAir);
139 pMedAir = gGeoManager->GetMedium("air");
140 if (!pMedAir)
141 Fatal("Main", "Medium air not found");
142
143 // carbon medium
144 FairGeoMedium* mCarbon = geoMedia->getMedium("carbon");
145 if (!mCarbon)
146 Fatal("Main", "FairMedium carbon not found");
147 geoBuild->createMedium(mCarbon);
148 pMedCarbon = gGeoManager->GetMedium("carbon");
149 if (!pMedCarbon)
150 Fatal("Main", "Medium carbon not found");
151
152 // fiberglass medium
153 FairGeoMedium* mFiberGlass = geoMedia->getMedium("fiberglass");
154 if (!mFiberGlass)
155 Fatal("Main", "FairMedium fiberglass not found");
156 geoBuild->createMedium(mFiberGlass);
157 pMedFiberGlass = gGeoManager->GetMedium("fiberglass");
158 if (!pMedFiberGlass)
159 Fatal("Main", "Medium fiberglass not found");
160
161 // arco27020 medium
162 FairGeoMedium* mArCO27030 = geoMedia->getMedium("arco27030");
163 if (!mArCO27030)
164 Fatal("Main", "FairMedium arco27030 not found");
165 geoBuild->createMedium(mArCO27030);
166 pMedArCO27030 = gGeoManager->GetMedium("arco27030");
167 if (!pMedArCO27030)
168 Fatal("Main", "Medium arco27030 not found");
169}
170
172{
173 // Calculate the Beam Pipe Radius for each GEM-stations
174 Double_t BeamPipeAngle =
176 * 180 / Pi();
180 for (UInt_t iStation = 1; iStation < nStations - 1; iStation++) {
181 BeamPipeRadius[iStation] =
182 delta_const + (ZStationPositions[iStation] - ZStationPositions[0]) * Tan((BeamPipeAngle * Pi() / 180));
183 }
184 cout << "Beam Pipe Angle = " << BeamPipeAngle << " deg" << "\n";
185 cout << "Beam Pipe Radiuses:" << "\n";
186 for (UInt_t iStation = 0; iStation < nStations; iStation++) {
187 cout << " Station[" << iStation << "] = " << BeamPipeRadius[iStation] << " cm" << "\n";
188 }
189 cout << "----------------------------" << "\n";
190}
191
193{
194
196
197 // Load the necessary FairRoot libraries
198 gROOT->LoadMacro("$VMCWORKDIR/macro/run/bmnloadlibs.C");
199 bmnloadlibs(); // load libraries
200
201 // ---- set working directory --------------------------------------------
202 TString gPath = gSystem->Getenv("VMCWORKDIR");
203
204 // ------- Geometry file name (output) ----------------------------------
205 const TString geoDetectorName = "GEMS";
206 const TString geoDetectorVersion = "v3";
207 const TString geoFileName = gPath + "/geometry/" + geoDetectorName + "_" + geoDetectorVersion + ".root";
208
209 // ---- global geometry parameters ---------------------------------------
210 FairGeoLoader* geoLoad = new FairGeoLoader("TGeo", "FairGeoLoader");
211 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
212
213 // ------- Load media from media file ----------------------------------
214 TString medFile = gPath + "/geometry/media.geo";
215 geoFace->setMediaFile(medFile);
216 geoFace->readMedia();
217 FairGeoMedia* geoMedia = geoFace->getMedia();
218 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
219
220 DefineRequiredMedia(geoMedia, geoBuild);
221 // -------------------------------------------------------------------------
222
223 // -------------- Create geometry and top volume -------------------------
224 gGeoMan = (TGeoManager*)gROOT->FindObject("FAIRGeom");
225 gGeoMan->SetName(geoDetectorName + "_geom");
226 TGeoVolume* top = new TGeoVolumeAssembly("TOP");
227 top->SetMedium(pMedAir);
228 gGeoMan->SetTopVolume(top);
229 // gGeoMan->SetTopVisible(1);
230 // --------------------------------------------------------------------------
231
232 // Define TOP Geometry
233 TGeoVolume* GEMS = new TGeoVolumeAssembly(geoDetectorName);
234 GEMS->SetMedium(pMedAir);
235
236 // station creating
245
247 BeamPipeRadius[4]);
248
258
271
272 top->AddNode(GEMS, 0);
274
275 // --------------- Finish -----------------------------------------------
276 gGeoMan->CloseGeometry();
277 gGeoMan->CheckOverlaps(0.0001);
278 gGeoMan->PrintOverlaps();
279 gGeoMan->Test();
280
281 TFile* geoFile = new TFile(geoFileName, "RECREATE");
282 top->Write();
283 geoFile->Close();
284 top->Draw("ogl");
285}
286
287//------------------------------------------------------------------------------
289 TString station_name,
290 Double_t x_position,
291 Double_t y_position,
292 Double_t z_position,
293 Double_t* x_zone_sizes,
294 Double_t* y_zone_sizes,
295 Double_t hole_radius)
296{
297
298 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
299 stationA->SetMedium(pMedAir);
300
301 // zone sizes (in the one quadrant)
302 Double_t xHalfSizeZone1 = x_zone_sizes[0];
303 Double_t yHalfSizeZone1 = y_zone_sizes[0];
304
305 Double_t xHalfSizeZone2 = x_zone_sizes[1];
306 Double_t yHalfSizeZone2 = y_zone_sizes[1];
307
308 Double_t xHalfSizeZone3 = x_zone_sizes[2];
309 Double_t yHalfSizeZone3 = y_zone_sizes[2];
310
311 Double_t xHalfSizeZone4 = x_zone_sizes[3];
312 Double_t yHalfSizeZone4 = y_zone_sizes[3];
313
314 // zone part sizes
315 Double_t vpart_xsize_zone1 = xHalfSizeZone1 - xHalfSizeZone2;
316 Double_t vpart_ysize_zone1 = yHalfSizeZone1;
317 Double_t hpart_xsize_zone1 = xHalfSizeZone2;
318 Double_t hpart_ysize_zone1 = yHalfSizeZone1 - yHalfSizeZone2;
319
320 Double_t vpart_xsize_zone2 = xHalfSizeZone2 - xHalfSizeZone3;
321 Double_t vpart_ysize_zone2 = yHalfSizeZone2;
322 Double_t hpart_xsize_zone2 = xHalfSizeZone3;
323 Double_t hpart_ysize_zone2 = yHalfSizeZone2 - yHalfSizeZone3;
324
325 Double_t vpart_xsize_zone3 = xHalfSizeZone3 - xHalfSizeZone4;
326 Double_t vpart_ysize_zone3 = yHalfSizeZone3;
327 Double_t hpart_xsize_zone3 = xHalfSizeZone4;
328 Double_t hpart_ysize_zone3 = yHalfSizeZone3 - yHalfSizeZone4;
329
330 Double_t part_xsize_zone4 = xHalfSizeZone4;
331 Double_t part_ysize_zone4 = yHalfSizeZone4;
332
333 // zone1 shape
334 TString vpart_zone1S_name = Form("vpart_zone1_%s", station_name.Data());
335 TString hpart_zone1S_name = Form("hpart_zone1_%s", station_name.Data());
336 TString hole_zone1S_name = Form("hole_zone1_%s", station_name.Data());
337 TGeoShape* vpart_zone1S =
338 new TGeoBBox(vpart_zone1S_name, vpart_xsize_zone1 / 2, vpart_ysize_zone1 / 2, dZSensitiveVolume / 2);
339 TGeoShape* hpart_zone1S =
340 new TGeoBBox(hpart_zone1S_name, hpart_xsize_zone1 / 2, hpart_ysize_zone1 / 2, dZSensitiveVolume / 2);
341 // TGeoShape *hole_zone1S = new TGeoTubeSeg(hole_zone1S_name, 0.0, hole_radius, dZSensitiveVolume/2 + 0.1, -1, 91);
342 TGeoShape* hole_zone1S = new TGeoTube(hole_zone1S_name, 0.0, hole_radius, dZSensitiveVolume / 2 + 0.01);
343 TGeoTranslation* vpart_zone1_trans =
344 new TGeoTranslation(vpart_xsize_zone1 / 2 + xHalfSizeZone2, yHalfSizeZone1 / 2, 0);
345 TGeoTranslation* hpart_zone1_trans =
346 new TGeoTranslation(hpart_xsize_zone1 / 2, hpart_ysize_zone1 / 2 + yHalfSizeZone2, 0);
347 TString vpart_zone1S_trans_name = Form("vpart_zone1_trans_%s", station_name.Data());
348 TString hpart_zone1S_trans_name = Form("hpart_zone1_trans_%s", station_name.Data());
349 vpart_zone1_trans->SetName(vpart_zone1S_trans_name);
350 hpart_zone1_trans->SetName(hpart_zone1S_trans_name);
351 vpart_zone1_trans->RegisterYourself();
352 hpart_zone1_trans->RegisterYourself();
353 TString bool_expression_zone1 =
354 vpart_zone1S_name + ":" + vpart_zone1S_trans_name + " + " + hpart_zone1S_name + ":" + hpart_zone1S_trans_name;
355 if (xHalfSizeZone2 < hole_radius || yHalfSizeZone2 < hole_radius)
356 bool_expression_zone1 += " - " + hole_zone1S_name;
357 TGeoCompositeShape* zone1S = new TGeoCompositeShape(bool_expression_zone1);
358
359 // zone2 shape
360 TString vpart_zone2S_name = Form("vpart_zone2_%s", station_name.Data());
361 TString hpart_zone2S_name = Form("hpart_zone2_%s", station_name.Data());
362 TString hole_zone2S_name = Form("hole_zone2_%s", station_name.Data());
363 TGeoShape* vpart_zone2S =
364 new TGeoBBox(vpart_zone2S_name, vpart_xsize_zone2 / 2, vpart_ysize_zone2 / 2, dZSensitiveVolume / 2);
365 TGeoShape* hpart_zone2S =
366 new TGeoBBox(hpart_zone2S_name, hpart_xsize_zone2 / 2, hpart_ysize_zone2 / 2, dZSensitiveVolume / 2);
367 // TGeoShape *hole_zone2S = new TGeoTubeSeg(hole_zone2S_name, 0.0, hole_radius, dZSensitiveVolume/2 + 0.1, -1, 91);
368 TGeoShape* hole_zone2S = new TGeoTube(hole_zone2S_name, 0.0, hole_radius, dZSensitiveVolume / 2 + 0.01);
369 TGeoTranslation* vpart_zone2_trans =
370 new TGeoTranslation(vpart_xsize_zone2 / 2 + xHalfSizeZone3, yHalfSizeZone2 / 2, 0);
371 TGeoTranslation* hpart_zone2_trans =
372 new TGeoTranslation(hpart_xsize_zone2 / 2, hpart_ysize_zone2 / 2 + yHalfSizeZone3, 0);
373 TString vpart_zone2S_trans_name = Form("vpart_zone2_trans_%s", station_name.Data());
374 TString hpart_zone2S_trans_name = Form("hpart_zone2_trans_%s", station_name.Data());
375 vpart_zone2_trans->SetName(vpart_zone2S_trans_name);
376 hpart_zone2_trans->SetName(hpart_zone2S_trans_name);
377 vpart_zone2_trans->RegisterYourself();
378 hpart_zone2_trans->RegisterYourself();
379 TString bool_expression_zone2 =
380 vpart_zone2S_name + ":" + vpart_zone2S_trans_name + " + " + hpart_zone2S_name + ":" + hpart_zone2S_trans_name;
381 if (xHalfSizeZone3 < hole_radius || yHalfSizeZone3 < hole_radius)
382 bool_expression_zone2 += " - " + hole_zone2S_name;
383 TGeoCompositeShape* zone2S = new TGeoCompositeShape(bool_expression_zone2);
384
385 // zone3 shape
386 TString vpart_zone3S_name = Form("vpart_zone3_%s", station_name.Data());
387 TString hpart_zone3S_name = Form("hpart_zone3_%s", station_name.Data());
388 TString hole_zone3S_name = Form("hole_zone3_%s", station_name.Data());
389 TGeoShape* vpart_zone3S =
390 new TGeoBBox(vpart_zone3S_name, vpart_xsize_zone3 / 2, vpart_ysize_zone3 / 2, dZSensitiveVolume / 2);
391 TGeoShape* hpart_zone3S =
392 new TGeoBBox(hpart_zone3S_name, hpart_xsize_zone3 / 2, hpart_ysize_zone3 / 2, dZSensitiveVolume / 2);
393 // TGeoShape *hole_zone3S = new TGeoTubeSeg(hole_zone3S_name, 0.0, hole_radius, dZSensitiveVolume/2 + 0.1, -1, 91);
394 TGeoShape* hole_zone3S = new TGeoTube(hole_zone3S_name, 0.0, hole_radius, dZSensitiveVolume / 2 + 0.01);
395 TGeoTranslation* vpart_zone3_trans =
396 new TGeoTranslation(vpart_xsize_zone3 / 2 + xHalfSizeZone4, yHalfSizeZone3 / 2, 0);
397 TGeoTranslation* hpart_zone3_trans =
398 new TGeoTranslation(hpart_xsize_zone3 / 2, hpart_ysize_zone3 / 2 + yHalfSizeZone4, 0);
399 TString vpart_zone3S_trans_name = Form("vpart_zone3_trans_%s", station_name.Data());
400 TString hpart_zone3S_trans_name = Form("hpart_zone3_trans_%s", station_name.Data());
401 vpart_zone3_trans->SetName(vpart_zone3S_trans_name);
402 hpart_zone3_trans->SetName(hpart_zone3S_trans_name);
403 vpart_zone3_trans->RegisterYourself();
404 hpart_zone3_trans->RegisterYourself();
405 TString bool_expression_zone3 =
406 vpart_zone3S_name + ":" + vpart_zone3S_trans_name + " + " + hpart_zone3S_name + ":" + hpart_zone3S_trans_name;
407 if (xHalfSizeZone4 < hole_radius || yHalfSizeZone4 < hole_radius)
408 bool_expression_zone3 += " - " + hole_zone3S_name;
409 TGeoCompositeShape* zone3S = new TGeoCompositeShape(bool_expression_zone3);
410
411 // zone4 shape
412 TString part_zone4S_name = Form("part_zone4_%s", station_name.Data());
413 TString hole_zone4S_name = Form("hole_zone4_%s", station_name.Data());
414 TGeoShape* part_zone4S =
415 new TGeoBBox(part_zone4S_name, part_xsize_zone4 / 2, part_ysize_zone4 / 2, dZSensitiveVolume / 2);
416 // TGeoShape *hole_zone4S = new TGeoTubeSeg(hole_zone4S_name, 0.0, hole_radius, dZSensitiveVolume/2 + 0.1, -1, 91);
417 TGeoShape* hole_zone4S = new TGeoTube(hole_zone4S_name, 0.0, hole_radius, dZSensitiveVolume / 2 + 0.01);
418 TGeoTranslation* part_zone4_trans = new TGeoTranslation(part_xsize_zone4 / 2, part_ysize_zone4 / 2, 0);
419 TString part_zone4S_trans_name = Form("part_zone4_trans_%s", station_name.Data());
420 part_zone4_trans->SetName(part_zone4S_trans_name);
421 part_zone4_trans->RegisterYourself();
422 TString bool_expression_zone4 = part_zone4S_name + ":" + part_zone4S_trans_name + " - " + hole_zone4S_name;
423 TGeoCompositeShape* zone4S = new TGeoCompositeShape(bool_expression_zone4);
424
425 // frame shapes
426 TGeoShape* vertical_frameS =
427 new TGeoBBox("vertical_frameS", dXOuterFrame / 2, (2 * yHalfSizeZone1 + 2 * dYOuterFrame) / 2, ZModuleSize / 2);
428 TGeoShape* horizontal_frameS = new TGeoBBox("vertical_frameS", 2 * xHalfSizeZone1 / 2, dYOuterFrame / 2,
430 TGeoShape* circle_inner_frameS = new TGeoTube("circle_inner_frameS", hole_radius - dXInnerFrame, hole_radius,
432
433 // zone volumes
434 TGeoVolume* zone1V = new TGeoVolume("zone1_Sensor", zone1S);
435 zone1V->SetLineColor(TColor::GetColor("#ff47ca"));
436
437 TGeoVolume* zone2V = new TGeoVolume("zone2_Sensor", zone2S);
438 zone2V->SetLineColor(TColor::GetColor("#e0b0ff"));
439
440 TGeoVolume* zone3V = new TGeoVolume("zone3_Sensor", zone3S);
441 zone3V->SetLineColor(TColor::GetColor("#2af7ed"));
442
443 TGeoVolume* zone4V = new TGeoVolume("zone4_Sensor", zone4S);
444 zone4V->SetLineColor(TColor::GetColor("#ffff66"));
445
446 // frame volumes
447 TGeoVolume* vertical_frameV = new TGeoVolume("vertical_frame", vertical_frameS);
448 TGeoVolume* horizontal_frameV = new TGeoVolume("horizontal_frame", horizontal_frameS);
449 TGeoVolume* circle_inner_frameV = new TGeoVolume("circle_inner_frame", circle_inner_frameS);
450 vertical_frameV->SetLineColor(TColor::GetColor("#9999ff"));
451 horizontal_frameV->SetLineColor(TColor::GetColor("#9999ff"));
452 circle_inner_frameV->SetLineColor(TColor::GetColor("#9999ff"));
453
454 // zone media
455 TGeoMedium* zone_medium = pMedArCO27030; // set medium
456 if (zone_medium) {
457 zone1V->SetMedium(zone_medium);
458 zone2V->SetMedium(zone_medium);
459 zone3V->SetMedium(zone_medium);
460 zone4V->SetMedium(zone_medium);
461 } else
462 Fatal("Main", "Invalid medium for zones!");
463
464 // frame media
465 TGeoMedium* frame_medium = pMedCarbon; // set medium
466 if (frame_medium) {
467 vertical_frameV->SetMedium(frame_medium);
468 horizontal_frameV->SetMedium(frame_medium);
469 circle_inner_frameV->SetMedium(frame_medium);
470 } else
471 Fatal("Main", "Invalid medium for frames!");
472
473 // left-top quadrant
474 stationA->AddNode(zone1V, 0);
475 stationA->AddNode(zone2V, 0);
476 stationA->AddNode(zone3V, 0);
477 stationA->AddNode(zone4V, 0);
478
479 // right-top quadrant
480 TGeoCombiTrans* quadrant_right_top_position = new TGeoCombiTrans();
481 quadrant_right_top_position->ReflectX(true);
482 stationA->AddNode(zone1V, 1, quadrant_right_top_position);
483 stationA->AddNode(zone2V, 1, quadrant_right_top_position);
484 stationA->AddNode(zone3V, 1, quadrant_right_top_position);
485 stationA->AddNode(zone4V, 1, quadrant_right_top_position);
486
487 // left-bottom quadrant
488 TGeoCombiTrans* quadrant_left_bottom_position = new TGeoCombiTrans();
489 quadrant_left_bottom_position->ReflectY(true);
490 stationA->AddNode(zone1V, 2, quadrant_left_bottom_position);
491 stationA->AddNode(zone2V, 2, quadrant_left_bottom_position);
492 stationA->AddNode(zone3V, 2, quadrant_left_bottom_position);
493 stationA->AddNode(zone4V, 2, quadrant_left_bottom_position);
494
495 // right-bottom quadrant
496 TGeoCombiTrans* quadrant_right_bottom_position = new TGeoCombiTrans();
497 quadrant_right_bottom_position->ReflectY(true);
498 quadrant_right_bottom_position->ReflectX(true);
499 stationA->AddNode(zone1V, 3, quadrant_right_bottom_position);
500 stationA->AddNode(zone2V, 3, quadrant_right_bottom_position);
501 stationA->AddNode(zone3V, 3, quadrant_right_bottom_position);
502 stationA->AddNode(zone4V, 3, quadrant_right_bottom_position);
503
504 // frame
505 TGeoTranslation* left_vertical_frame_pos =
506 new TGeoTranslation(dXOuterFrame / 2 + xHalfSizeZone1, 0, -(ZModuleSize - dZSensitiveVolume) / 2);
507 TGeoTranslation* right_vertical_frame_pos =
508 new TGeoTranslation(-(dXOuterFrame / 2 + xHalfSizeZone1), 0, -(ZModuleSize - dZSensitiveVolume) / 2);
509 TGeoTranslation* top_horizontal_frame_pos =
510 new TGeoTranslation(0, dYOuterFrame / 2 + yHalfSizeZone1, -ZModuleSize / 2);
511 TGeoTranslation* bottom_horizontal_frame_pos =
512 new TGeoTranslation(0, -(dYOuterFrame / 2 + yHalfSizeZone1), -ZModuleSize / 2);
513 stationA->AddNode(vertical_frameV, 0, left_vertical_frame_pos);
514 stationA->AddNode(vertical_frameV, 1, right_vertical_frame_pos);
515 stationA->AddNode(horizontal_frameV, 0, top_horizontal_frame_pos);
516 stationA->AddNode(horizontal_frameV, 1, bottom_horizontal_frame_pos);
517 stationA->AddNode(circle_inner_frameV, 0);
518
519 // Station position
520 Double_t station_shift = 0.0;
522 station_shift = dZSensitiveVolume / 2 + (ZModuleSize - dZSensitiveVolume);
523 TGeoTranslation* station_pos = new TGeoTranslation(x_position, y_position, z_position + station_shift);
524
525 mother_volume->AddNode(stationA, 0, station_pos);
526}
527
529 TString station_name,
530 Double_t x_position,
531 Double_t y_position,
532 Double_t z_position,
533 Double_t hole_radius)
534{
535 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
536 stationA->SetMedium(pMedAir);
537
538 // sensitive shapes
541 TGeoShape* hot_zoneS = new TGeoBBox("hot_zoneS", XHotZoneSize_StationPrototype / 2,
543
544 // frame shapes
545 TGeoShape* vertical_outer_frameS =
546 new TGeoBBox("vertical_outer_frameS", dXOuterFrame / 2,
548 TGeoShape* horizontal_outer_frameS =
549 new TGeoBBox("horizontal_outer_frameS", (XModuleSize_StationPrototype + dXInnerFrame) / 2, dYOuterFrame / 2,
551 TGeoShape* vertical_inner_frameS =
552 new TGeoBBox("vertical_inner_frameS", dXInnerFrame / 2, YModuleSize_StationPrototype / 2,
554 TGeoShape* horizontal_inner_frameS =
555 new TGeoBBox("horizontal_inner_frameS", (XModuleSize_StationPrototype + dXInnerFrame) / 2, dYInnerFrame / 2,
556 ZModuleSize / 2);
557
558 /*
559 TGeoXtru *moduleS = new TGeoXtru(2);
560 Double_t x_pos[6] = {XModuleSize_StationPrototype, XModuleSize_StationPrototype, 0.0, 0.0,
561 XHotZoneSize_StationPrototype, XHotZoneSize_StationPrototype}; Double_t y_pos[6] = {0.0,
562 YModuleSize_StationPrototype, YModuleSize_StationPrototype, YHotZoneSize_StationPrototype,
563 YHotZoneSize_StationPrototype, 0.0}; moduleS->DefinePolygon(6, x_pos, y_pos); moduleS->DefineSection(0,
564 -dZSensitiveVolume/2); moduleS->DefineSection(1, dZSensitiveVolume/2);
565 */
566 // sensitive volumes
567 TGeoVolume* moduleV = new TGeoVolume("module_Sensor", moduleS);
568 TGeoVolume* hot_zoneV = new TGeoVolume("hot_zone_Sensor", hot_zoneS);
569 moduleV->SetLineColor(TColor::GetColor("#ff47ca"));
570 hot_zoneV->SetLineColor(TColor::GetColor("#e0b0ff"));
571
572 // frame volumes
573 TGeoVolume* vertical_outer_frameV = new TGeoVolume("vertical_outer_frame", vertical_outer_frameS);
574 TGeoVolume* horizontal_outer_frameV = new TGeoVolume("horizontal_outer_frame", horizontal_outer_frameS);
575 TGeoVolume* vertical_inner_frameV = new TGeoVolume("vertical_inner_frame", vertical_inner_frameS);
576 TGeoVolume* horizontal_inner_frameV = new TGeoVolume("horizontal_inner_frame", horizontal_inner_frameS);
577 TGeoVolume* composite_frameV = new TGeoVolumeAssembly("frame");
578 vertical_outer_frameV->SetLineColor(TColor::GetColor("#9999ff"));
579 horizontal_outer_frameV->SetLineColor(TColor::GetColor("#9999ff"));
580 vertical_inner_frameV->SetLineColor(TColor::GetColor("#9999ff"));
581 horizontal_inner_frameV->SetLineColor(TColor::GetColor("#9999ff"));
582
583 // media for sensitive volumes
584 TGeoMedium* sensitive_medium = pMedArCO27030; // set medium
585 if (sensitive_medium) {
586 moduleV->SetMedium(sensitive_medium);
587 hot_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_outer_frameV->SetMedium(frame_medium);
595 horizontal_outer_frameV->SetMedium(frame_medium);
596 vertical_inner_frameV->SetMedium(frame_medium);
597 horizontal_inner_frameV->SetMedium(frame_medium);
598 composite_frameV->SetMedium(frame_medium);
599 } else
600 Fatal("Main", "Invalid medium for frames!");
601
602 moduleV->SetTransparency(20);
603
604 // hot zone position in the module
605 TGeoTranslation* hot_zone_trans =
608
609 // module positions in the station
610 TGeoCombiTrans* module_left_bottom_position = new TGeoCombiTrans();
611 module_left_bottom_position->ReflectY(true);
612 module_left_bottom_position->SetTranslation(XModuleSize_StationPrototype / 2 + dXInnerFrame + hole_radius,
613 -YModuleSize_StationPrototype / 2 + dYInnerFrame + hole_radius,
614 -dZSensitiveVolume / 2);
615
616 TGeoCombiTrans* module_right_bottom_position = new TGeoCombiTrans();
617 module_right_bottom_position->ReflectX(true);
618 module_right_bottom_position->ReflectY(true);
619 module_right_bottom_position->SetTranslation(-XModuleSize_StationPrototype / 2 + hole_radius + dXInnerFrame,
620 -YModuleSize_StationPrototype / 2 - dYInnerFrame - hole_radius,
622
623 TGeoCombiTrans* module_right_top_position = new TGeoCombiTrans();
624 module_right_top_position->ReflectX(true);
625 module_right_top_position->SetTranslation(-XModuleSize_StationPrototype / 2 - dXInnerFrame - hole_radius,
626 YModuleSize_StationPrototype / 2 - dYInnerFrame - hole_radius,
627 -dZSensitiveVolume / 2);
628
629 TGeoCombiTrans* module_left_top_position = new TGeoCombiTrans();
630 module_left_top_position->SetTranslation(XModuleSize_StationPrototype / 2 - dXInnerFrame - hole_radius,
631 YModuleSize_StationPrototype / 2 + dYInnerFrame + hole_radius,
633
634 // frame part positions in the frame
635 TGeoCombiTrans* left_outer_frame_position = new TGeoCombiTrans();
636 left_outer_frame_position->SetTranslation(XModuleSize_StationPrototype / 2 + dXOuterFrame / 2,
638
639 TGeoCombiTrans* top_outer_frame_position = new TGeoCombiTrans();
640 top_outer_frame_position->SetTranslation(-dXInnerFrame / 2, YModuleSize_StationPrototype / 2 + dYOuterFrame / 2,
641 ZModuleSize / 2);
642
643 TGeoCombiTrans* right_inner_frame_position = new TGeoCombiTrans();
644 right_inner_frame_position->SetTranslation(-XModuleSize_StationPrototype / 2 - dXInnerFrame / 2, 0,
645 ZModuleSize / 2);
646
647 TGeoCombiTrans* bottom_inner_frame_position = new TGeoCombiTrans();
648 bottom_inner_frame_position->SetTranslation(-dXInnerFrame / 2, -YModuleSize_StationPrototype / 2 - dYInnerFrame / 2,
650
651 // frame positions in the station
652 TGeoCombiTrans* comp_frame_left_bottom_position = new TGeoCombiTrans();
653 comp_frame_left_bottom_position->ReflectZ(true);
654 comp_frame_left_bottom_position->ReflectY(true);
655 comp_frame_left_bottom_position->SetTranslation(module_left_bottom_position->GetTranslation());
656
657 TGeoCombiTrans* comp_frame_right_bottom_position = new TGeoCombiTrans();
658 comp_frame_right_bottom_position->RotateX(180.0);
659 comp_frame_right_bottom_position->RotateY(180.0);
660 comp_frame_right_bottom_position->SetTranslation(module_right_bottom_position->GetTranslation());
661
662 TGeoCombiTrans* comp_frame_right_top_position = new TGeoCombiTrans();
663 comp_frame_right_top_position->RotateY(180.0);
664 comp_frame_right_top_position->SetTranslation(module_right_top_position->GetTranslation());
665
666 TGeoCombiTrans* comp_frame_left_top_position = new TGeoCombiTrans();
667 comp_frame_left_top_position->SetTranslation(module_left_top_position->GetTranslation());
668
669 // station assembling
670 moduleV->AddNode(hot_zoneV, 0, hot_zone_trans);
671
672 composite_frameV->AddNode(vertical_outer_frameV, 0, left_outer_frame_position);
673 composite_frameV->AddNode(horizontal_outer_frameV, 0, top_outer_frame_position);
674 composite_frameV->AddNode(vertical_inner_frameV, 0, right_inner_frame_position);
675 composite_frameV->AddNode(horizontal_inner_frameV, 0, bottom_inner_frame_position);
676
677 stationA->AddNode(moduleV, 0, module_left_bottom_position);
678 stationA->AddNode(moduleV, 1, module_right_bottom_position);
679 stationA->AddNode(moduleV, 2, module_right_top_position);
680 stationA->AddNode(moduleV, 3, module_left_top_position);
681
682 stationA->AddNode(composite_frameV, 0, comp_frame_left_bottom_position);
683 stationA->AddNode(composite_frameV, 1, comp_frame_right_bottom_position);
684 stationA->AddNode(composite_frameV, 2, comp_frame_right_top_position);
685 stationA->AddNode(composite_frameV, 3, comp_frame_left_top_position);
686
687 // Station position
688 Double_t station_shift = 0.0;
690 station_shift = (ZModuleSize * 2) / 2;
691 TGeoTranslation* station_pos = new TGeoTranslation(x_position, y_position, z_position + station_shift);
692
693 mother_volume->AddNode(stationA, 0, station_pos);
694}
695
697 TString station_name,
698 Double_t x_position,
699 Double_t y_position,
700 Double_t z_position,
701 Double_t hole_radius,
702 Bool_t start_positive_angle,
703 Double_t* outer_zone_sizes,
704 Double_t* hot_zone_sizes_rect,
705 Double_t* hot_zone_sizes_slope)
706{
707 TGeoVolume* stationA = new TGeoVolumeAssembly(station_name);
708 stationA->SetMedium(pMedAir);
709
710 Double_t XOuterZoneSize = outer_zone_sizes[0];
711 Double_t YOuterZoneSize = outer_zone_sizes[1];
712
713 Double_t XRectangleZoneSize = hot_zone_sizes_rect[0];
714 Double_t YRectangleZoneSize = hot_zone_sizes_rect[1];
715
716 Double_t XMinSlopeZoneSize = hot_zone_sizes_slope[0];
717 Double_t XMaxSlopeZoneSize = hot_zone_sizes_slope[1];
718 Double_t YSlopeZoneSize = hot_zone_sizes_slope[2];
719
720 // module shape
721 TString part_module_name = "part_moduleS_" + station_name;
722 TGeoShape* part_moduleS =
723 new TGeoBBox(part_module_name, XOuterZoneSize / 2, YOuterZoneSize / 2, dZSensitiveVolume / 2);
724
725 // part hot zone shapes (without the hole)
726 TString part_rectangle_inner_zone_name = "part_rectangle_inner_zoneS_" + station_name;
727 TGeoShape* part_rectangle_inner_zoneS = new TGeoBBox(part_rectangle_inner_zone_name, XRectangleZoneSize / 2,
728 YRectangleZoneSize / 2, dZSensitiveVolume / 2);
729
730 TString part_slope_inner_zone_name = "part_slope_inner_zoneS_" + station_name;
731 TGeoXtru* part_slope_inner_zoneS = new TGeoXtru(2); // origin centered
732 part_slope_inner_zoneS->SetName(part_slope_inner_zone_name);
733 Double_t x_pos[4] = {XMaxSlopeZoneSize / 2, XMaxSlopeZoneSize / 2 - (XMaxSlopeZoneSize - XMinSlopeZoneSize),
734 -XMaxSlopeZoneSize / 2, -XMaxSlopeZoneSize / 2};
735 Double_t y_pos[4] = {-YSlopeZoneSize / 2, YSlopeZoneSize / 2, YSlopeZoneSize / 2, -YSlopeZoneSize / 2};
736 part_slope_inner_zoneS->DefinePolygon(4, x_pos, y_pos);
737 part_slope_inner_zoneS->DefineSection(0, -dZSensitiveVolume / 2);
738 part_slope_inner_zoneS->DefineSection(1, dZSensitiveVolume / 2);
739
740 // hole shape
741 TString hole_name = "holeS_" + station_name;
742 // TGeoShape *holeS = new TGeoTubeSeg(hole_name, 0.0, hole_radius, dZSensitiveVolume/2 + 0.1, -1.0, 91.0);
743 TGeoShape* holeS = new TGeoTube(hole_name, 0.0, hole_radius, dZSensitiveVolume / 2 + 0.01);
744
745 // hole positions in the module and zones to extract the hole
746 TString hole_module_trans_name = "hole_module_trans_name_" + station_name;
747 TGeoTranslation* hole_module_trans =
748 new TGeoTranslation(hole_module_trans_name, -XOuterZoneSize / 2, -YOuterZoneSize / 2, 0);
749 hole_module_trans->RegisterYourself();
750
751 TString hole_rectangle_inner_zone_trans_name = "hole_rectangle_inner_zone_trans_name_" + station_name;
752 TGeoTranslation* hole_rectangle_inner_zone_trans =
753 new TGeoTranslation(hole_rectangle_inner_zone_trans_name, -XRectangleZoneSize / 2, -YRectangleZoneSize / 2, 0);
754 hole_rectangle_inner_zone_trans->RegisterYourself();
755
756 TString hole_slope_inner_zone_trans_name = "hole_slope_inner_zone_trans_name_" + station_name;
757 TGeoTranslation* hole_slope_inner_zone_trans =
758 new TGeoTranslation(hole_slope_inner_zone_trans_name, -XMaxSlopeZoneSize / 2, -YSlopeZoneSize / 2, 0);
759 hole_slope_inner_zone_trans->RegisterYourself();
760
761 // module and hot zone shapes
762 TString bool_expression_module = part_module_name + " - " + hole_name + ":" + hole_module_trans_name;
763 TGeoCompositeShape* moduleS = new TGeoCompositeShape(bool_expression_module);
764
765 TString bool_expression_rectangle_inner_zone =
766 part_rectangle_inner_zone_name + " - " + hole_name + ":" + hole_rectangle_inner_zone_trans_name;
767 TGeoCompositeShape* rectangle_inner_zoneS = new TGeoCompositeShape(bool_expression_rectangle_inner_zone);
768
769 TString bool_expression_slope_inner_zone =
770 part_slope_inner_zone_name + " - " + hole_name + ":" + hole_slope_inner_zone_trans_name;
771 TGeoCompositeShape* slope_inner_zoneS = new TGeoCompositeShape(bool_expression_slope_inner_zone);
772
773 // frame shapes
774 TGeoShape* vertical_frameS = new TGeoBBox("vertical_frameS", dXOuterFrame / 2,
775 (YOuterZoneSize + dYInnerFrame + dYOuterFrame) / 2, ZModuleSize / 2);
776 TGeoShape* horizontal_long_frameS =
777 new TGeoBBox("horizontal_long_frameS", XOuterZoneSize, dYOuterFrame / 2, (ZModuleSize - dZSensitiveVolume) / 2);
778 TGeoShape* horizontal_short_frameS =
779 new TGeoBBox("horizontal_short_frameS", (XOuterZoneSize - hole_radius + dXInnerFrame) / 2, dYInnerFrame / 2,
781 TGeoShape* circle_inner_frameS =
782 new TGeoTubeSeg("circle_inner_frameS", hole_radius - dXInnerFrame, hole_radius, ZModuleSize / 2, 0., -180.0);
783
784 // Volumes
785 TGeoVolume* module_with_slope_inner_zoneV = new TGeoVolume("module_Sensor", moduleS);
786 TGeoVolume* module_with_rect_inner_zoneV = new TGeoVolume("module_Sensor", moduleS);
787
788 TGeoVolume* rectangle_inner_zoneV = new TGeoVolume("inner_zone_Sensor", rectangle_inner_zoneS);
789 TGeoVolume* slope_inner_zoneV = new TGeoVolume("inner_zone_Sensor", slope_inner_zoneS);
790
791 TGeoVolume* vertical_frameV = new TGeoVolume("vertical_frame", vertical_frameS);
792 TGeoVolume* horizontal_long_frameV = new TGeoVolume("horizontal_long_frame", horizontal_long_frameS);
793 TGeoVolume* horizontal_short_frameV = new TGeoVolume("horizontal_short_frame", horizontal_short_frameS);
794 TGeoVolume* circle_inner_frameV = new TGeoVolume("circle_inner_frame", circle_inner_frameS);
795 TGeoVolume* composite_frameV = new TGeoVolumeAssembly("frame");
796
797 // media for sensitive volumes
798 TGeoMedium* sensitive_medium = pMedArCO27030; // set medium
799 if (sensitive_medium) {
800 module_with_slope_inner_zoneV->SetMedium(sensitive_medium);
801 module_with_rect_inner_zoneV->SetMedium(sensitive_medium);
802 rectangle_inner_zoneV->SetMedium(sensitive_medium);
803 slope_inner_zoneV->SetMedium(sensitive_medium);
804 } else
805 Fatal("Main", "Invalid medium for sensitive modules!");
806
807 // media for frames
808 TGeoMedium* frame_medium = pMedCarbon; // set medium
809 if (frame_medium) {
810 vertical_frameV->SetMedium(frame_medium);
811 horizontal_long_frameV->SetMedium(frame_medium);
812 horizontal_short_frameV->SetMedium(frame_medium);
813 circle_inner_frameV->SetMedium(frame_medium);
814 composite_frameV->SetMedium(frame_medium);
815 } else
816 Fatal("Main", "Invalid medium for frames!");
817
818 // volume visual properties
819 module_with_slope_inner_zoneV->SetTransparency(20);
820 module_with_rect_inner_zoneV->SetTransparency(20);
821 module_with_slope_inner_zoneV->SetLineColor(TColor::GetColor("#ff47ca"));
822 module_with_rect_inner_zoneV->SetLineColor(TColor::GetColor("#ff47ca"));
823 rectangle_inner_zoneV->SetLineColor(TColor::GetColor("#e0b0ff"));
824 slope_inner_zoneV->SetLineColor(TColor::GetColor("#e0b0ff"));
825 vertical_frameV->SetLineColor(TColor::GetColor("#9999ff"));
826 horizontal_long_frameV->SetLineColor(TColor::GetColor("#9999ff"));
827 horizontal_short_frameV->SetLineColor(TColor::GetColor("#9999ff"));
828 circle_inner_frameV->SetLineColor(TColor::GetColor("#9999ff"));
829
830 // hot zone positions in modules
831 TGeoTranslation* slope_inner_zone_position =
832 new TGeoTranslation(-XOuterZoneSize / 2 + XMaxSlopeZoneSize / 2, -YOuterZoneSize / 2 + YSlopeZoneSize / 2, 0);
833 TGeoTranslation* rect_inner_zone_position = new TGeoTranslation(-XOuterZoneSize / 2 + XRectangleZoneSize / 2,
834 -YOuterZoneSize / 2 + YRectangleZoneSize / 2, 0);
835
836 // module positions in the station
837 TGeoCombiTrans* left_top_module_position = new TGeoCombiTrans();
838 left_top_module_position->SetTranslation(XOuterZoneSize / 2, YOuterZoneSize / 2, dZSensitiveVolume / 2);
839
840 TGeoCombiTrans* right_top_module_position = new TGeoCombiTrans();
841 right_top_module_position->RotateY(180.0);
842 right_top_module_position->SetTranslation(-XOuterZoneSize / 2, YOuterZoneSize / 2, dZSensitiveVolume / 2);
843
844 TGeoCombiTrans* right_bottom_module_position = new TGeoCombiTrans();
845 right_bottom_module_position->RotateY(180.0);
846 right_bottom_module_position->RotateX(180.0);
847 right_bottom_module_position->SetTranslation(-XOuterZoneSize / 2, -YOuterZoneSize / 2, -dZSensitiveVolume / 2);
848
849 TGeoCombiTrans* left_bottom_module_position = new TGeoCombiTrans();
850 left_bottom_module_position->RotateX(180.0);
851 left_bottom_module_position->SetTranslation(XOuterZoneSize / 2, -YOuterZoneSize / 2, -dZSensitiveVolume / 2);
852
853 // frame part positions in the frame
854 TGeoTranslation* left_top_frame_position = new TGeoTranslation(
855 XOuterZoneSize + dXOuterFrame / 2, YOuterZoneSize / 2 + (dYOuterFrame - dYInnerFrame) / 2, ZModuleSize / 2);
856 TGeoTranslation* right_top_frame_position = new TGeoTranslation(
857 -(XOuterZoneSize + dXOuterFrame / 2), YOuterZoneSize / 2 + (dYOuterFrame - dYInnerFrame) / 2, ZModuleSize / 2);
858 TGeoTranslation* top_long_frame_position = new TGeoTranslation(
859 0, YOuterZoneSize + dYOuterFrame / 2, (ZModuleSize - dZSensitiveVolume) / 2 + dZSensitiveVolume);
860 TGeoTranslation* left_top_short_frame_position =
861 new TGeoTranslation((XOuterZoneSize - hole_radius - dXInnerFrame) / 2 + hole_radius, -dYInnerFrame / 2,
863 TGeoTranslation* right_top_short_frame_position =
864 new TGeoTranslation(-((XOuterZoneSize - hole_radius - dXInnerFrame) / 2 + hole_radius), -dYInnerFrame / 2,
866
867 // frame positions in the station
868 TGeoCombiTrans* upper_frame_trans = new TGeoCombiTrans();
869
870 TGeoCombiTrans* lower_frame_trans = new TGeoCombiTrans();
871 lower_frame_trans->ReflectY(true);
872 lower_frame_trans->ReflectZ(true);
873
874 // station assembling
875 module_with_slope_inner_zoneV->AddNode(slope_inner_zoneV, 0, slope_inner_zone_position);
876 module_with_rect_inner_zoneV->AddNode(rectangle_inner_zoneV, 0, rect_inner_zone_position);
877
878 if (start_positive_angle) {
879 stationA->AddNode(module_with_slope_inner_zoneV, 0, left_top_module_position);
880 stationA->AddNode(module_with_rect_inner_zoneV, 1, right_top_module_position);
881 stationA->AddNode(module_with_rect_inner_zoneV, 2, right_bottom_module_position);
882 stationA->AddNode(module_with_slope_inner_zoneV, 3, left_bottom_module_position);
883 } else {
884 stationA->AddNode(module_with_rect_inner_zoneV, 0, left_top_module_position);
885 stationA->AddNode(module_with_slope_inner_zoneV, 1, right_top_module_position);
886 stationA->AddNode(module_with_slope_inner_zoneV, 2, right_bottom_module_position);
887 stationA->AddNode(module_with_rect_inner_zoneV, 3, left_bottom_module_position);
888 }
889
890 // frames
891 composite_frameV->AddNode(vertical_frameV, 0, left_top_frame_position);
892 composite_frameV->AddNode(vertical_frameV, 1, right_top_frame_position);
893 composite_frameV->AddNode(horizontal_long_frameV, 0, top_long_frame_position);
894 composite_frameV->AddNode(horizontal_short_frameV, 0, left_top_short_frame_position);
895 composite_frameV->AddNode(horizontal_short_frameV, 1, right_top_short_frame_position);
896 composite_frameV->AddNode(circle_inner_frameV, 0, new TGeoTranslation(0, 0, ZModuleSize / 2));
897
898 stationA->AddNode(composite_frameV, 0, upper_frame_trans);
899 stationA->AddNode(composite_frameV, 1, lower_frame_trans);
900
901 // Station position
902 Double_t station_shift = 0.0;
904 station_shift = (ZModuleSize * 2) / 2;
905 TGeoTranslation* station_pos = new TGeoTranslation(x_position, y_position, z_position + station_shift);
906
907 mother_volume->AddNode(stationA, 0, station_pos);
908}
bool Bool_t
int Int_t
unsigned int UInt_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
char * Form(const char *fmt,...)
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
const Double_t * GetTranslation() const override
void RotateY(Double_t angle) override
void RotateX(Double_t angle) override
void SetTranslation(const TGeoTranslation &tr)
void ReflectY(Bool_t leftside, Bool_t rotonly=kFALSE) override
void ReflectZ(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 char * Data() const
TGeoMedium * pMedAir
TGeoMedium * pMedCarbon
TGeoManager * gGeoMan
TGeoMedium * pMedArCO27030
TGeoMedium * pMedFiberGlass
TGeoMedium * pMedCopper
const Double_t dXOuterFrame
const Double_t dZSensitiveVolume
const Double_t BeamPipeMaxRadius
const Double_t BeamPipeMinRadius
const Int_t nStations
const Double_t dXInnerFrame
const Bool_t StationCenterPosition
const Double_t dYOuterFrame
const Double_t dYInnerFrame
const Int_t nModulesInStation
const Double_t ZDisplacementOfDetector
const Double_t XModuleSize_StationPrototype
const Double_t XHotZoneSize_StationPrototype
const Double_t YHotZoneSize_StationPrototype
const Double_t YModuleSize_StationPrototype
const Double_t XSizeSpacer
const Double_t YSizeSpacer
const Double_t SpacerThickness
const Bool_t WithSpacers
const Double_t SpacerWidth
void CreateStation_Type4Zones(TGeoVolume *mother_volume, TString station_name, Double_t x_position, Double_t y_position, Double_t z_position, Double_t *x_zone_sizes, Double_t *y_zone_sizes, Double_t hole_radius)
const Double_t OuterZoneSizes_Station8[2]
void CalculateParameters()
void CreateStationTypePrototype(TGeoVolume *mother_volume, TString station_name, Double_t x_position, Double_t y_position, Double_t z_position, Double_t hole_radius)
void create_rootgeom_GEMS_v3()
const Double_t HotZoneSizes_rectangle_Station8[2]
const Double_t XZoneSizes_Station0[4]
const Double_t YZoneSizes_Station2[4]
const Double_t YZoneSizes_Station0[4]
const Double_t XZoneSizes_Station2[4]
const Double_t HotZoneSizes_slope_Station8[3]
void DefineRequiredMedia(FairGeoMedia *geoMedia, FairGeoBuilder *geoBuild)
const Double_t HotZoneSizes_slope_Station5[3]
const Double_t OuterZoneSizes_Station5[2]
void CreateStation_TypeTwoModules(TGeoVolume *mother_volume, TString station_name, Double_t x_position, Double_t y_position, Double_t z_position, Double_t hole_radius, Bool_t start_positive_angle, Double_t *outer_zone_sizes, Double_t *hot_zone_sizes_rect, Double_t *hot_zone_sizes_slope)
const Double_t HotZoneSizes_rectangle_Station5[2]
Double_t ATan(Double_t)
constexpr Double_t Pi()
Double_t Tan(Double_t)