00001 #ifndef St_TpcAvgCurrentC_h
00002 #define St_TpcAvgCurrentC_h
00003
00004 #include "TChair.h"
00005 #include "tables/St_TpcAvgCurrent_Table.h"
00006 #include "St_tpcAnodeHVC.h"
00007 class St_TpcAvgCurrentC : public TChair {
00008 public:
00009 static St_TpcAvgCurrentC* instance();
00010 TpcAvgCurrent_st *Struct(Int_t i = 0) const {return ((St_TpcAvgCurrent*) Table())->GetTable()+i;}
00011 UInt_t getNumRows() const {return GetNRows();}
00012 Int_t run(Int_t i = 0) const {return Struct(i)->run;}
00013 Int_t start_time(Int_t i = 0) const {return Struct(i)->start_time;}
00014 Int_t stop_time(Int_t i = 0) const {return Struct(i)->stop_time;}
00015 static Int_t ChannelFromRow(Int_t row);
00016 static Int_t ChannelFromSocket(Int_t socket);
00017 Float_t AvCurrent(Int_t sector = 1, Int_t channel = 1) {
00018 return (sector > 0 && sector <= 24 && channel > 0 && channel <= 8) ?
00019 Struct()->AvCurrent[8*(sector-1)+channel-1] :
00020 0;}
00021 Float_t AvCurrSocket(Int_t sector = 1, Int_t socket = 1) {return AvCurrent(sector,ChannelFromSocket(socket));}
00022 Float_t AvCurrRow(Int_t sector = 1, Int_t row = 1) {return AvCurrent(sector,ChannelFromRow(row));}
00023 Float_t AcCharge(Int_t sector = 1, Int_t channel = 1) {
00024 return (sector > 0 && sector <= 24 && channel > 0 && channel <= 8) ?
00025 Struct()->AcCharge[8*(sector-1)+channel-1] :
00026 0;
00027 }
00028 Float_t AcChargeSocket(Int_t sector = 1, Int_t socket = 1) {return AcCharge(sector,ChannelFromSocket(socket));}
00029 Float_t AcChargeRow(Int_t sector = 1, Int_t row = 1) {return AcCharge(sector,ChannelFromRow(row));}
00030 protected:
00031 St_TpcAvgCurrentC(St_TpcAvgCurrent *table=0) : TChair(table) {}
00032 virtual ~St_TpcAvgCurrentC() {fgInstance = 0;}
00033 private:
00034 static St_TpcAvgCurrentC* fgInstance;
00035 ClassDefChair(St_TpcAvgCurrent, TpcAvgCurrent_st )
00036 ClassDef(St_TpcAvgCurrentC,1)
00037 };
00038 #endif