Warning in <TGeoChecker::CheckOverlaps>

Hello,

I’m currently working on importing the volumes from one geometry into a geometry that I’m creating in a ROOT script. I’m encountering a warning and I’m not sure if it is a concern or not. I get

Info in <TGeoNodeMatrix::CheckOverlaps>: Checking overlaps for world and daughters within 0.001
Warning in <TGeoChecker::CheckOverlaps>: Volume outerAirVolume with 2 daughters but not voxelized
Warning in <TGeoChecker::CheckOverlaps>: Volume lab with 6 daughters but not voxelized
Warning in <TGeoChecker::CheckOverlaps>: Volume GArCylinder with 3 daughters but not voxelized

Is this an error I should be concerned about? Or can I get away with ignoring it? I’m not too familiar with voxelization in ROOT, so I’m not sure if it is important or not. At first glance, it doesn’t seem like it introduces any problems. Though problems could very well show up later if these warnings are important. Let me know if you need more details or the code I’m using.

Thanks for the help.


ROOT Version: 6.12/06
Platform: Linux
Compiler: Not Provided


This shows that either CloseGeometry was not called or that you appended part of a geometry to an already closed one. This is bad not only for performance in navigation, but also for consistency of the geometry (some structures are finalized by CloseGeometry). So you should read in the volumes before you close the geometry and not after.

2 Likes

Hi @agheata. Thanks for the response. I believe that I am reading in the volumes before I do CloseGeometry. I think that I’m not appending a part of a geometry to an already closed one, but I could be wrong. Below I have the code I use, let me know if you spot something incorrect:
First I save the volumes to a ROOT file:

TGeoManager *geo = new TGeoManager("geo","test");
geo->Import("SingleCube.gdml");

TFile::Open("SingleCubeVols.root", "RECREATE");

TGeoVolume *volume = NULL;
TObjArray *volumes = geo->GetListOfVolumes();
Int_t nvolumes = volumes->GetEntries();
for ( int i = 0; i < nvolumes; i++ )
  {
    volume = (TGeoVolume*)volumes->At(i);
    volume->Write();
  }

Then I load in these volumes in a separate session, when I’m creating a new geometry:

 gSystem->Load("libGeom");
 TGeoManager *geo = new TGeoManager("geo","SC");
 TFile *f = TFile::Open("SingleCubeVols.root");
 TGeoVolume *LArCube = (TGeoVolume*)f->Get("volSingleCube");
 geo->AddVolume(LArCube);

 // make a material and medium
 TGeoMixture *air = new TGeoMixture("air", 2, 1.29);
 TGeoElement *N = table->FindElement("N");
 TGeoElement *O = table->FindElement("O");
 air->AddElement(N, 0.7);
 air->AddElement(O, 0.3);
 TGeoMedium *airMed = new TGeoMedium("airMed", 1, air);

 ///// make some more volumes which I won't show

 TGeoVolume *world = gGeoManager->MakeBox("world",airMed, 100.,100.,100.);
 world->AddNode(LArCube,1);
 gGeoManager->SetTopVolume(world);
 geo->CloseGeometry();
 world->Draw();
 double precision = 0.001;
 gGeoManager->CheckOverlaps(precision, "d");
 gGeoManager->Export("SingleCubeComplete.gdml");

Can you spot problems?

Thanks,
Sam

Additional question: In the first script, do I need to save the materials/mediums to file (and load them in the second script), like I do the volumes? Or are those naturally carried over when writing the volumes to file?

Hi,
I don’t know how the first part saving some volumes even works. TGeoManager::Import is a static method that deletes the gGeoManager pointer (your geo pointer) and creates a new geometry manager, so geo->GetListOfVolumes() should be already invalid. You should use directly:
TGeoManager *geo = TGeoManager::Import("SingleCube.gdml");
Writing down a volume writes also its medium/material, but to read everything back correctly and register the shapes/matrices/material/… to the new TGeoManager, you need to use either TGeoVolume::Import method, or read as you do but call: LArCube->RegisterYourself() which does the registration properly, rather than geo->AddVolume(LArCube). Then you do not need to redefine materials and media, you can search them in the manager.
You can iterate the list of volumes of a manager and check: volume->GetVoxels() to understand which ones are not voxelized. Voxelizing manually is also possible: volume->Voxelize("ALL"); but I would first try to understand why those are not voxelized in the first place. Maybe it is just because you do not call RegisterYourself().

The combination of

TGeoManager *geo = TGeoManager::Import("SingleCube.gdml");

and

LArCube->RegisterYourself()

in their respective sessions seemed to have worked. I’m not getting any voxelization problems and no other problems. And successfully runs through the software I’m using. I’m cautiously optimistic but I think that fixed all my problems (for now). Thanks @agheata .

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.