StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St_tpcRDOMasksC.h
1 #ifndef St_tpcRDOMasksC_h
2 #define St_tpcRDOMasksC_h
3 
4 #include "TChair.h"
5 #include "tables/St_tpcRDOMasks_Table.h"
6 #include "St_tpcPadPlanesC.h"
7 #include "St_tpcPadConfigC.h"
8 #include "St_tpcRDOMapC.h"
9 class St_tpcRDOMasksC : public TChair {
10  public:
11  static St_tpcRDOMasksC* instance();
12  tpcRDOMasks_st *Struct(Int_t i = 0) {return ((St_tpcRDOMasks*) Table())->GetTable()+i;}
13  UInt_t getNumRows() {return GetNRows();}
14  UInt_t runNumber(Int_t i = 0) {return Struct(i)->runNumber;}
15  UInt_t sector(Int_t i = 0) {return Struct(i)->sector;}
16  UInt_t &mask(Int_t i = 0) {return *&Struct(i)->mask;}
17  UInt_t getSectorMask(UInt_t sector);
18  void setSectorRDOMaskOff(UInt_t sector, Int_t rdo);
19 #if 0
20  static UInt_t rdoForPadrow(Int_t row) { //Function returns the rdo board number for a given padrow index. Range of map used is 1-45.
21  UInt_t rdo = 0;
22  if (row > 0 && row <= 8) rdo = 1;
23  else if (row > 8 && row <= 13) rdo = 2;
24  else if (row >13 && row <= 21) rdo = 3;
25  else if (row >21 && row <= 29) rdo = 4;
26  else if (row >29 && row <= 37) rdo = 5;
27  else if (row >37 && row <= 45) rdo = 6;
28  return rdo;
29  }
30 #else
31  static UInt_t rdoForPadrow(Int_t row) {return rdoForPadrow(1,row,1);}
32 #endif
33  static UInt_t rdoForPadrow(Int_t sector, Int_t row, Int_t pad=1) {
34  //Function returns the rdo board number for a given padrow index. Range of map used is 1-72
35  return St_tpcRDOMapC::instance()->rdo(sector, row, pad);
36  }
37  Bool_t isOn(Int_t sector,Int_t rdo);
38  Bool_t isRowOn(Int_t sector, Int_t row, Int_t pad = 1) {return isOn(sector, rdoForPadrow(sector, row, pad));}
39  protected:
40  St_tpcRDOMasksC(St_tpcRDOMasks *table=0) : TChair(table) {}
41  virtual ~St_tpcRDOMasksC() {fgInstance = 0;}
42  private:
43  static St_tpcRDOMasksC* fgInstance;
44  ClassDefChair(St_tpcRDOMasks, tpcRDOMasks_st )
45  ClassDef(St_tpcRDOMasksC,1) //C++ TChair for tpcRDOMasks table class
46 };
47 #endif
Definition: TChair.h:27