View Javadoc

1   package org.lcsim.event;
2   
3   import org.lcsim.detector.DetectorIdentifierHelper;
4   import org.lcsim.detector.HasDetectorElement;
5   import org.lcsim.detector.identifier.Identifiable;
6   import org.lcsim.event.EventHeader.LCMetaData;
7   import org.lcsim.geometry.subdetector.BarrelEndcapFlag;
8   import org.lcsim.geometry.IDDecoder;
9   import org.lcsim.geometry.Subdetector;
10  import hep.physics.vec.Hep3Vector;
11  
12  /**
13   * This is a common API for hit objects in events such
14   * as CalorimeterHit, etc.
15   * @author Jeremy McCormick <jeremym@slac.stanford.edu>
16   */
17  public interface Hit extends HasDetectorElement, Identifiable {
18  
19      /**
20       * Get the position vector of the hit.
21       * @return The position of the hit as a vector.
22       */
23      Hep3Vector getPositionVec();
24  
25      /**
26       * Get the position of the hit as a double array of length 3.
27       * @return The position of the hit.
28       */
29      double[] getPosition();
30  	
31      /**
32       * Convenience method to get the Subdetector's IdentifierHelper.
33       * @return The subdetector identifier helper.
34       */
35      DetectorIdentifierHelper getDetectorIdentifierHelper();
36      
37      /**
38       * Get the collection meta data reference for this object.
39       * @return The collection meta data.
40       */
41      LCMetaData getMetaData();
42      
43      /**
44       * Set the collection meta data of this object.
45       */
46      void setMetaData(LCMetaData meta);
47     
48      /**
49       * Get the subdetector of this hit.
50       * @return The subdetector of the hit.
51       */
52      Subdetector getSubdetector();
53      
54      /**
55       * Get the IDDecoder for the hit.
56       * @return The IDDecoder for the hit.
57       */
58      IDDecoder getIDDecoder();
59      
60      /**
61       * Get the subdetector's system ID.
62       * @return The subdetector's system ID.
63       */
64      int getSystemId();
65  	
66      /**
67       * Get the barrel flag (collider-detector specific).
68       * @return The barrel flag.
69       */
70      BarrelEndcapFlag getBarrelEndcapFlag();
71  	
72      /**
73       * Get the layer number of the hit.
74       * @return The layer number.
75       */
76      int getLayerNumber();
77  	
78      /**
79       * Get a field value using the helper.
80       * @param field The name of the field.
81       * @return A field value.
82       */
83      int getIdentifierFieldValue(String field);
84  }