#include <MatacqDataFormatter.h>
Definition at line 15 of file MatacqDataFormatter.h.
MatacqTBDataFormatter::MatacqTBDataFormatter |
( |
| ) |
|
|
inline |
virtual MatacqTBDataFormatter::~MatacqTBDataFormatter |
( |
| ) |
|
|
inlinevirtual |
Callback method for decoding raw data
- Parameters
-
data | raw data |
matacqDigiCollection | [out] digi collection object to fill with the decoded data |
Definition at line 19 of file MatacqDataFormatter.cc.
References edm::SortedCollection< T, SORT >::back(), filterCSVwithJSON::copy, gather_cfg::cout, FEDRawData::data(), relativeConstraints::empty, i, max(), printData(), edm::SortedCollection< T, SORT >::push_back(), FEDRawData::size(), and BeamSplash_cfg::version.
Referenced by EcalDCCTBUnpackingModule::produce(), and EcalDCCTB07UnpackingModule::produce().
21 std::cout <<
"****************************************************************\n";
22 std::cout <<
"********************** MATACQ decoder **************************\n";
23 std::cout <<
"****************************************************************\n";
26 for(
int i=0;
i <
max(100, (
int)data.
size()); ++
i){
28 << ((
i+1)%8?
" ":
"\n") ;
31 std::cout <<
"======================================================================\n";
32 #endif //MATACQ_DEBUG defined
38 #endif //MATACQ_DEBUG defined
40 const double ns = 1.e-9;
41 const double ps = 1.e-12;
42 double ts = ns/matacq.getFreqGHz();
44 ps*matacq.getTTrigPs():999.;
45 int version = matacq.getMatacqDataFormatVersion();
47 std::vector<int16_t> samples;
51 const std::vector<MatacqTBRawEvent::ChannelData>& chData = matacq.getChannelData();
52 for(
unsigned iCh=0; iCh < chData.size(); ++iCh){
54 samples.resize(chData[iCh].nSamples);
55 copy(chData[iCh].samples, chData[iCh].samples+chData[iCh].nSamples,
57 int chId = chData[iCh].chId;
58 std::vector<int16_t>
empty;
60 matacqDigiCollection.
push_back(matacqDigi);
61 matacqDigiCollection.
back().swap(samples);
void push_back(T const &t)
size_t size() const
Lenght of the data buffer in bytes.
const T & max(const T &a, const T &b)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
const_reference back() const
void MatacqTBDataFormatter::printData |
( |
std::ostream & |
out, |
|
|
const MatacqTBRawEvent & |
event |
|
) |
| const |
|
private |
Definition at line 65 of file MatacqDataFormatter.cc.
References ecalMGPA::adc(), gather_cfg::cout, MatacqTBRawEvent::getBxId(), MatacqTBRawEvent::getChannelCount(), MatacqTBRawEvent::getChannelData(), MatacqTBRawEvent::getDccErrors(), MatacqTBRawEvent::getDccLen(), MatacqTBRawEvent::getEventId(), MatacqTBRawEvent::getFedId(), MatacqTBRawEvent::getFov(), MatacqTBRawEvent::getFreqGHz(), MatacqTBRawEvent::getMatacqDataFormatVersion(), MatacqTBRawEvent::getRunNum(), MatacqTBRawEvent::getStatus(), MatacqTBRawEvent::getTimeStamp(), MatacqTBRawEvent::getTriggerType(), i, and stor::utils::timeStamp().
Referenced by interpretRawData().
66 std::cout <<
"FED id: " << std::hex <<
"0x" << matacq.getFedId() << std::dec <<
"\n";
68 << std::hex <<
"0x" << matacq.getEventId() << std::dec <<
"\n";
69 std::cout <<
"FOV: " << std::hex <<
"0x" << matacq.getFov() << std::dec <<
"\n";
70 std::cout <<
"BX id: " << std::hex <<
"0x" << matacq.getBxId() << std::dec <<
"\n";
72 << std::hex <<
"0x" << matacq.getTriggerType() << std::dec <<
"\n";
73 std::cout <<
"DCC Length: " << matacq.getDccLen() <<
"\n";
74 std::cout <<
"Run number: " << matacq.getRunNum() <<
"\n";
76 << std::hex <<
"0x" << matacq.getDccErrors() << std::dec <<
"\n";
78 if(matacq.getStatus()){
79 std::cout <<
"Error in matacq data. Errot code: "
80 << std::hex <<
"0x" << matacq.getStatus() << std::dec <<
"\n";
83 std::cout <<
"MATACQ data format version: " << matacq.getMatacqDataFormatVersion()
85 std::cout <<
"Sampling frequency: " << matacq.getFreqGHz() <<
" GHz\n";
86 std::cout <<
"MATACQ channel count: " << matacq.getChannelCount() <<
"\n";
88 std::cout <<
"Data acquired on : " << ctime(&timeStamp);
90 const std::vector<MatacqTBRawEvent::ChannelData>& channels = matacq.getChannelData();
91 for(
unsigned i=0;
i< channels.size(); ++
i){
92 std::cout <<
"-------------------------------------- Channel "
94 <<
": " << std::setw(4) << channels[
i].nSamples
95 <<
" samples --------------------------------------\n";
97 for(
int iSample = 0; iSample<channels[
i].nSamples; ++iSample){
100 << ((iSample%20==19)?
"\n":
" ");
103 std::cout <<
"=================================================="
104 "==================================================\n\n";
int adc(sample_type sample)
get the ADC sample (12 bits)
std::string timeStamp(TimePoint_t)