27 cout <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endl;
28 FairGeoLoader* geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
29 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
31 TString medFile = geoPath +
"/geometry/media.geo";
32 geoFace->setMediaFile(medFile);
37 const TString geoDetectorName =
"TOF400";
38 const TString geoDetectorVersion =
"RUN8_v3";
40 const TString geoFileName = geoDetectorName +
"_" + geoDetectorVersion +
".root";
43 FairGeoMedia* geoMedia = geoFace->getMedia();
44 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
47 FairGeoMedium* matAir = geoMedia->getMedium(
"air");
49 Fatal(
"Main",
"FairMedium air not found");
50 geoBuild->createMedium(matAir);
51 TGeoMedium* medAir = gGeoMan->GetMedium(
"air");
53 Fatal(
"Main",
"Medium air not found");
56 FairGeoMedium* matPprop = geoMedia->getMedium(
"polypropylene");
58 Fatal(
"Main",
"FairMedium polypropylene not found");
59 geoBuild->createMedium(matPprop);
60 TGeoMedium* medPprop = gGeoMan->GetMedium(
"polypropylene");
62 Fatal(
"Main",
"Medium polypropylene not found");
65 FairGeoMedium* matPb = geoMedia->getMedium(
"lead");
67 Fatal(
"Main",
"FairMedium lead not found");
68 geoBuild->createMedium(matPb);
69 TGeoMedium* medPb = gGeoMan->GetMedium(
"lead");
71 Fatal(
"Main",
"Medium lead not found");
74 FairGeoMedium* matAl = geoMedia->getMedium(
"aluminium");
76 Fatal(
"Main",
"FairMedium aluminium not found");
77 geoBuild->createMedium(matAl);
78 TGeoMedium* medAl = gGeoMan->GetMedium(
"aluminium");
80 Fatal(
"Main",
"Medium aluminium not found");
83 FairGeoMedium* matGlass = geoMedia->getMedium(
"RPCglass");
85 Fatal(
"Main",
"FairMedium RPCglass not found");
86 geoBuild->createMedium(matGlass);
87 TGeoMedium* medGlass = gGeoMan->GetMedium(
"RPCglass");
89 Fatal(
"Main",
"Medium RPCglass not found");
92 FairGeoMedium* matGas = geoMedia->getMedium(
"RPCgas");
94 Fatal(
"Main",
"FairMedium RPCgas not found");
95 geoBuild->createMedium(matGas);
96 TGeoMedium* medGas = gGeoMan->GetMedium(
"RPCgas");
98 Fatal(
"Main",
"Medium RPCgas not found");
101 FairGeoMedium* matG10 = geoMedia->getMedium(
"G10");
103 Fatal(
"Main",
"FairMedium G10 not found");
104 geoBuild->createMedium(matG10);
105 TGeoMedium* medG10 = gGeoMan->GetMedium(
"G10");
107 Fatal(
"Main",
"Medium G10 not found");
112 gGeoMan->SetName(geoDetectorName +
"_geom");
115 gGeoMan->SetTopVolume(top);
116 gGeoMan->SetTopVisible(1);
117 gGeoMan->SetVisLevel(7);
126 const double DetXsize = 60.;
127 const double DetYsize = 30.;
128 const double DetZsize = 3.0;
182 const float stripGasX = 1., stripGasY = DetYsize, stripGasZ = 0.3;
183 TGeoBBox* sStripGas =
new TGeoBBox(stripGasX / 2., stripGasY / 2., stripGasZ / 2.);
184 sStripGas->
SetName(
"StripGas");
189 const float detGlassX = DetXsize, detGlassY = DetYsize, detGlassZ = 0.618 / 2.;
190 TGeoBBox* sDetGlass =
new TGeoBBox(detGlassX / 2., detGlassY / 2., detGlassZ / 2.);
191 sDetGlass->
SetName(
"DetectorGlass");
196 const float detPlateX = DetXsize, detPlateY = DetYsize, detPlateZ = 0.64 / 2.;
197 TGeoBBox* sDetPlate =
new TGeoBBox(detPlateX / 2., detPlateY / 2., detPlateZ / 2.);
198 sDetPlate->
SetName(
"DetectorPlate");
205 const int NStrips = 48;
206 const double StripStep = 1.25;
207 for (
int i = 0;
i < NStrips;
i++) {
208 vDetector->
AddNode(vStripGas,
i + 1,
209 new TGeoTranslation(
"", -DetXsize / 2. + StripStep / 2. +
i * StripStep, 0., 0.));
221 const double tofZgap = 0.86;
222 const double tofYoverlap = 3.0;
224 const double tofXgap = 0.;
227 double tofX = tofXgap / 2. + DetXsize / 2.;
228 double tofZshift = tofZgap + DetZsize;
235 const double box1_x = 207.405;
236 const double box1_y = 2.478 - 3.;
237 const double box1_z = 434.286 - 2.5 + 6.5;
242 const Double_t corr_X_box1[5] = {-0.43, -0.115, -0.267, -0.323, -1.427};
243 const Double_t corr_Y_box1[5] = {0.123, 0.269, 0.26, 0.521, 1.107};
244 const Double_t corr_Z_box1[5] = {-1.203, 0.057, 0.447, 0.58, -0.788};
247 new TGeoCombiTrans(
"", box1_x + corr_X_box1[0], 2. * DetYsize - 2 * tofYoverlap + box1_y + corr_Y_box1[0],
248 box1_z + corr_Z_box1[0], geoRot1);
249 topTof->
AddNode(vDetector, 1, cR1);
252 new TGeoCombiTrans(
"", box1_x + corr_X_box1[1], 1. * DetYsize - tofYoverlap + box1_y + corr_Y_box1[1],
253 box1_z + tofZshift + corr_Z_box1[1], geoRot1);
254 topTof->
AddNode(vDetector, 2, cR2);
257 new TGeoCombiTrans(
"", box1_x + corr_X_box1[2], 0 + box1_y + corr_Y_box1[2], box1_z + corr_Z_box1[2], geoRot1);
258 topTof->
AddNode(vDetector, 3, cR3);
261 new TGeoCombiTrans(
"", box1_x + corr_X_box1[3], -1. * DetYsize + tofYoverlap + box1_y + corr_Y_box1[3],
262 box1_z + tofZshift + corr_Z_box1[3], geoRot1);
263 topTof->
AddNode(vDetector, 4, cR4);
266 new TGeoCombiTrans(
"", box1_x + corr_X_box1[4], -2. * DetYsize + 2 * tofYoverlap + box1_y + corr_Y_box1[4],
267 box1_z + corr_Z_box1[4], geoRot1);
268 topTof->
AddNode(vDetector, 5, cR5);
271 topTof->
AddNode(vBox, 1, cBox1);
274 const double box2_x = 150.04;
275 const double box2_y = 3.163 - 3.;
276 const double box2_z = 421.161 - 2.5 + 6.5;
281 const Double_t corr_X_box2[5] = {0.926, 0.717, 0.067, -0.579, -0.178};
282 const Double_t corr_Y_box2[5] = {-0.293, -0.299, -0.204, -0.143, 0.948};
283 const Double_t corr_Z_box2[5] = {1.61, 1.22, 0.57, -0.083, 0.922};
286 new TGeoCombiTrans(
"", box2_x + corr_X_box2[0], 2. * DetYsize - 2 * tofYoverlap + box2_y + corr_Y_box2[0],
287 box2_z + corr_Z_box2[0], geoRot2);
288 topTof->
AddNode(vDetector, 6, cR6);
291 new TGeoCombiTrans(
"", box2_x + corr_X_box2[1], 1. * DetYsize - tofYoverlap + box2_y + corr_Y_box2[1],
292 box2_z + tofZshift + corr_Z_box2[1], geoRot2);
293 topTof->
AddNode(vDetector, 7, cR7);
296 new TGeoCombiTrans(
"", box2_x + corr_X_box2[2], 0 + box2_y + corr_Y_box2[2], box2_z + corr_Z_box2[2], geoRot2);
297 topTof->
AddNode(vDetector, 8, cR8);
300 new TGeoCombiTrans(
"", box2_x + corr_X_box2[3], -1. * DetYsize + tofYoverlap + box2_y + corr_Y_box2[3],
301 box2_z + tofZshift + corr_Z_box2[3], geoRot2);
302 topTof->
AddNode(vDetector, 9, cR9);
305 new TGeoCombiTrans(
"", box2_x + corr_X_box2[4], -2. * DetYsize + 2 * tofYoverlap + box2_y + corr_Y_box2[4],
306 box2_z + corr_Z_box2[4], geoRot2);
307 topTof->
AddNode(vDetector, 10, cR10);
310 topTof->
AddNode(vBox, 2, cBox2);
313 const double box3_x = -94.244;
314 const double box3_y = 3.583 - 3.;
315 const double box3_z = 421.065 - 2.5 + 6.5;
320 const Double_t corr_X_box3[5] = {-0.078, 0.016, -0.043, 0.124, -0.211};
321 const Double_t corr_Y_box3[5] = {1.673, 1.11, 1.815, 1.481, 2.184};
322 const Double_t corr_Z_box3[5] = {1.04, 0.967, 1.427, 0.34, 0.748};
325 new TGeoCombiTrans(
"", box3_x + corr_X_box3[0], 2. * DetYsize - 2 * tofYoverlap + box3_y + corr_Y_box3[0],
326 box3_z + corr_Z_box3[0], geoRot3);
327 topTof->
AddNode(vDetector, 11, cR11);
330 new TGeoCombiTrans(
"", box3_x + corr_X_box3[1], 1. * DetYsize - tofYoverlap + box3_y + corr_Y_box3[1],
331 box3_z + tofZshift + corr_Z_box3[1], geoRot3);
332 topTof->
AddNode(vDetector, 12, cR12);
335 new TGeoCombiTrans(
"", box3_x + corr_X_box3[2], 0 + box3_y + corr_Y_box3[2], box3_z + corr_Z_box3[2], geoRot3);
336 topTof->
AddNode(vDetector, 13, cR13);
339 new TGeoCombiTrans(
"", box3_x + corr_X_box3[3], -1. * DetYsize + tofYoverlap + box3_y + corr_Y_box3[3],
340 box3_z + tofZshift + corr_Z_box3[3], geoRot3);
341 topTof->
AddNode(vDetector, 14, cR14);
344 new TGeoCombiTrans(
"", box3_x + corr_X_box3[4], -2. * DetYsize + 2 * tofYoverlap + box3_y + corr_Y_box3[4],
345 box3_z + corr_Z_box3[4], geoRot3);
346 topTof->
AddNode(vDetector, 15, cR15);
349 topTof->
AddNode(vBox, 3, cBox3);
352 const double box4_x = -150.210;
353 const double box4_y = 2.588 - 3. + 1.24;
354 const double box4_z = 434.650 - 2.5 + 6.5;
359 const Double_t corr_X_box4[5] = {0.025, 0.189, 0.222, 0.200, 0.123};
360 const Double_t corr_Y_box4[5] = {1.167 + 1.35 - 1.24, 1.262 + 1.27 - 1.24, 1.258 + 1.1 - 1.24, 1.793 + 1.17 - 1.24,
361 1.376 + 1.32 - 1.24};
362 const Double_t corr_Z_box4[5] = {-0.916, -1.048, -1.096, -1.096, -1.657};
365 new TGeoCombiTrans(
"", box4_x + corr_X_box4[0], 2. * DetYsize - 2 * tofYoverlap + box4_y + corr_Y_box4[0],
366 box4_z + corr_Z_box4[0], geoRot4);
367 topTof->
AddNode(vDetector, 16, cR16);
370 new TGeoCombiTrans(
"", box4_x + corr_X_box4[1], 1. * DetYsize - tofYoverlap + box4_y + corr_Y_box4[1],
371 box4_z + tofZshift + corr_Z_box4[1], geoRot4);
372 topTof->
AddNode(vDetector, 17, cR17);
375 new TGeoCombiTrans(
"", box4_x + corr_X_box4[2], 0 + box4_y + corr_Y_box4[2], box4_z + corr_Z_box4[2], geoRot4);
376 topTof->
AddNode(vDetector, 18, cR18);
379 new TGeoCombiTrans(
"", box4_x + corr_X_box4[3], -1. * DetYsize + tofYoverlap + box4_y + corr_Y_box4[3],
380 box4_z + tofZshift + corr_Z_box4[3], geoRot4);
381 topTof->
AddNode(vDetector, 19, cR19);
384 new TGeoCombiTrans(
"", box4_x + corr_X_box4[4], -2. * DetYsize + 2 * tofYoverlap + box4_y + corr_Y_box4[4],
385 box4_z + corr_Z_box4[4], geoRot4);
386 topTof->
AddNode(vDetector, 20, cR20);
389 topTof->
AddNode(vBox, 4, cBox4);
398 gGeoMan->CloseGeometry();
399 gGeoMan->CheckOverlaps(0.001);
400 gGeoMan->PrintOverlaps();
403 TFile* geoFile =
new TFile(geoFileName,
"RECREATE");