Re: [BLAST_ANAWARE] phi and varphi

From: zhangchi (zhangchi@general.lns.mit.edu)
Date: Thu Apr 03 2003 - 12:45:52 EST


Hi I guess I would be most affected by the change of convention since I
have millions of phi angles from SC and NC and the comparison of them to
wire chamber track angles in PID part of the codes.

To make the transition easy, I quickly checked the range of a few
frequently used funtions and I list them here and hope it would be least
bit helpful to others.

atan(): -pi/2 to +pi/2
atan2(): -pi to pi, first variable typically would be tof hit position
        atan2(1,1) = pi/4, atan2(1,-1)= 3*pi/4,
        atan2(-1,1) = -pi/4, atan2(-1,-1) = -3*pi/4
acos(): 0 to pi, acos(+): 0 to pi/2, acos(-): pi/2 to pi
asin(): -pi/2 to pi/2, asin(+): 0 to pi/2, asin(-): -pi/2 to 0

from atan() to varphi: +pi if right sector,
             to phi: +2*pi if atan()<0 & right sector
from atan2() to varphi: +2*pi if right sector, lower than beam height
             to phi: +2*pi if lower than beam height

On Thu, 3 Apr 2003, Douglas Hasell wrote:

> Hi,
>
> I agree with Tancredi. No reason not to have two (or even more)
> variables, phi [0,360) and varphi (-90,270]. People just have to be
> careful to document their code and specify which range they are using.
>
> So I would propose that people who use [0,360) should use the name
> phi as that is the standard definition in all the texts and people using
> (-90,270] change the name to varphi so that the meaning is a bit more clear
> to someone else coming and reading the code.
>
> Cheers,
> Douglas
>
> 26-415 M.I.T. Tel: +1 617 258 7199
> 77 Massachusetts Avenue Fax: +1 617 258 5440
> Cambridge, MA 02139, USA E-mail: hasell@mit.edu
>



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:29 EST