22.05.2014 Views

CERN Program Library Long Writeup W5013 - CERNLIB ...

CERN Program Library Long Writeup W5013 - CERNLIB ...

CERN Program Library Long Writeup W5013 - CERNLIB ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CALL GFANG<br />

(P,COSTH*,SINTH*,COSPH*,SINPH*,ROTATE*)<br />

P(3)<br />

COSTH<br />

SINTH<br />

COSPH<br />

SINPH<br />

ROTATE<br />

(REAL) input direction;<br />

(REAL) cosine of the polar angle;<br />

(REAL) sine of the polar angle;<br />

(REAL) cosine of the azimuthal angle;<br />

(REAL) sine of the azimuthal angle;<br />

(LOGICAL) rotation flag, the rotation matrix is the unit matrix if ROTATE=.FALSE., i.e. no<br />

rotation is needed;<br />

Find the sine and cosine of the polar and azimuthal angle of the direction defined by the vector P. IfP is<br />

along the z axis, ROTATE=.FALSE..<br />

CALL GVROT<br />

(DCOSIN,PART*)<br />

PART(3) (REAL) direction to be rotated, overwritten on output;<br />

DCOSIN(3) (REAL) direction of the new z axis;<br />

Given the direction PART in a system of reference O, it returns the same direction in the system of reference<br />

where the z axis of O is along DCOSIN. This routine is very useful when the θ angle of a secondary particle<br />

is sampled in a reference frame where the parent particle moves along the z axis. Then the direction of the<br />

secondary product in the MRS is returned by GVROT if DCOSIN is the direction of the parent particle.<br />

A call to GVROT is equivalent to the following code:<br />

DIMENSION PART(3), DCOSIN(3)<br />

LOGICAL ROTATE<br />

.<br />

.<br />

.<br />

CALL GFANG(DCOSIN,COSTH,SINTH,COSPH,SINPH,ROTATE)<br />

IF(ROTATE) CALL GDROT(PART,COSTH,SINTH,COSPH,SINPH)<br />

with the advantage that inside GVROT all calculations are performed in double precision.<br />

PHYS410 – 2 296

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!