StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
l3TrgReaderV12.cxx
1 
2 #include "l3TrgReader.h"
3 //#include "daqFormats.h"
4 #include "TRG/trgStructures-Jan2002.h"
5 
6 #include "l3Swap.h"
7 //#include "l3Log.h"
8 
9 #include <string.h>
10 
11 int l3TrgReader::readV12(void *buffer)
12 {
13  EvtDescData ed;
14  TrgSumData sumData;
15  RawTrgDet trgDet;
16 
17  // Need to swap byte order
18  l3SwapBuffer(&ed, buffer, sizeof(EvtDescData)/4);
19  l3SwapBuffer(&sumData,
20  (char*)buffer + sizeof(EvtDescData),
21  sizeof(TrgSumData)/4);
22  memcpy(&trgDet,
23  (char*)buffer + sizeof(EvtDescData) + sizeof(TrgSumData),
24  sizeof(RawTrgDet));
25 
26 
27  // Everything is prepared, let's get the data
28  bunchXing_hi = swap32(ed.bunchXing_hi);
29  bunchXing_lo = swap32(ed.bunchXing_lo);
30 
31  //token = swap16(ed.TCU1.FIFO1.TrgToken);
32  token = (swap32(ed.TCU1.fifo1) & 0xFFFF0000)>>16;
33  //triggerWord = swap16(ed.TCU3.FIFO3.TriggerWd);
34  physicsWord = 0; // Comes in v20
35 
36  memcpy(ZDC, sumData.DSM.ZDC, 16);
37  memcpy(CTB, trgDet.CTB, 256);
38 
39  return 0;
40 }