20 #include "ReferenceStateOnPlane.h"
26 ReferenceStateOnPlane::ReferenceStateOnPlane() :
28 forwardSegmentLength_(0),
29 backwardSegmentLength_(0),
30 forwardTransportMatrix_(),
31 backwardTransportMatrix_(),
32 forwardNoiseMatrix_(),
33 backwardNoiseMatrix_(),
40 ReferenceStateOnPlane::ReferenceStateOnPlane(
const TVectorD& state,
41 const SharedPlanePtr& plane,
42 const AbsTrackRep* rep) :
43 StateOnPlane(state, plane, rep),
44 forwardSegmentLength_(0),
45 backwardSegmentLength_(0),
46 forwardTransportMatrix_(rep->getDim(), rep->getDim()),
47 backwardTransportMatrix_(rep->getDim(), rep->getDim()),
48 forwardNoiseMatrix_(rep->getDim()),
49 backwardNoiseMatrix_(rep->getDim()),
50 forwardDeltaState_(rep->getDim()),
51 backwardDeltaState_(rep->getDim())
56 ReferenceStateOnPlane::ReferenceStateOnPlane(
const TVectorD& state,
57 const SharedPlanePtr& plane,
58 const AbsTrackRep* rep,
59 const TVectorD& auxInfo) :
60 StateOnPlane(state, plane, rep, auxInfo),
61 forwardSegmentLength_(0),
62 backwardSegmentLength_(0),
63 forwardTransportMatrix_(rep->getDim(), rep->getDim()),
64 backwardTransportMatrix_(rep->getDim(), rep->getDim()),
65 forwardNoiseMatrix_(rep->getDim()),
66 backwardNoiseMatrix_(rep->getDim()),
67 forwardDeltaState_(rep->getDim()),
68 backwardDeltaState_(rep->getDim())
74 ReferenceStateOnPlane::ReferenceStateOnPlane(
const StateOnPlane& state) :
76 forwardSegmentLength_(0),
77 backwardSegmentLength_(0),
78 forwardTransportMatrix_(state.getRep()->getDim(), state.getRep()->getDim()),
79 backwardTransportMatrix_(state.getRep()->getDim(), state.getRep()->getDim()),
80 forwardNoiseMatrix_(state.getRep()->getDim()),
81 backwardNoiseMatrix_(state.getRep()->getDim()),
82 forwardDeltaState_(state.getRep()->getDim()),
83 backwardDeltaState_(state.getRep()->getDim())
85 errorOut <<
"should never come here" << std::endl;
90 StateOnPlane& ReferenceStateOnPlane::operator=(ReferenceStateOnPlane other) {
95 void ReferenceStateOnPlane::swap(ReferenceStateOnPlane& other) {
96 StateOnPlane::swap(other);
97 std::swap(this->forwardSegmentLength_, other.forwardSegmentLength_);
98 std::swap(this->backwardSegmentLength_, other.backwardSegmentLength_);
99 this->forwardTransportMatrix_.ResizeTo(other.forwardTransportMatrix_);
100 std::swap(this->forwardTransportMatrix_, other.forwardTransportMatrix_);
101 this->backwardTransportMatrix_.ResizeTo(other.backwardTransportMatrix_);
102 std::swap(this->backwardTransportMatrix_, other.backwardTransportMatrix_);
103 this->forwardNoiseMatrix_.ResizeTo(other.forwardNoiseMatrix_);
104 std::swap(this->forwardNoiseMatrix_, other.forwardNoiseMatrix_);
105 this->backwardNoiseMatrix_.ResizeTo(other.backwardNoiseMatrix_);
106 std::swap(this->backwardNoiseMatrix_, other.backwardNoiseMatrix_);
107 this->forwardDeltaState_.ResizeTo(other.forwardDeltaState_);
108 std::swap(this->forwardDeltaState_, other.forwardDeltaState_);
109 this->backwardDeltaState_.ResizeTo(other.backwardDeltaState_);
110 std::swap(this->backwardDeltaState_, other.backwardDeltaState_);
114 void ReferenceStateOnPlane::resetForward() {
115 forwardSegmentLength_ = 0;
116 forwardTransportMatrix_.UnitMatrix();
117 forwardNoiseMatrix_.Zero();
118 forwardDeltaState_.Zero();
121 void ReferenceStateOnPlane::resetBackward() {
122 backwardSegmentLength_ = 0;
123 backwardTransportMatrix_.UnitMatrix();
124 backwardNoiseMatrix_.Zero();
125 backwardDeltaState_.Zero();
129 void ReferenceStateOnPlane::Print(Option_t*)
const {
130 StateOnPlane::Print();
132 printOut <<
" forwardSegmentLength: " << forwardSegmentLength_ <<
"\n";
133 printOut <<
" forwardTransportMatrix: "; forwardTransportMatrix_.Print();
134 printOut <<
" forwardNoiseMatrix: "; forwardNoiseMatrix_.Print();
135 printOut <<
" forwardDeltaState: "; forwardDeltaState_.Print();
137 printOut <<
" backwardSegmentLength_: " << backwardSegmentLength_ <<
"\n";
138 printOut <<
" backwardTransportMatrix: "; backwardTransportMatrix_.Print();
139 printOut <<
" backwardNoiseMatrix: "; backwardNoiseMatrix_.Print();
140 printOut <<
" backwardDeltaState: "; backwardDeltaState_.Print();
Defines for I/O streams used for error and debug printing.
std::ostream printOut
Default stream for output of Print calls.
std::ostream errorOut
Default stream for error output.