PandaRoot
MeasurementOnPlane.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 */
31 
36 #ifndef genfit_MeasurementOnPlane_h
37 #define genfit_MeasurementOnPlane_h
38 
39 #include "MeasuredStateOnPlane.h"
40 #include "AbsHMatrix.h"
41 
42 #include <TMatrixD.h>
43 
44 #include <cmath>
45 
46 namespace genfit {
47 
57 
58  public:
59  MeasurementOnPlane(const AbsTrackRep *rep = nullptr) : MeasuredStateOnPlane(rep), hMatrix_(nullptr), weight_(0) {}
60  MeasurementOnPlane(const TVectorD &state, const TMatrixDSym &cov, SharedPlanePtr plane, const AbsTrackRep *rep, const AbsHMatrix *hMatrix, double weight = 1.)
61  : MeasuredStateOnPlane(state, cov, plane, rep), hMatrix_(hMatrix), weight_(weight)
62  {
63  }
64 
69  void swap(MeasurementOnPlane &other);
70 
71  virtual ~MeasurementOnPlane() {}
72 
73  const AbsHMatrix *getHMatrix() const { return hMatrix_.get(); }
74  double getWeight() const { return weight_; }
75 
76  TMatrixDSym getWeightedCov() { return weight_ * cov_; }
77 
78  void setHMatrix(const AbsHMatrix *hMatrix) { hMatrix_.reset(hMatrix); }
79  void setWeight(double weight) { weight_ = fmax(weight, 1.E-10); }
80 
81  void Print(Option_t *option = "") const;
82 
83  protected:
84 #ifndef __CINT__
85  boost::scoped_ptr<const AbsHMatrix> hMatrix_; // Ownership
86 #else
87  const AbsHMatrix *hMatrix_;
88 #endif
89  double weight_;
90 
91  public:
92  ClassDef(MeasurementOnPlane, 1)
93 };
94 
95 } // namespace genfit
98 #endif // _MeasurementOnPlane_h
const AbsHMatrix * getHMatrix() const
boost::scoped_ptr< const AbsHMatrix > hMatrix_
void Print(Option_t *option="") const
Abstract base class for a track representation.
Definition: AbsTrackRep.h:74
MeasurementOnPlane(const TVectorD &state, const TMatrixDSym &cov, SharedPlanePtr plane, const AbsTrackRep *rep, const AbsHMatrix *hMatrix, double weight=1.)
StateOnPlane with additional covariance matrix.
HMatrix for projecting from AbsTrackRep parameters to measured parameters in a DetPlane.
Definition: AbsHMatrix.h:48
void setHMatrix(const AbsHMatrix *hMatrix)
MeasurementOnPlane(const AbsTrackRep *rep=nullptr)
Measured coordinates on a plane.
void swap(MeasurementOnPlane &other)
MeasurementOnPlane & operator=(MeasurementOnPlane other)
assignment operator
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
void setWeight(double weight)
Matrix inversion tools.
Definition: AbsBField.h:40