8 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/basiclibs.C");
11 gSystem->Load(
"libGeoBase");
12 gSystem->Load(
"libParBase");
13 gSystem->Load(
"libBase");
14 gSystem->Load(
"libPassive");
16 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
17 FairGeoInterface*
geoFace = geoLoad->getGeoInterface();
18 geoFace->setMediaFile(
"../../geometry/media_pnd.geo");
23 FairGeoBuilder*
geoBuild = geoLoad->getGeoBuilder();
91 geoBuild->createMedium(FairMediumAir);
92 geoBuild->createMedium(FairMediumVacuum);
93 geoBuild->createMedium(FairMediumFusedSil);
94 geoBuild->createMedium(FairMediumDIRCAir);
95 geoBuild->createMedium(FairMediumMirror);
97 TGeoManager*
gGeoManager = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
99 cout<<
"-I- overall top"<<endl;
102 TGeoBBox* lTop =
new TGeoBBox(200,200,200);
103 vTop =
new TGeoVolume(
"top", lTop, gGeoManager->GetMedium(
"air"));
104 gGeoManager->SetTopVolume(vTop);
107 cout<<
"-I- calculating local mother"<<endl;
113 TGeoPgon* lLocalMother =
new TGeoPgon(fPhi, 360., fEdges, 2);
115 lLocalMother->DefineSection(0, -fCoatThickness,
116 fWindowHeightHalf - fAbsorberThickness - fCoatThickness,
117 fDiskRMax + fMirrorHeight + fMcpHeight);
118 lLocalMother->DefineSection(1, fDiskThickness + fCoatThickness,
119 fWindowHeightHalf - fAbsorberThickness - fCoatThickness,
120 fDiskRMax + fMirrorHeight + fMcpHeight);
121 vLocalMother =
new TGeoVolume(
"mother", lLocalMother, gGeoManager->GetMedium(
"DIRCair"));
122 vTop->AddNode(vLocalMother, 0,
new TGeoCombiTrans(0, 0, fDiskDistanceZ,
new TGeoRotation(0)));
124 cout<<
"-I- calculating radiator disk"<<endl;
129 TGeoPgon* lDiskGlass =
new TGeoPgon(
"DG",fPhi,360.,fEdges, 2);
130 lDiskGlass->DefineSection(0, 0.,fDiskRMin,fDiskRMax);
131 lDiskGlass->DefineSection(1,fDiskThickness,fDiskRMin,fDiskRMax);
135 TGeoBBox* lDiskWindow =
new TGeoBBox(
"DW",fWindowWidthHalf,fWindowHeightHalf,fDiskThickness);
137 TGeoEltu* lDiskWindow =
new TGeoEltu(
"DW",fWindowWidthHalf,fWindowHeightHalf,fDiskThickness);
140 TGeoTranslation*
trDW =
new TGeoTranslation(
"trDW",0., 0., fDiskThickness/2.);
141 trDW->RegisterYourself();
142 TGeoCompositeShape*
lDisk =
new TGeoCompositeShape(
"DG - DW:trDW");
143 TGeoVolume*
vDisk =
new TGeoVolume(
"radiator", lDisk, gGeoManager->GetMedium(
"FusedSil"));
144 vDisk->SetLineColor(colYellow);
146 vLocalMother->AddNode(vDisk,0,
new TGeoCombiTrans(0., 0., 0.,
new TGeoRotation(0)));
150 cout<<
"-I- calculating absorber"<<endl;
155 TGeoBBox* lAbsorberOuter =
new TGeoBBox(
"AO",fWindowWidthHalf,fWindowHeightHalf,fDiskThickness/2.);
156 TGeoBBox* lAbsorberInner =
new TGeoBBox(
"AI",fWindowWidthHalf-fAbsorberThickness,
157 fWindowHeightHalf-fAbsorberThickness,fDiskThickness);
159 TGeoEltu* lAbsorberOuter =
new TGeoEltu(
"AO",fWindowWidthHalf,fWindowHeightHalf,fDiskThickness/2.);
160 TGeoEltu* lAbsorberInner =
new TGeoEltu(
"AI",fWindowWidthHalf-fAbsorberThickness,
161 fWindowHeightHalf-fAbsorberThickness,fDiskThickness);
163 TGeoCompositeShape* lAbsorber =
new TGeoCompositeShape(
"AO - AI");
164 TGeoVolume* vAbsorber =
new TGeoVolume(
"absorber", lAbsorber, gGeoManager->GetMedium(
"vacuum"));
165 vAbsorber->SetLineColor(colBlack);
167 vLocalMother->AddNode(vAbsorber,0,
new TGeoCombiTrans(0., 0.,fDiskThickness/2.,
new TGeoRotation(0)));
171 cout<<
"-I- calculating detectors (mother for mirror/mcp)"<<endl;
178 lDetector[
i] =
new TGeoBBox(fDetectorWidth/2., fDetectorHeight/2., fDiskThickness/2.);
179 name=
"detector"; name+=(
i);
180 vDetector[
i] =
new TGeoVolume(name.Data(),lDetector[
i],gGeoManager->GetMedium(
"DIRCair"));
181 vDetector[
i]->SetLineColor(fDetectorColor[
i]);
184 cout<<
"-I- calculating mirrors"<<endl;
190 lMirror[
i] =
new TGeoBBox(fDetectorWidth/2., fMirrorHeight/2., fDiskThickness/2.);
191 name=
"mirror"; name+=(
i);
193 vMirror[
i] =
new TGeoVolume(name.Data(),lMirror[
i],gGeoManager->GetMedium(medium.Data()));
194 vMirror[
i]->SetLineColor(fMirrorColor[
i]);
195 vDetector[
i]->AddNode(vMirror[i],0,
196 new TGeoCombiTrans(0.,-fDetectorHeight/2.+fMirrorHeight/2.,0.,
197 new TGeoRotation(0)));
201 cout<<
"-I- calculating mcps"<<endl;
203 TGeoBBox* lMcp =
new TGeoBBox(fDetectorWidth/2.,fMcpHeight/2.,fDiskThickness/2.);
206 name=
"mcp"; name+=(
i);
207 vMcp[
i] =
new TGeoVolume(name.Data(),lMcp,gGeoManager->GetMedium(
"FusedSil"));
208 vMcp[
i]->SetLineColor(colGray);
209 vDetector[
i]->AddNode(vMcp[i],0,
210 new TGeoCombiTrans(0.,-fDetectorHeight/2.+fMirrorHeight+fMcpHeight/2.,0.,
211 new TGeoRotation(0)));
214 cout<<
"-I- placing detectors"<<endl;
215 edgeStartPos.SetXYZ(fEdgeWidthHalf-fDetectorWidth/2.,fDiskRMax+fDetectorHeight/2.,fDiskThickness/2.);
216 for (Int_t iEdge=0; iEdge<
fEdges; iEdge++) {
220 corner.RotateZ(iEdge*fAlphaRad);
222 rotation.RotateZ(iEdge*fAlpha);
223 vLocalMother->AddNode(vDetector[(fDetectorsPerEdge*iEdge+iDet)%fDetectorTypes],
224 fDetectorsPerEdge*iEdge + iDet,
225 new TGeoCombiTrans(corner.X(),corner.Y(),corner.Z(),
226 new TGeoRotation(rotation)));
235 gGeoManager->CloseGeometry();
238 TFile*
fi =
new TFile(fGeoFile,
"RECREATE");
243 cout <<
"Done." << endl;
FairGeoMedium * FairMediumVacuum
Double_t const fMcpHeight
Double_t const fDiskDistanceZ
Double_t const fDetectorWidth
TGeoCompositeShape * lDisk
Double_t const fCoatThickness
Int_t const fDetectorsPerEdge
TGeoManager * gGeoManager
Double_t const fDiskThickness
Double_t const fEdgeWidth
Bool_t const fWindowIsBox
Double_t const fAbsorberThickness
FairGeoMedium * FairMediumAir
Int_t const fDetectorTypes
FairGeoMedium * FairMediumMirror
Double_t const fWindowHeightHalf
FairGeoMedium * FairMediumFusedSil
Double_t const fEdgeWidthHalf
Int_t const fMirrorColor[fDetectorTypes]
FairGeoInterface * geoFace
Double_t const fWindowWidthHalf
Double_t const fDetectorHeight
Int_t const fDetectorColor[fDetectorTypes]
Double_t const fMirrorHeight
TGeoRotation nullRotation
Bool_t const fAbsorberUse
FairGeoBuilder * geoBuild
FairGeoMedium * FairMediumDIRCAir