Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbsMeasurement.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file AbsMeasurement.h
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 */
23 #ifndef genfit_AbsMeasurement_h
24 #define genfit_AbsMeasurement_h
25 
26 #include "MeasurementOnPlane.h"
27 #include "AbsHMatrix.h"
28 
29 #include <TObject.h>
30 
31 
32 namespace genfit {
33 
34 class AbsTrackRep;
35 class TrackPoint;
36 
42 class AbsMeasurement : public TObject {
43 
44  public:
45 
47  AbsMeasurement(int nDims) : rawHitCoords_(nDims), rawHitCov_(nDims), detId_(-1), hitId_(-1), trackPoint_(nullptr) {;}
48  AbsMeasurement(const TVectorD& rawHitCoords, const TMatrixDSym& rawHitCov, int detId, int hitId, TrackPoint* trackPoint);
49 
50  virtual ~AbsMeasurement();
51 
53  virtual AbsMeasurement* clone() const = 0;
54 
57 
58  const TVectorD& getRawHitCoords() const {return rawHitCoords_;}
59  const TMatrixDSym& getRawHitCov() const {return rawHitCov_;}
60  TVectorD& getRawHitCoords() {return rawHitCoords_;}
61  TMatrixDSym& getRawHitCov() {return rawHitCov_;}
62  int getDetId() const {return detId_;}
63  int getHitId() const {return hitId_;}
64 
66  virtual bool isLeftRightMeasurement() const {return false;}
67  virtual int getLeftRightResolution() const {return 0;}
68 
69  unsigned int getDim() const {return rawHitCoords_.GetNrows();}
70 
71  void setRawHitCoords(const TVectorD& coords) {rawHitCoords_ = coords;}
72  void setRawHitCov(const TMatrixDSym& cov) {rawHitCov_ = cov;}
73  void setDetId(int detId) {detId_ = detId;}
74  void setHitId(int hitId) {hitId_ = hitId;}
75 
76 
84  virtual SharedPlanePtr constructPlane(const StateOnPlane& state) const = 0;
85 
95  virtual std::vector<genfit::MeasurementOnPlane*> constructMeasurementsOnPlane(const StateOnPlane& state) const = 0;
96 
100  virtual const AbsHMatrix* constructHMatrix(const AbsTrackRep*) const = 0;
101 
102  virtual void Print(const Option_t* = "") const;
103 
104 
105  private:
107  AbsMeasurement& operator=(const AbsMeasurement&); // default cannot work because TVector and TMatrix = operators don't do resizing
108 
109  protected:
112 
113  TVectorD rawHitCoords_;
114  TMatrixDSym rawHitCov_;
115  int detId_; // detId id is -1 per default
116  int hitId_; // hitId id is -1 per default
117 
120 
121  public:
122  ClassDef(AbsMeasurement, 3)
123 };
124 
125 } /* End of namespace genfit */
128 #endif // genfit_AbsMeasurement_h