PandaRoot
AbsMeasurement.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 */
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 namespace genfit {
32 
33 class AbsTrackRep;
34 class TrackPoint;
35 
41 class AbsMeasurement : public TObject {
42 
43  public:
45  AbsMeasurement(int nDims) : rawHitCoords_(nDims), rawHitCov_(nDims), detId_(-1), hitId_(-1) { ; }
46  AbsMeasurement(const TVectorD &rawHitCoords, const TMatrixDSym &rawHitCov, int detId, int hitId, TrackPoint *trackPoint);
47 
48  virtual ~AbsMeasurement();
49 
51  virtual AbsMeasurement *clone() const = 0;
52 
53  TrackPoint *getTrackPoint() const { return trackPoint_; }
54  void setTrackPoint(TrackPoint *tp) { trackPoint_ = tp; }
55 
56  const TVectorD &getRawHitCoords() const { return rawHitCoords_; }
57  const TMatrixDSym &getRawHitCov() const { return rawHitCov_; }
58  TVectorD &getRawHitCoords() { return rawHitCoords_; }
59  TMatrixDSym &getRawHitCov() { return rawHitCov_; }
60  int getDetId() const { return detId_; }
61  int getHitId() const { return hitId_; }
62 
64  virtual bool isLeftRightMeasurement() const { return false; }
65  virtual int getLeftRightResolution() const { return 0; }
66 
67  unsigned int getDim() const { return rawHitCoords_.GetNrows(); }
68 
69  void setRawHitCoords(const TVectorD &coords) { rawHitCoords_ = coords; }
70  void setRawHitCov(const TMatrixDSym &cov) { rawHitCov_ = cov; }
71  void setDetId(int detId) { detId_ = detId; }
72  void setHitId(int hitId) { hitId_ = hitId; }
73 
81  virtual SharedPlanePtr constructPlane(const StateOnPlane &state) const = 0;
82 
92  virtual std::vector<genfit::MeasurementOnPlane *> constructMeasurementsOnPlane(const StateOnPlane &state) const = 0;
93 
97  virtual const AbsHMatrix *constructHMatrix(const AbsTrackRep *) const = 0;
98 
99  virtual void Print(const Option_t * = "") const;
100 
101  private:
103  AbsMeasurement &operator=(const AbsMeasurement &); // default cannot work because TVector and TMatrix = operators don't do resizing
104 
105  protected:
108 
109  TVectorD rawHitCoords_;
110  TMatrixDSym rawHitCov_;
111  int detId_; // detId id is -1 per default
112  int hitId_; // hitId id is -1 per default
113 
116 
117  public:
118  ClassDef(AbsMeasurement, 3)
119 };
120 
121 } /* End of namespace genfit */
124 #endif // genfit_AbsMeasurement_h
virtual int getLeftRightResolution() const
unsigned int getDim() const
virtual AbsMeasurement * clone() const =0
Deep copy ctor for polymorphic class.
Abstract base class for a track representation.
Definition: AbsTrackRep.h:62
void setRawHitCov(const TMatrixDSym &cov)
const TVectorD & getRawHitCoords() const
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
Definition: AbsHMatrix.h:36
virtual SharedPlanePtr constructPlane(const StateOnPlane &state) const =0
TrackPoint * trackPoint_
Pointer to TrackPoint where the measurement belongs to.
void setDetId(int detId)
void setTrackPoint(TrackPoint *tp)
A state with arbitrary dimension defined in a DetPlane.
Definition: StateOnPlane.h:44
void setRawHitCoords(const TVectorD &coords)
TVectorD & getRawHitCoords()
TrackPoint * getTrackPoint() const
virtual const AbsHMatrix * constructHMatrix(const AbsTrackRep *) const =0
Object containing AbsMeasurement and AbsFitterInfo objects.
Definition: TrackPoint.h:49
void setHitId(int hitId)
virtual void Print(const Option_t *="") const
const TMatrixDSym & getRawHitCov() const
virtual std::vector< genfit::MeasurementOnPlane * > constructMeasurementsOnPlane(const StateOnPlane &state) const =0
Contains the measurement and covariance in raw detector coordinates.
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
virtual bool isLeftRightMeasurement() const
If the AbsMeasurement is a wire hit, the left/right resolution will be used.
TMatrixDSym & getRawHitCov()
Matrix inversion tools.
Definition: AbsBField.h:28