GENFIT  Rev:NoNumberAvailable
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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  */
23 #ifndef genfit_GblFitterInfo_h
24 #define genfit_GblFitterInfo_h
25 
26 #include "AbsFitterInfo.h"
27 #include "MeasuredStateOnPlane.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 
44 #ifndef __CINT__
45 #include <boost/scoped_ptr.hpp>
46 #endif
47 
48 
49 namespace genfit {
50 
51 
55  class GblFitterInfo : public AbsFitterInfo {
56 
57  public:
58 
62  GblFitterInfo();
63 
69  GblFitterInfo(const TrackPoint* trackPoint, const AbsTrackRep* rep);
70 
78  GblFitterInfo(const TrackPoint* trackPoint, const AbsTrackRep* rep, StateOnPlane& referenceState);
79 
87  void reset(unsigned int measurementDim = 2, unsigned int repDim = 5);
88 
102  void setReferenceState(StateOnPlane& referenceState);
110  void setJacobian(TMatrixD jacobian);
111 
120  TMatrixDSym getCovariance(double variance, TVector3 trackDirection, SharedPlanePtr measurementPlane) const;
121 
133 
144 
159  const MeasuredStateOnPlane& getFittedState(bool afterKink = true) const;
160 
175  MeasurementOnPlane getResidual(unsigned int = 0, bool = false, bool onlyMeasurementErrors = true) const;
176 
183  MeasurementOnPlane getKink() const;
184 
191  TVectorD getKinks() const;
192 
200 
209  void updateMeasurementAndPlane(const StateOnPlane & sop);
210 
217 
226  void recalculateJacobian(GblFitterInfo* prevFitterInfo);
227 
228  virtual ~GblFitterInfo() {;}
229  virtual GblFitterInfo* clone() const;
231  bool hasReferenceState() const {return (refPrediction_(0) != 0.);}
232  bool hasForwardPrediction() const {return hasReferenceState();}
233  bool hasBackwardPrediction() const {return hasReferenceState();}
234  bool hasForwardUpdate() const {return hasForwardPrediction();}
235  bool hasBackwardUpdate() const {return hasBackwardPrediction();}
236  bool hasUpdate(int direction) const {if (direction < 0) return hasBackwardPrediction(); return hasForwardPrediction();}
238 
239  void deleteForwardInfo() {;}
244  }
245  void deleteReferenceInfo() {;} // Empty because we really do not want to delete reference without a new one
246  void deleteMeasurementInfo() {;} // We do not keep the measurements
247  virtual void Print(const Option_t* = "") const;
248  virtual bool checkConsistency(const genfit::PruneFlags* = NULL) const;
249 
250  private:
251  TMatrixD jacobian_;
252  TVectorD measResiduals_;
254  TVectorD kinkResiduals_;
260  TMatrixDSym bwdCov_;
261  TMatrixDSym fwdCov_;
262  TVectorD fwdPrediction_;
263  TVectorD bwdPrediction_;
264  TVectorD refPrediction_;
265 
266  TVectorD measurement_;
267  TMatrixDSym measCov_;
268  TMatrixD hMatrix_;
269 
270  #ifndef __CINT__
271  mutable boost::scoped_ptr<MeasuredStateOnPlane> fittedStateBwd_;
272  mutable boost::scoped_ptr<MeasuredStateOnPlane> fittedStateFwd_;
273  #else
276  #endif
277 
278  public:
279 
280  ClassDef(GblFitterInfo, 1)
281 
282  };
283 
284 } /* End of namespace genfit */
287 #endif // genfit_GblFitterInfo_h
gbl::GblPoint constructGblPoint()
Collect all data and create a GblPoint.
boost::shared_ptr< genfit::DetPlane > SharedPlanePtr
Shared Pointer to a DetPlane.
GBL trajectory.
Definition: GblTrajectory.h:26
virtual void Print(const Option_t *="") const
bool hasBackwardUpdate() const
TMatrixDSym getCovariance(double variance, TVector3 trackDirection, SharedPlanePtr measurementPlane) const
Get scattering covariance projected into (measurement) plane.
Info which information has been pruned from the Track.
Definition: FitStatus.h:47
virtual bool checkConsistency(const genfit::PruneFlags *=NULL) const
bool hasUpdate(int direction) const
Point on trajectory.
Definition: GblPoint.h:48
Collects information needed and produced by a GblFitter/GBL and is specific to one AbsTrackRep of the...
Definition: GblFitterInfo.h:55
SharedPlanePtr sharedPlane_
No ownership.
Definition: AbsFitterInfo.h:94
GblFitterInfo()
Constructor for ROOT I/O.
virtual GblFitterInfo * clone() const
Deep copy ctor for polymorphic class.
boost::scoped_ptr< MeasuredStateOnPlane > fittedStateFwd_
cache
TVectorD getKinks() const
Get kink (residual) (2D) = 0 - ( (+)pred - (-)pred )
bool hasBackwardPrediction() const
boost::scoped_ptr< MeasuredStateOnPlane > fittedStateBwd_
StateOnPlane with additional covariance matrix.
bool hasMeasurements() const
void updateMeasurementAndPlane(const StateOnPlane &sop)
SHOULD BE USED ONLY INTERNALY! Update the plane from measurement constructed with state or take plane...
void reset(unsigned int measurementDim=2, unsigned int repDim=5)
(Initial) reset of fitter info
Abstract base class for a track representation.
Definition: AbsTrackRep.h:66
void updateFitResults(gbl::GblTrajectory &traj)
Update fitter info from GBL fit results.
StateOnPlane getReferenceState() const
Returns (copy of) the stored reference 5D state at current plane with internal rep.
bool hasReferenceState() const
bool hasPredictionsAndUpdates() const
Object containing AbsMeasurement and AbsFitterInfo objects.
Definition: TrackPoint.h:50
MeasurementOnPlane getResidual(unsigned int=0, bool=false, bool onlyMeasurementErrors=true) const
Get the residual.
void setReferenceState(StateOnPlane &referenceState)
Set the prediction and plane (from measurement if any) You should use the user constructor instead...
MeasurementOnPlane getKink() const
Get kink (residual) with diagonalized covariance (2D) Covariance may be zero if not yet fitted or no ...
const TrackPoint * trackPoint_
Definition: AbsFitterInfo.h:88
A state with arbitrary dimension defined in a DetPlane.
Definition: StateOnPlane.h:45
const MeasuredStateOnPlane & getFittedState(bool afterKink=true) const
Get the prediction at this point Always biased in GBL (global fit) There are 2 states, before and after kink (if there is a scatterer at this point). Per default the state after kink for forward propagation is returned.
bool hasRawMeasurements() const
Definition: TrackPoint.h:96
void recalculateJacobian(GblFitterInfo *prevFitterInfo)
Re-extrapolates between prevFitterInfo and this point using forward state to update the Jacobian (if ...
MeasurementOnPlane getMeasurement() const
Get the measurement on plane from stored measurement data (from last construction/update) ...
bool hasForwardUpdate() const
Measured coordinates on a plane.
const AbsTrackRep * rep_
No ownership.
Definition: AbsFitterInfo.h:92
Defines for I/O streams used for error and debug printing.
This class collects all information needed and produced by a specific AbsFitter and is specific to on...
Definition: AbsFitterInfo.h:42
void setJacobian(TMatrixD jacobian)
Set the Jacobian for further GblPoint construction.
bool hasForwardPrediction() const