24 #ifndef genfit_MeasuredStateOnPlane_h
25 #define genfit_MeasuredStateOnPlane_h
27 #include "StateOnPlane.h"
28 #include "AbsTrackRep.h"
30 #include <TMatrixDSym.h>
56 const TMatrixDSym& getCov()
const {
return cov_;}
57 TMatrixDSym& getCov() {
return cov_;}
60 void blowUpCov(
double blowUpFac,
bool resetOffDiagonals =
true,
double maxVal = -1.);
62 void setStateCov(
const TVectorD& state,
const TMatrixDSym& cov) {setState(state); setCov(cov);}
63 void setStateCovPlane(
const TVectorD& state,
const TMatrixDSym& cov,
const SharedPlanePtr& plane) {setStatePlane(state, plane); setCov(cov);}
64 void setCov(
const TMatrixDSym& cov) {
if(cov_.GetNrows() == 0) cov_.ResizeTo(cov); cov_ = cov;}
67 TMatrixDSym get6DCov()
const {
return getRep()->
get6DCov(*
this);};
68 void getPosMomCov(TVector3& pos, TVector3& mom, TMatrixDSym& cov)
const {getRep()->
getPosMomCov(*
this, pos, mom, cov);}
69 void get6DStateCov(TVectorD& stateVec, TMatrixDSym& cov)
const {getRep()->
get6DStateCov(*
this, stateVec, cov);}
70 double getMomVar()
const {
return getRep()->
getMomVar(*
this);}
72 void setPosMomErr(
const TVector3& pos,
const TVector3& mom,
const TVector3& posErr,
const TVector3& momErr) {getRep()->
setPosMomErr(*
this, pos, mom, posErr, momErr);}
73 void setPosMomCov(
const TVector3& pos,
const TVector3& mom,
const TMatrixDSym& cov6x6) {getRep()->
setPosMomCov(*
this, pos, mom, cov6x6);}
74 void setPosMomCov(
const TVectorD& state6,
const TMatrixDSym& cov6x6) {getRep()->
setPosMomCov(*
this, state6, cov6x6);}
77 virtual void Print(Option_t* option =
"")
const override;
96 StateOnPlane::swap(other);
97 this->cov_.ResizeTo(other.cov_);
98 std::swap(this->cov_, other.cov_);
101 inline MeasuredStateOnPlane::MeasuredStateOnPlane(
const AbsTrackRep* rep) :
102 StateOnPlane(rep), cov_(0,0)
104 if (rep !=
nullptr) {
105 cov_.ResizeTo(rep->getDim(), rep->getDim());
109 inline MeasuredStateOnPlane::MeasuredStateOnPlane(
const TVectorD& state,
const TMatrixDSym& cov,
const SharedPlanePtr& plane,
const AbsTrackRep* rep) :
110 StateOnPlane(state, plane, rep), cov_(cov)
112 assert(rep !=
nullptr);
116 inline MeasuredStateOnPlane::MeasuredStateOnPlane(
const TVectorD& state,
const TMatrixDSym& cov,
const SharedPlanePtr& plane,
const AbsTrackRep* rep,
const TVectorD& auxInfo) :
117 StateOnPlane(state, plane, rep, auxInfo), cov_(cov)
119 assert(rep !=
nullptr);
123 inline MeasuredStateOnPlane::MeasuredStateOnPlane(
const MeasuredStateOnPlane& o) :
124 StateOnPlane(o), cov_(o.cov_)
128 inline MeasuredStateOnPlane::MeasuredStateOnPlane(
const StateOnPlane& state,
const TMatrixDSym& cov) :
129 StateOnPlane(state), cov_(cov)
134 inline MeasuredStateOnPlane& MeasuredStateOnPlane::operator=(MeasuredStateOnPlane other) {
Abstract base class for a track representation.
virtual void setPosMomCov(MeasuredStateOnPlane &state, const TVector3 &pos, const TVector3 &mom, const TMatrixDSym &cov6x6) const =0
Set position, momentum and covariance of state.
virtual double getMomVar(const MeasuredStateOnPlane &state) const =0
get the variance of the absolute value of the momentum .
virtual void setPosMomErr(MeasuredStateOnPlane &state, const TVector3 &pos, const TVector3 &mom, const TVector3 &posErr, const TVector3 &momErr) const =0
Set position and momentum and error of state.
virtual void get6DStateCov(const MeasuredStateOnPlane &state, TVectorD &stateVec, TMatrixDSym &cov) const
Translates MeasuredStateOnPlane into 6D state vector (x, y, z, p_x, p_y, p_z) and 6x6 covariance.
virtual TMatrixDSym get6DCov(const MeasuredStateOnPlane &state) const =0
Get the 6D covariance.
virtual void getPosMomCov(const MeasuredStateOnPlane &state, TVector3 &pos, TVector3 &mom, TMatrixDSym &cov) const =0
Translates MeasuredStateOnPlane into 3D position, momentum and 6x6 covariance.
#StateOnPlane with additional covariance matrix.
void blowUpCov(double blowUpFac, bool resetOffDiagonals=true, double maxVal=-1.)
Blow up covariance matrix with blowUpFac. Per default, off diagonals are reset to 0 and the maximum v...
A state with arbitrary dimension defined in a DetPlane.
Defines for I/O streams used for error and debug printing.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
MeasuredStateOnPlane calcAverageState(const MeasuredStateOnPlane &forwardState, const MeasuredStateOnPlane &backwardState)
Calculate weighted average between two MeasuredStateOnPlanes.