- Timestamp:
- Apr 13, 2021, 1:38:49 PM (4 years ago)
- Branches:
- master
- Children:
- 4df491e
- Parents:
- c5696dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
external/TrackCovariance/TrkUtil.cc
rc5696dd r59ba063 290 290 // 291 291 // Include second branch of loopers 292 Double_t ph2 = 2*TMath::Pi() - TMath::Abs(ph); 292 Double_t Pi = 3.14159265358979323846; 293 Double_t ph2 = 2*Pi - TMath::Abs(ph); 293 294 if (ph < 0)ph2 = -ph2; 294 295 z = z0 + ct * ph2 / (2.0 * C); … … 324 325 Double_t dPhase = 0.0; // Phase difference between two close intersections 325 326 Double_t ph_arr[Nint] = { phRin, phRin2, phRhi, phZmn, phZmx }; 326 Int_t srtind[Nint]; 327 //TMath::Sort(Nint, ph_arr, srtind, kFALSE); 328 for (Int_t i = 0; i < Nint; i++) { srtind[i] = i; } 329 std::sort(srtind, srtind + Nint, CompareAsc<const Double_t*>(ph_arr)); 327 std::sort(ph_arr, ph_arr + Nint); 330 328 Int_t iPos = -1; // First element > 0 331 329 for (Int_t i = 0; i < Nint; i++) 332 330 { 333 if (ph_arr[ srtind[i]] <= 0.0) iPos = i;331 if (ph_arr[i] <= 0.0) iPos = i; 334 332 } 335 333 336 334 if (iPos < Nint - 2) 337 335 { 338 dPhase = ph_arr[ srtind[iPos + 2]] - ph_arr[srtind[iPos + 1]];336 dPhase = ph_arr[iPos + 2] - ph_arr[iPos + 1]; 339 337 tLength = dPhase*Scale; 340 338 }
Note:
See TracChangeset
for help on using the changeset viewer.