StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TPCV2P0.hh
1 /***************************************************************************
2  * $Id: TPCV2P0.hh,v 1.4 2004/03/04 21:51:29 ward Exp $
3  * Author: Jeff Landgraf and M.J. LeVine
4  ***************************************************************************
5  * Description: declarations For TPC version 2.0
6  *
7  *
8  * change log
9  * 22-Jun-99 MJL added TPCV2P0_CPP_SR::getAsicParams(ASIC_params *);
10  * 25-Jun-99 MJL remove #include "MemMan.hh"
11  * 20-Jul-99 MJL add #include "Error.hh"
12  *
13  ***************************************************************************
14  * $Log: TPCV2P0.hh,v $
15  * Revision 1.4 2004/03/04 21:51:29 ward
16  * Replaced MERGE_SEQUENCES with a StDAQMaker chain parameter, as suggested by Landgraf and Lauret.
17  *
18  * Revision 1.3 1999/07/21 21:32:38 levine
19  *
20  *
21  * changes to include error logging to file.
22  *
23  * There are now 2 constructors for EventReader:
24  *
25  * EventReader();
26  * EventReader(const char *logfilename);
27  *
28  * Constructed with no argument, there is no error logging. Supplying a file name
29  * sends all diagnostic output to the named file (N.B. opens in append mode)
30  *
31  * See example in client.cxx for constructing a log file name based on the
32  * datafile name.
33  *
34  * It is strongly advised to use the log file capability. You can grep it for
35  * instances of "ERROR:" to trap anything noteworthy (i.e., corrupted data files).
36  *
37  * Revision 1.2 1999/07/02 04:43:24 levine
38  * Many changes -
39  * navigates to head of TPCP bank independent of position.
40  * move declarations out of loops where they were upsetting some compilers
41  * suppress output from class libraries with run-time switch EventReader.verbose
42  * added TPCV2P0_CPP_SR::getAsicParams()
43  *
44  *
45  **************************************************************************/
46 
47 #ifndef TPCV2P0_HH
48 #define TPCV2P0_HH
49 
50 #include "StDaqLib/GENERIC/EventReader.hh"
51 #include "StDaqLib/GENERIC/Error.hh"
52 #include "StDaqLib/GENERIC/RecHeaderFormats.hh"
53 #include "TPCV2P0.Banks.hh"
54 //#include "MemMan.hh"
55 #include "TPCV2P0_Reader.hh"
56 
57 class TPCV2P0_Reader;
58 class TPCV2P0_PADK_SR;
59 
60 // The sector reader virtual classes
61 
62 // Zero-suppressed reader
64 {
65 public:
66  int getPadList(int PadRow, unsigned char **padList);
67  int getSequences(int PadRow, int Pad, int *nSeq, Sequence **SeqData);
68  int getSpacePts(int PadRow, int *nSpacePts, SpacePt **SpacePts);
69 
70  int MemUsed();
71 
72  TPCV2P0_ZS_SR(int sector, TPCV2P0_Reader *,char mergeSequences);
73  int initialize();
74  int getFeeSequences(int Fee, int Pin, int *nSeq, Sequence **SeqData);
75 
76  ~TPCV2P0_ZS_SR();
77 
78 
79 private:
80  classname(Bank_TPCADCD) *adcd_p[6][3];
81  classname(Bank_TPCADCX) *adcx_p[6][3];
82  classname(Bank_TPCSEQD) *seqd_p[6][3];
83  classname(Bank_TPCMZCLD) *cld_p[6][3];
84 
85  char mMergeSequences;
86  int sector;
87  int nsptrow[TPC_PADROWS]; // num space pts each pad row
88  SpacePt *RowSpacePts[TPC_PADROWS]; // pointer to SpacePt array for each padrow
89  struct Pad Pad_array[TPC_PADROWS][TPC_MAXPADS];
90  struct PadRow Row_array[TPC_PADROWS];
91  u_char padlist[TPC_PADROWS][TPC_MAXPADS];
92 
93  TPCV2P0_Reader *detector;
94  TPCV2P0_PADK_SR *padkr;
95 
96 };
97 
98 
99 // Reads Raw ADC values
101 {
102 public:
103  int getPadList(int PadRow, unsigned char **padList);
104  int getSequences(int PadRow, int Pad, int *nArray, u_char **Array);
105  int MemUsed();
106 
107  TPCV2P0_ADCR_SR(int sector, TPCV2P0_Reader *);
108  int initialize();
109  ~TPCV2P0_ADCR_SR();
110 
111 private:
112  int sector;
113  TPCV2P0_Reader *detector;
114  TPCV2P0_PADK_SR *padkr;
115  u_char padlist[TPC_PADROWS][TPC_MAXPADS];
116 
117  classname(Bank_TPCADCR) *banks[6][3];
118 };
119 
120 // Reads the Pedestal values
122 {
123 private:
124  int sector;
125  TPCV2P0_Reader *detector;
126  TPCV2P0_PADK_SR *padkr;
127  classname(Bank_TPCPEDR) *banks[6][3];
128  u_char padlist[TPC_PADROWS][TPC_MAXPADS];
129  int numEvents;
130 
131 public:
132  int getPadList(int PadRow, unsigned char **padList);
133  int getSequences(int PadRow, int Pad, int *nArray, u_char **Array);
134  int getNumberOfEvents();
135 
136  int MemUsed();
137 
138  TPCV2P0_PEDR_SR(int sector, TPCV2P0_Reader *); int initialize();
139  ~TPCV2P0_PEDR_SR();
140 };
141 
142 // The RMS pedestal values
144 {
145 private:
146  int sector;
147  TPCV2P0_Reader *detector;
148  TPCV2P0_PADK_SR *padkr;
149  classname(Bank_TPCRMSR) *banks[6][3];
150  u_char padlist[TPC_PADROWS][TPC_MAXPADS];
151  int numEvents;
152 
153 public:
154  int getPadList(int PadRow, unsigned char **padList);
155  int getSequences(int PadRow, int Pad, int *nArray, u_char **Array);
156  int getNumberOfEvents();
157 
158  int MemUsed();
159 
160  TPCV2P0_PRMS_SR(int sector, TPCV2P0_Reader *);
161  int initialize();
162  ~TPCV2P0_PRMS_SR();
163 };
164 
165 // The gain reader
166 class TPCV2P0_G_SR : public GainReader
167 {
168 private:
169  int sector;
170  TPCV2P0_Reader *detector;
171 
172 public:
173  int getGain(int PadRow, int Pad, struct Gain **gain);
174  int getMeanGain();
175  int getNumberOfEvents();
176 
177  int MemUsed();
178 
179  TPCV2P0_G_SR(int sector, TPCV2P0_Reader *);
180  int initialize();
181  ~TPCV2P0_G_SR();
182 };
183 
184 // Reads Cluster Pointer Pairs from the ASIC
185 class TPCV2P0_CPP_SR : public CPPReader
186 {
187 public:
188  int getClusters(int PadRow, int Pad, int *nClusters,
189  struct ASIC_Cluster **clusters);
190  int getAsicParams(ASIC_params *);
191  int MemUsed();
192 
193  TPCV2P0_CPP_SR(int sector, TPCV2P0_Reader *);
194  int initialize();
195  ~TPCV2P0_CPP_SR();
196 
197 private:
198  int sector;
199  TPCV2P0_Reader *detector;
200  TPCV2P0_PADK_SR *padkr;
201  classname(Bank_TPCCPPR) *banks[6][3];
202 };
203 
204 // Reads the bad channels
206 {
207 private:
208  int sector;
209 
210 public:
211  int IsBad(int PadRow, int Pad);
212 
213  int MemUsed();
214 
215  TPCV2P0_BC_SR(int sector, TPCV2P0_Reader *);
216  int initialize();
217  ~TPCV2P0_BC_SR();
218 };
219 
220 // Read the front end electronics configuration
222 {
223 private:
224  int sector;
225 
226 public:
227  int FEE_id(int PadRow, int Pad) = 0;
228  // returns FEE_id
229 
230  int MemUsed();
231 
232  TPCV2P0_CR_SR(int sector, TPCV2P0_Reader *);
233  int initialize();
234  ~TPCV2P0_CR_SR();
235 };
236 
237 struct PADK_entry
238 {
239  short offset;
240  short mz; // mz and rb are counted up from 1
241  short rb;
242 };
243 
245 {
246 public:
247  TPCV2P0_PADK_SR(int sector, TPCV2P0_Reader *);
248  int initialize();
249 
250  void place(short padrow, short pad, PADK_entry *);
251  void get(short padrow, short pad, PADK_entry *);
252 
253  int getADCBytes() { return 512; };
254  int getCPPBytes() { return 128; };
255  int getPEDBytes() { return 512; };
256  int getRMSBytes() { return 512; };
257  int getCFGBytes() { return 1; };
258  int getGAINBytes() { return 4; };
259 
260 private:
261  int sector;
262  TPCV2P0_Reader *detector;
263 
264  short packed_address[TPC_PADROWS][TPC_MAXPADS];
265 
266  short pack(short rcb, short mz, short offset);
267  void unpack(PADK_entry *, short paddress);
268 };
269 
270 #endif
271 
272 
273 
274 
275 
Definition: rb.hh:21
Definition: TPCV1P0.hh:217