Re: ROOT & GEANT

Rene Brun (Rene.Brun@cern.ch)
Wed, 25 Feb 1998 11:17:49 +0100


Alexander,
See my previous article about Root and Geant.
Concerning the TNode and Clone problem, my answer to roottalk
that you quote below is the technical answer to your question.
One could imagine to implement a special TNode::Clone function,
but the current TObject::Clone cannot be used to achieve what
you want to do. Use the solution that I proposed in the quoted
mail.

Rene Brun

Alexander Zvyagin wrote:
>
> IHEP, Protvino, Russia, 24-FEB-1998
>
> Dear ALL!
>
> Creation of ROOT geometry is simpler than creation of GEANT one. So it may be
> good to change GEANT geometry description to ROOT style.
>
> I managed to write some code
> ( http://gams.ihep.su/~zvyagin/home/ROOT_GEANT/1998-02-24/ROOT_GEANT.c )
> that produces GEANT geometry from TGeometry. It works with very simple
> geometries. But it WORKS. See
> http://gams.ihep.su/~zvyagin/home/ROOT_GEANT/1998-02-24/test/GEANT/
>
> One problem stops me. I do not know how to insert correctly
> in mother TNode several identical son-TNodes. This is GSPOS level of GEANT
> calls. The next code is bad:
>
> TNode *mother=....; // mother node.
> mother->cd();
> TNode *son=...; // pointer to node that we want to insert several times
> son->SetParent(NULL);
> for( int j=0; j<son_nodes_amount; j++ )
> {
> TNode *son_node = (TNode*) son->Clone(); // The problem is here.
> mother->GetListOfNodes->Add(cell_node);
> char name[111];
> sprintf(name,"n%d",j);
> son_node->SetName(name);
> son_node->SetPosition(....);
> son->SetParent(mother);
> }
>
> The problem is in TNode->Clone(). See
> http://root.cern.ch/root/roottalk/roottalk98/0217.html
> The call time of TNode->Clone() depends strongly on geometry.
>
> At present time I don not know how to solve the problem...
>
> I belive that other steps of this work (in automatic creation of GEANT geometry
> from ROOT TGeometry) are simpler.
> Step I. GEANT::GSVOLU does not place volume to mother one.
> but
> ROOT::TNode do it.
> Step II. We need add some new classes or modify the current ones.
> Example: GEANT::GSPOS uses "volume copy number", geant material has
> "radiation length", "absorbtion length".
> See http://gams.ihep.su/~zvyagin/home/ROOT_GEANT/1998-02-24/TNode_G.h
> Step III. Something else...
>
> P.S. I hope that GEANT4 will solve a lot of problems ...