Fork me on GitHub

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

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

Fix CovarianceMatrix scaling error. Vertexing improvements.

  • Property mode set to 100644
File size: 3.9 KB
Line 
1//
2#ifndef G__TRKUTIL_H
3#define G__TRKUTIL_H
4//
5#include <TVector3.h>
6#include <TVectorD.h>
7#include <TMatrixDSym.h>
8#include <TRandom.h>
9#include <TMath.h>
10//
11//
12// Class test
13
14class TrkUtil {
15 //
16 //
17protected:
18 Double_t fBz; // Solenoid magnetic field
19 //
20 Int_t fGasSel; // Gas selection: 0: He-Iso, 1: He, 2:Ar-Eth, 3: Ar
21 Double_t fRmin; // Lower DCH radius
22 Double_t fRmax; // Higher DCH radius
23 Double_t fZmin; // Lower DCH z
24 Double_t fZmax; // Higher DCH z
25 //
26 // Service routines
27 //
28 void SetB(Double_t Bz) { fBz = Bz; }
29 TVectorD XPtoPar(TVector3 x, TVector3 p, Double_t Q);
30 TVector3 ParToP(TVectorD Par);
31 TMatrixDSym RegInv(TMatrixDSym& Min);
32 //
33 // Track trajectory derivatives
34 TMatrixD derXdPar(TVectorD par, Double_t s); // derivatives of position wrt parameters
35 TVectorD derXds(TVectorD par, Double_t s); // derivatives of position wrt phase
36 TVectorD dsdPar_R(TVectorD par, Double_t R); // derivatives of phase at constant R
37 TVectorD dsdPar_z(TVectorD par, Double_t z); // derivatives of phase at constant z
38 //
39 // Conversion to ACTS parametrization
40 //
41 TVectorD ParToACTS(TVectorD Par); // Parameter conversion
42 TMatrixDSym CovToACTS(TVectorD Par, TMatrixDSym Cov); // Covariance conversion
43 //
44 // Conversion to ILC parametrization
45 //
46 TVectorD ParToILC(TVectorD Par); // Parameter conversion
47 TMatrixDSym CovToILC(TMatrixDSym Cov); // Covariance conversion
48 //
49
50public:
51 //
52 // Constructors
53 TrkUtil();
54 TrkUtil(Double_t Bz);
55 // Destructor
56 ~TrkUtil();
57 //
58 // Overload methods to allow call without instantiating class
59 //
60 static Double_t cSpeed()
61 {
62 Double_t c = 2.99792458e8; // speed of light m/sec
63 //return TMath::C()*1.0e-9; // Incompatible with root5
64 return c*1.0e-9; // Reduced speed of light
65 }
66 //
67 // Service routines
68 //
69 static TVectorD XPtoPar(TVector3 x, TVector3 p, Double_t Q, Double_t Bz);
70 static TVector3 ParToX(TVectorD Par); // position of minimum distance from z axis
71 static TVector3 ParToP(TVectorD Par, Double_t Bz); // Get Momentum from track parameters
72 static Double_t ParToQ(TVectorD Par); // Get track charge
73 static void LineDistance(TVector3 x0, TVector3 y0, TVector3 dirx, TVector3 diry, Double_t &sx, Double_t &sy, Double_t &distance);
74 //
75 // Track trajectory
76 //
77 static TVector3 Xtrack(TVectorD par, Double_t s); // Parametric track trajectory
78 TVectorD derRphi_R(TVectorD par, Double_t R); // Derivatives of R-phi at constant R
79 TVectorD derZ_R(TVectorD par, Double_t R); // Derivatives of z at constant R
80 TVectorD derRphi_Z(TVectorD par, Double_t z); // Derivatives of R-phi at constant z
81 TVectorD derR_Z(TVectorD par, Double_t z); // Derivatives of R at constant z
82 //
83 // Smear with given covariance matrix
84 //
85 static TVectorD CovSmear(TVectorD x, TMatrixDSym C);
86 //
87 // Conversion from meters to mm
88 //
89 static TVectorD ParToMm(TVectorD Par); // Parameter conversion
90 static TMatrixDSym CovToMm(TMatrixDSym Cov); // Covariance conversion
91 //
92 // Inside cylindrical volume
93 //
94 static Bool_t IsInside(TVector3 x, Double_t Rout, Double_t Zmin, Double_t Zmax)
95 {
96 Bool_t Is = kFALSE;
97 if (x.Pt() <= Rout && x.z() >= Zmin && x.z() <= Zmax)Is = kTRUE;
98 return Is;
99 }
100 //
101 // Cluster counting in gas
102 //
103 void SetBfield(Double_t Bz) { fBz = Bz; }
104 // Define gas volume (units = meters)
105 void SetDchBoundaries(Double_t Rmin, Double_t Rmax, Double_t Zmin, Double_t Zmax);
106 // Gas mixture selection
107 void SetGasMix(Int_t Opt);
108 // Get number of ionization clusters
109 Bool_t IonClusters(Double_t &Ncl, Double_t mass, TVectorD Par);
110 Double_t Nclusters(Double_t bgam); // mean clusters/meter vs beta*gamma
111 static Double_t Nclusters(Double_t bgam, Int_t Opt); // mean clusters/meter vs beta*gamma
112 Double_t funcNcl(Double_t *xp, Double_t *par);
113 Double_t TrkLen(TVectorD Par); // Track length inside chamber
114};
115
116#endif
Note: See TracBrowser for help on using the repository browser.