1 #include "TGeoManager.h"
7 TString outfileWithoutPath =
"hypGeGeoCOSYSiPm.root";
8 return outfileWithoutPath;
14 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
17 gSystem->Load(
"libGeoBase");
18 gSystem->Load(
"libParBase");
19 gSystem->Load(
"libBase");
20 gSystem->Load(
"libPndData");
21 gSystem->Load(
"libPassive");
22 gSystem->Load(
"libHypGe");
26 outfile += outfileWithoutPath;
28 cout << outfile << endl;
30 TFile*
fi =
new TFile(outfile,
"RECREATE");
32 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
33 FairGeoInterface *
geoFace = geoLoad->getGeoInterface();
34 geoFace->setMediaFile(
"../../../../geometry/media_pnd.geo");
38 FairGeoMedia *
Media = geoFace->getMedia();
39 FairGeoBuilder *
geobuild=geoLoad->getGeoBuilder();
41 FairGeoMedium *
medSilicon = Media->getMedium(
"HYPsilicon");
42 Int_t nmedcap=geobuild->createMedium(medSilicon);
44 TGeoMedium *Silicon =
gGeoManager->GetMedium(
"HYPsilicon");
46 TGeoManager *
geom = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
47 TGeoVolume *
top =
new TGeoVolumeAssembly(
"hpGe");
48 TGeoVolume *Realtop =
new TGeoVolumeAssembly(
"Realtop");
50 geom->SetTopVolume(top);
52 TGeoVolume* SiPm = geom->MakeBox(
"CrystalSiPm_1",Silicon,0.15,0.15,0.005);
53 SiPm->SetLineColor(kYellow);
54 SiPm->SetFillColor(kYellow);
55 TGeoRotation *SiPmRot =
new TGeoRotation(
"SiPmRot",0,0,0);
56 Realtop->AddNode(SiPm,20000,
new TGeoCombiTrans(60,0,10,SiPmRot));
58 TGeoVolume* SiPm2 = geom->MakeBox(
"CrystalSiPm_2",Silicon,0.15,0.15,0.005);
59 SiPm2->SetLineColor(kYellow);
60 SiPm2->SetFillColor(kYellow);
61 Realtop->AddNode(SiPm2,20001,
new TGeoCombiTrans(-25,0,20,SiPmRot));
64 top->AddNode(Realtop,0);
65 geom->CloseGeometry();
66 cout <<
"# of Nodes: " << Realtop->CountNodes(10,1) << endl;
78 return outfileWithoutPath;
TString hypGeGeoCOSYSiPm(Double_t Angle=0)
TString BuildOutputNameSiPm()
TGeoManager * gGeoManager
FairGeoBuilder * geobuild
FairGeoInterface * geoFace