39 #include "StDaqLib/GENERIC/EventReader.hh"
40 #include "StDaqLib/GENERIC/RecHeaderFormats.hh"
53 #define TOF_MAX_ADC_CHANNELS (48+12+120)
55 #define TOF_MAX_TDC_CHANNELS (198)
56 #define TOF_MAX_TOT_CHANNELS 10
57 #define TOF_MAX_A2D_CHANNELS 32
58 #define TOF_MAX_SCA_CHANNELS 12
61 #ifndef _DAQ_FORMATS_H
62 typedef unsigned int UINT32;
63 typedef unsigned short UINT16;
64 typedef unsigned char UINT8 ;
69 #ifdef UNIX_LITTLE_ENDIAN
97 unsigned int channel:8;
129 unsigned int data:24;
130 unsigned int channel:8;
160 unsigned int data[1];
167 unsigned int EventNumber;
173 const int TRAILING=5;
178 unsigned int ByteSwapped ;
179 unsigned int EventNumber;
180 unsigned short AdcData[TOF_MAX_ADC_CHANNELS];
181 unsigned short TdcData[TOF_MAX_TDC_CHANNELS];
182 short A2dData[TOF_MAX_A2D_CHANNELS];
183 unsigned short ScaData[TOF_MAX_SCA_CHANNELS];
185 std::vector<TofRawHit> TofLeadingHits;
186 std::vector<TofRawHit> TofTrailingHits;
188 unsigned int LdTdcData[TOF_MAX_TDC_CHANNELS];
189 unsigned int TrTdcData[TOF_MAX_TDC_CHANNELS];
190 unsigned short LdNHit[TOF_MAX_TDC_CHANNELS];
191 unsigned short TrNHit[TOF_MAX_TDC_CHANNELS];
201 virtual unsigned short GetAdcFromSlat(
int)=0;
202 virtual unsigned short GetTdcFromSlat(
int)=0;
203 virtual short GetTc(
int)=0;
204 virtual unsigned short GetSc(
int)=0;
205 virtual unsigned int GetEventNumber()=0;
206 virtual unsigned short GetTofpAdc(
int)=0;
207 virtual unsigned short GetTofpTdc(
int)=0;
208 virtual unsigned short GetTofrAdc(
int)=0;
209 virtual unsigned short GetTofrTdc(
int)=0;
213 virtual unsigned int GetLdTdc(
int)=0;
214 virtual unsigned int GetTrTdc(
int)=0;
215 virtual unsigned int GetLdmTdc(
int,
int)=0;
216 virtual unsigned int GetTrmTdc(
int,
int)=0;
218 virtual unsigned int GetPvpdLdTdc(
int)=0;
219 virtual unsigned int GetPvpdTrTdc(
int)=0;
220 virtual unsigned int GetPvpdLdmTdc(
int,
int)=0;
221 virtual unsigned int GetPvpdTrmTdc(
int,
int)=0;
223 virtual unsigned short GetNLdHits(
int)=0;
224 virtual unsigned short GetNTrHits(
int)=0;
226 virtual unsigned int GetNLeadingHits()=0;
227 virtual unsigned int GetLeadingEventNumber(
int)=0;
228 virtual unsigned short GetLeadingFiberId(
int)=0;
229 virtual unsigned short GetLeadingGlobalTdcChan(
int)=0;
230 virtual unsigned int GetLeadingTdc(
int)=0;
231 virtual unsigned int GetNTrailingHits()=0;
232 virtual unsigned int GetTrailingEventNumber(
int)=0;
233 virtual unsigned short GetTrailingFiberId(
int)=0;
234 virtual unsigned short GetTrailingGlobalTdcChan(
int)=0;
235 virtual unsigned int GetTrailingTdc(
int)=0;
241 void ProcessEvent(
const Bank_TOFP * TofPTR);
242 int mTofRawDataVersion;
243 int mMaxAdcChannels, mMaxTdcChannels;
244 int mMaxA2dChannels, mMaxScaChannels;
247 int UnpackYear2to4Data(
const Bank_TOFP * TofPTR);
248 int UnpackYear5Data(
const Bank_TOFP * TofPTR);
258 unsigned short GetAdcFromSlat(
int slatId);
259 unsigned short GetTdcFromSlat(
int slatId);
261 unsigned short GetAdc(
int id);
262 unsigned short GetTdc(
int id);
263 unsigned short GetTofrAdc(
int padId);
264 unsigned short GetTofrTdc(
int padId);
265 unsigned short GetTofpAdc(
int SlatId);
266 unsigned short GetTofpTdc(
int SlatId);
267 unsigned short GetPvpdAdcHigh(
int id);
268 unsigned short GetPvpdAdc(
int id);
269 unsigned short GetPvpdTdc(
int id);
270 unsigned short GetClockAdc();
271 unsigned short GetTofrTOT(
int totId);
274 unsigned int GetLdTdc(
int id);
275 unsigned int GetTrTdc(
int id);
276 unsigned int GetLdmTdc(
int id ,
int n);
277 unsigned int GetTrmTdc(
int id,
int n);
279 unsigned int GetPvpdLdTdc(
int id);
280 unsigned int GetPvpdTrTdc(
int id );
281 unsigned int GetPvpdLdmTdc(
int id,
int n);
282 unsigned int GetPvpdTrmTdc(
int id,
int n);
284 unsigned short GetNLdHits(
int id);
285 unsigned short GetNTrHits(
int id);
287 unsigned int GetNLeadingHits();
288 unsigned int GetLeadingEventNumber(
int ihit);
289 unsigned short GetLeadingFiberId(
int ihit);
290 unsigned short GetLeadingGlobalTdcChan(
int ihit);
291 unsigned int GetLeadingTdc(
int ihit);
292 unsigned int GetNTrailingHits();
293 unsigned int GetTrailingEventNumber(
int ihit);
294 unsigned short GetTrailingFiberId(
int ihit);
295 unsigned short GetTrailingGlobalTdcChan(
int ihit);
296 unsigned int GetTrailingTdc(
int ihit);
304 short GetTc(
int chanId);
305 unsigned short GetSc(
int chanId);
306 unsigned int GetEventNumber();
unsigned char globaltdcchan
1,2,......,120,for tray, 121, 122 for upvpd
unsigned char fiberid
data word before unpack