6 gROOT->LoadMacro(
"$VMCWORKDIR/macro/run/bmnloadlibs.C");
10 FairGeoLoader* geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
11 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
12 TString geoPath = gSystem->Getenv(
"VMCWORKDIR");
13 TString medFile = geoPath +
"/geometry/media.geo";
14 geoFace->setMediaFile(medFile);
16 gGeoMan = gGeoManager;
19 const TString geoDetectorName =
"TOF400";
20 const TString geoDetectorVersion =
"RUN6";
21 const TString geoFileName = geoPath +
"/geometry/" + geoDetectorName +
"_" + geoDetectorVersion +
".root";
24 FairGeoMedia* geoMedia = geoFace->getMedia();
25 FairGeoBuilder* geoBuild = geoLoad->getGeoBuilder();
28 FairGeoMedium* matAir = geoMedia->getMedium(
"air");
29 if (!matAir) Fatal(
"Main",
"FairMedium air not found");
30 geoBuild->createMedium(matAir);
31 TGeoMedium* medAir = gGeoMan->GetMedium(
"air");
32 if (!medAir) Fatal(
"Main",
"Medium air not found");
35 FairGeoMedium* matPprop = geoMedia->getMedium(
"polypropylene");
36 if (!matPprop) Fatal(
"Main",
"FairMedium polypropylene not found");
37 geoBuild->createMedium(matPprop);
38 TGeoMedium* medPprop = gGeoMan->GetMedium(
"polypropylene");
39 if (!medPprop) Fatal(
"Main",
"Medium polypropylene not found");
42 FairGeoMedium* matPb = geoMedia->getMedium(
"lead");
43 if (!matPb) Fatal(
"Main",
"FairMedium lead not found");
44 geoBuild->createMedium(matPb);
45 TGeoMedium* medPb = gGeoMan->GetMedium(
"lead");
46 if (!medPb) Fatal(
"Main",
"Medium lead not found");
49 FairGeoMedium* matAl = geoMedia->getMedium(
"aluminium");
50 if (!matAl) Fatal(
"Main",
"FairMedium aluminium not found");
51 geoBuild->createMedium(matAl);
52 TGeoMedium* medAl = gGeoMan->GetMedium(
"aluminium");
53 if (!medAl) Fatal(
"Main",
"Medium aluminium not found");
56 FairGeoMedium* matGlass = geoMedia->getMedium(
"RPCglass");
57 if (!matGlass) Fatal(
"Main",
"FairMedium RPCglass not found");
58 geoBuild->createMedium(matGlass);
59 TGeoMedium* medGlass = gGeoMan->GetMedium(
"RPCglass");
60 if (!medGlass) Fatal(
"Main",
"Medium RPCglass not found");
63 FairGeoMedium* matGas = geoMedia->getMedium(
"RPCgas");
64 if (!matGas) Fatal(
"Main",
"FairMedium RPCgas not found");
65 geoBuild->createMedium(matGas);
66 TGeoMedium* medGas = gGeoMan->GetMedium(
"RPCgas");
67 if (!medGas) Fatal(
"Main",
"Medium RPCgas not found");
70 FairGeoMedium* matG10 = geoMedia->getMedium(
"G10");
71 if (!matG10) Fatal(
"Main",
"FairMedium G10 not found");
72 geoBuild->createMedium(matG10);
73 TGeoMedium* medG10 = gGeoMan->GetMedium(
"G10");
74 if (!medG10) Fatal(
"Main",
"Medium G10 not found");
77 gGeoMan = (TGeoManager*) gROOT->FindObject(
"FAIRGeom");
78 gGeoMan->SetName(geoDetectorName +
"_geom");
79 TGeoVolume* top =
new TGeoVolumeAssembly(
"TOP");
80 top->SetMedium(medAir);
81 gGeoMan->SetTopVolume(top);
82 gGeoMan->SetTopVisible(1);
83 gGeoMan->SetVisLevel(7);
86 TGeoVolume* topTof =
new TGeoVolumeAssembly(geoDetectorName);
87 topTof->SetMedium(medAir);
89 TGeoVolume* vDetector =
new TGeoVolumeAssembly(
"tof1Detector");
90 vDetector->SetMedium(medAir);
92 const double DetXsize = 60.;
93 const double DetYsize = 30.;
94 const double DetZsize = 3.0;
96 const float stripGasX = 1., stripGasY = DetYsize, stripGasZ = 0.3;
97 TGeoBBox *sStripGas =
new TGeoBBox(stripGasX / 2., stripGasY / 2., stripGasZ / 2.);
98 sStripGas->SetName(
"StripGas");
99 TGeoVolume *vStripGas =
new TGeoVolume(
"tof1StripActiveGasV", sStripGas, medGas);
100 vStripGas->SetLineColor(kRed);
104 const float detGlassX = DetXsize, detGlassY = DetYsize, detGlassZ = 0.618 / 2.;
105 TGeoBBox *sDetGlass =
new TGeoBBox(detGlassX / 2., detGlassY / 2., detGlassZ / 2.);
106 sDetGlass->SetName(
"DetectorGlass");
107 TGeoVolume *vDetGlass =
new TGeoVolume(
"tof1DetGlassV", sDetGlass, medGlass);
108 vDetGlass->SetLineColor(kYellow);
111 const float detPlateX = DetXsize, detPlateY = DetYsize, detPlateZ = 0.64 / 2.;
112 TGeoBBox *sDetPlate =
new TGeoBBox(detPlateX / 2., detPlateY / 2., detPlateZ / 2.);
113 sDetPlate->SetName(
"DetectorPlate");
114 TGeoVolume *vDetPlate =
new TGeoVolume(
"tof1DetPlateV", sDetPlate, medG10);
115 vDetPlate->SetLineColor(kBlue);
120 const int NStrips = 48;
121 const double StripStep = 1.25;
122 for (
int i = 0;
i < NStrips;
i++)
124 vDetector->AddNode(vStripGas,
i + 1,
new TGeoTranslation(
"", -DetXsize / 2. + StripStep / 2. +
i * StripStep, 0., 0.));
128 vDetector->AddNode(vDetGlass, 1,
new TGeoTranslation(
"", 0., 0., -stripGasZ / 2. - detGlassZ / 2.));
129 vDetector->AddNode(vDetGlass, 2,
new TGeoTranslation(
"", 0., 0., +stripGasZ / 2. + detGlassZ / 2.));
132 vDetector->AddNode(vDetPlate, 1,
new TGeoTranslation(
"", 0., 0., -DetZsize / 2. + detPlateZ / 2.));
133 vDetector->AddNode(vDetPlate, 2,
new TGeoTranslation(
"", 0., 0., +DetZsize / 2. - detPlateZ / 2.));
136 const double tofZgap = 0.86;
137 const double tofYoverlap = 3.0;
139 const double tofXgap = 0.;
141 const double tofZ_1box = 454.8.;
142 const double tofZ_2box = 442.6.;
144 double tofX = tofXgap / 2. + DetXsize / 2.;
145 double tofZshift = tofZgap + DetZsize;
148 topTof->AddNode(vDetector, 1,
new TGeoTranslation(
"t1", +tofX+55.2+27.17, -3.48 + 2 * DetYsize - 2 * tofYoverlap, tofZ_1box + tofZshift));
149 topTof->AddNode(vDetector, 2,
new TGeoTranslation(
"t1", +tofX+55.2+27.17, -3.48 + DetYsize - tofYoverlap, tofZ_1box));
150 topTof->AddNode(vDetector, 3,
new TGeoTranslation(
"t1", +tofX+55.2+27.17, -3.48, tofZ_1box + tofZshift));
151 topTof->AddNode(vDetector, 4,
new TGeoTranslation(
"t1", +tofX+55.2+27.17, -3.48 - DetYsize + tofYoverlap, tofZ_1box));
152 topTof->AddNode(vDetector, 5,
new TGeoTranslation(
"t1", +tofX+55.2+27.17, -3.48 - 2 * DetYsize + 2 * tofYoverlap, tofZ_1box + tofZshift));
155 topTof->AddNode(vDetector, 6,
new TGeoTranslation(
"t1", +tofX+32.96, -3.48 + 2 * DetYsize - 2 * tofYoverlap, tofZ_2box + tofZshift));
156 topTof->AddNode(vDetector, 7,
new TGeoTranslation(
"t1", +tofX+32.96, -3.48 + DetYsize - tofYoverlap, tofZ_2box));
157 topTof->AddNode(vDetector, 8,
new TGeoTranslation(
"t1", +tofX+32.96, -3.48, tofZ_2box + tofZshift));
158 topTof->AddNode(vDetector, 9,
new TGeoTranslation(
"t1", +tofX+32.96, -3.48 - DetYsize + tofYoverlap, tofZ_2box));
159 topTof->AddNode(vDetector, 10,
new TGeoTranslation(
"t1", +tofX+32.96, -3.48 - 2 * DetYsize + 2 * tofYoverlap, tofZ_2box + tofZshift));
167 top->AddNode(topTof, 1,
new TGeoTranslation(
"tw", 0., 0., 0.));
170 top->SetVisContainers(kTRUE);
172 gGeoMan->CloseGeometry();
173 gGeoMan->CheckOverlaps(0.001);
174 gGeoMan->PrintOverlaps();
177 TFile* geoFile =
new TFile(geoFileName,
"RECREATE");
182 gGeoMan->Browse(
new TBrowser);