19 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
22 gSystem->Load(
"libGeoBase");
23 gSystem->Load(
"libParBase");
24 gSystem->Load(
"libBase");
25 gSystem->Load(
"libPndData");
26 gSystem->Load(
"libPassive");
29 TFile*
fi =
new TFile(outfile,
"RECREATE");
31 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
32 FairGeoInterface *
geoFace = geoLoad->getGeoInterface();
33 geoFace->setMediaFile(
"../../geometry/media_pnd.geo");
37 FairGeoMedia *
Media = geoFace->getMedia();
38 FairGeoBuilder *
geobuild=geoLoad->getGeoBuilder();
40 FairGeoMedium *CbmMediumSci = Media->getMedium(
"polyvinyltoluene");
43 Int_t
nmed=geobuild->createMedium(CbmMediumSci);
46 TGeoManager*
gGeoMan = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
48 TGeoVolume *
top =
new TGeoVolumeAssembly(
"Ftof");
50 gGeoMan->SetTopVolume(top);
53 TGeoBBox *CentShape[26];
54 TGeoBBox *BeamShape[26];
55 TGeoBBox *VertShape[50];
57 TGeoVolume* CentVol[26];
58 TGeoVolume* BeamVol[26];
59 TGeoVolume* VertVol[50];
64 TGeoVolumeAssembly*
SubunitVol =
new TGeoVolumeAssembly(
"Ftof_strips");
78 for(
int i=0;
i<26;
i++){
79 bx[
i]=-40+kBCentX*((2*
i)+1);
82 for(
int i=0;
i<26;
i++){
86 sprintf (name,
"Centshape%d",
i);
87 sprintf (name1,
"Ftof_Central_Strip%d",
i);
89 CentShape[
i] =
new TGeoBBox(name,kBCentX,kBCentY,kBCentZ);
90 CentVol[
i] =
new TGeoVolume(name1,CentShape[
i],gGeoMan->GetMedium(
"polyvinyltoluene"));
91 if(i<8)TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bx[i],0,0.,
new TGeoRotation ());
92 else if (i>17)TGeoCombiTrans* trc1=
new TGeoCombiTrans(bx[i-5],0,0.,
new TGeoRotation ());
95 trc1->RegisterYourself();
96 SubunitVol->AddNode(CentVol[i],i,trc1);
100 sprintf (namB,
"Beamshape%d",
i);
101 sprintf (namB1,
"Ftof_Beam_Strip%02d",
i);
102 BeamShape[
i] =
new TGeoBBox(namB,kBBeamX,kBBeamY,kBBeamZ);
103 BeamVol[
i] =
new TGeoVolume(namB1,BeamShape[
i],gGeoMan->GetMedium(
"polyvinyltoluene"));
108 (i==8 ? (
offset = -70+kBBeamY) : (
offset = 70-kBBeamY));
109 TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bx[8],
offset,0.,
new TGeoRotation ());
112 trc1->RegisterYourself();
113 SubunitVol->AddNode(BeamVol[i],i,trc1);
118 (i==10 ? (
offset = -70+kBBeamY) : (
offset = 70-kBBeamY));
120 TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bx[9],
offset,0.,
new TGeoRotation ());
123 trc1->RegisterYourself();
124 SubunitVol->AddNode(BeamVol[i],i,trc1);
129 (i==12 ? (
offset = -70+kBBeamY) : (
offset = 70-kBBeamY));
131 TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bx[10],
offset,0.,
new TGeoRotation ());
134 trc1->RegisterYourself();
135 SubunitVol->AddNode(BeamVol[i],i,trc1);
140 (i==14 ? (
offset = -70+kBBeamY) : (
offset = 70-kBBeamY));
142 TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bx[11],
offset,0.,
new TGeoRotation ());
145 trc1->RegisterYourself();
146 SubunitVol->AddNode(BeamVol[i],i,trc1);
151 (i==16 ? (
offset = -70+kBBeamY) : (
offset = 70-kBBeamY));
153 TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bx[12],
offset,0.,
new TGeoRotation ());
156 trc1->RegisterYourself();
157 SubunitVol->AddNode(BeamVol[i],i,trc1);
165 for(
int i=0;
i<24;
i++){
166 bvx[
i]=-280+kBVertX*((2*
i)+1);
169 for(
int i=0;
i<26;
i++){
171 bvx[
i+24]=60+kBVertX*((2*
i)+1);
174 for(
int i=0;
i<50;
i++){
177 sprintf (namV,
"VertShape%d",
i);
178 sprintf (namV1,
"Ftof_Vertical_Strip%d",
i);
180 VertShape[
i] =
new TGeoBBox(namV,kBVertX,kBVertY,kBVertZ);
181 VertVol[
i] =
new TGeoVolume(namV1,VertShape[
i],gGeoMan->GetMedium(
"polyvinyltoluene"));
182 TGeoCombiTrans*
trc1=
new TGeoCombiTrans(bvx[i],0,0.,
new TGeoRotation ());
185 trc1->RegisterYourself();
186 SubunitVol->AddNode(VertVol[i],i,trc1);
190 top->AddNode(SubunitVol,0,
new TGeoCombiTrans(0.,0.,distance,
new TGeoRotation ()));
192 gGeoMan->CloseGeometry();
FairGeoBuilder * geobuild
int create_ftof_rootgeo(Double_t distance=775)
FairGeoInterface * geoFace