FairRoot/PandaRoot
PndMvdReadInToPix4TBData.cxx
Go to the documentation of this file.
1 /*
2  * PndMvdReadInToPix4TBData.cxx
3  *
4  * Created on: 23.10.2014
5  * Author: Stockmanns
6  */
7 
9 
10 #include "mrfdata_8b.h"
11 #include "mrftools.h"
12 #include "boost/archive/binary_oarchive.hpp"
13 #include "boost/archive/binary_iarchive.hpp"
14 #include "boost/serialization/binary_object.hpp"
15 #include <boost/archive/archive_exception.hpp>
16 #include "FairMQLogger.h"
17 
18 
19 using namespace ToPix4;
20 
21 PndMvdReadInToPix4TBData::PndMvdReadInToPix4TBData() : fClockFrequency(0), fSuperFrameCount(0),
22  fOldFrameCount(0), fOldAllHeaderCount(0), fFirstHeader(kTRUE), fFE(-1),
23  fNonSequentialFC(0), fHammingLossFrameCount(0), fCRCLossFrameCount(0),
24  fTotalHitCount(0),fPreFrameLossHitCount(0), fHammingLossHitCount(0), fCRCLossHitCount(0), fCorrectHitCount(0),
25  fHeaderPresent(kFALSE), fTrailerPresent(kFALSE), fDoubleHeader(0), fDoubleTrailer(0), fVerbose(0),
26  fFileCounter(0), fTotalFrameCount(0), fTotalHeaderCount(0), fTotalTrailerCount(0), fFileHandle(0),
27  fTimeStampCorrection(0.0), fFilter(kFALSE), fNFilteredHits(0)
28 {
29  fStatusValues.resize(Last, 0);
30 }
31 
33 {
34  if (fFileHandle != 0){
35  fFileHandle->close();
36  delete(fFileHandle);
37  }
38 }
39 
40 
42  //std::cout << "PndMvdReadInToPix4TBData::Init called" << std::endl;
43 // for (int i = 0; i < fFileName.size(); i++){
44  std::ifstream* ifs = new std::ifstream(fFileNames[fFileCounter], std::ios::binary);
45  if (ifs->good() == kFALSE)
46  LOG(ERROR) << "File: " << fFileNames[fFileCounter] << " is good: " << ifs->good();
47  fFileCounter++;
48  fFileHandle=ifs;
49 // }
50 }
51 
52 Bool_t PndMvdReadInToPix4TBData::ReadInData(std::vector<std::vector<PndSdsDigiTopix4> >& data){
53  ULong_t dataword=0;
54  Bool_t endOfFile = kFALSE;
55 
56 // fOutputArrayAllHeader = allheaderContainer;
57  std::vector<ULong64_t> rawArray;
58  TMrfData_8b* mrfData = 0;
59  endOfFile |= ReadInDataFromFile(mrfData);
60  if (mrfData != 0){
61  rawArray = fTopix.GetRawData(mrfData);
62  delete(mrfData);
63  }
64 // endOfFile |= ReadInRawData(fFileHandle, rawArray);
65  data = AnalyzeData(rawArray, fClockFrequency);
66  return endOfFile;
67 }
68 
70 {
71  Bool_t endOfFile = kFALSE;
72 
73  if (fFileHandle->good()) {
74  if (fVerbose > 1)
75  LOG(DEBUG) << "PndMvdReadInToPix4TBData::ReadInRawData reading file ";
76  try {
77  boost::archive::binary_iarchive iar(*fFileHandle); //this line causes an "Invalid Signature Error" at the end of the file but the file is still good
78  iar >> data;
79  } catch (boost::archive::archive_exception& exception) {
80  LOG(WARN) << "PndMvdReadInToPix4TBData::ReadInRawData: Error found in reading file "
81  << " : " << fFileHandle->good() << " " << fFileHandle->eof() << " Exception: "
82  << exception.code << " " << exception.what();
83 
84  if (exception.code == 3) {
85  if (fFileCounter < fFileNames.size()) {
86  LOG(INFO) << fFE << " open new file " << fFileNames[fFileCounter];
87  fFileHandle->close();
88  delete (fFileHandle);
89  std::ifstream* ifs = new std::ifstream(fFileNames[fFileCounter], std::ios::binary);
90  fFileHandle = ifs;
91  fFileCounter++;
92  return endOfFile;
93  } else {
94  LOG(INFO) << fFE << " All files read! Finishing FE ";
95  endOfFile = kTRUE;
96  return endOfFile;
97  }
98  }
99  return kTRUE;
100  }
101  } else {
102  LOG(ERROR) << fFE << " An error occured ";
103  LOG(ERROR) << fFE << " fFileHandle->good() " << fFileHandle->good();
104  LOG(ERROR) << fFE << " fFileHandle->eof() " << fFileHandle->eof();
105  LOG(ERROR) << fFE << " fFileHandle->fail() " << fFileHandle->fail();
106  LOG(ERROR) << fFE << " fFileHandle->bad() " << fFileHandle->bad();
107 
108  endOfFile = kTRUE;
109  return endOfFile;
110  }
111  return endOfFile;
112 }
113 
114 //std::vector<ULong64_t> PndMvdReadInToPix4TBData::GetRawData(TMrfData_8b* data)
115 //{
116 // std::vector<ULong64_t> rawData;
117 // for (UInt_t i = 0; i < data->getNumWords(); i += 5) {
118 // ULong_t dataword = 0;
119 // for (uint j = 0; j < 5; j++) {
120 // dataword = dataword << 8;
121 // dataword += data->getWord(i + j);
122 // }
123 // rawData.push_back(dataword);
124 //
125 // if (fVerbose > 2) {
126 // ULong_t frameCount = -1;
127 // ULong64_t header = fTopix.GetHeader(dataword);
128 // if (header == 1)
129 // frameCount = fTopix.GetFrameCount(dataword);
130 //
131 // LOG(INFO) << std::dec << "dataword No " << i / 5 << "/" << data->getNumWords() / 5 << ": " << std::hex
132 // << dataword << " ";
133 // }
134 // }
135 // return rawData;
136 //}
137 
138 //Bool_t PndMvdReadInToPix4TBData::ReadInRawData(std::ifstream* fileHandle, std::vector<ULong64_t>& rawData) {
139 // TMrfData_8b* tempdata;
140 // //tempdata = new TMrfData_8b;
141 // ULong_t dataword = 0;
142 // Bool_t endOfFile = kFALSE;
143 // //fVerbose = 3;
144 // if (fileHandle->good()) {
145 // if (fVerbose > 2)
146 // LOG(DEBUG) << "PndMvdReadInToPix4TBData::ReadInRawData reading file ";
147 //
148 // try {
149 // boost::archive::binary_iarchive iar(*fileHandle); //this line causes an "Invalid Signature Error" at the end of the file but the file is still good
150 // iar >> tempdata;
151 // } catch (boost::archive::archive_exception& exception) {
152 // LOG(WARN) << "PndMvdReadInToPix4TBData::ReadInRawData: Error found in reading file "
153 // << " : " << fileHandle->good() << " " << fileHandle->eof() << " Exception: "
154 // << exception.code << " " << exception.what();
155 //
156 // if (exception.code == 3) {
157 // if (fFileCounter < fFileNames.size()) {
158 // LOG(INFO) << fFE << " open new file " << fFileNames[fFileCounter];
159 // fileHandle->close();
160 // delete (fFileHandle);
161 // std::ifstream* ifs = new std::ifstream(fFileNames[fFileCounter], std::ios::binary);
162 // fFileCounter++;
163 // return endOfFile;
164 // } else {
165 // LOG(INFO) << fFE << " All files read! Finishing FE ";
166 // endOfFile = kTRUE;
167 // return endOfFile;
168 // }
169 // }
170 // return kTRUE;
171 // }
172 // if (fVerbose > 2)
173 // LOG(DEBUG) << fFE << " PndMvdReadInToPix4TBData::ReadInRawData: NWords: " << tempdata->getNumWords();
174 // for (UInt_t i = 0; i < tempdata->getNumWords(); i += 5) {
175 // dataword = 0;
176 // for (uint j = 0; j < 5; j++) {
177 // dataword = dataword << 8;
178 // dataword += tempdata->getWord(i + j);
179 // }
180 // rawData.push_back(dataword);
181 //
182 // if (fVerbose > 2) {
183 // ULong_t frameCount = -1;
184 // ULong64_t header = fTopix.GetHeader(dataword);
185 // if (header == 1)
186 // frameCount = fTopix.GetFrameCount(dataword);
187 //
188 // LOG(DEBUG) << std::dec << "dataword No " << i / 5 << "/" << tempdata->getNumWords() / 5 << ": " << std::hex
189 // << dataword << " " << std::dec << header << " : " << frameCount;
190 // }
191 // }
192 // delete(tempdata);
193 // } else {
194 // LOG(ERROR)<< fFE << " An error occured ";
195 // LOG(ERROR) << fFE << " fileHandle->good() " << fileHandle->good();
196 // LOG(ERROR) << fFE << " fileHandle->eof() " << fileHandle->eof();
197 // LOG(ERROR) << fFE << " fileHandle->fail() " << fileHandle->fail();
198 // LOG(ERROR) << fFE << " fileHandle->bad() " << fileHandle->bad();
199 //
200 // endOfFile = kFALSE;
201 // return endOfFile;
202 // }
203 // return endOfFile;
204 //}
205 
206 std::vector<std::vector<PndSdsDigiTopix4> > PndMvdReadInToPix4TBData::AnalyzeData(std::vector<ULong64_t>& rawData, Double_t clockFrequency) {
207  std::vector<std::vector<PndSdsDigiTopix4> > result;
208  if (fVerbose > 2)
209  LOG(DEBUG) << "PndMvdReadInToPix4TBData::AnalyzeData rawData.size(): " << rawData.size();
210  for (int i = 0; i < rawData.size(); i++) {
211  if (BuildFrame(rawData[i]) == true){ //a frame was found
212  std::vector<PndSdsDigiTopix4> hitList = AnalyzeToPixFrame(clockFrequency);
213  //LOG(INFO) << "TestData: " << hitList.front() << std::endl;
214  result.push_back(hitList);
215  fToPixFrame.clear();
216  }
217  }
218  return result;
219 }
220 
221 bool PndMvdReadInToPix4TBData::BuildFrame(ULong64_t& rawData)
222 {
223  int header = fTopix.GetType(rawData);
224  if (fFirstHeader) { // if data stream does not start with a header all data is thrown away until a header is present
225  if (header == 1) {
226  fFirstHeader = kFALSE;
227  } else {
228  return false;
229  }
230  }
231 
232  if (header == 1) // header word found
233  {
235 
237 
238  Int_t deltaAllFrameCount = ((int) (frameHeader.fFrameCount - fOldAllHeaderCount) < 0 ?
239  ((frameHeader.fFrameCount - fOldAllHeaderCount) + 256) :
240  (frameHeader.fFrameCount - fOldAllHeaderCount));
241 // new ((*fOutputArrayAllHeader)[fOutputArrayAllHeader->GetEntriesFast()]) PndSdsDigiTopix4Header(frameHeader.fFrameCount, fFE,
242 // frameHeader.fChipAddress, frameHeader.fECC, fTotalHeaderCount, deltaAllFrameCount, 0, 0);
243  if (deltaAllFrameCount > 1 && fVerbose > 0)
244  std::cout << "-W- deltaAllFrameCount > 1: " << deltaAllFrameCount << std::endl;
245  fOldAllHeaderCount = frameHeader.fFrameCount;
246 
247  if (fHeaderPresent == kTRUE) {
248  // double header found, cannot check previous data without trailer, clear vector
249  fDoubleHeader++;
251 
252  if (fVerbose > 1) {
253  std::cout << "Double Header Found! count: " << fDoubleHeader << "| FE: " << fFE << std::hex << " last ToPixFrame element: "
254  << fToPixFrame.back() << " new frame header " << rawData << std::endl;
255  }
256  fPreFrameLossHitCount += fToPixFrame.size() - 1;
257  fToPixFrame.clear();
258  // load new header into vector
259  fToPixFrame.push_back(rawData);
260  } else {
261  // header found, start recording topix frame
262  fTrailerPresent = kFALSE;
263  fHeaderPresent = kTRUE;
264  fToPixFrame.push_back(rawData);
265  }
266  }
267 
268  else if (header == 2) // trailer word found
269  {
272  if (fTrailerPresent == kTRUE) {
273  // double trailer found, cannot give the hits a valid timestamp without the header, clear vector
274 
275  fToPixFrame.clear();
277 
278  if (fVerbose > 1) {
279  std::cout << "Double Trailer Found! Double header counter: " << fDoubleTrailer << std::endl;
280  }
281  } else {
282  if (fHeaderPresent == kTRUE) {
283  // one topix frame found! Go and analyze the vector...
284  fHeaderPresent = kFALSE;
285  fTrailerPresent = kTRUE;
286  fToPixFrame.push_back(rawData);
287  // if (fVerbose > 1)
288  // {
289  // std::cout << "ToPix Frame found! Go and analyze this amount of data: " << fToPixFrame.size() << std::endl;
290  //}
291 
293  //AnalyzeToPixFrame(clockFrequency);
294  return true;
295  } else {
296  if (fVerbose > 1) {
297  std::cout << "Trailer without header found! Double header counter: " << fDoubleHeader << std::endl;
298  }
299  // trailer without header, can happen at the beginning of the file or the header was not detected correctly
300  // this case is in principle impossible to enter
301  fPreFrameLossHitCount += fToPixFrame.size() - 1;
302  fDoubleTrailer++;
304  fToPixFrame.clear();
305  }
306  }
307  } else if (header == 3) // data word found
308  {
309  fTotalHitCount++;
311  if (fHeaderPresent == kTRUE) { // found data while a active header is present, go and save the data
312  fToPixFrame.push_back(rawData);
313  } else { // found data without a valid header, may happen at the beginning of the file or the header was detected
316  }
317  }
318  return false;
319 }
320 
321 
322 std::vector<PndSdsDigiTopix4> PndMvdReadInToPix4TBData::AnalyzeToPixFrame(Double_t clockFrequency) {
323  std::vector<PndSdsDigiTopix4> hitList;
324  if (fVerbose > 2) {
325  std::cout << fFE << " PndMvdReadInToPix4TBData::AnalyzeToPixFrame: fToPixFrame size: "
326  << std::dec << fToPixFrame.size() << " header " << std::hex << fToPixFrame[0] << std::endl;
327  }
328 
329  if (CheckDataIntegrity(fToPixFrame) != true){
330  fToPixFrame.clear();
331  return hitList;
332  }
333 
334  for (int i = 0; i < fToPixFrame.size(); i++) {
335  ULong64_t header = fTopix.GetType(fToPixFrame[i]);
336 
337  switch (header) {
338  case 1: {
340 
341  if (fVerbose > 2)
342  std::cout << fFE << " FrameHeader: rawData: " << std::hex
343  << fToPixFrame[i] << " chip " << std::dec
344  << fRecentFrameHeader.fChipAddress << " framecount "
345  << fRecentFrameHeader.fFrameCount << std::endl;
346 
347  Int_t deltaFrameCount = GetDeltaFrameCount();
348  if (deltaFrameCount > 1){
349  if (fVerbose > 1)
350  std::cout << fFE << "-E- non sequential FC: " << fOldFrameCount << " " << fRecentFrameHeader.fFrameCount << std::endl;
353  }
354 
358  if (fVerbose > 1)
359  std::cout << fFE << " SuperFrameCount increased: " << std::dec << fSuperFrameCount << " oldFC "
360  << fOldFrameCount << " recent FC " << fRecentFrameHeader.fFrameCount << std::endl;
361  }
362  //fOldFrameCount = fRecentFrameHeader.fFrameCount;
363 
364  // new ((*fOutputArrayHeader)[fOutputArrayHeader->GetEntriesFast()]) PndSdsDigiTopix4Header(fRecentFrameHeader.fFrameCount, fFE, fRecentFrameHeader.fChipAddress, fRecentFrameHeader.fECC, fTotalFrameCount,deltaFrameCount, 0, fToPixFrame.size()-2 );
365  //new ((*fOutputArrayHeader)[fOutputArrayHeader->GetEntriesFast()]) PndSdsDigiTopix4Header(fRecentFrameHeader.fFrameCount, 0, fFE,
366  // fRecentFrameHeader.fECC, fTotalFrameCount, deltaFrameCount, 0, fToPixFrame.size() - 2);
367 
369  }
370  break;
371 
372  case 2: {
374  if (fRecentFrameTrailer.fFrameCRC != 0 && (fToPixFrame.size() < 20)) {
375  // std::cout << fFE << " Frame counter " << fRecentFrameHeader.fFrameCount << std::endl;
376  if (fVerbose == -1) {
377  for (int y = 0; y < fToPixFrame.size(); y++) {
378  if (y == 0) {
379  std::cout << fFE << " " << std::hex << fToPixFrame[y] << " - FCount " << fRecentFrameHeader.fFrameCount << std::endl;
380  } else {
381  std::cout << fFE << " " << std::hex << fToPixFrame[y] << std::endl;
382  }
383  }
384  std::cout << std::endl;
385  }
386  }
387  if (fVerbose > 2)
388  std::cout << fFE << " FrameTrailer: nEvents " << fRecentFrameTrailer.fNEvents << " frame CRC: "
389  << fRecentFrameTrailer.fFrameCRC << std::endl;
390 
391  //PndSdsDigiTopix4Header * header_trailer = (PndSdsDigiTopix4Header*) (fOutputArrayHeader->Last());
392  //header_trailer->SetNumberOfEvents(fRecentFrameTrailer.fNEvents);
393  }
394  break;
395 
396  case 3:
397  PndSdsDigiTopix4 recentPixel = ProcessData(fToPixFrame[i], fRecentFrameHeader, clockFrequency);
398  if (fVerbose > 1)
399  LOG(INFO) << "RecentPixel: " << recentPixel;
400  if (fFilter == kTRUE){
401  if (HitToFilter(recentPixel) == true){
402  //LOG(INFO) << "Hit to Filter found!";
403  fNFilteredHits++;
405  break;
406  }
407  }
408  hitList.push_back(recentPixel);
409  if (fVerbose > 2)
410  std::cout << fFE << " Pixel: " << recentPixel << std::endl;
411  //WriteoutToPix4Digi(recentPixel);
414  break;
415  }
416  }
417  return hitList;
418 }
419 
421 {
422  int leadingEdge = hit.GetLeadingEdge();
423  int trailingEdge = hit.GetTrailingEdge();
424  if (leadingEdge == 2729 || leadingEdge == 2730)
425  return true;
426  if (trailingEdge == 2730 || trailingEdge == 2731)
427  return true;
428  return false;
429 }
430 
432 {
433  return ((int) (fRecentFrameHeader.fFrameCount - fOldFrameCount) < 0 ?
436 }
437 
438 bool PndMvdReadInToPix4TBData::CheckDataIntegrity(std::vector<ULong64_t> topix4Frame)
439 {
440  ULong_t hammingcheck = fHamming.CheckHammingCode(fTopix.ConvertToPix4HammingToStandardHamming(topix4Frame[0]), 40); // check hamming of header
441  if (hammingcheck != 0) {
442  if (fVerbose > 1) {
443  std::cout << "Wrong Hamming Code found! (Header) : " << std::hex<< topix4Frame[0] << " Parity bits " << hammingcheck << std::endl;
444  }
447  fHammingLossHitCount += topix4Frame.size() - 2;
448  fStatusValues[HammingLossHitCount] += topix4Frame.size() - 2;
449  return false;
450  }
451 
452  hammingcheck = fHamming.CheckHammingCode(fTopix.ConvertToPix4HammingToStandardHamming(topix4Frame[topix4Frame.size() - 1]), 40); // check hamming of trailer
453  if (hammingcheck != 0) {
454  if (fVerbose > 1) {
455  std::cout << "Wrong Hamming Code found! (Trailer): " << std::hex << topix4Frame[0] << " Parity bits " << hammingcheck << std::endl;
456  }
459  fHammingLossHitCount += topix4Frame.size() - 2;
460  fStatusValues[HammingLossHitCount] += topix4Frame.size() - 2;
461  return false;
462  }
463 
464  std::vector<char> topix_data = fHamming.ConvertData(topix4Frame);
465  ULong64_t crc_calculated = fHamming.CalculateCRCTableFast(topix_data, topix_data.size());
466 
467  if (crc_calculated != ((topix4Frame.back() >> 6) & 0xffff)) {
470  fCRCLossHitCount += topix4Frame.size() - 2;
471  fStatusValues[CRCLossHitCount] += topix4Frame.size() - 2;
472  if (fVerbose == -1) {
473  std::cout << fFE << " CRC WRONG! Frame will be deleted. Calculated CRC: " << std::hex << crc_calculated <<
474  " topix CRC: " << ((topix4Frame.back() >> 6) & 0xffff) << std::endl;
475 
476  for (int y = 0; y < topix4Frame.size(); y++) {
477  if (y == 0) {
478  std::cout << fFE << " " << std::hex << topix4Frame[y] << " - FCount " << fRecentFrameHeader.fFrameCount << std::endl;
479  } else {
480  std::cout << fFE << " " << std::hex << topix4Frame[y] << std::endl;
481  }
482  }
483  std::cout << std::endl;
484  }
485  topix4Frame.clear(); // delete topix frame due to negative CRC check.
486  return false;
487  }
488  return true;
489 }
490 
491 
493 {
494  if (fVerbose > 1) std::cout << "PndMvdReadInToPix4TBData::ProcessData raw Data: " << data << std::endl;
495  pixel pixelData = fTopix.BitAnalyzePixelData(data);
496  std::pair<UInt_t, UInt_t> pixelAddress = fTopix.PixelNumberToMatrixAddress(pixelData.fPixelNumber);
497 
498  Int_t frameCountHeader = header.fFrameCount;
499  if (pixelData.fLeadingEdge > pixelData.fTrailingEdge){
500  frameCountHeader--;
501  //std::cout << "PndMvdReadInToPix4TBData::ProcessData frameCount corrected" << std::endl;
502  }
503  Double_t timestamp = ((Double_t)fSuperFrameCount * 256. * 4096. + (Double_t)frameCountHeader * 4096. + (Double_t)pixelData.fLeadingEdge)/clockFrequency * 1000.;
504  timestamp += fTimeStampCorrection;
505  Double_t timestamp_independent = ((Double_t) fTotalHeaderCount * 4096. + (Double_t)pixelData.fLeadingEdge)/clockFrequency * 1000.;
506 
507  std::vector<Int_t> indices; // just for compatibility with PndSdsDigiPixel
508 // return PndSdsDigiTopix4(indices, 0, 0, fFE, pixelAddress.first, pixelAddress.second, pixelData.fLeadingEdge, pixelData.fTrailingEdge, header.fFrameCount, timestamp, fCorrectHitCount,fTotalHitCount, timestamp_independent);
509  PndSdsDigiTopix4 result(indices, 0, fFE - 1, 0, pixelAddress.first, pixelAddress.second, pixelData.fLeadingEdge, pixelData.fTrailingEdge, header.fFrameCount, timestamp, fCorrectHitCount,fTotalHitCount, timestamp_independent);
510  result.SetTimeStampError(1/clockFrequency * 1000);
511  return result;
512 
513 }
int fVerbose
Definition: poormantracks.C:24
std::vector< std::string > fFileNames
virtual Bool_t ReadInDataFromFile(TMrfData_8b *&data)
std::vector< char > ConvertData(std::vector< ULong64_t > topixFrame)
Int_t i
Definition: run_full.C:25
Data class to store the digi output of a pixel module.
ToPix4::frameTrailer BitAnalyzeTrailer(ULong64_t &trailer)
Definition: PndTopix4.cxx:75
ToPix4::frameHeader BitAnalyzeHeader(ULong64_t &header)
Definition: PndTopix4.cxx:61
Bool_t HitToFilter(PndSdsDigiTopix4 &hit)
ULong64_t ConvertToPix4HammingToStandardHamming(ULong64_t topixhamming)
Definition: PndTopix4.cxx:314
ToPix4::pixel BitAnalyzePixelData(ULong64_t &data)
Definition: PndTopix4.cxx:91
std::vector< std::vector< PndSdsDigiTopix4 > > AnalyzeData(std::vector< ULong64_t > &rawData, Double_t clockFrequency)
UInt_t GetLeadingEdge() const
#define DEBUG
UInt_t GetTrailingEdge() const
PndSdsDigiTopix4 ProcessData(ULong64_t &data, ToPix4::frameHeader &header, Double_t &clockFrequency)
std::vector< ULong64_t > GetRawData(TMrfData_8b *data)
Definition: PndTopix4.cxx:25
Double_t
std::pair< UInt_t, UInt_t > PixelNumberToMatrixAddress(UInt_t pixelnumber)
Definition: PndTopix4.cxx:128
UInt_t fLeadingEdge
Definition: PndTopix4.h:36
Base interface class for data storage and manipulation. Compatible with IO classes from MRF Suite...
Bool_t ReadInData(std::vector< std::vector< PndSdsDigiTopix4 > > &data)
std::vector< CbmEmcHit * > hitList
Definition: digi_analys.C:26
ToPix4::frameTrailer fRecentFrameTrailer
ToPix4::frameHeader fRecentFrameHeader
ULong64_t CalculateCRCTableFast(std::vector< char > p, ULong64_t len)
PndSdsMCPoint * hit
Definition: anasim.C:70
std::vector< PndSdsDigiTopix4 > AnalyzeToPixFrame(Double_t clockFrequency)
UInt_t fPixelNumber
Definition: PndTopix4.h:33
UInt_t fTrailingEdge
Definition: PndTopix4.h:37
Double_t y
std::vector< ULong64_t > fToPixFrame
bool BuildFrame(ULong64_t &rawData)
int GetType(ULong64_t data)
returns if the data word is a header (0b01), trailer (0b10) or data (0b11)
Definition: PndTopix4.cxx:49
bool CheckDataIntegrity(std::vector< ULong64_t > topix4Frame)
UShort_t CheckHammingCode(ULong64_t dataword, int dataword_length)