pyROOT - viewing geometry

From: Michal Dwuznik <Michal.Dwuznik_at_cern.ch>
Date: Tue, 4 Mar 2008 16:09:17 +0100


Hi ROOTers,

I was probably hit some TGeoMatrix creation error. Attached is a toy geometry file with some bricks, and the following macro works perfectly in "direct ROOT" (showing the geom, aligning the bricks, redrawing,
realigning, redrawing):

{
new TGeoManager();
gGeoManager->Import("lcontainers.root"); TGeoPhysicalNode *physnodes[6];
nentries=gGeoManager->GetListOfPhysicalNodes()->GetEntries(); for (Int_t i=0 ; i<nentries;i++)
{
cout << i << endl;
physnodes[i]=gGeoManager->GetPhysicalNode(i); }
TGeoVolume *top = gGeoManager->GetTopVolume(); top->Draw("ogl");
TGeoRotation *rot = new TGeoRotation();
TGeoCombiTrans *combi[6];
for (Int_t i=0 ; i<nentries;i++)
{
cout << i << endl;
combi[i] = new TGeoCombiTrans(0,500*i, 0, rot); }
for (Int_t i=0 ; i<nentries;i++)
{
physnodes[i].Align(combi[i]);
}
top->Draw("ogl");
}

yet a try to recreate the following using pyROOT fails with segfault:

import ROOT
g = ROOT.TGeoManager()
g = ROOT.gGeoManager.Import("lcontainers.root") rotation=ROOT.TGeoRotation()
corr=[]
vol = g.GetTopVolume()
vol.Draw("ogl")
for i in range(6):

    corr.append(ROOT.TGeoCombiTrans(0,500*i,0,rotation))     g.GetPhysicalNode(i).Align(corr[i])
vol.Draw("ogl")

Invoking Draw() on the top volume after aligning the contents yields: Info in <TGLSceneBase::RemoveViewer>: scene 'unnamed-1' not used - autodestructing.

Could you please check yourselves and/or point me my mistake ?

Regards
Michal

Received on Tue Mar 04 2008 - 16:09:31 CET

This archive was generated by hypermail 2.2.0 : Wed Mar 05 2008 - 17:50:02 CET