Event model: User interface for the event
D. Adams
25sep01 0920
Clearly the event is a central concept in the event model. Here we
discuss how to present events to users. While users will sometimes
want to examine a single event specified by an event identifier, a
more typical usage pattern is to iterate over a collection of events
meeting some criteria.
We consider three models: global, object and functional.
Global
In the global model, there is one event in memory and after an initial
request for an event or the next event. Event data can be obtained with
calls to global functions. These functions might be disguised as member
functions.
Object
In the object model, there is an Event class which provides an interface
to all the event information. Members of this class provide access to all
the event data.
Functional
In the functional model, access is again provided by global functions
but each function call also includes an event identifier and it is easy
for a user to access multiple events.
Comparison
The global model has long and successful history in high energy physics
and is sufficient for typical processing where a collection of events is
each processed individually. It can be cumbersome when one needs to work
with simultaneously with multiple events (e.g. combining Monte Carlo
overlap events or tests comparing events) but this is not a common
operation.
The object model seems natural for object-oriented reconstruction. It is
typical of OO design to identify central concepts, such as the event, and
then associate a class with each. My feeling is that this is easiest
to understand, implement and maintain.
If desired, it is straightforward
to implement a global model (e.g. a framework) in terms of an object
model. The converse is not true.
The functional model is a less attractive interface and would be more
cumbersome to implement than the object model.
dladams@bnl.gov