File indexing completed on 2025-08-05 08:18:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024 #ifndef genfit_MeasurementOnPlane_h
0025 #define genfit_MeasurementOnPlane_h
0026
0027 #include "MeasuredStateOnPlane.h"
0028 #include "AbsHMatrix.h"
0029
0030 #include <TMatrixD.h>
0031
0032 #include <cmath>
0033 #include <memory>
0034
0035
0036 namespace genfit {
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 class MeasurementOnPlane : public MeasuredStateOnPlane {
0047
0048 public:
0049
0050 MeasurementOnPlane(const AbsTrackRep* rep = nullptr) :
0051 MeasuredStateOnPlane(rep), hMatrix_(nullptr), weight_(0) {}
0052 MeasurementOnPlane(const TVectorD& state, const TMatrixDSym& cov, SharedPlanePtr plane, const AbsTrackRep* rep, const AbsHMatrix* hMatrix, double weight = 1.) :
0053 MeasuredStateOnPlane(state, cov, plane, rep), hMatrix_(hMatrix), weight_(weight) {}
0054
0055
0056 MeasurementOnPlane(const MeasurementOnPlane& other);
0057
0058 MeasurementOnPlane& operator=(MeasurementOnPlane other);
0059 void swap(MeasurementOnPlane& other);
0060
0061 virtual ~MeasurementOnPlane() {}
0062
0063 const AbsHMatrix* getHMatrix() const {return hMatrix_.get();}
0064 double getWeight() const {return weight_;}
0065
0066 TMatrixDSym getWeightedCov() {return weight_*cov_;}
0067
0068 void setHMatrix(const AbsHMatrix* hMatrix) {hMatrix_.reset(hMatrix);}
0069 void setWeight(double weight) {weight_ = fmax(weight, 1.E-10);}
0070
0071 void Print(Option_t* option = "") const override ;
0072
0073 private:
0074 TVector3 getPos() const;
0075 TVector3 getMom() const;
0076 TVector3 getDir() const;
0077 void getPosMom(TVector3& pos, TVector3& mom) const;
0078 void getPosDir(TVector3& pos, TVector3& dir) const;
0079 TVectorD get6DState() const;
0080 double getMomMag() const;
0081 int getPDG() const;
0082 double getCharge() const;
0083 double getQop() const;
0084 double getMass() const;
0085 double getTime() const;
0086
0087 void setPosMom(const TVector3& pos, const TVector3& mom);
0088 void setPosMom(const TVectorD& state6);
0089 void setChargeSign(double charge);
0090 void setQop(double qop);
0091 void setTime(double time);
0092
0093
0094 protected:
0095
0096 std::unique_ptr<const AbsHMatrix> hMatrix_;
0097 double weight_;
0098
0099 public:
0100 ClassDefOverride(MeasurementOnPlane,1)
0101
0102 };
0103
0104 }
0105
0106
0107 #endif