[ROOT] Drawing TGeoNodes

From: Ilektra-atha Christidi (christid@grad.physics.sunysb.edu)
Date: Mon Aug 18 2003 - 22:50:01 MEST


Hello
I'm trying to draw objects from a GEANT3 geometry, which I have 
successfully read into ROOT. I managed to get a pointer to a certain 
volume and then draw it, using (name is a character string variable 
containing the name of the volume I want to draw)

TGeoVolume *volu = gGeoManager->GetListOfVolumes()->FindObject(name);
name->Draw();

but I need to do the same for TGeoNodes, because I want to draw only the 
parts of the detector that saw a hit. The same recipe to get the pointer 
doesn't work, though, (I mean 
TGeoNode *node = gGeoManager->GetListOfNodes()->FindObject(name); 
node->Draw();   )
giving the message

Error: illegal pointer to class object node 0x0 803  FILE:(tmpfile) LINE:1
*** Interpreter error recovered ***

and neither does GetNode(), GetNodes() and FindNode(). The message I get
is

Error: Can't call TObjArray::GetNode("SDSC") in current scope 
FILE:(tmpfile) LINE:1
Possible candidates are...
filename       line:size busy function type and name  (in TObjArray)
filename       line:size busy function type and name  (in TSeqCollection)
filename       line:size busy function type and name  (in TCollection)
filename       line:size busy function type and name  (in TObject)
Error: non class,struct,union object GetListOfNodes() used with . or -> 
FILE:(tmpfile) LINE:1
*** Interpreter error recovered ***

I guess I have to set the node I want to retrieve as current node, but how 
do I do that? Or do I also need to specify the copy number when I call 
TGeoNode functions?

In the next step, when I'll draw the nodes, is it possible to draw only 
the ones that saw a hit but in global coordinates (if the node appears 
always in the middle of the screen, as it happens for volumes, it's not 
very helpful...)? Maybe if I overlay them with a basic drawing of the 
whole detector?

Thanks

						Ilektra Christidi



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET