TGeoVolume and Voxelizing problem

Dear,

I am trying to build a geometry using the TGeoManager.

I have an error message at the CloseGeometry() stage :

[code]List of materials :
Fixing runtime shapes…
— nothing to fix
Counting nodes…
Voxelizing…

*** Break *** segmentation violation
Generating stack trace…
0x40b4fdbe in TGeoVolume::SortNodes() + 0x1e from /data/cern/root/lib/libGeom.so
0x40b14703 in TGeoManager::Voxelize(char const*) + 0x6d from /data/cern/root/lib/libGeom.so
0x40b0d790 in TGeoManager::CloseGeometry(char const*) + 0x374 from /data/cern/root/lib/libGeom.so
0x0804bf73 in main + 0x29b from src/gmsminimizator
0x42015574 in __libc_start_main + 0xe4 from /lib/tls/libc.so.6
0x0804bc49 in operator new(unsigned) + 0x31 from src/gmsminimizator
Abandon (core dumped)
[/code]

Does anyone saw this error message before ?

Thank you for your help

Raphael

Could you
-indicate which version of ROOT?
-send the shortest possible script reproducing the problem?

Your problem will be processed by Andrei when he comes back at the end of July.

Rene

Dear,

I am running root 4.01/04 under RedHat 9.0

I am using the TGeo classes in a project where I am doing some geometry monitoring of a detector.

Let say I have two classes one name “Plan” and the other name “Box”.
The box
Both object have pointers to a TGeoVolume, a TGeoRotation and a TGeoCombiTrans.

Here is a part of the file Plan.h

TGeoVolume *fVolume; TGeoCombiTrans *fVolCombiTrans; TGeoRotation *fVolRotation;

[code]int main(int argc, char *argv[])
{
TApplication theApp(“App”, &argc, argv);
TCanvas *Canvas = new TCanvas(“c1”,“c1”);
Canvas->cd();

//--- Definition of a simple geometry
geom = new TGeoManager("GMS", "GMS Geometry");

//---> create some materials
mat = new TGeoMaterial("Vacuum",0,0,0);
mat->SetUniqueID(0);
mat = new TGeoMaterial("Al", 26.98,13,2.7);
mat->SetUniqueID(1);

//---> create mediums
med0 = new TGeoMedium("Vacuum",0,0,0,0,0,20,0.1000000E+11,0.212,0.1000000E-02,1.150551);
med1 = new TGeoMedium("Al",1,1,0,0,0,20,0.1000000E+11,0.212,0.1000000E-02,1.150551);

TOP = geom->MakeBox(“TOP”, med0, 20000, 20000, 2000);
geom->SetTopVolume(TOP);
TOP->SetVisibility(kFALSE);
// TGeoVolume *bar1 = geom->MakeBox(“bar1”, med1, 5., 25, 5.);
// bar1->SetLineColor(2);
// TOP->AddNode(bar1, 1, new TGeoTranslation(20., 0, 0.));

cout << "Hello, world!" << endl;
Spectro *SimulatedSpectrometer = new Spectro("data/Chambers.db","data/Lignes.db");

 //--- close the geometry

cout<<“Before closeGeometry”<<endl;
geom->CloseGeometry();

cout<<“After closeGeometry”<<endl;
geom->SetVisLevel(5);

TOP->Draw();
theApp.Run();

delete SimulatedSpectrometer;
delete med1;
delete med0;
delete mat;
delete geom;
[/code]

Dear,

I am running root 4.01/04 under RedHat 9.0

I am using the TGeo classes in a project where I am doing some geometry monitoring of a detector.

Let say I have two classes one name “Plan” and the other name “Box”.
The boxes are objects which are fixed on the Plan.

Both object have pointers to a TGeoVolume, a TGeoRotation and a TGeoCombiTrans.

Here is a part of the file Plan.h

public:
TGeoVolume *fVolume;
TGeoCombiTrans *fVolCombiTrans;
TGeoRotation *fVolRotation;[/code]


This is the main program:
[code]

#include <TROOT.h>
#include <TCanvas.h>
#include <TApplication.h>
#include <TGeoManager.h>
#include <TGeoVolume.h>
#include <TGeoMatrix.h>

TGeoManager *geom;
TGeoMaterial *mat;

TGeoMedium *med0 ;
TGeoMedium *med1 ;
TGeoVolume *TOP ;

int main(int argc, char *argv[])
{
TApplication theApp("App", &argc, argv);
TCanvas *Canvas = new TCanvas("c1","c1");
Canvas->cd();

//--- Definition of a simple geometry
geom = new TGeoManager("GMS", "GMS Geometry");

//---> create some materials
mat = new TGeoMaterial("Vacuum",0,0,0);
mat->SetUniqueID(0);
mat = new TGeoMaterial("Al", 26.98,13,2.7);
mat->SetUniqueID(1);

//---> create mediums
med0 = new TGeoMedium("Vacuum",0,0,0,0,0,20,0.1000000E+11,0.212,0.1000000E-02,1.150551);
med1 = new TGeoMedium("Al",1,1,0,0,0,20,0.1000000E+11,0.212,0.1000000E-02,1.150551);
   	
//Create Top volume
TOP = geom->MakeBox("TOP", med0, 20000, 20000, 2000);
geom->SetTopVolume(TOP);
TOP->SetVisibility(kFALSE);

Plan *plan= new Plan();
Box *box = new Box(plan);
  
//--- close the geometry
geom->CloseGeometry();

TOP->Draw();
theApp.Run();
   
delete plan;
delete med1;
delete med0;
delete mat;
delete geom;
 }
[/code]


Here is part of the constructeur of "Plan":

 [code] Plan::Plan()
  {
 	sprintf(fName,"Chamber_%d",fID);
	char Name[30], RotName[30];
	sprintf(RotName,"Rot_%s",fName);
	
	fVolRotation = new TGeoRotation(RotName, ang_th[0]*RadToDeg, ang_th[1]*RadToDeg, ang_th[2]*RadToDeg);
	fVolCombiTrans = new TGeoCombiTrans(pos_th[0]*100.,pos_th[1]*100.,pos_th[2]*100., fVolRotation);

	fVolume = geom->MakeBox(fName, med1, Size[0]/2.*100., Size[1]/2.*100., Size[2]/2.*100.);
  	fVolume->SetLineColor(kBlue);
	
  	TOP->AddNode(fVolume, 1, fVolCombiTrans);

  }

And here part of the constructeur of box:

[code]Box::Box(Plan* Ch){

sprintf(fName,"Box_%d_%d_%d",fChID,fPlatformID,fLocationID);

char RotName[30];
sprintf(RotName,"Rot_%s",fName);

fVolume = geom->MakeBox(fName,med1, fVolSize[0]/2.*100., fVolSize[1]/2.*100., fVolSize[2]/2.*100.);

fVolRotation = new TGeoRotation(RotName, fAngles[0]*RadToDeg, fAngles[1]*RadToDeg, fAngles[2]*RadToDeg);
fVolCombiTrans = new TGeoCombiTrans(centre[0]*100.,centre[1]*100.,centre[2]*100.
					, fVolRotation);
(Ch->fVolume)->AddNode(fVolume, 1,  fVolCombiTrans);

}[/code]

I thank you in advance for your help,

Raphael

We need the shortest possible RUNNING script reproducing the problem.

Rene