StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St_pidCorrectionC.h
1 #ifndef St_pidCorrectionC_h
2 #define St_pidCorrectionC_h
3 
4 #include "TChair.h"
5 #include "tables/St_pidCorrection_Table.h"
6 #include "StEvent/StPidParticleDefinition.h"
8 #include "TF1.h"
9 class St_pidCorrectionC : public TChair {
10  public:
11  enum PiDStatusIDs { // from StdEdxY2Maker/StTrackCombPiD.h
12  kUndef = kUndefinedMethodId,
13  kI70 = kTruncatedMeanId,
14  kI70U = kEnsembleTruncatedMeanId,
15  kFit = kLikelihoodFitId,
16  kFitU = kWeightedTruncatedMeanId,
17  kdNdx = kOtherMethodId,
18  kdNdxU = kOtherMethodId2,
19  kBTof, kETof, kMtd, kBEmc, kTotal
20  };
21  static St_pidCorrectionC* instance();
22  pidCorrection_st *Struct(Int_t i = 0) const {return ((St_pidCorrection*) Table())->GetTable()+i;}
23  UInt_t getNumRows() const {return GetNRows();}
24  Int_t idx(Int_t i = 0) const {return Struct(i)->idx;} // row index > 0 if it is real
25  Int_t nrows(Int_t i = 0) const {return Struct(i)->nrows;} // total no. of real rows in the table; For Db interface (where nrows = 50)
26  Int_t type(Int_t i = 0) const {return Struct(i)->type;} // type = 0 polymonical fit, use only [min,max]
27  Int_t var(Int_t i = 0) const {return Struct(i)->var;} // fit variable: 0 => pmomL10, 1 => bgL10
28  Int_t particle(Int_t i = 0) const {return Struct(i)->particle;} // from StEvent/StPidParticleDefinition.h : kUndef = -1, kPidElectron = 0, Proton = 1,
29  // Kaon = 2, Pion = 3, Muon = 4, Deuteron = 5, Triton = 6,
30  // He3 = 7, Alpha = 8, He6 = 9, Li5 = 10, Li6,= 11, Li7 = 12, Be7 = 13, Be9 = 14, Be10 = 15, B11 = 16
31  Int_t charge(Int_t i = 0) const {return Struct(i)->charge;} // +/-1, 0 does not matter
32  Int_t pull(Int_t i = 0) const {return Struct(i)->pull;} // != 0 calculated pull correction, == 0 to value
33  Int_t det(Int_t i = 0) const {return Struct(i)->det;} // from StdEdxY2Maker/StTrackPiD.h : kUndef = 0, kI70 = 1, kI70U = 2, kFit = 3, kFitU = 4, kdNdx = 5,
34  // kdNdxU = 6, kBTof -7 , kETof = 8, kMtd = 9, kBEmc = 10
35  Int_t npar(Int_t i = 0) const {return Struct(i)->npar;} // npar < 0, X = exp(x) paramterization; abs(npar) >= 100 cut on range [min.max]
36  Double_t OffSet(Int_t i = 0) const {return Struct(i)->OffSet;} // for future use
37  Double_t min(Int_t i = 0) const {return Struct(i)->min;} // fit range
38  Double_t max(Int_t i = 0) const {return Struct(i)->max;} //
39  Double_t* a(Int_t i = 0) const {return Struct(i)->a;} // a[npar]
40  Char_t* comment(Int_t i = 0) const {return Struct(i)->comment;}
41  Double_t CalcCorrection(Int_t i, Double_t x, Double_t z = 0, Int_t NparMax = -1) const;
42  Double_t SumSeries(pidCorrection_st *cor, Double_t x, Double_t z = 0, Int_t NparMax = -1) const;
43  Double_t Correction(Double_t X, Int_t part = kPidPion, Int_t det = kFit, Int_t charge = 0, Int_t pull = 0, Int_t varT = 0);
44  static Double_t func(Double_t *x, Double_t *p);
45  TF1* Func(Int_t part = kPidPion, Int_t det = kFit, Int_t charge = 0, Int_t pull = 0, Int_t varT = 0);
46  Int_t IsActiveChair() const;
47  protected:
48  St_pidCorrectionC(St_pidCorrection *table=0) : TChair(table) {}
49  virtual ~St_pidCorrectionC() {fgInstance = 0;}
50  private:
51  static St_pidCorrectionC* fgInstance;
52  ClassDefChair(St_pidCorrection, pidCorrection_st )
53  ClassDef(St_pidCorrectionC,1) //C++ TChair for pidCorrection table class
54 };
55 #endif
Definition: TChair.h:27