3 #include "tpcCorrection.h"
6 Int_t utime, date, time;
11 {{0,10,2,4,0, 2.30, 4.79, {1.82545,-1.13077,0.249432,-0.0189606,0,0,0,0,0,0} }, 994003200, 20010701, 120000},
12 {{0, 6,2,3,0, 2.30, 4.70, {0.621603,-0.228409,0.0236501,0,0,0,0,0,0,0} },1001304004, 20010924, 4},
13 {{0,13,2,4,0, 0.00, 0.00, {0.0370811,0.142838,-0.0513699,0.00477384,0,0,0,0,0,0 } },1041829200, 20030106, 0},
14 {{0, 6,2,3,0, 0.00, 0.00, {0.399909,-0.113657,0.0089704,0,0,0,0,0,0,0} },1073192401, 20040104, 1},
15 {{0, 6,2,3,0, 0.00, 0.00, {0.399909,-0.113657,0.0089704,0,0,0,0,0,0,0} },1075957201, 20040205, 1},
16 {{0, 6,2,3,0, 0.00, 0.00, {0.399909,-0.113657,0.0089704,0,0,0,0,0,0,0} },1076994001, 20040217, 1},
17 {{0, 6,2,3,0, 0.00, 0.00, {0.399909,-0.113657,0.0089704,0,0,0,0,0,0,0} },1080104401, 20040324, 1},
18 {{0, 6,2,5,0, 2.30, 4.80, {1.27303,-1.25341,0.532478,-0.102658,0.00733247,0,0,0,0,0} },1105498801, 20050111, 220001},
19 {{0, 6,2,4,0, 2.30, 4.70, {-0.314706,0.404681,-0.116752,0.0101701,0,0,0,0,0,0} },1112508000, 20050403, 10000},
20 {{0, 6,2,6,0, 2.30, 4.79, {2.7451,-3.64943,1.98889,-0.525204,0.0666543,-0.00324793,0,0,0,0}},1141837080, 20060308, 115800},
21 {{0, 6,2,6,0, 0.00, 0.00, {2.7451,-3.64943,1.98889,-0.525204,0.0666543,-0.00324793,0,0,0,0}},1144314000, 20060406, 50000},
22 {{0, 6,2,5,0, 0.00, 0.00, {1.11775,-1.24347,0.586667,-0.121644,0.00915544,0,0,0,0,0} },1147287961, 20060510, 150601},
23 {{0, 6,2,4,0, 2.30, 4.70, {-0.0748715,0.243322,-0.0793629,0.00726962,0,0,0,0,0,0 } },1174449642, 20070321, 42}
25 static Int_t N =
sizeof(Sigmas)/
sizeof(
Sigma_t);
27 Double_t Bichsel::GetdEdxResolution(Int_t k, Double_t TrackLengthInTPC) {
28 if (TrackLengthInTPC <= 0.0 || k < 0)
return -999;
31 for (k = N - 1; k > 0; k--) {
32 if (uc >= Sigmas[k].utime)
break;
35 if (k >= N)
return -999;
36 Double_t X = TMath::Log(TrackLengthInTPC);
37 return CalcCorrection(&Sigmas[k].
params, X);
40 Double_t Bichsel::GetdEdxResolution(Double_t *x, Double_t *p) {
41 Int_t k = (Int_t) p[0];
42 return GetdEdxResolution(k,x[0]);
45 Double_t Bichsel::CalcCorrection(
const tpcCorrection_st *cor,
const Double_t x) {
46 Int_t N = TMath::Abs(cor->npar);
48 if (cor->npar < 0) X = TMath::Exp(x);
50 if (cor->min < cor->max) {
51 if (X < cor->min) X = cor->min;
52 if (X > cor->max) X = cor->max;
54 return SumSeries(X,N,&cor->a[0]);
59 Double_t Bichsel::SumSeries(
const Double_t &X,
const Int_t &N,
const Double_t *
params) {
63 for (
int n = N-2; n>=0; n--) Sum = X*Sum + params[n];