8 const Int_t nsegs =128;
18 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/basiclibs.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(
"../../../pandaroot/geometry/media_pnd.geo");
37 FairGeoMedia *
Media = geoFace->getMedia();
38 FairGeoBuilder *
geobuild=geoLoad->getGeoBuilder();
44 Int_t
nmed=geobuild->createMedium(CbmMediumDIRCair);
45 nmed=geobuild->createMedium(CbmMediumDIRCglass);
46 nmed=geobuild->createMedium(CbmMediumDIRClg);
48 TGeoManager*
gGeoMan = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
51 TGeoVolume *
top = gGeoMan->MakeTube(
"EnDrc",gGeoMan->GetMedium(
"DIRCair"),0,dist_z2+20. ,5.);
52 gGeoMan->SetTopVolume(top);
58 TGeoTrd1 *
dsegShape=
new TGeoTrd1(segName,0.,dist_z2*tan(angle/2),thickness/2,dist_z2/2);
69 if(nsegs%4!=0)
return;
70 for(Int_t
i=0;
i<nsegs/4;
i++){
72 sprintf(rotNamech,
"drot%d",
i);
74 rot=
new TGeoRotation(rotName);
76 rot->RotateY((angle*
i+angle/2)*TMath::RadToDeg());
77 sprintf(rotNamech,
"dtra%d",
i);
79 TVector3 temp(0,0,dist_z2/2);
80 temp.RotateY(angle*
i+angle/2);
81 trans=
new TGeoTranslation(rotNamech,temp.X(),temp.Y(),temp.Z());
82 combi=
new TGeoCombiTrans(*trans,*rot);
83 sprintf(rotNamech,
"dcom%d",
i);
85 combi->SetName(rotName);
86 combi->RegisterYourself();
91 compShape+=
"-hole:thole)";
93 if(
i!=nsegs/4-1)compShape+=
"+";
96 TGeoBBox*
holeShape=
new TGeoBBox(
"hole",ztarget*tan(5*TMath::DegToRad()),thickness,ztarget*tan(10*TMath::DegToRad()));
97 trans=
new TGeoTranslation(
"thole",0,0,0);
98 trans->RegisterYourself();
102 cout<<
"Composite shape "<<compShape<<endl;
103 TGeoCompositeShape* discShape=
new TGeoCompositeShape(
"dshape",compShape);
104 TGeoVolume* disc=
new TGeoVolume(
"disc",discShape,gGeoMan->GetMedium(
"FusedSil"));
106 TGeoRotation* rotCave=
new TGeoRotation(
"drotCave");
107 rotCave->RotateX(90);
108 rotCave->RotateZ(90);
113 top->AddNode(disc,1,
new TGeoCombiTrans(TGeoTranslation(0,0,0),*rotCave));
114 rotCave->ReflectX(kFALSE);
115 top->AddNode(disc,2,
new TGeoCombiTrans(TGeoTranslation(0,0,0),*rotCave));
117 rotCave->RotateZ(-180);
118 top->AddNode(disc,3,
new TGeoCombiTrans(TGeoTranslation(0,0,0),*rotCave));
119 rotCave->ReflectX(kFALSE);
120 top->AddNode(disc,4,
new TGeoCombiTrans(TGeoTranslation(0,0,0),*rotCave));
122 TGeoBBox*
LiFShape=
new TGeoBBox(
"LiFShape",dist_z2*tan(angle/2),thickness/2,LiFThick/2);
124 TGeoBBox*
LGShape=
new TGeoBBox(
"LGShape",dist_z2*tan(angle/2),thickness/2,LiFThick);
127 for(Int_t
i=0;
i<nsegs;
i++){
128 sprintf(rotNamech,
"lrot%d",
i);
130 rot=
new TGeoRotation(rotName);
134 rot->RotateZ((angle*
i+angle/2)*TMath::RadToDeg());
135 TVector3 temp(0,0,dist_z2+LiFThick/2);
136 temp.RotateY(angle*
i+angle/2);
137 temp.RotateX(90*TMath::DegToRad());
138 temp.RotateZ(90*TMath::DegToRad());
139 trans=
new TGeoTranslation(rotNamech,temp.X(),temp.Y(),temp.Z());
140 combi=
new TGeoCombiTrans(*trans,*rot);
141 sprintf(rotNamech,
"lifc%d",
i);
143 combi->SetName(rotName);
144 sprintf(rotNamech,
"lif%d",
i);
147 lif=
new TGeoVolume(rotName,LiFShape,gGeoMan->GetMedium(
"FusedSil"));
148 top->AddNode(lif,
i+1,combi);
150 sprintf(rotNamech,
"lg%d",
i);
152 trans=
new TGeoTranslation(rotNamech,temp.X(),temp.Y(),temp.Z()-
thickness);
153 combi=
new TGeoCombiTrans(*trans,*rot);
155 lg=
new TGeoVolume(rotName,LGShape,gGeoMan->GetMedium(
"FusedSil"));
156 top->AddNode(lg,
i+1,combi);
161 TGeoHMatrix *
global = gGeoMan->GetHMatrix();
162 gGeoMan->GetListOfMatrices()->Remove(global);
165 trans=
new TGeoTranslation(
"EnDrcPos",0,0,ztarget);
168 gGeoMan->CloseGeometry();
FairGeoMedium * CbmMediumDIRCglass
FairGeoInterface * geoFace
FairGeoMedium * CbmMediumDIRCair
FairGeoMedium * CbmMediumDIRClg
FairGeoBuilder * geobuild