StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
St_itpcPadPlanesC.h
1 #ifndef St_itpcPadPlanesC_h
2 #define St_itpcPadPlanesC_h
3 
4 #include "TChair.h"
5 #include "tables/St_itpcPadPlanes_Table.h"
6 
7 class St_itpcPadPlanesC : public TChair {
8  public:
9  static St_itpcPadPlanesC* instance();
10  itpcPadPlanes_st *Struct(Int_t i = 0) {return ((St_itpcPadPlanes*) Table())->GetTable()+i;}
11  UInt_t getNumRows() {return GetNRows();}
12  Int_t padRows(Int_t i = 0) {return Struct(i)->padRows;}
13  Int_t innerPadRows(Int_t i = 0) {return Struct(i)->innerPadRows;}
14  Int_t innerPadRows48(Int_t i = 0) {return Struct(i)->innerPadRows48;}
15  Int_t innerPadRows52(Int_t i = 0) {return Struct(i)->innerPadRows52;}
16  Int_t outerPadRows(Int_t i = 0) {return Struct(i)->outerPadRows;}
17  Int_t superInnerPadRows(Int_t i = 0) {return Struct(i)->superInnerPadRows;}
18  Int_t superOuterPadRows(Int_t i = 0) {return Struct(i)->superOuterPadRows;}
19  Double_t innerSectorPadWidth(Int_t i = 0) {return Struct(i)->innerSectorPadWidth;}
20  Double_t innerSectorPadLength(Int_t i = 0){return Struct(i)->innerSectorPadLength;}
21  Double_t innerSectorPadPitch(Int_t i = 0) {return Struct(i)->innerSectorPadPitch;}
22  Double_t innerSectorRowPitch1(Int_t i = 0){return Struct(i)->innerSectorRowPitch1;}
23  Double_t innerSectorRowPitch2(Int_t i = 0){return Struct(i)->innerSectorRowPitch2;}
24  Double_t firstPadRow(Int_t i = 0) {return Struct(i)->firstPadRow;}
25  Double_t firstOuterSectorPadRow(Int_t i=0){return Struct(i)->firstOuterSectorPadRow;}
26  Double_t lastOuterSectorPadRow(Int_t i =0){return Struct(i)->lastOuterSectorPadRow;}
27  Double_t firstRowWidth(Int_t i = 0) {return Struct(i)->firstRowWidth;}
28  Double_t lastRowWidth(Int_t i = 0) {return Struct(i)->lastRowWidth;}
29  Double_t outerSectorPadWidth(Int_t i = 0) {return Struct(i)->outerSectorPadWidth;}
30  Double_t outerSectorPadLength(Int_t i = 0){return Struct(i)->outerSectorPadLength;}
31  Double_t outerSectorPadPitch(Int_t i = 0) {return Struct(i)->outerSectorPadPitch;}
32  Double_t outerSectorRowPitch(Int_t i = 0) {return Struct(i)->outerSectorRowPitch;}
33  Double_t outerSectorLength(Int_t i = 0) {return Struct(i)->outerSectorLength;}
34  Double_t ioSectorSeparation(Int_t i = 0) {return Struct(i)->ioSectorSeparation;}
35  Double_t innerSectorEdge(Int_t i = 0) {return Struct(i)->innerSectorEdge;}
36  Double_t outerSectorEdge(Int_t i = 0) {return Struct(i)->outerSectorEdge;}
37  Double_t innerSectorPadPlaneZ(Int_t i = 0){return Struct(i)->innerSectorPadPlaneZ;}
38  Double_t outerSectorPadPlaneZ(Int_t i = 0){return Struct(i)->outerSectorPadPlaneZ;}
39  Int_t* innerPadsPerRow(Int_t i = 0) {return Struct(i)->innerPadsPerRow;}
40  Int_t* outerPadsPerRow(Int_t i = 0) {return Struct(i)->outerPadsPerRow;}
41  Int_t padsPerRow(Int_t row = 1) {return (row <= innerPadRows()) ?
42  innerPadsPerRow()[row-1] :
43  outerPadsPerRow()[row-1-innerPadRows()];}
44  Double_t* innerRowRadii(Int_t i = 0) {return Struct(i)->innerRowRadii;}
45  Double_t* outerRowRadii(Int_t i = 0) {return Struct(i)->outerRowRadii;}
46  // taken from StRItpcPadPlane
47  Int_t numberOfRows() {return padRows();}
48  Int_t numberOfInnerRows() {return innerPadRows();}
49  Int_t numberOfInnerRows48() {return innerPadRows48();}
50  Int_t numberOfInnerRows52() {return innerPadRows52();}
51  Int_t numberOfOuterRows() {return outerPadRows();}
52  Bool_t isRowInRange(Int_t row) {return (row >= 1 && row<=numberOfRows()) ? kTRUE: kFALSE;}
53  Double_t radialDistanceAtRow(Int_t row) {
54  if (! isRowInRange(row)) return 0;
55  if ( row<=numberOfInnerRows() ) return innerRowRadii()[row-1];
56  else return outerRowRadii()[row-1-numberOfInnerRows()];
57  }
58  Int_t numberOfPadsAtRow(Int_t row) {
59  if (! isRowInRange(row)) return 0;
60  if ( row<=numberOfInnerRows() ) return innerPadsPerRow()[row-1];
61  return outerPadsPerRow()[row-1-numberOfInnerRows()];
62  }
63  Double_t PadWidthAtRow(Int_t row) {
64  if (! isRowInRange(row)) return 0;
65  if ( row<=numberOfInnerRows()) return innerSectorPadWidth();
66  return outerSectorPadWidth();
67  }
68  Double_t PadLengthAtRow(Int_t row) {
69  if (! isRowInRange(row)) return 0;
70  if ( row<=numberOfInnerRows()) return innerSectorPadLength();
71  return outerSectorPadLength();
72  }
73  Double_t PadPitchAtRow(Int_t row) {
74  if (! isRowInRange(row)) return 0;
75  if ( row<=numberOfInnerRows()) return innerSectorPadPitch();
76  return outerSectorPadPitch();
77  }
78  Double_t RowPitchAtRow(Int_t row) {
79  if (! isRowInRange(row)) return 0;
80  if ( row<=numberOfInnerRows48() ) return innerSectorRowPitch1();
81  else if (row>numberOfInnerRows48()&&row<=numberOfInnerRows()) return innerSectorRowPitch2();
82  return outerSectorRowPitch();
83  }
84  Int_t indexForRowPad(Int_t row, Int_t pad) {
85  if (pad >numberOfPadsAtRow(row)) return -1;
86  Int_t index = 0;
87  if (row>0 && row<=numberOfInnerRows() ) for (Int_t i=1;i<row;i++) index += numberOfPadsAtRow(i);
88  else
89  if (row>numberOfInnerRows()&&row<=numberOfRows()) for (Int_t i=numberOfInnerRows()+1;i<row;i++) index += numberOfPadsAtRow(i);
90  index+=pad-1;
91  return index;
92  }
93  protected:
94  St_itpcPadPlanesC(St_itpcPadPlanes *table=0) : TChair(table) {}
95  virtual ~St_itpcPadPlanesC() {fgInstance = 0;}
96  private:
97  static St_itpcPadPlanesC* fgInstance;
98  ClassDefChair(St_itpcPadPlanes, itpcPadPlanes_st )
99  ClassDef(St_itpcPadPlanesC,1) //C++ TChair for itpcPadPlanes table class
100 };
101 #endif
Definition: TChair.h:27