mvd_v20g_tr.geo.info 756 Bytes
Newer Older
Eoin Clerkin's avatar
Eoin Clerkin committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
TFile* ofile
TFile* nfile
ofile = TFile::Open("mvd_v20c_tr.geo.root")
nfile = TFile::Open("mvd_v20g_tr.geo.root","RECREATE")
TGeoVolume* top = (TGeoVolume *) ofile->Get("Top")
TGeoNode* node = top->GetNode("MVDscripted_1")
TGeoNodeMatrix* nm
TGeoVolume* ntop
ntop = new TGeoVolume("Top", top->GetShape(), top->GetMedium())
int id=0
nm = (TGeoNodeMatrix *) node->GetDaughter(1)
ntop->AddNode(nm->GetVolume(),id++,nm->GetMatrix())
nm = (TGeoNodeMatrix *) node->GetDaughter(2)
ntop->AddNode(nm->GetVolume(),id++,nm->GetMatrix())
nm = (TGeoNodeMatrix *) node->GetDaughter(3)
ntop->AddNode(nm->GetVolume(),id++,nm->GetMatrix())
ntop->GetNodes()->Print()
ntop->GetName()
ntop->GetMedium()->Print()
ntop->SetAsTopVolume()
nfile->WriteTObject(ntop)
nfile->Close()