10 Double_t beamlineangle = -TMath::DegToRad()*0.0;
51 gSystem->Load(
"libGeoBase");
52 gSystem->Load(
"libParBase");
53 gSystem->Load(
"libBase");
54 gSystem->Load(
"libPndData");
55 gSystem->Load(
"libPassive");
58 TFile*
fi =
new TFile(outfile,
"RECREATE");
60 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
61 FairGeoInterface *
geoFace = geoLoad->getGeoInterface();
64 geoFace->setMediaFile(
"/home/freez/fairsoft_mar15/pandaroot/geometry/media_pnd.geo");
68 FairGeoMedia *
Media = geoFace->getMedia();
69 FairGeoBuilder *
geobuild=geoLoad->getGeoBuilder();
78 Int_t
nmed=geobuild->createMedium(MediumAir);
79 nmed=geobuild->createMedium(MediumTyvek);
80 nmed=geobuild->createMedium(MediumCarbon);
81 nmed=geobuild->createMedium(MediumLead);
82 nmed=geobuild->createMedium(MediumScint);
83 nmed=geobuild->createMedium(MediumFiber);
85 TGeoManager*
gGeoMan = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
89 TGeoVolume *
top =
new TGeoVolumeAssembly(
"Emc5");
91 gGeoMan->SetTopVolume(top);
99 TGeoShape*
ModuleShape =
new TGeoBBox(name,cellxsize/2.,cellysize/2.,thickness/2.);
100 name =
"FscModuleVolume";
102 TGeoVolume*
ModuleVolume =
new TGeoVolume(name, ModuleShape, gGeoMan->GetMedium(medium));
103 ModuleVolume->SetLineColor(2);
106 name =
"FscTyvekShape";
107 TGeoShape*
TyvekShape =
new TGeoBBox(name,cellxsize/2. - paperbundle,cellysize/2. - paperbundle,thickness/2. - paperbundle);
108 name =
"FscTyvekVolume";
110 TGeoVolume*
TyvekVolume =
new TGeoVolume(name, TyvekShape, gGeoMan->GetMedium(medium));
111 TyvekVolume->SetLineColor(3);
112 ModuleVolume->AddNode(TyvekVolume,0);
115 name =
"FscLayerHolderShape";
116 TGeoShape*
LayerHolderShape =
new TGeoBBox(name, cellxsize/2. - crystalspace, cellysize/2. - crystalspace, cell_thickness/2.);
117 name =
"FscLayerHolderVolume";
127 name =
"FscLeadShape";
128 TGeoShape*
LeadShape =
new TGeoBBox(name, cellxsize/2. - crystalspace, cellysize/2. - crystalspace, Pb_thickness/2.);
129 name =
"FscLeadVolume";
131 TGeoVolume*
LeadVolume =
new TGeoVolume(name, LeadShape, gGeoMan->GetMedium(medium));
132 LeadVolume->SetLineColor(4);
133 iCombTrans =
new TGeoCombiTrans(0,0,-cell_thickness/2.+Pb_thickness/2.,
new TGeoRotation(rot));
134 LayerHolderVolume->AddNode(LeadVolume,0,iCombTrans);
136 name =
"FscSciShape";
137 TGeoShape*
SciShape =
new TGeoBBox(name, cellxsize/2. - crystalspace, cellysize/2. - crystalspace, Sci_thickness/2.);
138 name =
"FscSciVolume";
140 TGeoVolume*
SciVolume =
new TGeoVolume(name, SciShape, gGeoMan->GetMedium(medium));
141 SciVolume->SetLineColor(5);
142 iCombTrans =
new TGeoCombiTrans(0,0,cell_thickness/2.-Sci_thickness/2.,
new TGeoRotation(rot));
143 LayerHolderVolume->AddNode(SciVolume,0,iCombTrans);
151 z = -holder_thickness/2. + 0.5 * cell_thickness *(2.*iz - 1.);
152 iCombTrans =
new TGeoCombiTrans(0,0,z,
new TGeoRotation(rot));
153 name =
"FscLayerHolder";
155 TyvekVolume->AddNode(LayerHolderVolume,iz-1,iCombTrans);
163 name =
"FscFibHoleSHape";
165 TGeoShape*
FiberHoleShape =
new TGeoTube(name, 0., fiber_hole_r, (holder_thickness)/2.);
166 name =
"FscFibHoleVolume";
168 TGeoVolume*
FiberHoleVolume =
new TGeoVolume(name, FiberHoleShape, gGeoMan->GetMedium(medium));
173 x = -Absorb_xsize/2. + (Absorb_xsize/(
Double_t)numfibers)*(ix - 0.5);
174 y = -Absorb_ysize/2. + (Absorb_ysize/(
Double_t)numfibers)*(iy - 0.5);
176 iCombTrans =
new TGeoCombiTrans(x,y,0,
new TGeoRotation(rot));
177 name =
"FscFibHoleVolume";
179 iCombTrans->SetName(name);
180 iCombTrans->RegisterYourself();
183 TyvekVolume->AddNodeOverlap(FiberHoleVolume,iCopy,iCombTrans);
189 name =
"FscFiberShape";
191 TGeoShape*
FiberShape =
new TGeoTube(name, 0., fiber_r, (holder_thickness)/2.);
192 name =
"FscFiberVolume";
194 TGeoVolume*
FiberVolume =
new TGeoVolume(name, FiberShape, gGeoMan->GetMedium(medium));
195 FiberVolume->SetLineColor(5);
196 iCombTrans =
new TGeoCombiTrans(0,0,0,
new TGeoRotation(rot));
197 FiberHoleVolume->AddNode(FiberVolume,0,iCombTrans);
208 x = 0.5 * cellxsize * (2. * ix - numcellsx - 1.);
209 y = 0.5 * cellysize * (2. * iy - numcellsy - 1.);
211 iCombTrans =
new TGeoCombiTrans(x,y,0.,
new TGeoRotation(rot));
212 name =
"FscModuleVolume";
214 CopyCode = 100*ix+iy;
216 iCombTrans->SetName(name);
217 iCombTrans->RegisterYourself();
219 top->AddNode(ModuleVolume,CopyCode,iCombTrans);
226 gGeoMan->CloseGeometry();
FairGeoInterface * geoFace
const Double_t tyvekbundle
const Double_t fiber_hole_r
FairGeoMedium * MediumScint
TGeoShape * LayerHolderShape
TGeoShape * FiberHoleShape
FairGeoMedium * MediumLead
const Double_t Pb_thickness
FairGeoBuilder * geobuild
const Double_t paperbundle
FairGeoMedium * MediumTyvek
FairGeoMedium * MediumCarbon
Double_t holder_thickness
const Double_t Sci_thickness
FairGeoMedium * MediumAir
static T Max(const T &x, const T &y)
const Double_t Air_thickness
TGeoVolume * LayerHolderVolume
const Double_t Absorb_ysize
FairGeoMedium * MediumFiber
TGeoCombiTrans * iCombTrans
const Double_t Absorb_xsize
TGeoVolume * FiberHoleVolume
TGeoVolume * ModuleVolume