GENFIT Rev: NoNumberAvailable
Loading...
Searching...
No Matches
GblFitterInfo.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 */
22
23#ifndef genfit_GblFitterInfo_h
24#define genfit_GblFitterInfo_h
25
26#include "AbsFitterInfo.h"
28#include "MeasurementOnPlane.h"
29#include "StateOnPlane.h"
30#include "TrackPoint.h"
31#include "ThinScatterer.h"
32#include "StateOnPlane.h"
33#include "Track.h"
35#include "GblPoint.h"
36#include "GblTrajectory.h"
37#include "GblFitter.h"
38#include "TMatrixD.h"
39#include "TMatrixDSym.h"
40#include "AbsHMatrix.h"
41
42#include <vector>
43#include <memory>
44
45
46namespace genfit {
47
48
53
54 public:
55
60
66 GblFitterInfo(const TrackPoint* trackPoint, const AbsTrackRep* rep);
67
75 GblFitterInfo(const TrackPoint* trackPoint, const AbsTrackRep* rep, StateOnPlane& referenceState);
76
84 void reset(unsigned int measurementDim = 2, unsigned int repDim = 5);
85
99 void setReferenceState(StateOnPlane& referenceState);
107 void setJacobian(TMatrixD jacobian);
108
117 TMatrixDSym getCovariance(double variance, TVector3 trackDirection, SharedPlanePtr measurementPlane) const;
118
130
141
156 const MeasuredStateOnPlane& getFittedState(bool afterKink = true) const override;
157
172 MeasurementOnPlane getResidual(unsigned int = 0, bool = false, bool onlyMeasurementErrors = true) const override;
173
181
188 TVectorD getKinks() const;
189
197
206 void updateMeasurementAndPlane(const StateOnPlane & sop);
207
214
223 void recalculateJacobian(GblFitterInfo* prevFitterInfo);
224
225 virtual ~GblFitterInfo() {;}
226 virtual GblFitterInfo* clone() const override;
227 bool hasMeasurements() const override {return trackPoint_->hasRawMeasurements();}
228 bool hasReferenceState() const override {return (refPrediction_(0) != 0.);}
229 bool hasForwardPrediction() const override {return hasReferenceState();}
230 bool hasBackwardPrediction() const override {return hasReferenceState();}
231 bool hasForwardUpdate() const override {return hasForwardPrediction();}
232 bool hasBackwardUpdate() const override {return hasBackwardPrediction();}
233 bool hasUpdate(int direction) const override {if (direction < 0) return hasBackwardPrediction(); return hasForwardPrediction();}
235
236 void deleteForwardInfo() override {;}
237 void deleteBackwardInfo() override {;}
242 void deleteReferenceInfo() override {;} // Empty because we really do not want to delete reference without a new one
243 void deleteMeasurementInfo() override {;} // We do not keep the measurements
244 virtual void Print(const Option_t* = "") const override;
245 virtual bool checkConsistency(const genfit::PruneFlags* = nullptr) const override;
246
247 private:
248 TMatrixD jacobian_;
257 TMatrixDSym bwdCov_;
258 TMatrixDSym fwdCov_;
262
263 TVectorD measurement_;
264 TMatrixDSym measCov_;
265 TMatrixD hMatrix_;
266
267 mutable std::unique_ptr<MeasuredStateOnPlane> fittedStateBwd_;
268 mutable std::unique_ptr<MeasuredStateOnPlane> fittedStateFwd_;
269
270 public:
271
272 ClassDefOverride(GblFitterInfo, 1)
273
274 };
275
276} /* End of namespace genfit */
278
279#endif // genfit_GblFitterInfo_h
Point on trajectory.
Definition GblPoint.h:68
GBL trajectory.
const TrackPoint * trackPoint_
SharedPlanePtr sharedPlane_
No ownership.
const AbsTrackRep * rep_
No ownership.
Abstract base class for a track representation.
Definition AbsTrackRep.h:66
Collects information needed and produced by a GblFitter/GBL and is specific to one AbsTrackRep of the...
bool hasForwardPrediction() const override
bool hasBackwardUpdate() const override
TMatrixDSym getCovariance(double variance, TVector3 trackDirection, SharedPlanePtr measurementPlane) const
Get scattering covariance projected into (measurement) plane.
TVectorD getKinks() const
Get kink (residual) (2D) = 0 - ( (+)pred - (-)pred )
bool hasUpdate(int direction) const override
virtual void Print(const Option_t *="") const override
virtual GblFitterInfo * clone() const override
Deep copy ctor for polymorphic class.
GblFitterInfo()
Constructor for ROOT I/O.
void updateFitResults(gbl::GblTrajectory &traj)
Update fitter info from GBL fit results.
void recalculateJacobian(GblFitterInfo *prevFitterInfo)
Re-extrapolates between prevFitterInfo and this point using forward state to update the Jacobian (if ...
bool hasPredictionsAndUpdates() const
void reset(unsigned int measurementDim=2, unsigned int repDim=5)
(Initial) reset of fitter info
void updateMeasurementAndPlane(const StateOnPlane &sop)
SHOULD BE USED ONLY INTERNALY! Update the plane from measurement constructed with state or take plane...
MeasurementOnPlane getMeasurement() const
Get the measurement on plane from stored measurement data (from last construction/update)
std::unique_ptr< MeasuredStateOnPlane > fittedStateFwd_
cache
bool hasReferenceState() const override
const MeasuredStateOnPlane & getFittedState(bool afterKink=true) const override
Get the prediction at this point Always biased in GBL (global fit) There are 2 states,...
void setJacobian(TMatrixD jacobian)
Set the Jacobian for further GblPoint construction.
void deleteMeasurementInfo() override
bool hasBackwardPrediction() const override
gbl::GblPoint constructGblPoint()
Collect all data and create a GblPoint.
void deleteReferenceInfo() override
std::unique_ptr< MeasuredStateOnPlane > fittedStateBwd_
void setReferenceState(StateOnPlane &referenceState)
Set the prediction and plane (from measurement if any) You should use the user constructor instead.
virtual bool checkConsistency(const genfit::PruneFlags *=nullptr) const override
bool hasMeasurements() const override
StateOnPlane getReferenceState() const
Returns (copy of) the stored reference 5D state at current plane with internal rep.
MeasurementOnPlane getKink() const
Get kink (residual) with diagonalized covariance (2D) Covariance may be zero if not yet fitted or no ...
MeasurementOnPlane getResidual(unsigned int=0, bool=false, bool onlyMeasurementErrors=true) const override
Get the residual.
void deleteForwardInfo() override
void deleteBackwardInfo() override
bool hasForwardUpdate() const override
StateOnPlane with additional covariance matrix.
Measured coordinates on a plane.
A state with arbitrary dimension defined in a DetPlane.
Object containing AbsMeasurement and AbsFitterInfo objects.
Definition TrackPoint.h:46
Defines for I/O streams used for error and debug printing.
std::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
Info which information has been pruned from the Track.
Definition FitStatus.h:47