FreeHEP API
Version current

hep.physics.event
Class BaseEvent

java.lang.Object
  extended byhep.physics.event.BaseEvent
All Implemented Interfaces:
HEPEvent
Direct Known Subclasses:
GeneratorEvent

public class BaseEvent
extends Object
implements HEPEvent

A simple implementation of HEPEvent

Author:
Tony Johnson
Source Code:
BaseEvent.java

Constructor Summary
BaseEvent(int run, int event)
           
BaseEvent(int run, int event, long timestamp)
          Create a new event with an explicit timestamp
 
Method Summary
 Object get(String key)
          Get an object from the event
 int getEventNumber()
           
 int getRunNumber()
           
 Map getTags()
          An arbitrary set of tags that can be associated with the event.
 long getTimeStamp()
          Get the current timestamp.
 Set keys()
           
 void put(String key, Object component)
          Puts an arbitrary object into the event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseEvent

public BaseEvent(int run,
                 int event)
Parameters:
run - The run number
event - Create a new event. The timestamp will be set to the current time.

BaseEvent

public BaseEvent(int run,
                 int event,
                 long timestamp)
Create a new event with an explicit timestamp

Parameters:
run - Teh run number
event - The event number
timestamp - The timestamp. By convention this is measured in nS since 1-jan-1970 GMT.
Method Detail

get

public Object get(String key)
Description copied from interface: HEPEvent
Get an object from the event

Specified by:
get in interface HEPEvent
Parameters:
key - The key for the object

getEventNumber

public int getEventNumber()
Specified by:
getEventNumber in interface HEPEvent
Returns:
The event number

getRunNumber

public int getRunNumber()
Specified by:
getRunNumber in interface HEPEvent
Returns:
The run number for this event

getTags

public Map getTags()
Description copied from interface: HEPEvent
An arbitrary set of tags that can be associated with the event. Intended to be used for fast event selection.

Specified by:
getTags in interface HEPEvent

keys

public Set keys()
Specified by:
keys in interface HEPEvent
Returns:
The set of keys stored in the event

put

public void put(String key,
                Object component)
Description copied from interface: HEPEvent
Puts an arbitrary object into the event

Specified by:
put in interface HEPEvent
Parameters:
key - The key for this object
component - The object to add

getTimeStamp

public long getTimeStamp()
Description copied from interface: HEPEvent
Get the current timestamp. By convention this is measured in nS since 1-jan-1970 GMT.

Specified by:
getTimeStamp in interface HEPEvent
Returns:
The timestamp.

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.