Does consequtive Set?Axis() commands overrides the previous one

Hi,
I am trying to use TRotation class member functions to rotate and transform one coordinate system into another. So I need my Z axis to be in parallel to the direction of gamma propagation and Y axis to be perpendicular to the ZX plane. I have initial gamma propagation and a cross product to find Y. I am trying the following,

TVector3 initial_gamma1_dir, intitial_gamma2_dir;
TRotation R1,R2;

initial_gamma1_dir.SetXYZ(0,0,50);
initial_gamma2_dir.SetXYZ(0,0,-50);

A_x_B = initial_gamma1_dir.Cross(initial_gamma2_dir);

R1.SetYAxis(A_x_B); 
R1.SetZAxis(initial_gamma1_dir);
 
R2.SetYAxis(A_x_B); 
R2.SetZAxis(initial_gamma2_dir);

… something like this.

Later I use R1 and R2 to transform the coordinate system.

My question is, does consecutive rotation using Set?Axis() overrides the previous one.

ROOT Version: 6.28/06
Platform: Ubuntu 22.04
Compiler: C++17


Looking at the code (e.g. TRotation::SetYAxis), I would say yes, but I might be wrong… Did you try?

Hello Bellenot,

Yeah, I tried.
The motive is to make the ‘Z’ axis in the direction of gamma and the ‘Y’ axis in the direction of (A_X_B).
I think, rather trying to these steps separately, I should use

R1.SetYAxis(A_x_B,initial_gamma1_dir);

This will make the direction of Y axis perpendicular to the gamma propagation and the gamma propagation direction will also be in YZ plane. Is it correct?

Well, sorry but I don’t know. I think it will be easier for you to try out and see if it gives what you expect…