1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: EPmtData.hh 1607 2005-03-21 17:13:45Z thea $ |
---|
3 | // created May, 24 2004 |
---|
4 | |
---|
5 | #ifndef __EPMTDATA_HH_ |
---|
6 | #define __EPMTDATA_HH_ |
---|
7 | |
---|
8 | #include "TObject.h" |
---|
9 | #include "ERunParsFiller.hh" |
---|
10 | |
---|
11 | // EPmtData |
---|
12 | // common pmts' data |
---|
13 | class EPmtData: public TObject { |
---|
14 | public: |
---|
15 | EPmtData(); |
---|
16 | |
---|
17 | ~EPmtData(); |
---|
18 | |
---|
19 | virtual void Copy( TObject& ) const; |
---|
20 | virtual void Clear(Option_t* ="" ); |
---|
21 | |
---|
22 | // getters |
---|
23 | inline Float_t GetPmtSide() const { return fPmtSide;} |
---|
24 | inline Float_t GetPmtHeight() const { return fPmtHeight;} |
---|
25 | inline Float_t GetPadSide() const { return fPadSide;} |
---|
26 | inline Float_t GetPadGap() const { return fPadGap;} |
---|
27 | inline Float_t GetBorderWidth() const { return fBorderWidth;} |
---|
28 | inline Int_t GetNumPads() const { return fNumPads;} |
---|
29 | inline Int_t GetNumRows() const { return fNumRows; } |
---|
30 | inline Int_t GetNumCols() const { return fNumCols; } |
---|
31 | inline Float_t GetQuantum() const { return fQuantum; } |
---|
32 | inline Float_t GetGain() const { return fGain; } |
---|
33 | inline Float_t GetGainSigma() const { return fGainSigma; } |
---|
34 | inline Float_t GetWidth() const { return fWidth; } |
---|
35 | inline Float_t GetGtuLength() const { return fGtuLength; } |
---|
36 | |
---|
37 | // setters |
---|
38 | inline void SetPmtSide( Float_t side ) { fPmtSide = side; } |
---|
39 | inline void SetPmtHeight( Float_t h ) { fPmtHeight = h; } |
---|
40 | inline void SetPadSide( Float_t side ) { fPadSide = side; } |
---|
41 | inline void SetPadGap( Float_t gap ) { fPadGap = gap ; } |
---|
42 | inline void SetBorderWidth( Float_t bwidth ) { fBorderWidth = bwidth; } |
---|
43 | inline void SetNumPads( Int_t pads ) { fNumPads = pads; } |
---|
44 | inline void SetNumRows( Int_t rows ) { fNumRows = rows; } |
---|
45 | inline void SetNumCols( Int_t cols ) { fNumCols = cols; } |
---|
46 | inline void SetQuantum( Float_t q ) { fQuantum = q; } |
---|
47 | inline void SetGain( Float_t g ) { fGain = g; } |
---|
48 | inline void SetGainSigma( Float_t gsigma ) { fGainSigma = gsigma; } |
---|
49 | inline void SetWidth( Float_t width ) { fWidth = width; } |
---|
50 | inline void SetGtuLength( Float_t gtulen ) { fGtuLength = gtulen; } |
---|
51 | |
---|
52 | inline Int_t Pmt( Int_t uid ) const; |
---|
53 | // return pmt id from channel unique id |
---|
54 | |
---|
55 | inline Int_t Channel( Int_t uid ) const; |
---|
56 | // return channel id [0-(fNumPads-1)] from pixel id |
---|
57 | |
---|
58 | inline Int_t Col( Int_t uid ) const; |
---|
59 | // return colum number from uid |
---|
60 | |
---|
61 | inline Int_t Row( Int_t uid ) const; |
---|
62 | // return row number from uid |
---|
63 | |
---|
64 | inline Float_t X( Int_t uid ) const; |
---|
65 | // x coord. of pixel(uid) center in pmt ref frame |
---|
66 | |
---|
67 | inline Float_t Y( Int_t uid ) const; |
---|
68 | // y coord. of pixel(uid) center in pmt ref frame |
---|
69 | |
---|
70 | inline Int_t ChCol( Int_t ch ) const; |
---|
71 | // return colum of channel ch |
---|
72 | |
---|
73 | inline Int_t ChRow( Int_t ch ) const; |
---|
74 | // return row of channel ch |
---|
75 | |
---|
76 | inline Float_t ChX( Int_t ch ) const; |
---|
77 | // x coord of the channel ch in pmt ref frame |
---|
78 | |
---|
79 | inline Float_t ChY( Int_t ch ) const; |
---|
80 | // y coord of the channel ch in pmt ref frame |
---|
81 | |
---|
82 | private: |
---|
83 | |
---|
84 | // static variables of PmtGeometry |
---|
85 | Float_t fPmtSide; // pmt side length |
---|
86 | Float_t fPmtHeight; // pmt height |
---|
87 | Float_t fPadSide; // pmt pad side length |
---|
88 | Float_t fPadGap; // width of gap among pads |
---|
89 | Float_t fBorderWidth; // width of the pmt's dead border |
---|
90 | Int_t fNumPads; // number of pixels per pmt |
---|
91 | Int_t fNumRows; // number of rows |
---|
92 | Int_t fNumCols; // number of columns |
---|
93 | |
---|
94 | // static variables of Photomultiplier |
---|
95 | Float_t fQuantum; // quantum efficiency |
---|
96 | Float_t fGain; // nominal gain |
---|
97 | Float_t fGainSigma; // gain spread |
---|
98 | Float_t fWidth; // time width |
---|
99 | Float_t fGtuLength; // gtu length (ns) |
---|
100 | |
---|
101 | ClassDef(EPmtData,1) |
---|
102 | |
---|
103 | ERunParsVisitable() |
---|
104 | }; |
---|
105 | |
---|
106 | |
---|
107 | inline Int_t EPmtData::Pmt( Int_t uid ) const { |
---|
108 | return (uid-1)/GetNumPads()+1; |
---|
109 | } |
---|
110 | |
---|
111 | inline Int_t EPmtData::Channel( Int_t uid ) const { |
---|
112 | return (uid-1) % GetNumPads(); |
---|
113 | } |
---|
114 | |
---|
115 | inline Int_t EPmtData::Col( Int_t uid ) const { |
---|
116 | return ChCol(Channel( uid )); |
---|
117 | } |
---|
118 | |
---|
119 | inline Int_t EPmtData::Row( Int_t uid ) const { |
---|
120 | return ChRow(Channel( uid )); |
---|
121 | } |
---|
122 | |
---|
123 | inline Float_t EPmtData::X( Int_t uid ) const { |
---|
124 | return ChX(Channel(uid)); |
---|
125 | } |
---|
126 | |
---|
127 | inline Float_t EPmtData::Y( Int_t uid ) const { |
---|
128 | return ChY(Channel(uid)); |
---|
129 | } |
---|
130 | |
---|
131 | inline Int_t EPmtData::ChCol( Int_t ch ) const { |
---|
132 | return ch % GetNumCols(); |
---|
133 | } |
---|
134 | |
---|
135 | inline Int_t EPmtData::ChRow( Int_t ch ) const { |
---|
136 | return ch / GetNumCols(); |
---|
137 | } |
---|
138 | |
---|
139 | inline Float_t EPmtData::ChX( Int_t ch ) const { |
---|
140 | return -fPmtSide/2.+fBorderWidth |
---|
141 | +fPadGap*(ChCol(ch)) |
---|
142 | +fPadSide*(ChCol(ch)+0.5); |
---|
143 | } |
---|
144 | |
---|
145 | inline Float_t EPmtData::ChY( Int_t ch ) const { |
---|
146 | return -(-fPmtSide/2.+fBorderWidth |
---|
147 | +fPadGap*(ChRow(ch)) |
---|
148 | +fPadSide*(ChRow(ch)+0.5)); |
---|
149 | } |
---|
150 | #endif /* __EPMTDATA_HH_ */ |
---|
151 | |
---|