TGeoCombiTrans transformation not found!

I’ve recently begun “playing” with ROOT’s geometry capabilities. My goal is to create a region that models the intersection of 4 gaussian laser beams (can be modeled as hyperboloids). For this purpose I saw from the user’s manual one normally uses a composite shape. For this purpose I will provide the following code snippet (I have omitted the other combitrans objects because their declaration is very similar and I get an error with the very first one).

TGeoRotation *rot1 = new TGeoRotation( "rot1", 90. , 90. , 180. , 0. , 90. , 0. );
TGeoCombiTrans *combi1 = new TGeoCombiTrans( "combi1" , 5 , 0 , -1. , rot1 );
TGeoHype *beam = new TGeoHype( "beam" , 0 , 0 , w0 , angle , w0pos );
TGeoCompositeShape *4beams = new TGeoCompositeShape( "4beams" , "beam:combi1 + beam:combi2 + beam:combi3 + beam:combi4" );
TGeoVolume *molasses = new TGeoVolume( "molasses" , 4beams );

When running this I’m getting the following error:

I don’t understand what I’m doing wrong! and what is that nonsense about not finding the combi1 transformation! Help is greatly appreciated

EDIT: I decided to try without using the transformation combination object (see code below).

TGeoCompositeShape *4beams = new TGeoCompositeShape( "4beams" , "( beam : rot1 ) : tr1 + ( beam : rot2 ) : tr2 + ( beam : rot3 ) : tr3 + ( beam : rot4 ) : tr4" );

Unfortunately I got similar errors:

HELP!!!

Hi,

By default any transformation matrix is owned by the user and the geometry manager does not know about it. You have to call: matrix->RegisterYourself()

Note that you can also build-up a composite shape using the contructor with TGeoBoolNode. In this case your matrices do not need to be named as you provide pointers.

Cheers,

1 Like

Hello, sorry for the necroposting.
I just found myself in a similar issue in a similar scenario with same error:

Error in <TGeoBoolNode::MakeBranch>: transformation t1 not found

That reconduced me to the reference of TGeoCombiTrans, where the example provided is actually not working because matrices are not registered with matrix->RegisterYourself().
I just wanted to shout out to this old answer that fixed both bug in the reference and my issue.