BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkParams.cxx
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: TrkParams.cxx,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $
4//
5// Description:
6// Implementation of TrkParams class
7//
8// Environment:
9// Software developed for the BaBar Detector at the SLAC B-Factory.
10//
11// Author(s): Dave Brown, Steve Schaffner
12//------------------------------------------------------------------------
13//#include "BaBar/BaBar.h"
14#include <assert.h>
15#include "TrkBase/TrkParams.h"
16#include <iostream>
17using std::ostream;
18
19// Construct with the correct dimension
20//--------------------------------------
21TrkParams::TrkParams(int ndim) : DifIndepPar(ndim), _weightInverted(false)
22//--------------------------------------
23{
24}
25
26// Construct from an input parameter vector and covariance matrix
27//--------------------------------------
28TrkParams::TrkParams(const HepVector& pvec,const HepSymMatrix& pcov) :
29 DifIndepPar(pvec, pcov), _weightInverted(false)
30//--------------------------------------
31{
32
33}
34
35// copy constructor
36//--------------------------------------
38 DifIndepPar(old), _weightInverted(old._weightInverted), _weightMatrix(old._weightMatrix)
39//--------------------------------------
40{}
41
42// base implementation of clone function
43//--------------------------------------
46//--------------------------------------
47 return new TrkParams(*this);
48}
49
50//--------------------------------------
52//--------------------------------------
53
54// Assignment operator
55//--------------------------------------
58//--------------------------------------
59 if (this == &other) return *this;
60 parameter() = other.parameter();
61 covariance() = other.covariance();
62 _weightInverted = other._weightInverted ;
63 _weightMatrix = other._weightMatrix ;
64 return *this;
65}
66
67//--------------------------------------
68void
69TrkParams::printAll(ostream& os) const {
70//--------------------------------------
72}
73
74
75const HepSymMatrix& TrkParams::weightMatrix() const {
76
77 if (!_weightInverted){
78 _weightMatrix = covariance();
79 int invStatus;
80 _weightMatrix.invert(invStatus);
81 _weightInverted = true;
82 }
83 return _weightMatrix;
84
85}
HepVector & parameter()
Definition: DifIndepPar.h:51
void printAll(std::ostream &os=std::cout) const
Definition: DifIndepPar.cxx:76
TrkParams(int nParam)
Definition: TrkParams.cxx:21
HepSymMatrix & covariance()
Definition: TrkParams.h:54
virtual ~TrkParams()
Definition: TrkParams.cxx:51
virtual TrkParams * clone() const
Definition: TrkParams.cxx:45
void printAll(std::ostream &os) const
Definition: TrkParams.cxx:69
TrkParams & operator=(const TrkParams &)
Definition: TrkParams.cxx:57
const HepSymMatrix & weightMatrix() const
Definition: TrkParams.cxx:75