TGeoManager and TGeoVolume [message #5963] |
Mon, 25 February 2008 16:21 |
Ralf Kliemt
Messages: 507 Registered: May 2007 Location: GSI, Darmstadt
|
first-grade participant |
From: 141.30.85*
|
|
Hi all,
I have a root geometry file which contains a new design of the MVD. However, it is inside a TGeoManager object in the file. My main problem is that there can be only one TGeoManager in the simulation. This forbids me to load the stored manager from the file and subsequently adding the volumes to the global gGeoManager.
I tried to do a workaround by storing the Volumes in a new root file without the manager:
Toggle Spoiler
{
gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
basiclibs();
gSystem->Load("libGeoBase");
gSystem->Load("libParBase");
gSystem->Load("libBase");
gSystem->Load("libField");
gSystem->Load("libGen");
gSystem->Load("libPassive");
gSystem->Load("libMCStack");
gSystem->Load("libMvd");
gSystem->Load("libGeom.so");
TFile* file = new TFile("../../../geometry/MVD_20a.root");
TGeoManager *geoMan = (TGeoManager*) file->Get("CADtoROOT");
TGeoVolume* topvol = geoMan->GetMasterVolume();
//topvol->Write();
topvol->Export("../../../geometry/MVD_20a_vol.root","TOP","recreate ");
}
Loading this to the simulation does not work and it seems that only the top volume is stored, but not the subsequent ones.
Does have someone (Mohammed? Tobias(currently N/A)?) have experience with this?
I suppose there shall be some intelligent recursive loop over all entries in the file. Is there maybe a possibility to load the volumes directly and bypassing this stored geomanager?
Kind greetings from Dresden, Ralf.
|
|
|