GENFIT  Rev:NoNumberAvailable
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
genfit::MeasurementOnPlane::setWeight
void setWeight(double weight)
Definition: MeasurementOnPlane.h:68
genfit::SharedPlanePtr
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
Definition: SharedPlanePtr.h:43
genfit::MeasurementOnPlane::getQop
double getQop() const
genfit::MeasurementOnPlane::getHMatrix
const AbsHMatrix * getHMatrix() const
Definition: MeasurementOnPlane.h:62
genfit::AbsHMatrix
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
Definition: AbsHMatrix.h:37
genfit::MeasurementOnPlane::getDir
TVector3 getDir() const
genfit::MeasuredStateOnPlane
StateOnPlane with additional covariance matrix.
Definition: MeasuredStateOnPlane.h:38
genfit::MeasurementOnPlane::setHMatrix
void setHMatrix(const AbsHMatrix *hMatrix)
Definition: MeasurementOnPlane.h:67
genfit::MeasurementOnPlane::swap
void swap(MeasurementOnPlane &other)
Definition: MeasurementOnPlane.cc:43
genfit::MeasurementOnPlane::getPosMom
void getPosMom(TVector3 &pos, TVector3 &mom) const
genfit::MeasurementOnPlane::setQop
void setQop(double qop)
genfit::MeasurementOnPlane::getWeight
double getWeight() const
Definition: MeasurementOnPlane.h:63
genfit
Defines for I/O streams used for error and debug printing.
Definition: AbsFinitePlane.cc:22
genfit::MeasurementOnPlane::Print
void Print(Option_t *option="") const
Definition: MeasurementOnPlane.cc:50
genfit::MeasurementOnPlane::weight_
double weight_
Definition: MeasurementOnPlane.h:100
genfit::MeasurementOnPlane::hMatrix_
boost::scoped_ptr< const AbsHMatrix > hMatrix_
Definition: MeasurementOnPlane.h:96
genfit::MeasurementOnPlane::MeasurementOnPlane
MeasurementOnPlane(const TVectorD &state, const TMatrixDSym &cov, SharedPlanePtr plane, const AbsTrackRep *rep, const AbsHMatrix *hMatrix, double weight=1.)
Definition: MeasurementOnPlane.h:51
genfit::MeasurementOnPlane::getPosDir
void getPosDir(TVector3 &pos, TVector3 &dir) const
genfit::AbsTrackRep
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
genfit::MeasurementOnPlane::get6DState
TVectorD get6DState() const
genfit::MeasurementOnPlane::getWeightedCov
TMatrixDSym getWeightedCov()
Definition: MeasurementOnPlane.h:65
genfit::MeasurementOnPlane::getMass
double getMass() const
genfit::MeasurementOnPlane::~MeasurementOnPlane
virtual ~MeasurementOnPlane()
Definition: MeasurementOnPlane.h:60
genfit::MeasurementOnPlane::setChargeSign
void setChargeSign(double charge)
genfit::MeasurementOnPlane::getMomMag
double getMomMag() const
genfit::MeasurementOnPlane
Measured coordinates on a plane.
Definition: MeasurementOnPlane.h:45
genfit::MeasuredStateOnPlane::cov_
TMatrixDSym cov_
Definition: MeasuredStateOnPlane.h:80
AbsHMatrix.h
MeasuredStateOnPlane.h
genfit::MeasurementOnPlane::setTime
void setTime(double time)
genfit::MeasurementOnPlane::MeasurementOnPlane
MeasurementOnPlane(const AbsTrackRep *rep=NULL)
Definition: MeasurementOnPlane.h:49
genfit::MeasurementOnPlane::setPosMom
void setPosMom(const TVector3 &pos, const TVector3 &mom)
genfit::MeasurementOnPlane::getCharge
double getCharge() const
genfit::MeasurementOnPlane::getTime
double getTime() const
genfit::MeasurementOnPlane::operator=
MeasurementOnPlane & operator=(MeasurementOnPlane other)
assignment operator
Definition: MeasurementOnPlane.cc:37
genfit::MeasurementOnPlane::getPos
TVector3 getPos() const
genfit::MeasurementOnPlane::getMom
TVector3 getMom() const
genfit::MeasurementOnPlane::getPDG
int getPDG() const