1 #include "TGeoManager.h"
6 TString outfileWithoutPath =
"hypGeGeoCOSYBeamDumpTOF_dist";
7 outfileWithoutPath += BeamDumpDist;
8 outfileWithoutPath +=
"cm.root";
9 return outfileWithoutPath;
15 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
18 gSystem->Load(
"libGeoBase");
19 gSystem->Load(
"libParBase");
20 gSystem->Load(
"libBase");
21 gSystem->Load(
"libPndData");
22 gSystem->Load(
"libPassive");
23 gSystem->Load(
"libHypGe");
29 outfile += outfileWithoutPath;
30 TFile*
fi =
new TFile(outfile,
"RECREATE");
32 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
33 FairGeoInterface *
geoFace = geoLoad->getGeoInterface();
34 geoFace->setMediaFile(
"../MiscFiles/moded_media_pnd.geo");
38 FairGeoMedia *
Media = geoFace->getMedia();
39 FairGeoBuilder *
geobuild=geoLoad->getGeoBuilder();
41 FairGeoMedium *mediron = Media->getMedium(
"iron");
42 geobuild->createMedium(mediron);
45 FairGeoMedium *medconcrete = Media->getMedium(
"concrete");
46 geobuild->createMedium(medconcrete);
47 TGeoMedium *Concrete =
gGeoManager->GetMedium(
"concrete");
49 TGeoManager *
geom = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
50 TGeoVolume *
top =
new TGeoVolumeAssembly(
"hpGe");
51 TGeoVolume *Realtop =
new TGeoVolumeAssembly(
"Realtop");
52 TGeoVolume *BeamDumpAssembly =
new TGeoVolumeAssembly(
"BeamDumpAssembly");
54 geom->SetTopVolume(top);
59 TGeoTube *BackTube =
new TGeoTube(
"BackTube",0,100,120);
60 TGeoTube *FrontTube =
new TGeoTube(
"FrontTube",BeamTubeRadius,50,20);
62 TGeoTranslation *FrontTubeTranslation =
new TGeoTranslation(
"FrontTubeTranslation",0,0,-140);
63 FrontTubeTranslation->RegisterYourself();
64 TGeoCompositeShape *BeamDumpIronShape =
new TGeoCompositeShape(
"BeamDumpIronShape",
"BackTube+FrontTube : FrontTubeTranslation");
65 TGeoVolume *BeamDumpIron =
new TGeoVolume(
"BeamDumpIron",BeamDumpIronShape,Iron);
66 BeamDumpIron->SetLineColor(4);
67 BeamDumpIron->SetFillColor(4);
68 BeamDumpAssembly->AddNode(BeamDumpIron,1);
72 TGeoBBox *BeamDumpBox =
new TGeoBBox(
"BeamDumpBox",200,200,200);
73 TGeoTube *BeamTube =
new TGeoTube (
"BeamTube", 0,BeamTubeRadius,30);
74 TGeoTranslation *BeamTubeTranslation =
new TGeoTranslation (
"BeamTubeTranslation",0,0,-190);
75 BeamTubeTranslation->RegisterYourself();
76 TGeoCompositeShape *BeamDumpConcreteShape =
new TGeoCompositeShape(
"BeamDumpConcreteShape",
"BeamDumpBox - BeamDumpIronShape - BeamTube : BeamTubeTranslation");
78 TGeoVolume *BeamDumpConcrete =
new TGeoVolume(
"BeamDumpConcrete", BeamDumpConcreteShape, Concrete);
79 BeamDumpConcrete->SetLineColor(14);
80 BeamDumpConcrete->SetFillColor(14);
81 BeamDumpAssembly->AddNode(BeamDumpConcrete,1);
83 Realtop->AddNode(BeamDumpAssembly,0,
new TGeoTranslation(0,0,200+BeamDumpDist_ext));
84 top->AddNode(Realtop,0);
85 geom->CloseGeometry();
86 cout <<
"# of Nodes: " << Realtop->CountNodes(10,1) << endl;
98 return outfileWithoutPath;
TString hypGeGeoCOSYBeamDumpTOF(Double_t BeamDumpDist_ext)
TString BuildOutputNameBeamDump(Double_t BeamDumpDist)
TGeoManager * gGeoManager
FairGeoBuilder * geobuild
FairGeoInterface * geoFace