Track reflection in TGeoVolumes using TGeoNavigator

Hello,

I would like to perform a track reflection using TGeoNavigator engine.
I have tried it by hand, computing the new direction using information from gGeoManager->FindNormal(), but I got wrong normal vectors most of the time.
Can you please tell me the best way to proceed, if it is possible?

thanks in advance,
Luciano

Hi,
Please use FindNormalFast() as FindNormal() is obsolete. I will make it point to FindNormalFast()

Regards,

Yes, I am using FindNormalFast().
It seems the problem is the normal computation on the TGeoSubtraction class.
I am sending my macro.
As you can see, some times the normal computation for the cone part is wrong.
I am using last root version in svn (5.29).

Any idea?
Luciano
teste7.C (11.8 KB)

1 Like

Hi,
I have played a bit with your macro, exaggerating a bit the cones and shooting a parallel beam instead of a single ray (to see better the normals on the desired hit point. I’ve also fixed some algorithmic problem when tracking after reflections. I see no problem with the normal vector computation. I attached the new version of your test macro.

Cheers,
Andrei
teste8.C (10.3 KB)

1 Like

Hi,

I have found some normal computation problems in the macro you sent to me.
I just commented the line 247 (pl->Draw()) in order to see only the normal green lines.
Take a look on the picture attached.

cheers,
Luciano


Interesting, just compiling the macro makes the error disappear. Try to run the attached macro both with:
.x teste7.C
and:
.L teste7.C+
teste7()

Weird enough, no time to investigate why. Normals are good. Another good test using normals is Raytrace() if the interesting surface is visible. Try it independently for your volumes.

Cheers, Andrei
teste7.C (10.7 KB)

Still having problems.
I am sending latest version.
The goal is to propagating the photon until find a PMT.
Maybe now I am using a wrong sequence of commands.

Luciano
Reflexao.C (17.5 KB)

But that is what happens…


Yes, I know.
It works most of the time, but some time it fails.