EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GFTools.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GFTools.h
1 /* Copyright 2011, Technische Universitaet Muenchen,
2  Author: Karl Bicker
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 */
20 /* @{ */
21 
22 #ifndef GFTOOLS_H
23 #define GFTOOLS_H
24 
25 #include <cmath>
26 #include <GFAbsTrackRep.h>
27 #include <GFDetPlane.h>
28 #include <GFException.h>
29 #include <GFTrack.h>
30 #include <TMath.h>
31 #include <TMatrixT.h>
32 #include <TDecompSVD.h>
33 //#include <TDecompBK.h>
34 //#include <TDecompChol.h>
35 
44 namespace GFTools {
45 
48  TMatrixT<double> getSmoothedPos(const GFTrack* trk, unsigned int irep, unsigned int ihit);
49 
52  TVector3 getSmoothedPosXYZ(const GFTrack* trk, unsigned int irep, unsigned int ihit, bool *ret = 0);
53  TVector3 getBiasedSmoothedPosXYZ(const GFTrack* trk, unsigned int irep, unsigned int ihit, bool *ret = 0);
54 
57  //TVector3 getSmoothedMomXYZ(const GFTrack* trk, unsigned int irep, unsigned int ihit);
58  TVector3 getBiasedSmoothedMomXYZ(const GFTrack* trk, unsigned int irep, unsigned int ihit, bool *ret = 0);
59 
62  TMatrixT<double> getSmoothedCov(const GFTrack* trk, unsigned int irep, unsigned int ihit);
63 
66  bool getSmoothedData(const GFTrack* trk, unsigned int irep, unsigned int ihit, TMatrixT<double>& smoothed_state, TMatrixT<double>& smoothed_cov);
67 
73  bool getSmoothedData(const GFTrack* trk, unsigned int irep, unsigned int ihit, TMatrixT<double>& smoothed_state, TMatrixT<double>& smoothed_cov, GFDetPlane& smoothing_plane);
74 
90  bool getSmoothedData(const GFTrack* trk, unsigned int irep, unsigned int ihit, TMatrixT<double>& smoothed_state, TMatrixT<double>& smoothed_cov, GFDetPlane& smoothing_plane, TMatrixT<double>& auxInfo);
91 
94  GFDetPlane getSmoothingPlane(const GFTrack* trk, unsigned int irep, unsigned int ihit);
95 
98  bool getBiasedSmoothedData(const GFTrack* trk, unsigned int irep, unsigned int ihit, TMatrixT<double>& smoothed_state, TMatrixT<double>& smoothed_cov);
99 
105  bool getBiasedSmoothedData(const GFTrack* trk, unsigned int irep, unsigned int ihit, TMatrixT<double>& smoothed_state, TMatrixT<double>& smoothed_cov, GFDetPlane& smoothing_plane, bool extrapolation_allowed = true);
106 
113  bool getBiasedSmoothedData(const GFTrack* trk, unsigned int irep, unsigned int ihit, TMatrixT<double>& smoothed_state, TMatrixT<double>& smoothed_cov, GFDetPlane& smoothing_plane, TMatrixT<double>& auxInfo, bool extrapolation_allowed = true);
114 
117  TMatrixT<double> getBiasedSmoothedPos(const GFTrack* trk, unsigned int irep, unsigned int ihit);
118 
121  TMatrixT<double> getBiasedSmoothedCov(const GFTrack* trk, unsigned int irep, unsigned int ihit);
122 
127  double getTrackLength(const GFTrack* trk, unsigned int irep, unsigned int startHit=0, unsigned int endHit=0);
128 
131  void invertMatrix(const TMatrixT<double>& mat, TMatrixT<double>& inv);
141  double getSmoothedChiSqu(const GFTrack* trk, unsigned int irep, unsigned int ihit);
142 
145  void updateRepSmoothed(GFTrack* trk, unsigned int irep, unsigned int ihit);
146 
159  unsigned int getClosestHit(const GFTrack* trk, unsigned int irep, const TVector3& pos, double& distance, bool checkEveryHit = false);
160 
161 }
162 
163 #endif
164