LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VertexImpl.cc
Go to the documentation of this file.
1 #include "IMPL/VertexImpl.h"
2 #include <algorithm>
3 
4 using namespace EVENT ;
5 
6 namespace IMPL{
7 
8  VertexImpl::VertexImpl() :
9  _primary(0),
10  _type("Unknown"),
11  _chi2(0),
12  _probability(0),
13  _cov( VTXCOVMATRIX ),
14  _par(0),
15  _aParticle(0)
16  {}
17 
19 
20  bool VertexImpl::isPrimary() const { return _primary ; }
21  //int VertexImpl::getAlgorithmType() const { return _type ; }
22  const std::string& VertexImpl::getAlgorithmType() const { return _type ; }
23  float VertexImpl::getChi2() const { return _chi2 ; }
24  float VertexImpl::getProbability() const { return _probability ; }
25  const float* VertexImpl::getPosition() const { return _vpos ; }
26  const EVENT::FloatVec & VertexImpl::getCovMatrix() const { return _cov ; }
27  const EVENT::FloatVec & VertexImpl::getParameters() const { return _par ; }
29 
30 
31  //setters
32  void VertexImpl::setPrimary(bool primary){
33  checkAccess("VertexImpl::setPrimary" );
34  _primary = (primary==0?0:1);
35  }
36 /*
37  void VertexImpl::setAlgorithmType( int type ){
38  checkAccess("VertexImpl::setAlgorithmType");
39  _type = type;
40  }
41 */
43  checkAccess("VertexImpl::setAlgorithmType");
44  _type = type;
45  }
46 
47  void VertexImpl::setChi2(float chi2){
48  checkAccess("VertexImpl::setChi2" );
49  _chi2 = chi2 ;
50  }
51 
52  void VertexImpl::setProbability(float probability){
53  checkAccess("VertexImpl::setProbability" );
54  _probability = probability ;
55  }
56 
57  void VertexImpl::setPosition( const float vpos[3] ){
58  setPosition( vpos[0], vpos[1], vpos[2] ) ;
59  }
60 
61  void VertexImpl::setPosition( float px, float py, float pz ){
62  checkAccess("VertexImpl::setPosition" );
63  _vpos[0] = px ;
64  _vpos[1] = py ;
65  _vpos[2] = pz ;
66  }
67 
68  void VertexImpl::setCovMatrix( const float* cov ){
69  checkAccess("VertexImpl::setCovMatrix" );
70  for(int i=0;i<VTXCOVMATRIX;i++) _cov[i] = cov[i] ;
71  }
72 
74  checkAccess("VertexImpl::" );
75  for(int i=0;i<VTXCOVMATRIX;i++) _cov[i] = cov[i] ;
76  }
77 
79  checkAccess("VertexImpl::setAssociatedParticle" );
80  _aParticle = aP;
81  }
82 
83  void VertexImpl::addParameter( float p ){
84  checkAccess("VertexImpl::addParameter") ;
85  _par.push_back( p ) ;
86  }
87 
88 } // end namespace
89 
90 
91 
92 
void setPosition(const float vpos[3])
Definition: VertexImpl.cc:57
virtual EVENT::ReconstructedParticle * getAssociatedParticle() const
Returns Reconstructed Particle associated to the Vertex.
Definition: VertexImpl.cc:28
EVENT::FloatVec _par
Definition: VertexImpl.h:99
void setCovMatrix(const float *cov)
Definition: VertexImpl.cc:68
EVENT::ReconstructedParticle * _aParticle
Definition: VertexImpl.h:100
std::string _type
Definition: VertexImpl.h:94
float _probability
Definition: VertexImpl.h:96
virtual const EVENT::FloatVec & getParameters() const
Additional parameters related to this vertex - check/set the collection parameter &quot;VertexParameterNa...
Definition: VertexImpl.cc:27
#define VTXCOVMATRIX
Definition: VertexImpl.h:9
void setAlgorithmType(std::string type)
Definition: VertexImpl.cc:42
EVENT::FloatVec _cov
Definition: VertexImpl.h:98
virtual const EVENT::FloatVec & getCovMatrix() const
Covariance matrix of the position (stored as lower triangle matrix, i.e.
Definition: VertexImpl.cc:26
virtual bool isPrimary() const
Checks if the Vertex is the primary vertex of the event.
Definition: VertexImpl.cc:20
STL class.
T push_back(T...args)
void addParameter(float p)
Definition: VertexImpl.cc:83
virtual const std::string & getAlgorithmType() const
Type code for the algorithm that has been used to create the vertex - check/set the collection parame...
Definition: VertexImpl.cc:22
void setChi2(float chi2)
Definition: VertexImpl.cc:47
void setAssociatedParticle(EVENT::ReconstructedParticle *aP)
Definition: VertexImpl.cc:78
The LCIO reconstructedParticle.
virtual float getProbability() const
Probability of the vertex fit.
Definition: VertexImpl.cc:24
void setProbability(float probability)
Definition: VertexImpl.cc:52
virtual ~VertexImpl()
Definition: VertexImpl.cc:18
virtual float getChi2() const
Chi squared of the vertex fit.
Definition: VertexImpl.cc:23
float _vpos[3]
Definition: VertexImpl.h:97
virtual const float * getPosition() const
Position of the vertex.
Definition: VertexImpl.cc:25
void setPrimary(bool primary)
Definition: VertexImpl.cc:32