The LCDD geometry needs to be dumped to plain GDML to be loaded by ROOT.
Before using ROOT, the environment needs to be setup.
No Format |
---|
export ROOTSYS=/my/root/dir
cd $ROOTSYS
. $ROOTSYS/bin/thisroot.sh
|
Assuming that there is a file called test.gdml in the current directory, You can use a script similar to the following to will load a plain GDML file into ROOT.
No Format |
---|
void gdmlTest() { char* testfile="./TGeoManager::Import("test.gdml"; gSystem->Load("libGeom"); gSystem->Load("libGdml"); TGeoManager::Import(testfile); gGeoManager->GetTopVolume()->Draw("ogl"); } |
This command should display the ROOT OpenGL viewer with the geometry from the test.gdml file.
One can customize this by displaying only a particular volume, specified by name, using the following command:
No Format |
---|
gGeoManager->GetVolume("VolumeName")->Draw("ogl");
|
Note that in the gdml file the volume name has a hexadecimal number appended to it. This should be disregarded when specifying the volume name.