StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St_tofStatusC.h
1 #ifndef St_tofStatusC_h
2 #define St_tofStatusC_h
3 
4 #include "TChair.h"
5 #include "tables/St_tofStatus_Table.h"
6 
7 class St_tofStatusC : public TChair {
8  public:
9  static St_tofStatusC* instance();
10  tofStatus_st *Struct(Int_t i = 0) const {return ((St_tofStatus*) Table())->GetTable()+i;}
11  UInt_t getNumRows() const {return GetNRows();}
12  UShort_t *status(Int_t i = 0) const {return Struct(i)->status;}
13  Int_t status(Int_t trayId, Int_t moduleId, Int_t cellId) {
14  enum {mNModule = 32, mNCell = 6, mNTray=120};
15  if (trayId < 1 || trayId > mNTray ||
16  moduleId < 1 || moduleId > mNModule ||
17  cellId < 1 || cellId > mNCell ) return 0;
18  Int_t i = (cellId -1) + mNCell*((moduleId-1) + mNModule*(trayId-1));
19  return (Int_t) status()[i];
20  }
21  protected:
22  St_tofStatusC(St_tofStatus *table=0) : TChair(table) {}
23  virtual ~St_tofStatusC() {fgInstance = 0;}
24  private:
25  static St_tofStatusC* fgInstance;
26  ClassDefChair(St_tofStatus, tofStatus_st )
27  ClassDef(St_tofStatusC,1) //C++ TChair for tofStatus table class
28 };
29 #endif
Definition: TChair.h:27