Hello,
I’m running into an error–I’m working on a ROOT geometry. I have a program that generates a geometry and then a second program that imports the resulting ROOT geometry file and rotates/translates the whole thing (to change the coordinate system). They are both below. I should note that the first program is VERY simplified from what it really is, to make it easier to debug… (So rotating the whole geometry does actually makes sense.)
The first program runs fine (to make the geometry) but when I try to run the second program I get:
Info in <TGDMLWrite::WriteGDMLfile>: Extracting volumes
Info in <TGDMLWrite::CreateCommonBoolN>: ERROR! Left node is NULL - Boolean Shape will be skipped
Info in <TGDMLWrite::ExtractVolumes>: ERROR! bucket volume was not added, because solid is either not supported or corrupted
I suspect the problem may lie in how I create the composite shape (TGeoCompositeShape) in the first program. I use the composite shape to make a TGeoVolume. In my more complicated geometry I get this problem multiple times too, since I make multiple composite shapes. The second program seems to skip adding the bucket volume to the gdml and root files, and when I draw the geometry at the end of the second program all the volumes are shown.
#include <iostream>
using namespace std;
void makeGeom()
{
gSystem->Load("libGeom");
new TGeoManager("world", "the geometry");
////// define LAr material
TGeoElementTable *table = gGeoManager->GetElementTable();
TGeoElement *Ar = table->FindElement("Argon");
TGeoMaterial *LAr = new TGeoMaterial("LAr",Ar, 1.3954);
TGeoMedium *LArMed = new TGeoMedium("LArMed",1, LAr);
// this creates a volume with a material (medium) and dimensions
TGeoTube *bucket_i = new TGeoTube("bucket_i", 0.,30.48,60.96/2.0);
TGeoBBox *cube_cutout = new TGeoBBox("lcco",31.75875/2.0,34.0022/2.0,32.69235/2.0);
TGeoRotation *rCube = new TGeoRotation("rCube",45.0,0.,0.);
rCube->RegisterYourself();
TGeoCompositeShape *sbucket = new TGeoCompositeShape("sbucket","bucket_i-(lcco:rCube)");
TGeoVolume *bucket = new TGeoVolume("bucket",sbucket,LArMed);
TGeoVolume *outerVolume = gGeoManager->MakeBox("outerVolume",LArMed,
1000.,1000.,1000.);
// define top volume
TGeoVolume *top = outerVolume;
top->AddNode(bucket,1);
gGeoManager->SetTopVolume(top);
gGeoManager->CloseGeometry();
gGeoManager->SetTopVisible(); // the TOP is invisible
top->Draw();
gGeoManager->Export("TestGeom.gdml");
gGeoManager->Export("TestGeom.root");
}
Second program:
#include <iostream>
using namespace std;
void rotateGeom()
{
gSystem->Load("libGeom");
TFile *f = TFile::Open("TestGeom.root");
TGeoManager *geo = (TGeoManager*)f->Get("world");
TGeoVolume *SingleCube = geo->GetVolume("outerVolume");
TGeoElementTable *table = gGeoManager->GetElementTable();
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);
double worldx = 2000.;
double worldy = 2000.;
double worldz = 2000.;
TGeoVolume *world = gGeoManager->MakeBox("world",airMed,worldx,worldy,worldz);
TGeoRotation *coord = new TGeoRotation("coord",180.,90.,45.);
TGeoCombiTrans *cSingleCube = new TGeoCombiTrans("cSingleCube",0.,0.,14.60,coord);
// define top volume
TGeoVolume *top = world;
gGeoManager->SetTopVolume(top);
top->AddNode(SingleCube,1,cSingleCube);
gGeoManager->CloseGeometry();
//gGeoManager->SetTopVisible(); // the TOP is invisible
top->Draw();
gGeoManager->Export("testGeomRotated.root");
gGeoManager->Export("testGeomRotated.gdml");
}
I would greatly appreciate help to solve this problem! If you need anything else from me, feel free to ask.
Thank you,
Sam Fogarty
___
_ROOT Version: 6.12/06
_Platform: linux
_Compiler:_ Not Provided
___