23 cout <<
"****************************************************************\n";
24 cout <<
"********************** MATACQ decoder **************************\n";
25 cout <<
"****************************************************************\n";
26 cout <<
"FEDRawData: \n";
27 char oldPad =
cout.fill(
'0');
28 for(
int i=0;
i <
max(100, (
int)data.
size()); ++
i){
29 cout << hex << setw(2) << (int)(data.
data()[
i])
30 << ((
i+1)%8?
" ":
"\n") ;
33 cout <<
"======================================================================\n";
34 #endif //MATACQ_DEBUG defined
36 matacqDigiCollection);
42 printData(
cout, matacq);
43 #endif //MATACQ_DEBUG defined
45 const double ns = 1.e-9;
46 const double ps = 1.e-12;
52 vector<int16_t> samples;
56 const vector<MatacqRawEvent::ChannelData>& chData = matacq.
getChannelData();
57 for(
unsigned iCh=0; iCh < chData.size(); ++iCh){
59 samples.resize(chData[iCh].nSamples);
60 copy(chData[iCh].samples, chData[iCh].samples+chData[iCh].nSamples,
62 int chId = chData[iCh].chId;
63 vector<int16_t>
empty;
65 #if (defined(ECAL_MATACQ_DIGI_VERS) && (ECAL_MATACQ_DIGI_VERS >= 2))
81 #endif //matacq digi version >=2
82 matacqDigiCollection.
push_back(matacqDigi);
83 matacqDigiCollection.
back().swap(samples);
88 cout <<
"FED id: " << hex <<
"0x" << matacq.
getFedId() << dec <<
"\n";
89 cout <<
"Event id (lv1): "
90 << hex <<
"0x" << matacq.
getEventId() << dec <<
"\n";
91 cout <<
"FOV: " << hex <<
"0x" << matacq.
getFov() << dec <<
"\n";
92 cout <<
"BX id: " << hex <<
"0x" << matacq.
getBxId() << dec <<
"\n";
93 cout <<
"Trigger type: "
97 cout <<
"Field 'DCC errors': "
101 cout <<
"Error in matacq data. Errot code: "
102 << hex <<
"0x" << matacq.
getStatus() << dec <<
"\n";
107 cout <<
"Sampling frequency: " << matacq.
getFreqGHz() <<
" GHz\n";
110 cout <<
"Data acquired on : " << ctime(&timeStamp);
112 const vector<MatacqRawEvent::ChannelData>& channels = matacq.
getChannelData();
113 for(
unsigned i=0;
i< channels.size(); ++
i){
114 cout <<
"-------------------------------------- Channel "
116 <<
": " << setw(4) << channels[
i].nSamples
117 <<
" samples --------------------------------------\n";
119 for(
int iSample = 0; iSample<channels[
i].nSamples; ++iSample){
121 cout << setw(4) << adc
122 << ((iSample%20==19)?
"\n":
" ");
125 cout <<
"=================================================="
126 "==================================================\n\n";
int adc(sample_type sample)
get the ADC sample (12 bits)
timeval timeStamp() const
static unsigned getRunNum(unsigned char *data, size_t size)
static unsigned getOrbitId(unsigned char *data, size_t size)
void push_back(T const &t)
std::vector< int > vernier() const
int32_t getStatus() const
int attenuation_dB() const
size_t size() const
Lenght of the data buffer in bytes.
unsigned getDccLen() const
int getChannelCount() const
int getMatacqDataFormatVersion() const
const T & max(const T &a, const T &b)
int getTriggerType() const
int getAttenuation_dB() const
unsigned getEventId() const
int getLaserPower() const
char data[epos_bytes_allocation]
time_t getTimeStamp() const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
const std::vector< ChannelData > & getChannelData() const
std::vector< int > getVernier() const
std::string timeStamp(TimePoint_t)
const_reference back() const