FairRoot/PandaRoot
PndMvdReadInToPix4TBData.h
Go to the documentation of this file.
1 /*
2  * PndMvdReadInToPix4TBData.h
3  *
4  * Created on: 23.10.2014
5  * Author: Stockmanns
6  */
7 
8 #ifndef PNDMVDREADINTOPIX4TBDATA_H_
9 #define PNDMVDREADINTOPIX4TBDATA_H_
10 
11 #include "Rtypes.h"
12 //#include "TString.h"
13 
14 #include "PndSdsDigiTopix4.h"
15 #include "PndSdsDigiTopix4Header.h"
16 
17 #include "PndTopix4.h"
18 #include "PndHammingDecoder.h"
19 
20 #include <fstream>
21 #include <iostream>
22 #include <utility>
23 #include <vector>
24 #include <string>
25 
26 //#include <unordered_map>
27 
28 //#include "FairMQDevice.h
29 
30 class TMrfData_8b;
31 
32 
34 public:
35  enum {
52  };
54  virtual ~PndMvdReadInToPix4TBData();
55 
56  void SetFileName(std::vector<std::string> fileName){
57 
58  std::cout << "number of entires " << fileName.size() << std::endl;
59  for(int i=0; i < fileName.size();i++)
60  {
61  std::cout << i<< " " << fileName[i] << std::endl;
62  }
63  fFileNames= fileName;
64  }
65 
66  void SetFileName(std::string fileName){
67  std::vector<std::string> names;
68  names.push_back(fileName);
69  SetFileName(names);
70  }
71 
72  void Init();
73 
74  Bool_t ReadInData(std::vector<std::vector<PndSdsDigiTopix4> >& data);
75 // Bool_t ReadInRawData(std::ifstream* fileHandle, std::vector<ULong64_t>& rawData);//<input is fileHandle, output vector of raw data, output is end of file
76  virtual Bool_t ReadInDataFromFile(TMrfData_8b*& data);
77 // std::vector<ULong64_t> GetRawData(TMrfData_8b* data);
78  std::vector<std::vector<PndSdsDigiTopix4> > AnalyzeData(std::vector<ULong64_t>& rawData, Double_t clockFrequency);
79  bool BuildFrame(ULong64_t& rawData);
80 
81  Int_t GetDeltaFrameCount();
82 
83 
84 // virtual void WriteoutToPix4Digi(PndSdsDigiTopix4& data);
85 // virtual void WriteoutToPix4Frames(std::vector<std::vector<PndSdsDigiTopix4> > &frames);
86 
87  PndSdsDigiTopix4 ProcessData(ULong64_t& data, ToPix4::frameHeader& header, Double_t& clockFrequency);
88  std::vector<PndSdsDigiTopix4> AnalyzeToPixFrame(Double_t clockFrequency);
89  bool CheckDataIntegrity(std::vector<ULong64_t> topix4Frame);
90 
93  void SetFE(Int_t val){fFE = val;}
94  UInt_t GetNonSequenctialFC() const {return fNonSequentialFC;}
95  UInt_t GetDoubleHeader() const {return fDoubleHeader;}
96  UInt_t GetDoubleTrailer() const {return fDoubleTrailer;}
97  UInt_t GetSuperFrameCount() const {return fSuperFrameCount;}
98 
99 
100  UInt_t GetTotalHitCount() const {return fTotalHitCount;}
101  UInt_t GetCorrectHitCount() const {return fCorrectHitCount;}
104  UInt_t GetCRCLossHitCount() const {return fCRCLossHitCount;}
105 
106  UInt_t GetTotalFrameCount() const {return fTotalFrameCount;}
107  UInt_t GetCorrectFrameCount() const {return fCorrectFrameCount;}
109  UInt_t GetCRCLossFrameCount() const {return fCRCLossFrameCount;}
110 
111  UInt_t GetTotalHeaderCount() const {return fTotalHeaderCount;}
112  UInt_t GetTotalTrailerCount() const {return fTotalTrailerCount;}
113 
114  std::vector<int> GetStatusValues() const {return fStatusValues;}
115 
119 
120 
121  void SetVerbose(Int_t val){fVerbose = val;}
122 
123 private:
124  std::vector<std::string> fFileNames;
125  std::ifstream* fFileHandle;
128 
129  std::vector<int> fStatusValues;
130 
133 
138 
144 
147 
154 
157 
160 
163 
164  Int_t fVerbose; // fVerbose==5 gives all detected errors from ToPix build in error detection
165  Int_t fFE;
167 
168  std::vector<ULong64_t> fToPixFrame;
171 
172 
173 };
174 
175 #endif /* PNDMVDREADINTBDATA_H_ */
std::vector< std::string > fFileNames
virtual Bool_t ReadInDataFromFile(TMrfData_8b *&data)
Int_t i
Definition: run_full.C:25
Data class to store the digi output of a pixel module.
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
Bool_t HitToFilter(PndSdsDigiTopix4 &hit)
std::vector< std::vector< PndSdsDigiTopix4 > > AnalyzeData(std::vector< ULong64_t > &rawData, Double_t clockFrequency)
PndSdsDigiTopix4 ProcessData(ULong64_t &data, ToPix4::frameHeader &header, Double_t &clockFrequency)
std::vector< int > GetStatusValues() const
Double_t
void SetTimeStampCorrection(Double_t val)
Base interface class for data storage and manipulation. Compatible with IO classes from MRF Suite...
ToPix4::frameHeader fRecentAllFrameHeader
Bool_t ReadInData(std::vector< std::vector< PndSdsDigiTopix4 > > &data)
ToPix4::frameTrailer fRecentFrameTrailer
ToPix4::frameHeader fRecentFrameHeader
void SetClockFrequency(Double_t val)
PndSdsMCPoint * hit
Definition: anasim.C:70
std::vector< PndSdsDigiTopix4 > AnalyzeToPixFrame(Double_t clockFrequency)
std::vector< ULong64_t > fToPixFrame
void SetFileName(std::vector< std::string > fileName)
bool BuildFrame(ULong64_t &rawData)
bool CheckDataIntegrity(std::vector< ULong64_t > topix4Frame)
void SetFileName(std::string fileName)