FairRoot/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 
35 namespace genfit {
36 
46 
47  public:
48 
49  MeasurementOnPlane(const AbsTrackRep* rep = NULL) :
50  MeasuredStateOnPlane(rep), hMatrix_(NULL), weight_(0) {}
51  MeasurementOnPlane(const TVectorD& state, const TMatrixDSym& cov, SharedPlanePtr plane, const AbsTrackRep* rep, const AbsHMatrix* hMatrix, double weight = 1.) :
52  MeasuredStateOnPlane(state, cov, plane, rep), hMatrix_(hMatrix), weight_(weight) {}
53 
58  void swap(MeasurementOnPlane& other);
59 
60  virtual ~MeasurementOnPlane() {}
61 
62  const AbsHMatrix* getHMatrix() const {return hMatrix_.get();}
63  double getWeight() const {return weight_;}
64 
65  TMatrixDSym getWeightedCov() {return weight_*cov_;}
66 
67  void setHMatrix(const AbsHMatrix* hMatrix) {hMatrix_.reset(hMatrix);}
68  void setWeight(double weight) {weight_ = fmax(weight, 1.E-10);}
69 
70  void Print(Option_t* option = "") const ;
71 
72  protected:
73 
74 #ifndef __CINT__
75  boost::scoped_ptr<const AbsHMatrix> hMatrix_; // Ownership
76 #else
77  const AbsHMatrix* hMatrix_;
78 #endif
79  double weight_;
80 
81  public:
82  ClassDef(MeasurementOnPlane,1)
83 
84 };
85 
86 } /* End of namespace */
89 #endif // _MeasurementOnPlane_h
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
boost::scoped_ptr< const AbsHMatrix > hMatrix_
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
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:37
void setHMatrix(const AbsHMatrix *hMatrix)
Measured coordinates on a plane.
void swap(MeasurementOnPlane &other)
const AbsHMatrix * getHMatrix() const
MeasurementOnPlane & operator=(MeasurementOnPlane other)
assignment operator
void setWeight(double weight)
void Print(Option_t *option="") const
MeasurementOnPlane(const AbsTrackRep *rep=NULL)