PandaRoot
AbsMeasurement.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /* Copyright 2008-2010, Technische Universitaet Muenchen,
14  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
15 
16  This file is part of GENFIT.
17 
18  GENFIT is free software: you can redistribute it and/or modify
19  it under the terms of the GNU Lesser General Public License as published
20  by the Free Software Foundation, either version 3 of the License, or
21  (at your option) any later version.
22 
23  GENFIT is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26  GNU Lesser General Public License for more details.
27 
28  You should have received a copy of the GNU Lesser General Public License
29  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
30 */
35 #ifndef genfit_AbsMeasurement_h
36 #define genfit_AbsMeasurement_h
37 
38 #include "MeasurementOnPlane.h"
39 #include "AbsHMatrix.h"
40 
41 #include <TObject.h>
42 
43 namespace genfit {
44 
45 class AbsTrackRep;
46 class TrackPoint;
47 
53 class AbsMeasurement : public TObject {
54 
55  public:
57  AbsMeasurement(int nDims) : rawHitCoords_(nDims), rawHitCov_(nDims), detId_(-1), hitId_(-1) { ; }
58  AbsMeasurement(const TVectorD &rawHitCoords, const TMatrixDSym &rawHitCov, int detId, int hitId, TrackPoint *trackPoint);
59 
60  virtual ~AbsMeasurement();
61 
63  virtual AbsMeasurement *clone() const = 0;
64 
65  TrackPoint *getTrackPoint() const { return trackPoint_; }
66  void setTrackPoint(TrackPoint *tp) { trackPoint_ = tp; }
67 
68  const TVectorD &getRawHitCoords() const { return rawHitCoords_; }
69  const TMatrixDSym &getRawHitCov() const { return rawHitCov_; }
70  TVectorD &getRawHitCoords() { return rawHitCoords_; }
71  TMatrixDSym &getRawHitCov() { return rawHitCov_; }
72  int getDetId() const { return detId_; }
73  int getHitId() const { return hitId_; }
74 
76  virtual bool isLeftRightMeasurement() const { return false; }
77  virtual int getLeftRightResolution() const { return 0; }
78 
79  unsigned int getDim() const { return rawHitCoords_.GetNrows(); }
80 
81  void setRawHitCoords(const TVectorD &coords) { rawHitCoords_ = coords; }
82  void setRawHitCov(const TMatrixDSym &cov) { rawHitCov_ = cov; }
83  void setDetId(int detId) { detId_ = detId; }
84  void setHitId(int hitId) { hitId_ = hitId; }
85 
93  virtual SharedPlanePtr constructPlane(const StateOnPlane &state) const = 0;
94 
104  virtual std::vector<genfit::MeasurementOnPlane *> constructMeasurementsOnPlane(const StateOnPlane &state) const = 0;
105 
109  virtual const AbsHMatrix *constructHMatrix(const AbsTrackRep *) const = 0;
110 
111  virtual void Print(const Option_t * = "") const;
112 
113  private:
115  AbsMeasurement &operator=(const AbsMeasurement &); // default cannot work because TVector and TMatrix = operators don't do resizing
116 
117  protected:
120 
121  TVectorD rawHitCoords_;
122  TMatrixDSym rawHitCov_;
123  int detId_; // detId id is -1 per default
124  int hitId_; // hitId id is -1 per default
125 
128 
129  public:
130  ClassDef(AbsMeasurement, 3)
131 };
132 
133 } /* End of namespace genfit */
136 #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:74
void setRawHitCov(const TMatrixDSym &cov)
const TVectorD & getRawHitCoords() const
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
Definition: AbsHMatrix.h:48
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:56
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:61
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:40