Hi!
I want to run the following script:
void box_1e5_h2()
{
gSystem->Load(“libGeom”);
TGeoManager *geom = new TGeoManager(“world”,“IES geometry”);
//— define some materials
TGeoMaterial *matUHV = new TGeoMaterial(“UHV”, 0,0,0);
TGeoMaterial *matSi = new TGeoMaterial(“Si”,26.98,13,2.7);
//— define some media
TGeoMedium *UHV = new TGeoMedium(“UHV”,1, matUHV);
TGeoMedium *Si = new TGeoMedium(“Si”,1, matSi);
//— make the top container volume
TGeoVolume *world = geom->MakeBox(“World”, UHV, 5000., 5000., 5000.);
world->SetVisibility(kFALSE);
geom->SetTopVolume(world);
//make the substrate
TGeoVolume *subs = geom->MakeBox(“substrate”, Si, 5000., 5000., 2500.);
subs->SetVisibility(kYellow);
//assemble the geometry
//world->AddNode(subs, 0, new TGeoTranslation(0, 0, -2500));
TGeoShape *shape = new TGeoBBox(0.5, 0.5, 0.5);
TGeoVolume *vol = new TGeoVolume(“Box”, shape, Si);
for(double i=0; i < 100; i += 1 ) {
for(double j=0; j < 100; j += 1) {
for(double m=0; m<10; m += 1) {
world->AddNode(vol, k++, new TGeoTranslation(i, j, m+0.5));
}
}
}
geom->CloseGeometry();
geom->SetVisLevel(4);
world->Draw(“ogle”);
geom->Export(“box_1e5_h2.root”);
}
But I get still the following error message:
terminate called after throwing an instance of 'std::bad_alloc’
what(): std::bad_alloc
Can anybody help me? It seems there is no enough memory, but there are only
10to5 nodes that need to be added and my PC has 64bit 4GB physicall memory.
How Can I use AddNodeOffset() with positioning volumes in top volume? AddNodeOffset() doesnt have the option for the Volume Positioning. If I use above AddNodeOffset, then I can add 10to6 10to7 Nodes but all of them are not postioned.