Belle II Software  release-08-01-10
AbsHMatrix.h
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
23 #ifndef genfit_AbsHMatrix_h
24 #define genfit_AbsHMatrix_h
25 
26 #include <TObject.h>
27 #include <TMatrixDSym.h>
28 #include <TVectorD.h>
29 
30 
31 namespace genfit {
32 
37 class AbsHMatrix : public TObject {
38 
39  public:
40 
41  AbsHMatrix() {;}
42 
43  virtual ~AbsHMatrix() {;}
44 
46  virtual const TMatrixD& getMatrix() const = 0;
47 
49  virtual TVectorD Hv(const TVectorD& v) const {return getMatrix()*v;}
50 
52  virtual TMatrixD MHt(const TMatrixDSym& M) const {return TMatrixD(M, TMatrixD::kMultTranspose, getMatrix());}
53  virtual TMatrixD MHt(const TMatrixD& M) const {return TMatrixD(M, TMatrixD::kMultTranspose, getMatrix());}
54 
56  virtual void HMHt(TMatrixDSym& M) const {M.Similarity(getMatrix());}
57 
58  virtual AbsHMatrix* clone() const = 0;
59 
60  bool operator==(const AbsHMatrix& other) const {return this->isEqual(other);}
61  bool operator!=(const AbsHMatrix& other) const {return !(this->isEqual(other));}
62  virtual bool isEqual(const AbsHMatrix& other) const = 0;
63 
64  virtual void Print(const Option_t* = "") const {;}
65 
66  protected:
67  // protect from calling copy c'tor or assignment operator from outside the class. Use #clone() if you want a copy!
68  AbsHMatrix(const AbsHMatrix& o) : TObject(o) {;}
69  AbsHMatrix& operator=(const AbsHMatrix&);
70 
71  public:
72  ClassDef(AbsHMatrix,1)
73 
74 };
75 
76 } /* End of namespace genfit */
79 #endif // genfit_AbsHMatrix_h
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
Definition: AbsHMatrix.h:37
virtual void HMHt(TMatrixDSym &M) const
similarity: H*M*H^t
Definition: AbsHMatrix.h:56
virtual const TMatrixD & getMatrix() const =0
Get the actual matrix representation.
virtual TMatrixD MHt(const TMatrixDSym &M) const
M*H^t.
Definition: AbsHMatrix.h:52
virtual TVectorD Hv(const TVectorD &v) const
H*v.
Definition: AbsHMatrix.h:49
Defines for I/O streams used for error and debug printing.