StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SVTV1P0.hh
1 /***************************************************************************
2  *
3  * $Id: SVTV1P0.hh,v 1.2 2001/04/18 19:47:25 ward Exp $
4  *
5  * Author: Jeff Landgraf, M.J. LeVine, Marcelo Munhoz, J. Schambach
6  *
7  ***************************************************************************
8  *
9  * Description: declarations For SVT
10  *
11  ***************************************************************************
12  *
13  * $Log: SVTV1P0.hh,v $
14  * Revision 1.2 2001/04/18 19:47:25 ward
15  * StDaqLib/SVT stuff from Jo Schambach.
16  *
17  * Revision 1.1 2000/06/06 18:03:10 jml
18  * Initial version of SVT Reader code author (marcello munholz, helen caines)
19  *
20  *
21  **************************************************************************/
22 
23 #ifndef SVTV1P0_HH
24 #define SVTV1P0_HH
25 
26 #include "StDaqLib/GENERIC/EventReader.hh"
27 #include "StDaqLib/GENERIC/Error.hh"
28 #include "StDaqLib/GENERIC/RecHeaderFormats.hh"
29 #include "SVTV1P0.Banks.hh"
30 //#include "MemMan.hh"
31 #include "SVTV1P0_Reader.hh"
32 
33 class SVTV1P0_Reader;
34 class SVTV1P0_ANODK_SR;
35 
36 // The sector reader virtual classes
37 
38 // Zero-suppressed reader
40 {
41 public:
42  int getPadList(int hybrid, unsigned char **anodeList);
43  int getSequences(int hybrid, int Anode, int *nSeq, Sequence **SeqData);
44  int getSpacePts(int hybrid, int *nSpacePts, SpacePt **SpacePts);
45 
46  int MemUsed();
47 
48  SVTV1P0_ZS_SR(int wafer, SVTV1P0_Reader *);
49  SVTV1P0_ZS_SR(int barrel, int ladder, int wafer, SVTV1P0_Reader *);
50  int initialize();
51  int getFeeSequences(int Fee, int Pin, int *nSeq, Sequence **SeqData);
52 
53  ~SVTV1P0_ZS_SR();
54 
55 
56 private:
57  classname(Bank_SVTADCD) *adcd_p;
58  classname(Bank_SVTADCX) *adcx_p;
59  classname(Bank_SVTSEQD) *seqd_p;
60  classname(Bank_SVTMZCLD) *cld_p;
61 
62  int barrel, ladder, wafer;
63  int hyperSector, rcb, mezz, transitionBoard;
64  int nspthybrid[SVT_HYBRIDS]; // num space pts each hybrid
65  SpacePt *HybridSpacePts[SVT_HYBRIDS]; // pointer to SpacePt array for each padrow
66  struct Pad Anode_array[SVT_HYBRIDS][SVT_ANODES];
67  struct PadRow Hybrid_array[SVT_HYBRIDS];
68  u_char anodelist[SVT_HYBRIDS][SVT_ANODES];
69 
70  SVTV1P0_Reader *detector;
71  SVTV1P0_ANODK_SR *anodkr;
72 
73 };
74 
75 
76 // Reads Raw ADC values
78 {
79 public:
80  int getPadList(int hybrid, unsigned char **anodeList);
81  int getSequences(int hybrid, int Anode, int *nArray, u_char **Array);
82  int MemUsed();
83 
84  SVTV1P0_ADCR_SR(int wafer, SVTV1P0_Reader *);
85  SVTV1P0_ADCR_SR(int barrel, int ladder, int wafer, SVTV1P0_Reader *);
86  int initialize();
87  ~SVTV1P0_ADCR_SR();
88 
89 private:
90  int barrel, ladder, wafer;
91  SVTV1P0_Reader *detector;
92  SVTV1P0_ANODK_SR *anodkr;
93  u_char anodelist[SVT_HYBRIDS][SVT_ANODES];
94 
95  classname(Bank_SVTADCR) *banks;
96 };
97 
98 // Reads the Pedestal values
100 {
101 private:
102  int barrel, ladder, wafer;
103  SVTV1P0_Reader *detector;
104  SVTV1P0_ANODK_SR *anodkr;
105  classname(Bank_SVTPEDR) *banks;
106  u_char anodelist[SVT_HYBRIDS][SVT_ANODES];
107  int numEvents;
108 
109 public:
110  int getPadList(int hybrid, unsigned char **anodeList);
111  int getSequences(int hybrid, int Anode, int *nArray, u_char **Array);
112  int getNumberOfEvents();
113 
114  int MemUsed();
115 
116  SVTV1P0_PEDR_SR(int wafer, SVTV1P0_Reader *);
117  SVTV1P0_PEDR_SR(int barrel, int ladder, int wafer, SVTV1P0_Reader *);
118  int initialize();
119  ~SVTV1P0_PEDR_SR();
120 };
121 
122 // The RMS pedestal values
124 {
125 private:
126  int barrel, ladder, wafer;
127  SVTV1P0_Reader *detector;
128  SVTV1P0_ANODK_SR *anodkr;
129  classname(Bank_SVTRMSR) *banks;
130  u_char anodelist[SVT_HYBRIDS][SVT_ANODES];
131  int numEvents;
132 
133 public:
134  int getPadList(int hybrid, unsigned char **anodeList);
135  int getSequences(int hybrid, int Anode, int *nArray, u_char **Array);
136  int getNumberOfEvents();
137 
138  int MemUsed();
139 
140  SVTV1P0_PRMS_SR(int wafer, SVTV1P0_Reader *);
141  SVTV1P0_PRMS_SR(int barrel, int ladder, int wafer, SVTV1P0_Reader *);
142  int initialize();
143  ~SVTV1P0_PRMS_SR();
144 };
145 
146 // The gain reader
147 class SVTV1P0_G_SR : public GainReader
148 {
149 private:
150  int barrel, ladder, wafer;
151  SVTV1P0_Reader *detector;
152 
153 public:
154  int getGain(int hybrid, int Anode, struct Gain **gain);
155  int getMeanGain();
156  int getNumberOfEvents();
157 
158  int MemUsed();
159 
160  SVTV1P0_G_SR(int wafer, SVTV1P0_Reader *);
161  SVTV1P0_G_SR(int barrel, int ladder, int wafer, SVTV1P0_Reader *);
162  int initialize();
163  ~SVTV1P0_G_SR();
164 };
165 
166 // Reads Cluster Pointer Pairs from the ASIC
167 class SVTV1P0_CPP_SR : public CPPReader
168 {
169 public:
170  int getClusters(int hybrid, int Anode, int *nClusters,
171  struct ASIC_Cluster **clusters);
172  int getAsicParams(ASIC_params *);
173  int MemUsed();
174 
175  SVTV1P0_CPP_SR(int wafer, SVTV1P0_Reader *);
176  SVTV1P0_CPP_SR(int barrel, int ladder, int wafer, SVTV1P0_Reader *);
177  int initialize();
178  ~SVTV1P0_CPP_SR();
179 
180 private:
181  int barrel, ladder, wafer;
182  SVTV1P0_Reader *detector;
183  SVTV1P0_ANODK_SR *anodkr;
184  classname(Bank_SVTCPPR) *banks[SVT_HYBRIDS];
185 };
186 
187 // Reads the bad channels
189 {
190 private:
191  int barrel, ladder, wafer;
192 
193 public:
194  int IsBad(int hybrid, int Anode);
195 
196  int MemUsed();
197 
198  SVTV1P0_BC_SR(int wafer, SVTV1P0_Reader *);
199  SVTV1P0_BC_SR(int barrel, int ladder, int wafer, SVTV1P0_Reader *);
200  int initialize();
201  ~SVTV1P0_BC_SR();
202 };
203 
204 // Read the front end electronics configuration
206 {
207 private:
208  int barrel, ladder, wafer;
209 
210 public:
211  int FEE_id(int hybrid, int Anode) = 0;
212  // returns FEE_id
213 
214  int MemUsed();
215 
216  SVTV1P0_CR_SR(int wafer, SVTV1P0_Reader *);
217  SVTV1P0_CR_SR(int barrel, int ladder, int wafer, SVTV1P0_Reader *);
218  int initialize();
219  ~SVTV1P0_CR_SR();
220 };
221 
223 {
224  short offset;
225  short mz; // mz and rb are counted up from 1
226  short rb;
227  short hypersector;
228 };
229 
231 {
232 public:
234  int initialize(int maxSector);
235 
236  void place(short barrel, short ladder, short wafer, short hybrid, ANODK_entry *);
237  void get(short barrel, short ladder, short wafer, short hybrid, ANODK_entry *);
238  void get(short waferIndex, short hybrid, ANODK_entry *);
239  short getWaferIndex(short barrel, short ladder, short wafer);
240 
241  int getADCBytes() { return 128; };
242  int getCPPBytes() { return 128; };
243  int getPEDBytes() { return 128; };
244  int getRMSBytes() { return 128; };
245  int getCFGBytes() { return 1; };
246  int getGAINBytes() { return 4; };
247 
248 private:
249  SVTV1P0_Reader *detector;
250 
251  short packed_address[SVT_WAFERS][SVT_HYBRIDS];
252 
253  short pack(short hypersector, short rcb, short mz, short offset);
254  void unpack(ANODK_entry *, short anodedress);
255 };
256 
257 #endif
258 
259 
260 
261 
262 
Definition: rb.hh:21
Definition: SVTV1P0.hh:222