In this subdirectory /example one finds the following files: - readme.ex This file describing the two successive test runs whose scripts and results are in the following files. - testflat1.scr Script file of the first test run - testflat2.scr Script file of the second test run - testflat1.res Results of the first test run - testflat2.res Results of the second test run - abprob.dat File generated by the program in the first test run and used in the second - abvegas.dat File generated by the program in the first test run and used in the second With the first script testflat1.scr all processes are computed one by one in order to determine the relative weight and then they are computed all together in one shot, determining in the files abprob.dat and abvegas.dat the input for the successive generation, whose script is testflat2.scr. In this second run unweighted events are given to Pythia. The output files of the two runs are respectively testflat1.res and testflat2.res . In the following the script files are commented and explained in order to see what the program is doing. When there are yes/no choices 1 = yes, 0= no TESTFLAT1.SCR : 200.d0 ! e_cm The energy E=200 GeV is chosen 1 ! ioneshot All processes together will be evaluated 1 ! icompprob There is no a file abprob.dat in the directory to give the relative probabilities of all 20 final states for the energy and cuts at hand, so they will be first calculated one at a time, and the file abprob.dat will be created 0 ! ialfasrun ! alpha strong is taken from the data, and no running is requested 0 !isr ! yes/no ISR no initial state radiation is requested 2 !iycut ! iycut=0 no ycut; =1 durham; =2 jade; =3 cambridge a Jade type ycut is requested at parton level .01d0 ! ycut value of the ycut 0 !icut ! yes/no cuts no other cuts at parton level are requested ****** from now until further notice the input refers only to the calculations of one final state at a time ************* 0 !idistr ! yes/no distributions no parton level distributions will be computed 0 !iflat ! yes/no flat event generation no unweighted events will be produced ( remember that this refers to the one channel at a time only ) .001d0 !acc ! integration accuracy the integration will be performed with (optional) thermalization and then with repeated (normally 2, or 3 or 4) iterations. If after one of this iterations the above accuracy is reached, the remaining ones will not be computed. 1 !iterm ! yes/no thermalization we want some thermalization (evaluations not used for the calcualtion of the integral, but only to better define the "grid of integration") 10000 !ncall_term ! thermalization calls per iteration maximum number of evaluations of the function (matrix element) for every iteration in thermalization 2 !itmx_term ! thermalization iterations number of iterations in thermalization 100000 !ncall ! integration calls per iteration maximum number of evaluations of the function (matrix element) for every iteration 2 !itmx ! integration iterations (2 for flat event generation) number of iterations in thermalization for the calcualtion of the cross sections ****** from now the input refers only to the calculations of all final states in one shot ************* 0 !idistr ! yes/no distributions again no distributions also for one shot 1 !iflat ! yes/no flat event generation we want generation of unweighted events for one shot. In reality we are not going to use them now, only we find the maximum (for the hit and miss procedure) and the best grid for the successive run (whose script is testflat2.scr) in which the generated events will be in a predetermined number and they will be passed to Pythia 1.2 !scalemax ! scale factor for the maximum the maximum found in the first iteration is multiplied by the above factor in order to avoid finding higher values of the function. This is parameter is not so relevant now, but it will be in the next run. One must not choose it lower than 1. With 1 one gets the best efficiency for unweighted generation, but it might happen that some points are found higher than the maximum, and if they are a few, one must repeat the procedure with a higher value 1 !istorvegas ! yes/no VEGAS data stored we want to store the data of the integration routine (grid) because we are planning to generate unweighted events with the following run 0 !irepeat ! 0=normal;1=repeat 2nd only;2=rep. with It is not a repetition now. It is the first calculation! 0 !istormom ! yes/no momenta of flat events written We do not want to store in a file the momenta of the unweighted events 0 !ipyth ! yes/no call to Pythia We do not want to pass the unweighted events to Pythia. The reason is that we are generating events just to determine the maximum, and we do not know how many unweighted events will come out, so we prefer to rerun and ask for a determined number of events to be passed to Pythia in the following run. ***** these remaining lines have the same meaning as above, only they now refer to one shot calculation. The numerical values can of course be different from what they were before. As we have now chosen iflat =1, the last flag HAS to be itmx=2 .001d0 !acc ! integration accuracy 1 !iterm ! yes/no thermalization 100000 !ncall_term ! thermalization calls per iteration 2 !itmx_term ! thermalization iterations 1000000 !ncall ! integration calls per iteration 2 !itmx ! integration iterations (2 for flat event generation) ****** This run has given the output file testflat1.res and two files have been created: abprob.dat and abvegas.dat. The first contains the probabilities of the different channels for the cuts and energy at hand (in reality the n-th entry gives the sum of the probabilities of the first n channels). The second contains informations for the successive unweighted generation. As far as testflat1.res is concerned, one can read in it all results for every single channel and for one shot. One can verify that the statistical error in the integrations are not too big ( never trust results of a numerical integration by any program with a precision lower than ~1%),that the results do not oscillate from one iteration to another (this does not concern thermalization), and that the sum of all cross section for the 20 channels is an agreement with "one shot" cross section. If something does not work, one can ask for a higher number of calls and/or for a higher number of iterations (more than 4-5 are not useful, better increase the calls) and rerun. TESTFLAT2.SCR : ********* we are using this script to rerun with the same energy, cuts etc, just to produce a determined number of unweighted events and to pass them to Pythia. So many parameters must be the same as before 200.d0 ! e_cm Has to be the same as before 1 ! ioneshot Has to be the same as before, we want to generate all channels in the same run 0 ! icompprob Now we have already the probabilities of the different channels in the file abprob.dat so we choose 0, and the program does not compute again all channels before the oneshot 0 ! ialfasrun ! Has to be the same as before 0 !isr ! yes/no ISR Has to be the same as before 2 !iycut ! iycut=0 no ycut; =1 durham; =2 jade; =3 cambridge Has to be the same as before .01d0 ! ycut Has to be the same as before 0 !icut ! yes/no cuts Has to be the same as before 0 !idistr ! yes/no distributions Again we do not want parton distributions. This flag could have been also 1 in the previous run and 0 now. 1 !iflat ! yes/no flat event generation We want to generate unweighted events 1.2 !scalemax ! scale factor for the maximum Same meaning as before. But the values could have been changed 0 !istorvegas ! yes/no VEGAS data stored Now we want to use the previous abvegas.dat, and we do not want and cannot produce another file with the same name. 2 !irepeat ! 0=normal;1=repeat 2nd only;2=rep. with This is a kind of repetition of the previous run with the use of abvegas.dat and the generation of a requested number of events 1000 !nflevts ! number of events to be generated The program will run untin 1000 unweighted events are generated 0 !istormom ! yes/no momenta of flat events written We do not want to store the momenta of the generated events to a file 1 !ipyth ! yes/no call to Pythia Yes, we want to pass the generated events to Pythia now. .001d0 !acc ! integration accuracy Has to be the same as for oneshot run done before 1 !iterm ! yes/no thermalization Has to be the same as for oneshot run done before 100000 !ncall_term ! thermalization calls per iteration Has to be the same as for oneshot run done before 2 !itmx_term ! thermalization iterations Has to be the same as for oneshot run done before 1000000 !ncall ! integration calls per iteration Has to be the same as for oneshot run done before 2 !itmx ! integration iterations (2 for flat event generation) Has to be the same as for oneshot run done before This run has given the output file testflat2.res In it the Pythia output of the first 10 events is reported. This is due to the lines of 4jphact.f : if (nevent.lt.10) then call pylist(1) endif Of course one can comment them if the Pythia output is not wanted, or one can change the numer 10. At the end of testflat2.res one finds: number of function values over maximum = 0 This means that 1.2 chosen for scalemax was enough. If one obtained a value greater than 0, one would have rerun this second script after having increased scalemax.