lcsim/src/org/lcsim/event
diff -u -r1.21 -r1.22
--- EventHeader.java 18 Dec 2008 20:48:59 -0000 1.21
+++ EventHeader.java 17 Nov 2009 20:10:31 -0000 1.22
@@ -14,171 +14,176 @@
* The event header from which information about the rest of the event
* can be obtained.
* @author Tony Johnson
- * @version $Id: EventHeader.java,v 1.21 2008/12/18 20:48:59 jeremy Exp $
+ * @version $Id: EventHeader.java,v 1.22 2009/11/17 20:10:31 jeremy Exp $
*/
public interface EventHeader extends MCEvent
{
- /**
- * Get the list of MC particles associated with this event.
- */
- List<MCParticle> getMCParticles();
- List<Track> getTracks();
- List<Cluster> getClusters();
- List<SimCalorimeterHit> getSimCalorimeterHits(String name);
- List<SimTrackerHit> getSimTrackerHits(String name);
-
- /**
- * Get a collection of data from the event.
- * This method will throw <tt>IllegalArgumentException</tt> if the requested data is not found.
- * @param type The type of object requested.
- * @return The collection of data.
- */
- <T> List<List<T>> get(Class<T> type);
- /**
- * Obtain a collection of objects associated with this event, specified by type and name.
- * This method will throw <tt>IllegalArgumentException</tt> if the requested data is not found.
- * @param type The class of items stored in the requested collection
- * @param name The name of the requested collection
- * @return The resulting collection.
- */
- <T> List<T> get(Class<T> type, String name);
-
- /**
- * Get the meta data associated with a list obtained from this event.
- */
- LCMetaData getMetaData(List x);
-
- /**
- * Get all the meta data associated with this event.
- * @return A <code>Collection</code> of <code>LCMetaData</code> objects associated with this event.
- */
- Collection<LCMetaData> getMetaData();
-
- /**
- * Get all the lists associated with this event.
- * @return A <code>Set</code> of <code>List</code> objects associated with this event.
- */
- public Set<List> getLists();
-
- /**
- * The name of the detector, used to obtain geometry and conditions.
- */
- String getDetectorName();
-
- /**
- * The creation time of this event (in nS since 1-Jan-1970 GMT).
- */
- long getTimeStamp();
-
- /**
- * Get the detector description read from the conditions database
- */
- Detector getDetector();
-
- /**
- * Add a collection to the event.
- * @param name The name used to stored this collection in the event.
- * @param collection The data collection
- * @param type The class of objects stored in the collection.
- * @param flags The LCIO flags associated with the collection.
- */
- void put(String name, List collection, Class type, int flags);
-
- /**
- * Add a collection to the event.
- * @param name The name used to stored this collection in the event.
- * @param collection The data collection
- * @param type The class of objects stored in the collection.
- * @param flags The LCIO flags associated with the collection.
- * @param readoutName The name of the readout to be used to decode hits in this collection
- */
- void put(String name, List collection, Class type, int flags, String readoutName);
-
- String TRACKS = "Tracks";
- String CLUSTERS = "Clusters";
- String RECONSTRUCTEDPARTICLES = "ReconstructedParticles";
- String MCFASTRECONSTRUCTEDPARTICLES = "MCFastReconstructedParticles";
-
- /**
- * Removes an item from the event
- */
- void remove(String name);
-
- /**
- * Test if the event contains a collection of a given type and name. Can be used to avoid having
- * to catch an exception if the event does not contain an expected collection when calling get.
- */
- boolean hasCollection(Class type, String collection);
-
- /**
- * Test if the event contains at least one collection of the given type.
- */
- boolean hasCollection(Class type);
-
- /**
- * Test if the event contains a given item.
- * @param name The name of the item to look for
- * @return <code>true</code> if the event contains an item with the given name.
- */
- boolean hasItem(String name);
-
- /**
- * Get the event weight
- * @return The weight
- */
- float getWeight();
-
- Map<String,int[]> getIntegerParameters();
- Map<String,float[]> getFloatParameters();
- Map<String,String[]> getStringParameters();
-
- /**
- * List of elements stored in the event may have meta-data associated with
- * them. This interface allows this meta-data to be extracted.
- * LCIO allows arbitrary maps of int, float or strings to be stored
- * with each collection and these can also be accessed via this interface.
- */
- public interface LCMetaData
- {
- /**
- * The name of the associated data collection
- */
- String getName();
-
- /**
- * The type of objects stored in the associated data collection.
- */
- Class getType();
- /**
- * The LCIO flags stored with the associated data collection.
- */
- int getFlags();
- /**
- * An IDDecoder that can be used to decode the ID's stored in this
- * data collection. Primarily used for calorimeter and tracker hits.
- */
- IDDecoder getIDDecoder();
-
- Map<String,int[]> getIntegerParameters();
- Map<String,float[]> getFloatParameters();
- Map<String,String[]> getStringParameters();
-
- /** Get the event with which this meta-data is associated. */
- EventHeader getEvent();
- /**
- * Flag whether the collection associated with this meta-data is a subset
- * of some other collection. When flagged in this way the collection will be
- * written to an LCIO file as a reference collection, ie as a set of pointers
- * to objects in the master collection.
- */
- void setSubset(boolean isSubset);
- boolean isSubset();
- /**
- * Flag whether the collection associated with this meta-data should be
- * treated as transient. Transient collections are never written out to
- * LCIO files.
- */
- void setTransient(boolean isTransient);
- boolean isTransient();
- }
+ /**
+ * Get the path to the file source for this event.
+ */
+ String getInputFile();
+
+ /**
+ * Get the list of MC particles associated with this event.
+ */
+ List<MCParticle> getMCParticles();
+ List<Track> getTracks();
+ List<Cluster> getClusters();
+ List<SimCalorimeterHit> getSimCalorimeterHits(String name);
+ List<SimTrackerHit> getSimTrackerHits(String name);
+
+ /**
+ * Get a collection of data from the event.
+ * This method will throw <tt>IllegalArgumentException</tt> if the requested data is not found.
+ * @param type The type of object requested.
+ * @return The collection of data.
+ */
+ <T> List<List<T>> get(Class<T> type);
+ /**
+ * Obtain a collection of objects associated with this event, specified by type and name.
+ * This method will throw <tt>IllegalArgumentException</tt> if the requested data is not found.
+ * @param type The class of items stored in the requested collection
+ * @param name The name of the requested collection
+ * @return The resulting collection.
+ */
+ <T> List<T> get(Class<T> type, String name);
+
+ /**
+ * Get the meta data associated with a list obtained from this event.
+ */
+ LCMetaData getMetaData(List x);
+
+ /**
+ * Get all the meta data associated with this event.
+ * @return A <code>Collection</code> of <code>LCMetaData</code> objects associated with this event.
+ */
+ Collection<LCMetaData> getMetaData();
+
+ /**
+ * Get all the lists associated with this event.
+ * @return A <code>Set</code> of <code>List</code> objects associated with this event.
+ */
+ public Set<List> getLists();
+
+ /**
+ * The name of the detector, used to obtain geometry and conditions.
+ */
+ String getDetectorName();
+
+ /**
+ * The creation time of this event (in nS since 1-Jan-1970 GMT).
+ */
+ long getTimeStamp();
+
+ /**
+ * Get the detector description read from the conditions database
+ */
+ Detector getDetector();
+
+ /**
+ * Add a collection to the event.
+ * @param name The name used to stored this collection in the event.
+ * @param collection The data collection
+ * @param type The class of objects stored in the collection.
+ * @param flags The LCIO flags associated with the collection.
+ */
+ void put(String name, List collection, Class type, int flags);
+
+ /**
+ * Add a collection to the event.
+ * @param name The name used to stored this collection in the event.
+ * @param collection The data collection
+ * @param type The class of objects stored in the collection.
+ * @param flags The LCIO flags associated with the collection.
+ * @param readoutName The name of the readout to be used to decode hits in this collection
+ */
+ void put(String name, List collection, Class type, int flags, String readoutName);
+
+ String TRACKS = "Tracks";
+ String CLUSTERS = "Clusters";
+ String RECONSTRUCTEDPARTICLES = "ReconstructedParticles";
+ String MCFASTRECONSTRUCTEDPARTICLES = "MCFastReconstructedParticles";
+
+ /**
+ * Removes an item from the event
+ */
+ void remove(String name);
+
+ /**
+ * Test if the event contains a collection of a given type and name. Can be used to avoid having
+ * to catch an exception if the event does not contain an expected collection when calling get.
+ */
+ boolean hasCollection(Class type, String collection);
+
+ /**
+ * Test if the event contains at least one collection of the given type.
+ */
+ boolean hasCollection(Class type);
+
+ /**
+ * Test if the event contains a given item.
+ * @param name The name of the item to look for
+ * @return <code>true</code> if the event contains an item with the given name.
+ */
+ boolean hasItem(String name);
+
+ /**
+ * Get the event weight
+ * @return The weight
+ */
+ float getWeight();
+
+ Map<String,int[]> getIntegerParameters();
+ Map<String,float[]> getFloatParameters();
+ Map<String,String[]> getStringParameters();
+
+ /**
+ * List of elements stored in the event may have meta-data associated with
+ * them. This interface allows this meta-data to be extracted.
+ * LCIO allows arbitrary maps of int, float or strings to be stored
+ * with each collection and these can also be accessed via this interface.
+ */
+ public interface LCMetaData
+ {
+ /**
+ * The name of the associated data collection
+ */
+ String getName();
+
+ /**
+ * The type of objects stored in the associated data collection.
+ */
+ Class getType();
+ /**
+ * The LCIO flags stored with the associated data collection.
+ */
+ int getFlags();
+ /**
+ * An IDDecoder that can be used to decode the ID's stored in this
+ * data collection. Primarily used for calorimeter and tracker hits.
+ */
+ IDDecoder getIDDecoder();
+
+ Map<String,int[]> getIntegerParameters();
+ Map<String,float[]> getFloatParameters();
+ Map<String,String[]> getStringParameters();
+
+ /** Get the event with which this meta-data is associated. */
+ EventHeader getEvent();
+ /**
+ * Flag whether the collection associated with this meta-data is a subset
+ * of some other collection. When flagged in this way the collection will be
+ * written to an LCIO file as a reference collection, ie as a set of pointers
+ * to objects in the master collection.
+ */
+ void setSubset(boolean isSubset);
+ boolean isSubset();
+ /**
+ * Flag whether the collection associated with this meta-data should be
+ * treated as transient. Transient collections are never written out to
+ * LCIO files.
+ */
+ void setTransient(boolean isTransient);
+ boolean isTransient();
+ }
}
lcsim/src/org/lcsim/event/base
diff -u -r1.6 -r1.7
--- BaseLCSimEvent.java 18 Dec 2008 20:48:59 -0000 1.6
+++ BaseLCSimEvent.java 17 Nov 2009 20:10:31 -0000 1.7
@@ -60,6 +60,11 @@
}
}
+ public String getInputFile()
+ {
+ return (String)get("INPUT_FILE");
+ }
+
public String toString()
{
return "Run "+getRunNumber()+" Event "+getEventNumber()+" ("+new Date(getTimeStamp()/NANO_SECONDS)+") Detector: "+detectorName;