Changeset f9517a5 in git for external/TrackCovariance
- Timestamp:
- Mar 4, 2021, 11:31:58 AM (4 years ago)
- Branches:
- master
- Children:
- dc883b4
- Parents:
- 4586f8f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/TrackCovariance/TrkUtil.cc
r4586f8f rf9517a5 1 1 #include "TrkUtil.h" 2 #include <TMath.h> 2 3 #include <iostream> 3 4 … … 31 32 Double_t r2 = x.Perp2(); 32 33 Double_t cross = x(0) * p(1) - x(1) * p(0); 33 Double_t T = sqrt(pt * pt - 2 * a * cross + a * a * r2);34 Double_t phi0 = atan2((p(1) - a * x(0)) / T, (p(0) + a * x(1)) / T); // Phi034 Double_t T = TMath::Sqrt(pt * pt - 2 * a * cross + a * a * r2); 35 Double_t phi0 = TMath::ATan2((p(1) - a * x(0)) / T, (p(0) + a * x(1)) / T); // Phi0 35 36 Double_t D; // Impact parameter D 36 37 if (pt < 10.0) D = (T - pt) / a; … … 41 42 Par(2) = C; // Store C 42 43 //Longitudinal parameters 43 Double_t B = C * sqrt(TMath::Max(r2 - D * D, 0.0) / (1 + 2 * C * D));44 Double_t st = asin(B) / C;44 Double_t B = C * TMath::Sqrt(TMath::Max(r2 - D * D, 0.0) / (1 + 2 * C * D)); 45 Double_t st = TMath::ASin(B) / C; 45 46 Double_t ct = p(2) / pt; 46 47 Double_t z0 = x(2) - ct * st; … … 69 70 // 70 71 TVector3 Xval; 71 Xval(0) = -D * sin(phi0);72 Xval(1) = D * cos(phi0);72 Xval(0) = -D * TMath::Sin(phi0); 73 Xval(1) = D * TMath::Cos(phi0); 73 74 Xval(2) = z0; 74 75 // … … 92 93 TVector3 Pval; 93 94 Double_t pt = Bz * cSpeed() / TMath::Abs(2 * C); 94 Pval(0) = pt * cos(phi0);95 Pval(1) = pt * sin(phi0);95 Pval(0) = pt * TMath::Cos(phi0); 96 Pval(1) = pt * TMath::Sin(phi0); 96 97 Pval(2) = pt * ct; 97 98 // … … 114 115 pACTS(1) = 1000 * Par(3); // z0 from m to mm 115 116 pACTS(2) = Par(1); // Phi0 is unchanged 116 pACTS(3) = atan2(1.0, Par(4)); // Theta in [0, pi] range117 pACTS(4) = Par(2) / (b * sqrt(1 + Par(4) * Par(4))); // q/p in GeV117 pACTS(3) = TMath::ATan2(1.0, Par(4)); // Theta in [0, pi] range 118 pACTS(4) = Par(2) / (b * TMath::Sqrt(1 + Par(4) * Par(4))); // q/p in GeV 118 119 pACTS(5) = 0.0; // Time: currently undefined 119 120 // … … 132 133 A(0, 0) = 1000.; // D-D conversion to mm 133 134 A(1, 2) = 1.0; // phi0-phi0 134 A(2, 4) = 1.0 / ( sqrt(1.0 + ct * ct) * b); // q/p-C135 A(2, 4) = 1.0 / (TMath::Sqrt(1.0 + ct * ct) * b); // q/p-C 135 136 A(3, 1) = 1000.; // z0-z0 conversion to mm 136 137 A(4, 3) = -1.0 / (1.0 + ct * ct); // theta - cot(theta) 137 A(4, 4) = -C * ct / (b * pow(1.0 + ct * ct, 3.0 / 2.0)); // q/p-cot(theta)138 A(4, 4) = -C * ct / (b * TMath::Power(1.0 + ct * ct, 3.0 / 2.0)); // q/p-cot(theta) 138 139 // 139 140 TMatrixDSym Cv = Cov;
Note:
See TracChangeset
for help on using the changeset viewer.