Re: [ROOT] TGeoNode & TVirtualMC

From: Andrei Gheata (
Date: Mon Jun 07 2004 - 10:12:24 MEST

Hi Sue,

I will answer to your first question only: TGeoNode is a link between 2 
volumes, having pointers to both. For this reason it is not a re-usable 
object, being "personalized" to the combination. Of course that what you 
require could be implemented, but  it represents a potentially dangerous 
operation and I see no special reason why you need it. Here is the 
current scenario for adding a volume into another:
1. -  make volume A
   - make volume B
  - put B inside A: A->AddNode(B, matrix) which automatically creates a 
TGeoNode pointing to A and B

Your scenario is:
2. - make volume A
   - make volume B
  - make a node representing B: node = new TGeoNode(B, matrix);
  - connect the node with A:
       A->AddNode(node);   // makes the link A->B

This is just an extra complication which would make sense only if you 
are able to use the node inside another volume C:
      C->AddNode(node);  // makes the link C->B
This you cannot do because it destroys the link A->B. The situation is 
much more complex in the case of divisions. For these reasons node 
creation should not be handled by users.


Susan Kasahara wrote:

> Hi roottalk,
> I would like to write a class that inherits from TGeoNode and
> place nodes of this derived class in my constructed geometry
> volumes.  I'm having trouble in that there is no TGeoVolume::AddNode
> method to support adding a preexisting node to a volume, e.g.
> there is no AddNode method of the form:
>  TGeoVolume::AddNode(const TGeoNode* node)
> I'm wondering if  its possible to add support for this.
>    My second request is that I'd like to have the TVirtualMC methods
> which configure the MC:
> virtual void     SetCut(const char* cutName, Double_t cutValue) = 0;
> virtual void     SetProcess(const char* flagName, Int_t flagValue) = 0;
> return a value which indicates a success or failure for the setting
> of the requested flag/cut.  This would allow the caller to take
> appropriate action if there is failure.
> Thanks for your help,
> -Sue

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET