Changes in external/TrackCovariance/TrkUtil.cc [d3165fa:92b8d11] in git
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/TrackCovariance/TrkUtil.cc
rd3165fa r92b8d11 1 1 #include "TrkUtil.h" 2 #include <iostream> 2 3 3 4 // Constructor … … 31 32 Double_t cross = x(0) * p(1) - x(1) * p(0); 32 33 Double_t T = sqrt(pt * pt - 2 * a * cross + a * a * r2); 33 Double_t phi0 = TMath::ATan2((p(1) - a * x(0)) / T, (p(0) + a * x(1)) / T); // Phi034 Double_t phi0 = atan2((p(1) - a * x(0)) / T, (p(0) + a * x(1)) / T); // Phi0 34 35 Double_t D; // Impact parameter D 35 36 if (pt < 10.0) D = (T - pt) / a; … … 41 42 //Longitudinal parameters 42 43 Double_t B = C * sqrt(TMath::Max(r2 - D * D, 0.0) / (1 + 2 * C * D)); 43 Double_t st = TMath::ASin(B) / C;44 Double_t st = asin(B) / C; 44 45 Double_t ct = p(2) / pt; 45 46 Double_t z0 = x(2) - ct * st; … … 68 69 // 69 70 TVector3 Xval; 70 Xval(0) = -D * TMath::Sin(phi0);71 Xval(1) = D * TMath::Cos(phi0);71 Xval(0) = -D * sin(phi0); 72 Xval(1) = D * cos(phi0); 72 73 Xval(2) = z0; 73 74 // … … 76 77 // 77 78 TVector3 TrkUtil::ParToP(TVectorD Par) 79 { 80 if (fBz == 0.0) 81 std::cout << "TrkUtil::ParToP: Warning Bz not set" << std::endl; 82 // 83 return ParToP(Par,fBz); 84 } 85 // 86 TVector3 TrkUtil::ParToP(TVectorD Par, Double_t Bz) 78 87 { 79 88 Double_t C = Par(2); … … 82 91 // 83 92 TVector3 Pval; 84 Double_t pt = fBz * cSpeed() / TMath::Abs(2 * C);85 Pval(0) = pt * TMath::Cos(phi0);86 Pval(1) = pt * TMath::Sin(phi0);93 Double_t pt = Bz * cSpeed() / TMath::Abs(2 * C); 94 Pval(0) = pt * cos(phi0); 95 Pval(1) = pt * sin(phi0); 87 96 Pval(2) = pt * ct; 88 97 // … … 103 112 Double_t b = -cSpeed() * fBz / 2.; 104 113 pACTS(0) = 1000 * Par(0); // D from m to mm 105 pACTS(1) = 1000 * Par(3); // z0 from m to mm114 pACTS(1) = 1000 * Par(3); // z0 from m to mm 106 115 pACTS(2) = Par(1); // Phi0 is unchanged 107 pACTS(3) = TMath::ATan2(1.0, Par(4)); // Theta in [0, pi] range116 pACTS(3) = atan2(1.0, Par(4)); // Theta in [0, pi] range 108 117 pACTS(4) = Par(2) / (b * sqrt(1 + Par(4) * Par(4))); // q/p in GeV 109 118 pACTS(5) = 0.0; // Time: currently undefined
Note:
See TracChangeset
for help on using the changeset viewer.