StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St_spaceChargeCorC.h
1 #ifndef St_spaceChargeCorC_h
2 #define St_spaceChargeCorC_h
3 
4 #include "TChair.h"
5 #include "tables/St_spaceChargeCor_Table.h"
6 #include "StDetectorDbMagnet.h"
7 #include "StChain/StChain.h"
8 
9 class St_spaceChargeCorC : public TChair {
10  public:
11  spaceChargeCor_st *Struct(Int_t i = 0) {return ((St_spaceChargeCor*) Table())->GetTable()+i;}
12  UInt_t getNumRows() {return GetNRows();}
13  Double_t fullFieldB(Int_t i = 0) {return Struct(i)->fullFieldB;}
14  Double_t halfFieldB(Int_t i = 0) {return Struct(i)->halfFieldB;}
15  Double_t zeroField(Int_t i = 0) {return Struct(i)->zeroField;}
16  Double_t halfFieldA(Int_t i = 0) {return Struct(i)->halfFieldA;}
17  Double_t fullFieldA(Int_t i = 0) {return Struct(i)->fullFieldA;}
18  Double_t satRate(Int_t i = 0) {return Struct(i)->satRate;}
19  Float_t factor(Int_t i = 0) {return Struct(i)->factor;}
20  Float_t detector(Int_t i = 0) {return Struct(i)->detector;}
21  Float_t offset(Int_t i = 0) {return Struct(i)->offset;}
22  Float_t getEWRatio(Int_t i = 0) {return Struct(i)->ewratio;}
23  Double_t getSpaceChargeCorrection(Double_t scaleFactor, Int_t i = 0){
24  Double_t value = 0;
25  if(scaleFactor < -.75 && scaleFactor > -1.25) value = fullFieldB(i);
26  else if(scaleFactor < -0.25) value = halfFieldB(i);
27  else if(scaleFactor < .25) value = zeroField(i);
28  else if(scaleFactor < 0.75) value = halfFieldA(i);
29  else if(scaleFactor < 1.25) value = fullFieldA(i);
30  return value;
31  }
32  Double_t getSpaceChargeCorrection(){return getSpaceChargeCorrection(StDetectorDbMagnet::instance()->getScaleFactor());}
33  Double_t getSpaceChargeCoulombs(Double_t scaleFactor);
34  Double_t getSpaceChargeCoulombs(){return getSpaceChargeCoulombs(StDetectorDbMagnet::instance()->getScaleFactor());}
35  Double_t getSpaceChargeSatRate(Int_t i = 0) {return satRate(i);}
36  Float_t getSpaceChargeFactor(Int_t i = 0) {return factor(i);}
37  Float_t getSpaceChargeDetector(Int_t i = 0){return detector(i);}
38  Float_t getSpaceChargeOffset(Int_t i = 0) {return offset(i);}
39  TString getSpaceChargeString(Double_t scaleFactor);
40  TString getSpaceChargeString(){return getSpaceChargeString(StDetectorDbMagnet::instance()->getScaleFactor());}
41 
42  protected:
43  St_spaceChargeCorC(St_spaceChargeCor *table=0) : TChair(table) {}
44  virtual ~St_spaceChargeCorC() {}
45  private:
46  ClassDefChair(St_spaceChargeCor, spaceChargeCor_st )
47  ClassDef(St_spaceChargeCorC,1) //C++ TChair for spaceChargeCor table class
48 };
49 
51  public:
52  static St_spaceChargeCorR1C* instance();
53  protected:
54  St_spaceChargeCorR1C(St_spaceChargeCor *table=0) : St_spaceChargeCorC(table) {}
55  virtual ~St_spaceChargeCorR1C() {fgInstance = 0;}
56  private:
57  static St_spaceChargeCorR1C* fgInstance;
58  ClassDef(St_spaceChargeCorR1C,1) //C++ TChair for spaceChargeCor table class
59 };
61  public:
62  static St_spaceChargeCorR2C* instance();
63  protected:
64  St_spaceChargeCorR2C(St_spaceChargeCor *table=0) : St_spaceChargeCorC(table) {}
65  virtual ~St_spaceChargeCorR2C() {fgInstance = 0;}
66  private:
67  static St_spaceChargeCorR2C* fgInstance;
68  ClassDef(St_spaceChargeCorR2C,1) //C++ TChair for spaceChargeCor table class
69 };
70 #endif
Definition: TChair.h:27