PandaRoot
MeasurementOnPlane.h
Go to the documentation of this file.
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 */
19 
24 #ifndef genfit_MeasurementOnPlane_h
25 #define genfit_MeasurementOnPlane_h
26 
27 #include "MeasuredStateOnPlane.h"
28 #include "AbsHMatrix.h"
29 
30 #include <TMatrixD.h>
31 
32 #include <cmath>
33 
34 namespace genfit {
35 
45 
46  public:
47  MeasurementOnPlane(const AbsTrackRep *rep = nullptr) : MeasuredStateOnPlane(rep), hMatrix_(nullptr), weight_(0) {}
48  MeasurementOnPlane(const TVectorD &state, const TMatrixDSym &cov, SharedPlanePtr plane, const AbsTrackRep *rep, const AbsHMatrix *hMatrix, double weight = 1.)
49  : MeasuredStateOnPlane(state, cov, plane, rep), hMatrix_(hMatrix), weight_(weight)
50  {
51  }
52 
57  void swap(MeasurementOnPlane &other);
58 
59  virtual ~MeasurementOnPlane() {}
60 
61  const AbsHMatrix *getHMatrix() const { return hMatrix_.get(); }
62  double getWeight() const { return weight_; }
63 
64  TMatrixDSym getWeightedCov() { return weight_ * cov_; }
65 
66  void setHMatrix(const AbsHMatrix *hMatrix) { hMatrix_.reset(hMatrix); }
67  void setWeight(double weight) { weight_ = fmax(weight, 1.E-10); }
68 
69  void Print(Option_t *option = "") const;
70 
71  protected:
72 #ifndef __CINT__
73  boost::scoped_ptr<const AbsHMatrix> hMatrix_; // Ownership
74 #else
75  const AbsHMatrix *hMatrix_;
76 #endif
77  double weight_;
78 
79  public:
80  ClassDef(MeasurementOnPlane, 1)
81 };
82 
83 } // namespace genfit
86 #endif // _MeasurementOnPlane_h
const AbsHMatrix * getHMatrix() const
boost::scoped_ptr< const AbsHMatrix > hMatrix_
void Print(Option_t *option="") const
Abstract base class for a track representation.
Definition: AbsTrackRep.h:62
MeasurementOnPlane(const TVectorD &state, const TMatrixDSym &cov, SharedPlanePtr plane, const AbsTrackRep *rep, const AbsHMatrix *hMatrix, double weight=1.)
StateOnPlane with additional covariance matrix.
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
Definition: AbsHMatrix.h:36
void setHMatrix(const AbsHMatrix *hMatrix)
MeasurementOnPlane(const AbsTrackRep *rep=nullptr)
Measured coordinates on a plane.
void swap(MeasurementOnPlane &other)
MeasurementOnPlane & operator=(MeasurementOnPlane other)
assignment operator
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
void setWeight(double weight)
Matrix inversion tools.
Definition: AbsBField.h:28