00001 #include "IMPL/VertexImpl.h"
00002 #include <algorithm>
00003
00004 using namespace EVENT ;
00005
00006 namespace IMPL{
00007
00008 VertexImpl::VertexImpl() :
00009 _primary(0),
00010 _chi2(0),
00011 _probability(0),
00012 _par(0),
00013 _aParticle(0)
00014 {
00015 _type="Unknown";
00016 _cov.resize( VTXCOVMATRIX ) ;
00017 _vpos[0] = 0. ;
00018 _vpos[1] = 0. ;
00019 _vpos[2] = 0. ;
00020 }
00021
00022 VertexImpl::~VertexImpl(){ }
00023
00024 bool VertexImpl::isPrimary() const { return _primary ; }
00025
00026 const std::string& VertexImpl::getAlgorithmType() const { return _type ; }
00027 float VertexImpl::getChi2() const { return _chi2 ; }
00028 float VertexImpl::getProbability() const { return _probability ; }
00029 const float* VertexImpl::getPosition() const { return _vpos ; }
00030 const EVENT::FloatVec & VertexImpl::getCovMatrix() const { return _cov ; }
00031 const EVENT::FloatVec & VertexImpl::getParameters() const { return _par ; }
00032 EVENT::ReconstructedParticle * VertexImpl::getAssociatedParticle() const { return _aParticle ; }
00033
00034
00035
00036 void VertexImpl::setPrimary(bool primary){
00037 checkAccess("VertexImpl::setPrimary" );
00038 _primary = (primary==0?0:1);
00039 }
00040
00041
00042
00043
00044
00045
00046 void VertexImpl::setAlgorithmType( const std::string type ){
00047 checkAccess("VertexImpl::setAlgorithmType");
00048 _type = type;
00049 }
00050
00051 void VertexImpl::setChi2(float chi2){
00052 checkAccess("VertexImpl::setChi2" );
00053 _chi2 = chi2 ;
00054 }
00055
00056 void VertexImpl::setProbability(float probability){
00057 checkAccess("VertexImpl::setProbability" );
00058 _probability = probability ;
00059 }
00060
00061 void VertexImpl::setPosition( float vpos[3] ){
00062 setPosition( vpos[0], vpos[1], vpos[2] ) ;
00063 }
00064
00065 void VertexImpl::setPosition( float px, float py, float pz ){
00066 checkAccess("VertexImpl::setPosition" );
00067 _vpos[0] = px ;
00068 _vpos[1] = py ;
00069 _vpos[2] = pz ;
00070 }
00071
00072 void VertexImpl::setCovMatrix( const float* cov ){
00073 checkAccess("VertexImpl::setCovMatrix" );
00074 for(int i=0;i<VTXCOVMATRIX;i++) _cov[i] = cov[i] ;
00075 }
00076
00077 void VertexImpl::setCovMatrix( const EVENT::FloatVec& cov ){
00078 checkAccess("VertexImpl::" );
00079 for(int i=0;i<VTXCOVMATRIX;i++) _cov[i] = cov[i] ;
00080 }
00081
00082 void VertexImpl::setAssociatedParticle( EVENT::ReconstructedParticle *aP ){
00083 checkAccess("VertexImpl::setAssociatedParticle" );
00084 _aParticle = aP;
00085 }
00086
00087 void VertexImpl::addParameter( float p ){
00088 checkAccess("VertexImpl::addParameter") ;
00089 _par.push_back( p ) ;
00090 }
00091
00092 }
00093
00094
00095
00096