[Gate-users] FLIP in Bin_GATE.c

Mohamed Mohamed melkatib1 at gmail.com
Sun Jun 14 20:18:44 CEST 2020


Dear Gate users,

I need help about some lines in the Bin_GATE.c program if someone
understands what the following lines do?

if (u%2 == 0)
         {
            zi = (N_DET/2 - (crystal1 - crystal2) - 1)/2;
            if (zi >= N_DET/4) zi = zi - N_DET/2 + 1;
            if (zi <= -N_DET/4) zi = zi + N_DET/2 - 1;
         }
         else
         {
            zi = (N_DET/2 - (crystal1 - crystal2))/2;
            if (zi >= N_DET/4) zi = zi - N_DET/2;
            if (zi <= -N_DET/4) zi = zi + N_DET/2;
         }

         c1 = crystal1 + zi;
         c2 = crystal2 - zi;
         if (c1 >= N_DET)  c1 = c1 - N_DET;
         if (c1 < 0)       c1 = c1 + N_DET;
         if (c2 >= N_DET)  c2 = c2 - N_DET;
         if (c2 < 0)       c2 = c2 + N_DET;

         // Flip
         if (c1 < c2) ring1 = (ring1+ring2) - (ring2=ring1);

Thank you in advance for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengatecollaboration.org/pipermail/gate-users/attachments/20200614/411ecc8b/attachment.html>


More information about the Gate-users mailing list