TGeoRotation Tilt

Hello,

I am quite new to ROOT. I want to add a tilt of 0.2 degrees about the y axis for a composite shape that acts as a mirror. The composite shape is of a TGeoSphere and TGeoBBox. Can I do this through TGeoRotation? If so, how would I do this since TGeoRotation is about Z, X and Z? Or is there any way I can use TGeoTranslation to perform the tilt?

Thanks,
Parshad

Welcome to the ROOT Forum! I think @agheata can give you more details, but did you look at the TGeoRotation class reference?

root [1] TGeoRotation rot;
root [2] rot.RotateY(0.2);
root [3] rot.Print();
matrix  - tr=0  rot=1  refl=0  scl=0 shr=0 reg=0 own=0
  0.999994    0.000000    0.003491    Tx =   0.000000
  0.000000    1.000000    0.000000    Ty =   0.000000
 -0.003491    0.000000    0.999994    Tz =   0.000000
2 Likes

Hi @agheata,

Thank you for reaching back. I am applying my rotation to the mirrors like this but I get an invalid pointer error.

Best,
Parshad

TGeoRotation *rot1 = new TGeoRotation(); // in your case a dangling pointer
rot1->RotateX(0.2);
...
TGeoCombiTrans *combi = nullptr; // make sure it stays null if you don't catch the case
...
1 Like

Thank you so much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.