StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St_TpcPadCorrectionC.h
1 #ifndef St_TpcPadCorrectionC_h
2 #define St_TpcPadCorrectionC_h
3 
4 #include "TChair.h"
5 #include "tables/St_TpcPadCorrection_Table.h"
6 #include "TF1.h"
7 
8 class St_TpcPadCorrectionC : public TChair {
9  public:
10  static St_TpcPadCorrectionC* instance();
11  TpcPadCorrection_st *Struct(Int_t i = 0) const {return ((St_TpcPadCorrection*) Table())->GetTable()+i;}
12  UInt_t getNumRows() const {return GetNRows();}
13  Char_t* HistName(Int_t i = 0) const {return Struct(i)->HistName;}
14  Char_t* Type(Int_t i = 0) const {return Struct(i)->Type;}
15  Short_t npads(Int_t i = 0) const {return Struct(i)->npads;}
16  Short_t InOut(Int_t i = 0) const {return Struct(i)->InOut;}
17  Short_t N(Int_t i = 0) const {return Struct(i)->N;}
18  Short_t R(Int_t i = 0) const {return Struct(i)->R;}
19  const Double_t*params(Int_t i = 0) const {return &Struct(i)->a0;}
20  Double_t a0(Int_t i = 0) const {return Struct(i)->a0;}
21  Double_t a1(Int_t i = 0) const {return Struct(i)->a1;}
22  Double_t a2(Int_t i = 0) const {return Struct(i)->a2;}
23  Double_t a3(Int_t i = 0) const {return Struct(i)->a3;}
24  Double_t a4(Int_t i = 0) const {return Struct(i)->a4;}
25  Double_t a5(Int_t i = 0) const {return Struct(i)->a5;}
26  Double_t a6(Int_t i = 0) const {return Struct(i)->a6;}
27  Double_t a7(Int_t i = 0) const {return Struct(i)->a7;}
28  Double_t a8(Int_t i = 0) const {return Struct(i)->a8;}
29  Double_t a9(Int_t i = 0) const {return Struct(i)->a9;}
30  Double_t prob(Int_t i = 0) const {return Struct(i)->prob;}
31  // InOut = 1/2, No. of pads 1/7; MuOrSigma = 0/1
32  Double_t GetCorrection(Double_t pad, Int_t io=1, Int_t np = 1, Int_t MuOrSigma = 0) {
33  if (! fFunc) return 0;
34  if ((io < 1 || io > 2) ||
35  (np < 1 || np > 7) ||
36  (MuOrSigma < 0 || MuOrSigma > 1)) return 0;
37  Int_t indx = 2*(7*(io-1) + np-1)+MuOrSigma;
38  if (! fFunc[indx]) return 0;
39  Int_t ip = TMath::Nint(pad);
40  Double_t px = pad - ip;
41  return fFunc[indx]->Eval(px);
42  }
43  protected:
44  St_TpcPadCorrectionC(St_TpcPadCorrection *table=0);
45  virtual ~St_TpcPadCorrectionC();
46  private:
47  static St_TpcPadCorrectionC* fgInstance;
48  TF1** fFunc;
49  ClassDefChair(St_TpcPadCorrection, TpcPadCorrection_st )
50  ClassDef(St_TpcPadCorrectionC,1) //C++ TChair for TpcPadCorrection table class
51 };
52 #endif
Definition: TChair.h:27