Fork me on GitHub

source: git/external/TrackCovariance/SolTrack.h@ 7bca620

Last change on this file since 7bca620 was ebf40fd, checked in by Franco BEDESCHI <bed@…>, 3 years ago

Major update to handle highly displaced tracks

  • Property mode set to 100644
File size: 2.5 KB
Line 
1//
2#ifndef G__SOLTRK_H
3#define G__SOLTRK_H
4//
5#include <TMath.h>
6#include <TVector3.h>
7#include <TMatrixDSym.h>
8#include "SolGeom.h"
9#include "TrkUtil.h"
10#include <TGraph.h>
11//
12//
13// Class to store track information
14// Assumes that the geometry has been initialized
15//
16class SolTrack: public TrkUtil
17{
18 //
19 // Track handling class
20 // Assume tracks originate from (0,0) for the time being
21 //
22private:
23 Int_t fNl; // Actual number of layers
24 SolGeom *fG; // Geometry
25 Double_t fp[3]; // px, py, pz momentum
26 Double_t fx[3]; // x, y, z track origin
27 Double_t fpar[5]; // D, phi0, C, z0, cot(theta)
28 //
29 TMatrixDSym fCov; // Full covariance matrix
30 //
31 //
32public:
33 //
34 // Constructors
35 SolTrack(Double_t *x, Double_t *p, SolGeom *G);
36 SolTrack(TVector3 x, TVector3 p, SolGeom* G);
37 SolTrack(Double_t D, Double_t phi0, Double_t C, Double_t z0, Double_t ct, SolGeom *G);
38 // Destructor
39 ~SolTrack();
40 // Accessors
41 // Position (at minimum approach)
42 Double_t x() { return fx[0]; }
43 Double_t y() { return fx[1]; }
44 Double_t z() { return fx[2]; }
45 // Momentum (at minimum approach)
46 Double_t px() { return fp[0]; }
47 Double_t py() { return fp[1]; }
48 Double_t pz() { return fp[2]; }
49 Double_t pt() { return TMath::Sqrt(fp[0] * fp[0] + fp[1] * fp[1]); }
50 Double_t p() { return TMath::Sqrt(fp[0] * fp[0] + fp[1] * fp[1] + fp[2] * fp[2]); }
51 // Track parameters
52 Double_t D() { return fpar[0]; }
53 Double_t phi0() { return fpar[1]; }
54 Double_t C() { return fpar[2]; }
55 Double_t z0() { return fpar[3]; }
56 Double_t ct() { return fpar[4]; }
57 // Covariance
58 TMatrixDSym Cov() { return fCov; }
59 // Track parameter covariance calculation
60 void CovCalc(Bool_t Res, Bool_t MS);
61 // Parameter errors
62 Double_t s_D() { return TMath::Sqrt(fCov(0, 0)); }
63 Double_t s_phi0() { return TMath::Sqrt(fCov(1, 1)); }
64 Double_t s_C() { return TMath::Sqrt(fCov(2, 2)); }
65 Double_t s_pt() { return 2 * s_C()*pt() / (0.2998*fG->B()); } // Dpt/pt
66 Double_t s_z0() { return TMath::Sqrt(fCov(3, 3)); }
67 Double_t s_ct() { return TMath::Sqrt(fCov(4, 4)); }
68 //
69 // Track hit management
70 Int_t nHit();
71 Int_t nmHit();
72 Bool_t HitLayer(Int_t Layer, Double_t &R, Double_t &phi, Double_t &zz);
73 Int_t HitList(Int_t *&ihh, Double_t *&rhh, Double_t *&zhh);
74 Int_t HitListXYZ(Int_t *&ihh, Double_t *&Xh, Double_t *&Yh, Double_t *&Zh);
75 //
76 // Track graph
77 TGraph *TrkPlot(); // Graph with R-z plot of track trajectory
78 //
79 // Make normalized matrix positive definite
80 TMatrixDSym MakePosDef(TMatrixDSym NormMat);
81};
82//
83#endif
Note: See TracBrowser for help on using the repository browser.