StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St_starMagAvgC.h
1 #ifndef St_starMagAvgC_h
2 #define St_starMagAvgC_h
3 
4 #include "TChair.h"
5 #include "tables/St_starMagAvg_Table.h"
6 
7 class St_starMagAvgC : public TChair {
8  public:
9  static St_starMagAvgC* instance();
10  starMagAvg_st *Struct(Int_t i = 0) const {return ((St_starMagAvg*) Table())->GetTable()+i;}
11  UInt_t getNumRows() const {return GetNRows();}
12  UInt_t runNumber(Int_t i = 0) const {return Struct(i)->runNumber;}
13  UInt_t startRunTime(Int_t i = 0) const {return Struct(i)->startRunTime;}
14  UInt_t endRunTime(Int_t i = 0) const {return Struct(i)->endRunTime;}
15  UInt_t noEntries(Int_t i = 0) const {return Struct(i)->noEntries;}
16  Double_t current(Int_t i = 0) const {return Struct(i)->current;}
17  Double_t rms(Int_t i = 0) const {return Struct(i)->rms;}
18  Double_t ScaleFactor(Int_t i = 0){return current()/(4500/(9.98071899596718826e-01));} // 12/03/20 scale Run 2020 11p5GeV K_s^0 (pcmax(0.49827)/pcmax(0.497611)) to PDG value
19  StMagnetPolarity getMagneticField() {
20  StMagnetPolarity value = eUnknownMField;
21  if (! instance()) return value;
22  Double_t scaleFactor = ScaleFactor();
23  if (scaleFactor > 0.75) value = eFullMFieldPolA;
24  else if (scaleFactor > 0.10) value = eHalfMFieldPolA;
25  else if (scaleFactor > -0.10) value = eZeroMField;
26  else if (scaleFactor > -0.75) value = eHalfMFieldPolB;
27  else if (scaleFactor > -1.25) value = eFullMFieldPolB;
28  return value;
29  }
30  protected:
31  St_starMagAvgC(St_starMagAvg *table=0) : TChair(table) {}
32  virtual ~St_starMagAvgC() {fgInstance = 0;}
33  private:
34  static St_starMagAvgC* fgInstance;
35  ClassDefChair(St_starMagAvg, starMagAvg_st )
36  ClassDef(St_starMagAvgC,1) //C++ TChair for starMagAvg table class
37 };
38 #endif
Definition: TChair.h:27