13 counter_{iP.counter_},
14 orbit_number_{iP.orbit_number_},
17 runnumber_{iP.runnumber_},
19 doBarrel_{iC.doBarrel_},
20 doEndCap_{iC.doEndCap_},
23 doTower_{iC.doTower_} {}
32 <<
" " <<
bx <<
" " << lv1 << endl;
34 for (
int idcc = 1; idcc <= 54; idcc++) {
43 short int DCC_ERRORS = 0;
45 if (rawdata.
size() == 0) {
47 pData = rawdata.
data();
51 Word64* pw = reinterpret_cast<Word64*>(const_cast<unsigned char*>(pData));
55 pData = rawdata.
data();
56 pData[11] = DCC_ERRORS & 0xFF;
62 for (
int i = 16;
i <= 22;
i++) {
75 pData[28] = (SR & 0x1) + ((
ZS & 0
x1) << 1) + ((TZS & 0
x1) << 2);
78 for (
int i = 0;
i <= 4;
i++) {
79 for (
int j = 0;
j < 7;
j++) {
80 pData[32 + 8 *
i +
j] = 0;
82 pData[32 + 8 *
i + 7] = 0x04;
91 cout <<
"Print RawData size " <<
dec <<
size << endl;
92 unsigned char* pData = rawdata.
data();
95 for (
int i = 0;
i <
n;
i++) {
96 for (
int j = 7;
j >= 0;
j--) {
98 cout << hex << (
int)pData[8 *
i +
j] <<
" ";
105 for (
int id = 0;
id < 36 + 18;
id++) {
106 if ((!
doBarrel_) && (
id >= 9 &&
id <= 44))
108 if ((!
doEndCap_) && (id <= 8 || id >= 45))
115 if (
find((*plistDCCId_).begin(), (*plistDCCId_).end(), (
id + 1)) == (*plistDCCId_).end()) {
121 int lastline = rawdata.
size();
122 rawdata.
resize(lastline + 8);
123 unsigned char* pData = rawdata.
data();
124 int event_length = (lastline + 8) / 8;
126 pData[lastline + 7] = 0xa0;
128 pData[lastline + 4] = event_length & 0xFF;
129 pData[lastline + 5] = (event_length >> 8) & 0xFF;
130 pData[lastline + 6] = (event_length >> 16) & 0xFF;
131 int event_status = 0;
132 pData[lastline + 1] = event_status & 0x0F;
134 pData[lastline] = tts & 0xF0;
138 pData[8] = event_length & 0xFF;
139 pData[9] = (event_length >> 8) & 0xFF;
140 pData[10] = (event_length >> 16) & 0xFF;
144 map<int, map<int, int> >::iterator fen = FEDorder->find(FEDid);
146 bool FED_has_data =
true;
147 if (fen == FEDorder->end())
148 FED_has_data =
false;
149 if (
debug_ && (!FED_has_data))
150 cout <<
" FEDid is not in FEDorder ! " << endl;
153 for (
int iFE = 1; iFE <= 68; iFE++) {
154 int irow = (iFE - 1) / 14;
155 int kval = ((iFE - 1) % 14) / 2;
157 pData[32 + 8 * irow + kval] |= ch_status & 0xFF;
159 pData[32 + 8 * irow + kval] |= ((ch_status << 4) & 0xFF);
164 map<int, int>& FEorder = (*fen).second;
166 for (
int iFE = 1; iFE <= 68; iFE++) {
167 map<int, int>::iterator fe = FEorder.find(iFE);
169 if (fe == FEorder.end())
171 int irow = (iFE - 1) / 14;
172 int kval = ((iFE - 1) % 14) / 2;
174 pData[32 + 8 * irow + kval] |= ch_status & 0xFF;
176 pData[32 + 8 * irow + kval] |= ((ch_status << 4) & 0xFF);
183 for (
int id = 0;
id < 36 + 18;
id++) {
189 if (rawdata.
size() > 0)
190 cout <<
"Size of FED id " <<
dec << FEDid <<
" is : " <<
dec << rawdata.
size() << endl;