In more detail, sub-phases are possible in order to control the sequence of dependent tasks in addition to the program order, for example one wants to find a vertex before calculating multiplicity. Note that several common functions are taken over by phat.C (these are generally shared by "tasks"); you must thus delete TPhDetector and TPhDST and their execution in initialization. Input files are handled by phat.C. It also handles the event loop including getting the event and some common operations such as SetEvent and supplying a default vertex if not found. The names det, data, ev, v1 and iev must be used; see the phat.C listing.
The second parameter "dflag" is meant to control displays. Zero means no displays but no convention yet exists for non-zero values which may be used to select different types of displays.
In general, you must be careful about the scope of variables, this is perhaps the most common source of difficulty in adapting scripts to phat.C, especially for old FORTRAN retreads (:\>>>.