3 #include "St_svtCorrectionC.h"
6 Double_t St_svtCorrectionC::STcheb(Int_t N, Double_t *par, Double_t x) {
7 if (N < 0 || N > 12)
return 0;
11 Double_t Sum = par[0]*T0;
15 for (
int n = 2; n <= N; n++) {
16 T2 = 2*(2*x - 1)*T1 - T0;
25 svtCorrection_st *St_svtCorrectionC::pCorrection(Int_t layer, Int_t ladder, Int_t wafer, Int_t hybrid) {
26 St_svtCorrection *Table = (St_svtCorrection *) GetThisTable();
27 if (! Table)
return 0;
28 svtCorrection_st *Data = Table->GetTable();
30 static svtCorrection_st *pointers[6][16][7][2];
31 if (N == 0 || ! Table->IsMarked()) {
32 N = Table->GetNRows();
33 memset (pointers,0, 6*16*7*2*
sizeof(svtCorrection_st *));
36 assert(layer >= 1 && layer <= 6);
37 assert(ladder >= 1 && ladder <= 16);
38 assert(wafer >= 1 && wafer <= 7);
39 svtCorrection_st *p = pointers[layer-1][ladder-1][wafer-1][hybrid-1];
41 for (Int_t i = 0; i < N; i++) {
42 if (Data[i].layer == layer &&
43 Data[i].ladder == ladder &&
44 Data[i].wafer == wafer &&
45 Data[i].hybrid == hybrid) {
46 if (Data[i].Npar > -1) {
48 pointers[layer-1][ladder-1][wafer-1][hybrid-1] = p;
57 Double_t St_svtCorrectionC::CalcCorrection(Int_t layer, Int_t ladder, Int_t wafer, Int_t hybrid, Double_t u) {
58 svtCorrection_st *p = pCorrection(layer, ladder, wafer, hybrid);
59 return p ? STcheb(p->Npar, p->param, TMath::Abs(u/3.)) : 0;