View Javadoc

1   package org.lcsim.recon.tracking.vsegment.hitmaking;
2   
3   import java.util.*;
4   
5   import hep.physics.matrix.SymmetricMatrix;
6   import hep.physics.vec.Hep3Vector;
7   
8   import org.lcsim.recon.tracking.vsegment.hit.TrackerCluster;
9   
10  /**
11   * Implementation of org.lcsim.event.TrackerHit for converting hit objects used by
12   * this package into old <tt>TrackerHits</tt>.
13   *
14   * @author D. Onoprienko
15   * @version $Id: OldTrackerHit.java,v 1.3 2011/08/24 18:51:18 jeremy Exp $
16   */
17  public class OldTrackerHit implements org.lcsim.event.TrackerHit {
18    
19  // -- Constructors :  ----------------------------------------------------------
20    
21    public OldTrackerHit(Hep3Vector position, SymmetricMatrix covMatrix, 
22                         double signal, double time, int type, 
23                         List<TrackerCluster> parentClusters) {
24      _pos = position.v();
25      _cov = covMatrix.asPackedArray(true);
26      _dedx = signal;
27      _time = time;
28      _type = type;
29      _clusters = parentClusters;
30    }
31    
32    public OldTrackerHit(Hep3Vector position, double[] covMatrix, 
33                         double signal, double time, int type, 
34                         List<TrackerCluster> parentClusters) {
35      _pos = position.v();
36      _cov = covMatrix;
37      _dedx = signal;
38      _time = time;
39      _type = type;
40      _clusters = parentClusters;
41    }
42    
43  // -- Implementing org.lcsim.event.TrackerHit :  -------------------------------
44    
45    /** 
46     * The hit position in [mm].
47     */
48    public double[] getPosition() {return _pos;}
49    
50    /**
51     * Covariance of the position (x,y,z)
52     */
53    public double[] getCovMatrix() {return _cov;}
54    
55    /** 
56     * The dE/dx of the hit in [GeV].
57     */
58    public double getdEdx() {return _dedx;}
59    
60    /** 
61     * The  time of the hit in [ns].
62     */
63    public double getTime() {return _time;}
64    
65    /** 
66     * Type of hit. Mapping of integer types to type names
67     * through collection parameters "TrackerHitTypeNames"
68     * and "TrackerHitTypeValues".
69     */
70    public int getType() {return _type;}
71    
72    /** 
73     * The raw data hits.
74     * Check getType() to get actual data type.
75     */
76    public List getRawHits() {return _rawHits;}
77    
78  // -- Additional getters :  ----------------------------------------------------
79    
80    /**
81     * Returns a list of <tt>TrackerClusters</tt> from which this hit was produced.
82     */
83    public List<TrackerCluster> getClusters() {return _clusters;}
84    
85    /**
86     * Returns <tt>true</tt> if this hit is a cross between segment-like hits in
87     * stereo layers.
88     */
89    public boolean isStereo() {return _clusters.size() > 1;}
90    
91  // -- Setters :  ---------------------------------------------------------------
92    
93    /**
94     * Set the list of raw hits.
95     * The list supplied to this method will be owned by this <tt>OldTrackerHit</tt> object.
96     */
97    public void setRawHits(List rawHits) {_rawHits = rawHits;}
98    
99  // -- Private parts :  ---------------------------------------------------------
100    
101    protected double[] _pos;
102    protected double[] _cov;
103    protected double _dedx;
104    protected double _time;
105    protected int _type;
106    protected List _rawHits;
107    
108    protected List<TrackerCluster> _clusters;
109    
110    public double getEdepError()
111    {
112        return 0;
113    }
114    
115    public int getQuality()
116    {
117        return 0;
118    }
119    
120    public long getCellID()
121    {
122        if (true) throw new UnsupportedOperationException("This method is not implemented in this class.");
123        return 0;
124    }    
125 }