next up previous contents
Next: Permanent Data Structure Processing Up: Execution Previous: Execution   Contents

Event Processing

EVMAIN has the job of passing the event to each processor that the user has selected. It can either step through a simple list of processors, calling each in turn, or execute a more complex series of instructions where some processors are only called under certain conditions (see chapter 9 on the programmable event loop for more information). Processing normally starts with event input EIO_EVREAD or Monte Carlo MCMAIN. MCMAIN calls a number of physics routines to handle the details of the simulation. The control flow is primarily concerned with processing vertices and tracks. A vertex may be either a pre_source, source, sink, boundary or interaction; it is simply a ZEBRA bank containing all the relevant information for the physical process taking place at that point. Tracks are ZEBRA banks which contain information about the particle, they connect the vertices together, both in the physical sense that they represent the particle which propagates from one vertex to the other, and in the sense that within the code they carry links which identify the vertex where they where created and the one where they end. Note that the control routines handle all particles (broadly defined as electrons, positrons, gammas, neutrons, and eventually others) the same, and thus the same control code propagates all of them.

The Monte Carlo generation begins with the event generation in MCG_GENERATOR. This routine creates the initial seed vertices and their first outgoing track or sometimes tracks. The control routine MCEVLV is then called to take the initial vertices and tracks and propagate the particles they represent until no further physical processes of interest take place. Tracks are handled by the routine TKMAIN, which invokes geometry routines and physics processors (different processors depending on the type of particle) to determine where the particle next interacts or crosses a boundary, TKMAIN then creates the appropriate vertex. Different vertex processors are called (depending on the vertex type) to determine the outcome of the physical process at that point and either create the appropriate outgoing track or change the vertex to a sink (thus representing the end of that particle's life). Electrons, positrons, and gammas are handed to the special vertex processor VXEGS4, which invokes the EGS4 routines to propagate these particles and create the Cerenkov bundle vertices (which are subsequently unpacked by UNPCER and given outgoing tracks by the vertex processor VXCERN). Cerenkov photons which travel outwards are eventually handed by the boundary vertex processor VXBOU to the routine VXPMT to determine if they created a photomultiplier signal, were reflected, or were lost. When all particles have reached a sink vertex, routines are called to place the information from the photomultipliers into banks with the same structure as the banks from real events which will be read in off of tape (MCDAQ) and to add photomultiplier noise (MCNOIS).

For MC data the next pocessor to be called is (UCL_UNCALIBRATION) which applies inverse calibration. Then the data packed in a raw ZDAB bank by (PCK_PACKER) Another routine can read the ZDAB bank directly from tape, and from this point on the program flow is the same for real events and for Monte Carlo events.

The event is unpacked with UPK_UNPACKER and calibrated with CAL_CALIBRATION. The program then calls a combination of fitters (e.g. a time fitter FTT_FITTER and/or a quad fitter FTQ_FITTER), each of which independently calculates the best guess for the origin of the observed Cerenkov photons and creates fitter banks containing the output. The next call is to the output routine EVANAL, which stores whatever output is desired for the event in an HBOOK NTUPLE for later use with PAW. The program then calls EVVIEW, which does the graphics output. Finally unwanted banks are removed with the pruner PRU_PRUNER and output using EIO_EVWRIT.


next up previous contents
Next: Permanent Data Structure Processing Up: Execution Previous: Execution   Contents
sno Guest Acct 2009-09-09