2 |
// Implementation of the EventTrkReader class. |
// Implementation of the EventTrkReader class. |
3 |
|
|
4 |
|
|
5 |
#define UINT unsigned int |
|
|
#define BYTE unsigned char |
|
|
#include <string> |
|
6 |
#include <log4cxx/logger.h> |
#include <log4cxx/logger.h> |
7 |
|
|
8 |
#include <fstream> |
#include <fstream> |
|
#include "stdio.h" |
|
9 |
#include "ReaderAlgorithms.h" |
#include "ReaderAlgorithms.h" |
10 |
|
|
11 |
#include "event/EventTrkEvent.h" |
#include "event/EventTrkEvent.h" |
34 |
int fl2[12]; |
int fl2[12]; |
35 |
int fl1[12]; |
int fl1[12]; |
36 |
int fl6[12]; |
int fl6[12]; |
37 |
|
int checksum[12]; |
38 |
|
int TOTDATAlength; |
39 |
|
int datatracker[49152]; |
40 |
int pnum[12]; |
int pnum[12]; |
41 |
int cmdnum[12]; |
int cmdnum[12]; |
42 |
int bid[12]; |
int bid[12]; |
43 |
int alarm[12]; |
int alarm[12]; |
44 |
int aswr[12]; |
int aswr[12]; |
|
int TOTDATAlength; |
|
|
int datatracker[49152]; |
|
45 |
} level0_; |
} level0_; |
46 |
#include <dirent.h> |
#include <dirent.h> |
47 |
} |
} |
115 |
} |
} |
116 |
} else {*/ |
} else {*/ |
117 |
//Store the unpacked data |
//Store the unpacked data |
118 |
|
eventTrk->unpackError = ERROR; |
119 |
|
eventTrk->good0 = level0_.good0; |
120 |
|
eventTrk->nev0 = level0_.nev0; |
121 |
memcpy(eventTrk->DAQmode, level0_.DAQmode, sizeof(eventTrk->DAQmode)); |
memcpy(eventTrk->DAQmode, level0_.DAQmode, sizeof(eventTrk->DAQmode)); |
122 |
memcpy(eventTrk->DSPnumber, level0_.DSPnumber, sizeof(eventTrk->DSPnumber)); |
memcpy(eventTrk->DSPnumber, level0_.DSPnumber, sizeof(eventTrk->DSPnumber)); |
123 |
memcpy(eventTrk->DATAlength, level0_.DATAlength, sizeof(eventTrk->DATAlength)); |
memcpy(eventTrk->DATAlength, level0_.DATAlength, sizeof(eventTrk->DATAlength)); |
132 |
int tempSign[3][12]; |
int tempSign[3][12]; |
133 |
memcpy(tempAddr, (level0_.addrcluster), sizeof(tempAddr)); |
memcpy(tempAddr, (level0_.addrcluster), sizeof(tempAddr)); |
134 |
memcpy(tempSign, (level0_.signcluster), sizeof(tempSign)); |
memcpy(tempSign, (level0_.signcluster), sizeof(tempSign)); |
135 |
for (int j = 0; j < 11; j++){ |
for (int j = 0; j < 12; j++){ |
136 |
for (int i = 0; i < 2; i++){ |
for (int i = 0; i < 3; i++){ |
137 |
eventTrk->addrcluster[j][i] = tempAddr[i][j]; |
eventTrk->addrcluster[j][i] = tempAddr[i][j]; |
138 |
eventTrk->signcluster[j][i] = tempSign[i][j]; |
eventTrk->signcluster[j][i] = tempSign[i][j]; |
139 |
} |
} |