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 =
"RUN9_v2";
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;
181 const float stripGasX = 1.25, stripGasY = DetYsize, stripGasZ = 0.3;
182 TGeoBBox* sStripGas =
new TGeoBBox(stripGasX / 2., stripGasY / 2., stripGasZ / 2.);
183 sStripGas->
SetName(
"StripGas");
188 const float detGlassX = DetXsize, detGlassY = DetYsize, detGlassZ = 0.618 / 2.;
189 TGeoBBox* sDetGlass =
new TGeoBBox(detGlassX / 2., detGlassY / 2., detGlassZ / 2.);
190 sDetGlass->
SetName(
"DetectorGlass");
195 const float detPlateX = DetXsize, detPlateY = DetYsize, detPlateZ = 0.64 / 2.;
196 TGeoBBox* sDetPlate =
new TGeoBBox(detPlateX / 2., detPlateY / 2., detPlateZ / 2.);
197 sDetPlate->
SetName(
"DetectorPlate");
204 const int NStrips = 48;
205 const double StripStep = 1.25;
206 for (
int i = 0;
i < NStrips;
i++) {
207 vDetector->
AddNode(vStripGas,
i + 1,
208 new TGeoTranslation(
"", -DetXsize / 2. + StripStep / 2. +
i * StripStep, 0., 0.));
220 const double tofZgap = 0.4;
221 const double tofYoverlap = 3.0;
222 const double tofZshift = (tofZgap + DetZsize) * -1.;
225 const double box1_x = 164.193;
226 const double box1_y = -2.128;
227 const double box1_z = 422.167;
230 const double ofsetDetRelBox1_col1_x = +3.0 + 55.;
231 const double ofsetDetRelBox1_col1_y = -2.25;
232 const double ofsetDetRelBox1_col1_z = 15.0 + 2. * tofZshift;
238 const Double_t corr_X_col1[5] = {0.13, 0.22, 0.04, -0.08, -0.16};
239 const Double_t corr_Y_col1[5] = {0.71, 0.59, 0.44, 0.44, 0.40};
240 const Double_t corr_Z_col1[5] = {0, 0, 0, 0, 0};
243 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col1_x + corr_X_col1[0],
244 2. * DetYsize - 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[0],
245 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[0], geoRot1);
246 topTof->
AddNode(vDetector, 1, cR1);
249 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col1_x + corr_X_col1[1],
250 1. * DetYsize - tofYoverlap + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[1],
251 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[1] + tofZshift, geoRot1);
252 topTof->
AddNode(vDetector, 2, cR2);
255 0. + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[2],
256 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[2], geoRot1);
257 topTof->
AddNode(vDetector, 3, cR3);
260 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col1_x + corr_X_col1[3],
261 -1. * DetYsize + tofYoverlap + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[3],
262 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[3] + tofZshift, geoRot1);
263 topTof->
AddNode(vDetector, 4, cR4);
266 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col1_x + corr_X_col1[4],
267 -2. * DetYsize + 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col1_y + corr_Y_col1[4],
268 box1_z + ofsetDetRelBox1_col1_z + corr_Z_col1[4], geoRot1);
269 topTof->
AddNode(vDetector, 5, cR5);
272 const double ofsetDetRelBox1_col2_x = +3.0;
273 const double ofsetDetRelBox1_col2_y = -2.25;
274 const double ofsetDetRelBox1_col2_z = 15.0;
280 const Double_t corr_X_col2[5] = {-0.63, -0.43, -0.81, -0.74, -1.30};
281 const Double_t corr_Y_col2[5] = {0.4, 0.65, 0.15, 0.11, 0.16};
282 const Double_t corr_Z_col2[5] = {0, 0, 0, 0, 0};
285 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col2_x + corr_X_col2[0],
286 2. * DetYsize - 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[0],
287 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[0], geoRot1);
288 topTof->
AddNode(vDetector, 6, cR6);
291 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col2_x + corr_X_col2[1],
292 1. * DetYsize - tofYoverlap + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[1],
293 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[1] + tofZshift, geoRot1);
294 topTof->
AddNode(vDetector, 7, cR7);
297 0. + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[2],
298 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[2], geoRot1);
299 topTof->
AddNode(vDetector, 8, cR8);
302 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col2_x + corr_X_col2[3],
303 -1. * DetYsize + tofYoverlap + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[3],
304 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[3] + tofZshift, geoRot1);
305 topTof->
AddNode(vDetector, 9, cR9);
308 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col2_x + corr_X_col2[4],
309 -2. * DetYsize + 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col2_y + corr_Y_col2[4],
310 box1_z + ofsetDetRelBox1_col2_z + corr_Z_col2[4], geoRot1);
311 topTof->
AddNode(vDetector, 10, cR10);
314 const double ofsetDetRelBox1_col3_x = +3.0 - 55.;
315 const double ofsetDetRelBox1_col3_y = -2.25;
316 const double ofsetDetRelBox1_col3_z = 15.0 + 2. * tofZshift;
322 const Double_t corr_X_col3[5] = {-0.67, -0.84, -1.11, 0., -1.43};
323 const Double_t corr_Y_col3[5] = {0.42, 0.25, 0.28, 0., 0.};
324 const Double_t corr_Z_col3[5] = {0, 0, 0, 0, 0};
327 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col3_x + corr_X_col3[0],
328 2. * DetYsize - 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[0],
329 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[0], geoRot1);
330 topTof->
AddNode(vDetector, 11, cR11);
333 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col3_x + corr_X_col3[1],
334 1. * DetYsize - tofYoverlap + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[1],
335 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[1] + tofZshift, geoRot1);
336 topTof->
AddNode(vDetector, 12, cR12);
339 0. + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[2],
340 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[2], geoRot1);
341 topTof->
AddNode(vDetector, 13, cR13);
344 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col3_x + corr_X_col3[3],
345 -1. * DetYsize + tofYoverlap + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[3],
346 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[3] + tofZshift, geoRot1);
347 topTof->
AddNode(vDetector, 14, cR14);
350 new TGeoCombiTrans(
"", box1_x + ofsetDetRelBox1_col3_x + corr_X_col3[4],
351 -2. * DetYsize + 2 * tofYoverlap + box1_y + ofsetDetRelBox1_col3_y + corr_Y_col3[4],
352 box1_z + ofsetDetRelBox1_col3_z + corr_Z_col3[4], geoRot1);
353 topTof->
AddNode(vDetector, 15, cR15);
357 topTof->
AddNode(vBox, 1, cBox1);
361 const double box2_x = -119.799;
362 const double box2_y = -2.055;
363 const double box2_z = 422.238;
366 const double ofsetDetRelBox2_col4_x = -5.0 + 55.;
367 const double ofsetDetRelBox2_col4_y = -2.25;
368 const double ofsetDetRelBox2_col4_z = 15.0 + 2. * tofZshift;
374 const Double_t corr_X_col4[5] = {-0.14, 0., 0., -0.23, -0.2};
375 const Double_t corr_Y_col4[5] = {0.34, 0., 0., -0.1, -0.28};
376 const Double_t corr_Z_col4[5] = {0, 0, 0, 0, 0};
379 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col4_x + corr_X_col4[0],
380 2. * DetYsize - 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[0],
381 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[0], geoRot4);
382 topTof->
AddNode(vDetector, 16, cR16);
385 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col4_x + corr_X_col4[1],
386 1. * DetYsize - tofYoverlap + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[1],
387 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[1] + tofZshift, geoRot4);
388 topTof->
AddNode(vDetector, 17, cR17);
391 0. + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[2],
392 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[2], geoRot4);
393 topTof->
AddNode(vDetector, 18, cR18);
396 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col4_x + corr_X_col4[3],
397 -1. * DetYsize + tofYoverlap + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[3],
398 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[3] + tofZshift, geoRot4);
399 topTof->
AddNode(vDetector, 19, cR19);
402 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col4_x + corr_X_col4[4],
403 -2. * DetYsize + 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col4_y + corr_Y_col4[4],
404 box2_z + ofsetDetRelBox2_col4_z + corr_Z_col4[4], geoRot4);
405 topTof->
AddNode(vDetector, 20, cR20);
408 const double ofsetDetRelBox2_col5_x = -5.0;
409 const double ofsetDetRelBox2_col5_y = -2.25;
410 const double ofsetDetRelBox2_col5_z = 15.0;
416 const Double_t corr_X_col5[5] = {-0.3, -0.29, -0.43, -0.78, -0.57};
417 const Double_t corr_Y_col5[5] = {0.22, 0.12, -0.31, -0.6, -0.35};
418 const Double_t corr_Z_col5[5] = {0, 0, 0, 0, 0};
421 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col5_x + corr_X_col5[0],
422 2. * DetYsize - 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[0],
423 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[0], geoRot5);
424 topTof->
AddNode(vDetector, 21, cR21);
427 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col5_x + corr_X_col5[1],
428 1. * DetYsize - tofYoverlap + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[1],
429 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[1] + tofZshift, geoRot5);
430 topTof->
AddNode(vDetector, 22, cR22);
433 0. + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[2],
434 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[2], geoRot5);
435 topTof->
AddNode(vDetector, 23, cR23);
438 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col5_x + corr_X_col5[3],
439 -1. * DetYsize + tofYoverlap + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[3],
440 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[3] + tofZshift, geoRot5);
441 topTof->
AddNode(vDetector, 24, cR24);
444 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col5_x + corr_X_col5[4],
445 -2. * DetYsize + 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col5_y + corr_Y_col5[4],
446 box2_z + ofsetDetRelBox2_col5_z + corr_Z_col5[4], geoRot5);
447 topTof->
AddNode(vDetector, 25, cR25);
450 const double ofsetDetRelBox2_col6_x = -5.0 - 55.;
451 const double ofsetDetRelBox2_col6_y = -2.25;
452 const double ofsetDetRelBox2_col6_z = 15.0 + 2. * tofZshift;
458 const Double_t corr_X_col6[5] = {-0.45, -0.4, -0.4, -0.23, -0.33};
459 const Double_t corr_Y_col6[5] = {0.24, 0.12, -0.19, -0.24, -0.35};
460 const Double_t corr_Z_col6[5] = {0, 0, 0, 0, 0};
463 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col6_x + corr_X_col6[0],
464 2. * DetYsize - 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[0],
465 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[0], geoRot6);
466 topTof->
AddNode(vDetector, 26, cR26);
469 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col6_x + corr_X_col6[1],
470 1. * DetYsize - tofYoverlap + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[1],
471 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[1] + tofZshift, geoRot6);
472 topTof->
AddNode(vDetector, 27, cR27);
475 0. + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[2],
476 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[2], geoRot6);
477 topTof->
AddNode(vDetector, 28, cR28);
480 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col6_x + corr_X_col6[3],
481 -1. * DetYsize + tofYoverlap + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[3],
482 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[3] + tofZshift, geoRot6);
483 topTof->
AddNode(vDetector, 29, cR29);
486 new TGeoCombiTrans(
"", box2_x + ofsetDetRelBox2_col6_x + corr_X_col6[4],
487 -2. * DetYsize + 2 * tofYoverlap + box2_y + ofsetDetRelBox2_col6_y + corr_Y_col6[4],
488 box2_z + ofsetDetRelBox2_col6_z + corr_Z_col6[4], geoRot6);
489 topTof->
AddNode(vDetector, 30, cR30);
493 topTof->
AddNode(vBox, 2, cBox2);
501 gGeoMan->CloseGeometry();
502 gGeoMan->CheckOverlaps(0.001);
503 gGeoMan->PrintOverlaps();
506 TFile* geoFile =
new TFile(geoFileName,
"RECREATE");