CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrackHelixVertexFitter.h
Go to the documentation of this file.
1 #ifndef RecoTauTag_ImpactParameter_TrackHelixVertexFitter_h
2 #define RecoTauTag_ImpactParameter_TrackHelixVertexFitter_h
3 
4 /* From SimpleFits Package
5  * Designed an written by
6  * author: Ian M. Nugent
7  * Humboldt Foundations
8  */
9 
10 // system include files
11 #include <TMatrixT.h>
12 #include <TVectorT.h>
13 #include <TLorentzVector.h>
14 #include <TVector3.h>
15 #include <TVectorD.h>
16 
21 
22 namespace tauImpactParameter {
23 
25  public:
26  enum FreeVertexPar { x0 = 0, y0, z0, NFreeVertexPar };
28  enum ExtraPar { BField0 = 0, MassOffSet = 1, NExtraPar = 1 };
29 
30  TrackHelixVertexFitter(const std::vector<TrackParticle>& particles, const TVector3& vguess);
31  virtual ~TrackHelixVertexFitter();
32 
33  virtual bool fit() = 0;
34  virtual double updateChisquare(const TVectorT<double>& inpar);
35  virtual double chiSquare() { return chi2_; }
36  virtual double ndf() { return ndf_; }
38  virtual std::vector<TrackParticle> getRefitTracks();
39  std::vector<LorentzVectorParticle> getRefitLorentzVectorParticles();
40  virtual TVector3 getVertex();
41  virtual TMatrixTSym<double> getVertexError();
42 
43  static void computedxydz(const TVectorT<double>& inpar,
44  int particle,
45  double& kappa,
46  double& lam,
47  double& phi,
48  double& x,
49  double& y,
50  double& z,
51  double& s,
52  double& dxy,
53  double& dz);
54  static TVectorT<double> computeLorentzVectorPar(const TVectorT<double>& inpar);
55 
56  protected:
58  TVectorT<double> par_;
59  TMatrixTSym<double> parcov_;
60  virtual TString freeParName(int Par);
61  double chi2_, ndf_;
62 
63  private:
64  static TVectorT<double> computePar(const TVectorT<double>& inpar);
65  static TVectorT<double> computeTrackPar(const TVectorT<double>& inpar, int p = 0);
66  static TVectorT<double> computeMotherLorentzVectorPar(const TVectorT<double>& inpar);
67 
68  static int measuredValueIndex(int TrackPar, int Particle) { return TrackPar + Particle * TrackParticle::NHelixPar; }
69  static int freeParIndex(int Par, int Particle) {
70  if (Par == x0 || Par == y0 || Par == z0)
71  return Par;
72  return Par + Particle * (NFreeTrackPar - NFreeVertexPar);
73  }
74  static void parSizeInfo(const TVectorT<double>& inpar, int& np, int& parsize, bool hasextras = false);
75 
76  std::vector<TrackParticle> particles_;
77  TVectorT<double> val_;
78  TMatrixTSym<double> cov_;
79  TMatrixTSym<double> cov_inv_;
81  };
82 
83 } // namespace tauImpactParameter
84 #endif
static TVectorT< double > computeMotherLorentzVectorPar(const TVectorT< double > &inpar)
virtual double updateChisquare(const TVectorT< double > &inpar)
virtual std::vector< TrackParticle > getRefitTracks()
int np
Definition: AMPTWrapper.h:43
static TVectorT< double > computePar(const TVectorT< double > &inpar)
static TVectorT< double > computeLorentzVectorPar(const TVectorT< double > &inpar)
static void parSizeInfo(const TVectorT< double > &inpar, int &np, int &parsize, bool hasextras=false)
static int measuredValueIndex(int TrackPar, int Particle)
virtual TMatrixTSym< double > getVertexError()
std::vector< LorentzVectorParticle > getRefitLorentzVectorParticles()
TrackHelixVertexFitter(const std::vector< TrackParticle > &particles, const TVector3 &vguess)
static TVectorT< double > computeTrackPar(const TVectorT< double > &inpar, int p=0)
static int freeParIndex(int Par, int Particle)
static void computedxydz(const TVectorT< double > &inpar, int particle, double &kappa, double &lam, double &phi, double &x, double &y, double &z, double &s, double &dxy, double &dz)