GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » General » Problem storing the geometry to a root file
Re: Problem storing the geometry to a root file [message #4748 is a reply to message #4744] Thu, 26 July 2007 14:33 Go to previous messageGo to previous message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: 141.30.85*
In the source of Tobias' converter I found this structure to save the geometry objects into a root file:

TGeoManager* geom;                                                                                                                                      
TGeoVolume* topNode;                                                                                                                                    
std::map<std::string,TGeoMedium*> MediumMap;   


geom = new TGeoManager("myGeomanager","Production of Root Geometry Objects");                                          
  
TGeoMaterial *matVacuum = new TGeoMaterial("vacuum",0,0,0);                                                                                             
MediumMap["Vacuum"] = new TGeoMedium("vacuum", 1, matVacuum);                                                                                       

topNode = geom->MakeBox("TOP",MediumMap["Vacuum"],1000,1000,1000);
geom->SetTopVolume(topNode);


[.....]
topNode->AddNode(....);
[.....]


geom->CloseGeometry();                    
geom->Export("myGeo.root");   


The main things are, as far as I see, to close the Geo Manager and do the TGeoManager::Export(). Maybe it is enough to store the topNode.... I don't know.

Ralf.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Computing Wiki
Next Topic: Geometry update
Goto Forum:
  


Current Time: Mon Apr 29 05:37:29 CEST 2024

Total time taken to generate the page: 0.01133 seconds