View Javadoc

1   package org.lcsim.event.base;
2   
3   import hep.physics.matrix.SymmetricMatrix;
4   import hep.physics.vec.Hep3Vector;
5   import java.util.Collections;
6   import java.util.Map;
7   import org.lcsim.event.ReconstructedParticle;
8   import org.lcsim.event.Vertex;
9   
10  /**
11   * Default implementation of Vertex
12   * @author Norman Graf
13   * @version $Id: BaseVertex.java,v 1.2 2007/09/25 21:49:44 tonyj Exp $
14   */
15  public class BaseVertex implements Vertex
16  {
17      protected boolean _isPrimary ;
18      protected String _type ;
19      protected double _chi2 ;
20      protected double _probability ;
21      protected SymmetricMatrix _covarianceMatrix;
22      protected Hep3Vector _position;
23      protected ReconstructedParticle _aParticle ;   
24      
25      /** Creates a new instance of BaseVertex */
26      // TODO decide whether to allow default constructor and setters, or limit to a fully qualified constructor.
27      protected  BaseVertex()
28      {
29      }    
30      public BaseVertex(boolean isPrimary, String type, double chi2, double prob, SymmetricMatrix cov, Hep3Vector pos, ReconstructedParticle rp)
31      {
32          _isPrimary = isPrimary;
33          _type = type;
34          _chi2 = chi2;
35          _probability = prob;
36          _covarianceMatrix = cov;
37          _position = pos;
38          _aParticle = rp;
39      }
40      
41      public double getProbability()
42      {
43          return  _probability;
44      }
45      
46      public ReconstructedParticle getAssociatedParticle()
47      {
48          return _aParticle;
49      }
50      
51      public Map<String, Double> getParameters()
52      {
53          return Collections.<String, Double>emptyMap();
54      }
55      
56      public Hep3Vector getPosition()
57      {
58          return _position;
59      }
60      
61      public String getAlgorithmType()
62      {
63          return _type;
64      }
65      
66  //    public String toString()
67  //    {
68  //        String retValue;
69  //        
70  //        retValue = super.toString();
71  //        return retValue;
72  //    }
73      
74      public SymmetricMatrix getCovMatrix()
75      {
76          return _covarianceMatrix;
77      }
78      
79      public boolean isPrimary()
80      {
81          return _isPrimary;
82      }
83      
84      public double getChi2()
85      {
86          return _chi2;
87      }
88      
89      // setters
90      // TODO decide whether to allow separate setters.
91  //    public void setPrimary( boolean primary )
92  //    {
93  //        _isPrimary = primary;
94  //    }
95  //    //public void setAlgorithmType( int type ) ;
96  //    public void setAlgorithmType( String type )
97  //    {
98  //        _type = type;
99  //    }
100 //    public void setChi2( double chi2 )
101 //    {
102 //        _chi2 = chi2;
103 //    }
104 //    public void setProbability( double probability )
105 //    {
106 //        _probability = probability;
107 //    }
108 //    public void setPosition( Hep3Vector position )
109 //    {
110 //        _position = position;
111 //    }
112 //    public void setPosition( double x, double y, double z )
113 //    {
114 //        _position = new BasicHep3Vector(x, y, z);
115 //    }
116 //    public void setCovMatrix( SymmetricMatrix cov )
117 //    {
118 //        _covarianceMatrix = cov;
119 //    }
120 //    
121 //    public void setAssociatedParticle( ReconstructedParticle  rp )
122 //    {
123 //        _aParticle = rp;
124 //    }
125 }