28.11.2014 Views

THE EGS5 CODE SYSTEM

THE EGS5 CODE SYSTEM

THE EGS5 CODE SYSTEM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ekenp=e(np)-RM<br />

call randomset(rnnolp)<br />

if (rnnolp.lt.ekenp/eks) then ! Follow np<br />

e(np-1)=e(np)<br />

iq(np-1)=iq(np)<br />

u(np-1)=u(np)<br />

v(np-1)=v(np)<br />

w(np-1)=w(np)<br />

end if<br />

ekenp=e(np-1)-RM<br />

wt(np-1)=wt(np-1)*eks/ekenp<br />

np=np-1<br />

end if<br />

These statements to apply leading particle biasing for bremsstrahlung and pair are included in a<br />

version of UCCYL (called UC LP) at the proper locations within subroutine AUSGAB.<br />

If IAUSFL(8) or IAUSFL(17) is set as 1, AUSGAB is called for IARG of 7 and 16 respectively,<br />

then Leading Particle Biasing is applied after bremsstrahlung and pair production, respectively.<br />

The COMMON/EPCONT/ is now needed in MAIN in order to pass the IAUSFL(8) and IAUSFL(17) flags<br />

(1=on, 0=off). The subroutine RANDOMSET is explained in the <strong>EGS5</strong> User Manual (see Appendix B).<br />

The other quantities are best understood with the help of the <strong>EGS5</strong> Flow Diagrams for ELECTR<br />

and PHOTON (see Appendix A).<br />

Either statement can be explained as follows. An interaction of the proper type occurs and the<br />

flag has been turned “on”. A random number, uniformly distributed between 0 and 1, is drawn and<br />

compared with the fraction of the kinetic energy that was assigned to the current particle—i.e.,<br />

the lower energy particle of the two produced in the interaction. If the random number is less than<br />

this fraction, the lower energy (NP) particle is kept and the one below it on the stack (NP-1) is<br />

thrown away. Otherwise the higher energy particle (NP-1) is selected and the current particle (NP)<br />

is tossed out. Obviously the particles in the shower with the highest energy will preferentially be<br />

selected by such a scheme and, to assure that the Monte Carlo game is “played fairly”, we have<br />

imposed two necessary requirements:<br />

• The lowest energy particles must be selected some of the time (which we have done by<br />

sampling).<br />

• The proper weight must be assigned to whichever particle chosen.<br />

To complete the process, one should make use of the particle weight when scoring information in<br />

subroutine AUSGAB. Namely,<br />

• Sum particle weights (WT(NP)) when “counting” particles.<br />

192

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

Saved successfully!

Ooh no, something went wrong!