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.

where:<br />

n number of energy bins<br />

q i momentum of the photon with energy E i of the i th bin<br />

q n upper<br />

( )<br />

limit for the momentum of the scattered photon<br />

α i A qi<br />

2<br />

|F T (q)| 2<br />

f i (q)<br />

A (qn 2)<br />

g i (q) = 1+µ2 rejection function.<br />

2<br />

Therefore, for given values of the random numbers r 1 and r 2 , GRAYL samples the momentum of the scattered<br />

photon and the scattering angle θ via the following steps:<br />

1. sample A ( q 2) = r 1 A ( qn<br />

2 )<br />

2. find the (q i−1 ,q i ] interval which gives A ( qi−1) 2 ( ≤ A q<br />

2 ) ≤ A ( qi<br />

2 )<br />

3. calculate the linear extrapolation:<br />

( (<br />

q = q i−1 + A q 2) ( ))<br />

− A qi−1<br />

2 q i − q i−1<br />

A ( qi<br />

2 ) ( ) (4)<br />

− A qi−1<br />

2<br />

4. calculate µ = cosθ =1− q 2 /(2k 2 )<br />

5. calculate g i (q) =(1+µ 2 )/2<br />

6. if g i (q) >r 2 the event is accepted, otherwise go back to 1.<br />

PHYS251 – 2 231

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

Saved successfully!

Ooh no, something went wrong!