cs0104008/evdir.tex
1: 
2: \section{Event Directories}
3: \label{sec:evdir}
4: 
5: In order to remedy the limitations of sequential access to the event
6: data, a system was developed for ZEUS in which single events in the
7: event store are accessed directly using a system of {\it event
8: directories}. An event directory is an index containing for each event
9: 128 logical event flags as well as the collider run number\footnote{A
10: run is a datataking period with identical trigger conditions. One run
11: typically lasts a few hours and contains up to 300,000 events.}, the
12: event number, and the location of the event in the sequential event
13: store.  The event flags are determined once during reconstruction and
14: indicate whether the topology of the event matches each one of a wide
15: range of physics conditions.
16: 
17: The event directory system uses the capability of the ADAMO system to
18: index records in a sequential data file. This index is implemented
19: using a key table. Figure~\ref{fig:zdskey} shows the structure of the
20: ADAMO key table. In addition to name and type of record, and run and event
21: number, the table permits storage of four more 32-bit quantities. These
22: are used in the event directory system to encode the 128 event flags.
23: \begin{figure}[htbp]
24:   \begin{center}
25:     \epsfig{file=pix/zdskey.eps,height=5cm}
26:     \caption{ADAMO key table. A copy of the indicated quantities are stored for
27:       each record (i. e. event) in the database together with the
28:       offset in the sequential event file.}
29:     \label{fig:zdskey}
30:   \end{center}
31: \end{figure}
32: 
33: Figure~\ref{fig:evdir} depicts schematically how event directories are
34: used to access events. The event directory information is stored
35: run-by-run and event-by-event in tables. The tables can be queried
36: from an analysis job. For example a user might request all events where
37: certain conditions on the event flags are fulfilled. The event
38: directory system searches through the event directory tables and for
39: every requested entry it locates the event file, positions the file
40: pointer at the proper offset and reads and decodes the event record.
41: Then control is given to the analysis code to perform whatever
42: data analysis the user wants to perform.
43: \begin{figure}[htbp]
44:   \begin{center}
45:     \epsfig{file=pix/evdirpic.eps,height=20cm}
46:     \caption{Schematic of the ZEUS event directory system.}
47:     \label{fig:evdir}
48:   \end{center}
49: \end{figure}
50: For convenience, event directory files are stored in a human readable
51: format. An excerpt from an event directory file is given in
52: Appendix~\ref{app:b}.
53: 
54: The event directory system was developed for the ZEUS experiment and
55: has been in operation since 1994, working reliably and efficiently.
56: The CPU time overhead required to read ZEUS events through the event
57: directory system is small compared to the event reading time, and much
58: smaller than with the sequential method of reading events.
59: 
60: 
61: