StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St_TpcAvgPowerSupplyC.h
1 #ifndef St_TpcAvgPowerSupplyC_h
2 #define St_TpcAvgPowerSupplyC_h
3 
4 #include "TChair.h"
5 #include "tables/St_TpcAvgPowerSupply_Table.h"
6 #include "St_TpcAvgCurrentC.h"
7 class St_TpcAvgPowerSupplyC : public TChair {
8  public:
9  static St_TpcAvgPowerSupplyC* instance();
10  TpcAvgPowerSupply_st *Struct(Int_t i = 0) const {return ((St_TpcAvgPowerSupply*) Table())->GetTable()+i;}
11  UInt_t getNumRows() const {return GetNRows();}
12  Int_t run(Int_t i = 0) const {return Struct(i)->run;}
13  Int_t start_time(Int_t i = 0) const {return Struct(i)->start_time;}
14  Int_t stop_time(Int_t i = 0) const {return Struct(i)->stop_time;}
15  Float_t* Current(Int_t i = 0) const {return Struct(i)->Current;}
16  Float_t* Charge(Int_t i = 0) const {return Struct(i)->Charge;}
17  Float_t* Voltage(Int_t i = 0) const {return Struct(i)->Voltage;}
18  Float_t voltagePadrow(Int_t sec = 1, Int_t padrow = 1) const; // sector=1..24 , padrow=1..100
19  Bool_t tripped(Int_t sec = 1, Int_t row = 1) const {return voltagePadrow(sec,row) < -100;}
20  static Int_t ChannelFromRow(Int_t sector, Int_t row) {return St_TpcAvgCurrentC::ChannelFromRow(sector,row);}
21  static Int_t ChannelFromSocket(Int_t socket) {return St_TpcAvgCurrentC::ChannelFromSocket(socket);}
22  Float_t AvCurrent(Int_t sector = 1, Int_t channel = 1) {
23  return (sector > 0 && sector <= 24 && channel > 0 && channel <= 8) ?
24  Struct()->Current[8*(sector-1)+channel-1] :
25  0;}
26  Float_t AvCurrSocket(Int_t sector = 1, Int_t socket = 1) {return AvCurrent(sector,ChannelFromSocket(socket));}
27  Float_t AvCurrRow(Int_t sector = 1, Int_t row = 1) {return AvCurrent(sector,ChannelFromRow(sector,row));}
28  Float_t AcCharge(Int_t sector = 1, Int_t channel = 1) {
29  return (sector > 0 && sector <= 24 && channel > 0 && channel <= 8) ?
30  Struct()->Charge[8*(sector-1)+channel-1] :
31  0;
32  }
33  Float_t AcChargeSocket(Int_t sector = 1, Int_t socket = 1) {return AcCharge(sector,ChannelFromSocket(socket));}
34  Float_t AcChargeRow(Int_t sector = 1, Int_t row = 1) {return AcCharge(sector,ChannelFromRow(sector,row));}
35  Float_t AcChargeL(Int_t sector = 1, Int_t channel = 1); // C/cm
36  Float_t AcChargeRowL(Int_t sector = 1, Int_t row = 1) {return AcChargeL(sector,ChannelFromRow(sector,row));}
37  Bool_t livePadrow(Int_t sec = 1, Int_t padrow = 1) const { return voltagePadrow(sec,padrow) > 850;}
38  void PrintC() const;
39  protected:
40  St_TpcAvgPowerSupplyC(St_TpcAvgPowerSupply *table=0) : TChair(table) {}
41  virtual ~St_TpcAvgPowerSupplyC() {fgInstance = 0;}
42  private:
43  static St_TpcAvgPowerSupplyC* fgInstance;
44  ClassDefChair(St_TpcAvgPowerSupply, TpcAvgPowerSupply_st )
45  ClassDef(St_TpcAvgPowerSupplyC,1) //C++ TChair for TpcAvgPowerSupply table class
46 };
47 #endif
Definition: TChair.h:27