{ new TGeoManager("test", "just a simple test"); TGeoVolume *totl = gGeoManager->MakeBox("Totl", 0, 101, 102, 103); TGeoVolume *vol1 = gGeoManager->MakeBox("Box", 0, 20, 30, 40); TGeoVolume *vol2 = gGeoManager->MakeSphere("Sphere", 0, 0, 1); TGeoTranslation *tr_x = new TGeoTranslation("tr_x", 10, 0, 0); TGeoTranslation *tr_y = new TGeoTranslation("tr_y", 0, 10, 0); TGeoTranslation *tr_z = new TGeoTranslation("tr_z", 0, 0, 10); gGeoManager->SetTopVolume(totl); totl->AddNode(vol1, 1, tr_x); vol1->AddNode(vol2, 1, tr_y); gGeoManager->CloseGeometry(); gGeoManager->GetMasterVolume()->Draw(); Double_t *tr1 = totl->GetNode("Box_1")->GetMatrix()->GetTranslation(); cout << "box in totl: " << tr1[0] << ' ' << tr1[1] << ' ' << tr1[2] << endl; Double_t *tr2 = vol1->GetNode("Sphere_1")->GetMatrix()->GetTranslation(); cout << "sphere in box: " << tr2[0] << ' ' << tr2[1] << ' ' << tr2[2] << endl; }