GENFIT  Rev:NoNumberAvailable
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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  private:
73  TVector3 getPos() const;
74  TVector3 getMom() const;
75  TVector3 getDir() const;
76  void getPosMom(TVector3& pos, TVector3& mom) const;
77  void getPosDir(TVector3& pos, TVector3& dir) const;
78  TVectorD get6DState() const;
79  double getMomMag() const;
80  int getPDG() const;
81  double getCharge() const;
82  double getQop() const;
83  double getMass() const;
84  double getTime() const;
85 
86  void setPosMom(const TVector3& pos, const TVector3& mom);
87  void setPosMom(const TVectorD& state6);
88  void setChargeSign(double charge);
89  void setQop(double qop);
90  void setTime(double time);
91 
92 
93  protected:
94 
95 #ifndef __CINT__
96  boost::scoped_ptr<const AbsHMatrix> hMatrix_; // Ownership
97 #else
98  const AbsHMatrix* hMatrix_;
99 #endif
100  double weight_;
101 
102  public:
103  ClassDef(MeasurementOnPlane,1)
104 
105 };
106 
107 } /* End of namespace */
110 #endif // _MeasurementOnPlane_h
const AbsHMatrix * getHMatrix() const
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
double getMomMag() const
boost::scoped_ptr< const AbsHMatrix > hMatrix_
void setChargeSign(double charge)
void setHMatrix(const AbsHMatrix *hMatrix)
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
Definition: AbsHMatrix.h:37
MeasurementOnPlane(const AbsTrackRep *rep=NULL)
double getCharge() const
TVector3 getPos() const
void setQop(double qop)
TVector3 getMom() const
void setPosMom(const TVector3 &pos, const TVector3 &mom)
void setTime(double time)
TVector3 getDir() const
StateOnPlane with additional covariance matrix.
MeasurementOnPlane & operator=(MeasurementOnPlane other)
assignment operator
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
TVectorD get6DState() const
void getPosMom(TVector3 &pos, TVector3 &mom) const
void setWeight(double weight)
void swap(MeasurementOnPlane &other)
MeasurementOnPlane(const TVectorD &state, const TMatrixDSym &cov, SharedPlanePtr plane, const AbsTrackRep *rep, const AbsHMatrix *hMatrix, double weight=1.)
void getPosDir(TVector3 &pos, TVector3 &dir) const
void Print(Option_t *option="") const
Measured coordinates on a plane.
Defines for I/O streams used for error and debug printing.