10.07.2015 Views

THE EGS5 CODE SYSTEM

THE EGS5 CODE SYSTEM

THE EGS5 CODE SYSTEM

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.

C.3.9The HPLT OptionThe Histogram PLoT option is designed to be used in conjunction with UCTESTSR (User Codeto TEST Sampling Routine), which is provided with the <strong>EGS5</strong> distribution. This option providesa way to test the EGS methods used to sample differential distributions functions by lookingfor discrepancies between actual differential physics data and histograms of sampled data duringsimulations.Suppose that a probability density function, P DF (X) (see Chapter 2 of SLAC-R-730/KEK-2005-8), is to be sampled by EGS (note: P DF (X) will have other static arguments which weignore for this discussion). Let CDF (X) be the cumulative distribution function associated withP DF (X). If P DF (X) drops sharply with increasing X, we will not get many samples in thebins with large X unless we make the bins themselves larger in such regions. We accomplishthis by finding another p.d.f.and c.d.f., P DG(X) and CDG(X), respectively, such that P DG(X)approximates P DF (X). If we want N bins, we then pick the X(I) such thatCDG(X(I+1))-CDG(X(I))=(CDG(X(N+1))-CDG(X(I)))/N.For all I this implies thatX(I)=CDGI((CDG(X(N+1))-CDG(X(1)))*I/(N+1) + CDG(X(1)))where CDGI is the inverse function of CDG. Thus, if P DG(X) is a reasonable approximation,the histogram bins at large X should have the same order of magnitude of counts as those at lowerX. The function CDG(X) is called the “distribution function” in the context of the HPLT option.CDG(X), CDGI(X), and P DG(X) are used by the UCTESTSR user code and HPLT1 subroutinein PEGS. If we let SP DF (X) and SCDF (X) be the “sampled” data, and P DF (X) and CDF (X)be the theoretical data, then the routine HPLT1 can be summarized by the pseudo-code:DO I=1,NPLOT((SCDF(X(I+1))-SCDF(X(I)))/(CDG(X(I+1))-CDG(X(I))))PLOT((CDF(X(I+1))-CDF(X(I)))/(CDG(X(I+1))-CDG(X(I))))DO....X(I) at 10 points in the interval (X(I),X(I+1))PLOT(d(SCDF)/d(CDG)=PDF(X)/PDG(X))END DORETURNENDAll of the input data lines for a specified HPLT option are printed directly by UCTESTSR tostandard output. This data can then be used in a subsequent run of PEGS to produce line-printerstyle plots of the actual and sample functions . Users should refer to the listing for UCTESTSR andcomments therein for a better understanding of the HPLT option (see also Chapter 6 of SLAC-210).389

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

Saved successfully!

Ooh no, something went wrong!