Public Member Functions | |
virtual | ~RawDAQData () |
virtual void | copy (const RawDAQData &) |
Deep copy from the DAQDataFormat. More... | |
virtual void | copy (const void *buffer) |
Shallow copy from the external buffer. More... | |
void * | readData (const void *buffer) |
Shallow copy constructor. More... | |
void * | readData (const void *buffer, const uint32_t size_of_data) |
Read from the buffer if the size of data is known. More... | |
virtual readDataStatus | readData (const int fd) |
From the File descriptor. More... | |
void * | writeData (const void *buffer) const |
Write Data to target memory location. Return is the address of the end of the write. NULL on error. More... | |
ssize_t | writeData (const int fd) const |
Write Data to target file descriptor. Return is the number of bytes written. -1 on error. More... | |
uint32_t | calculateCheckSum (const uint32_t skip_last_words) const |
void * | getBuffer () const |
bool | setBufferSource (const void *) |
We are not going to overload these funtions, so no need to declare them virtual. More... | |
bool | resetBufferSource () |
virtual bool | clear () |
reset _Buffer to point to InternalBuffer More... | |
bool | reset () |
Reset. More... | |
bool | isInternalBuffer () const |
void | init () |
void | print (std::ostream &os=std::cout) const |
Method for printing the content of the Buffer. More... | |
void | print (std::string &output_string) const |
print into the string More... | |
uint32_t | sizeofdata () const |
Sizeof method for the current data block. Returns the size of the data block in 32bit words. More... | |
virtual bool | addCheckSum () |
Add the CRC into the end of fBuffer. CRC of all but the last words of the _Buffer. More... | |
Protected Member Functions | |
RawDAQData () | |
Default Constructor. More... | |
RawDAQData (version_t) | |
RawDAQData (version_t, sizeofdata_t) | |
RawDAQData (version_t, bool use_setBufferSourceUnknownVersion) | |
RawDAQData (version_t, bool use_setBufferSourceUnknownVersion, sizeofdata_t) | |
RawDAQData (init_t) | |
RawDAQData (version_t, init_t) | |
RawDAQData (version_t, init_t, sizeofdata_t) | |
RawDAQData (version_t, init_t, sizeofdata_t, setBufferSource_t) | |
RawDAQData (version_t, init_t, sizeofdata_t, setBufferSource_t, print_t, readData_t) | |
RawDAQData (const RawDAQData &) | |
Deep copy. More... | |
void * | readDataGeneral (const void *buffer) |
General ReadData method when the sizeofdata is known. More... | |
virtual version_t | figureOutTheVersion (const void *buffer) const =0 |
bool | checkBufferInternalness () |
If the buffer should be internal, check it's pointers and reassign them. More... | |
virtual bool | setFunctionPointers ()=0 |
void * | setBufferSourceGeneral (RawDAQData &, const void *) |
Set BufferSource of the input DataFormat and return pointer to the position right after the end of its buffer. More... | |
bool | setBufferSourceUnknownVersion (const void *) |
bool | reserveInternalBuffer (const uint32_t size_of_data) |
Reserve space for the internal buffer to some predetermined size. More... | |
bool | addToInternalBuffer (const uint32_t size_of_data_to_add) |
Add Zeros to internal buffer. More... | |
bool | resizeInternalBuffer (const uint32_t size_of_data) |
Resize the internal buffer. More... | |
uint32_t | boolToUint32_t (const bool number) const |
bool | uint32_tToBool (const uint32_t number) const |
void | printGeneral (std::ostream &os=std::cout) const |
void | printBuffer (std::ostream &os=std::cout, const bool print_offset=true,const bool print_ascii=true,const bool print_buffer_address=false,const bool print_internal_buffer=false,const bool print_size_of_data=false,const std::string separation_between_lines="\n",const uint32_t cols=4) const |
void | printWord (const uint32_t iword, const bool is_bynary_printing, std::ostream &os=std::cout) const |
Print word from Buffer. More... | |
void | printWordBinary (const uint32_t word, std::ostream &os=std::cout) const |
! Print the i-th word of _Buffer, is_bynary_printing: true = bynary, false = HEX More... | |
void | printWordHex (const uint32_t word, std::ostream &os=std::cout) const |
void | printBinary (const void *buffer0, const uint32_t size, std::ostream &os=std::cout) const |
void | printHex (const void *buffer0, const uint32_t size, std::ostream &os=std::cout) const |
void | printUnknownVersion (std::ostream &out_stream=std::cout) const |
void * | readDataGeneral (const void *buffer, const uint32_t size_of_data_to_read) |
Generic readData methods. More... | |
void * | readDataGeneral (const void *buffer, const uint32_t size_of_data_to_read, const uint32_t buffer_start_position) |
bool | functionIsNotAllowed (const std::string function="", const std::string message="") const |
One can call this function from another function, which usage is not allowed (for a particular version). More... | |
void | defaultConstructorFixedSize () |
void | defaultConstructorFixedSize (init_t) |
void | defaultConstructorFloatingSize () |
void | defaultConstructorFloatingSize (init_t) |
void * | readDataUnknownVersion (const void *buffer) |
Read data from the unknown version. More... | |
bool | isVersionUnknown () const |
is current _version unknown? More... | |
bool | isVersionUnknown (const version_t version) const |
is input version unknown? More... | |
uint64_t | getUint64_t (uint32_t low_word, uint32_t hi_word) const |
Get uint64_t from low and hi word. More... | |
bool | getLoAndHi (uint64_t input_data, uint32_t &output_low_word, uint32_t &output_hi_word) const |
bool | setUint64_t (uint64_t value, DELEGATE(RawDAQData, function_set_low_word, bool, uint32_t),) |
std::string | generateExceptionForWrongVersion (version_t maximum_version) const |
Generating exception message as the version of DAQDataFormat is greater than the maximum allowed. More... | |
void | lastOperationsInDeepCopy (const RawDAQData ©_in) |
Need to perform these operations in Deep Copy constructor. More... | |
Init_t (_function_init) | |
Some common function pointers used in each DAQDataFormats class. More... | |
Sizeofdata_t (_function_sizeofdata) | |
Print_t (_function_print) | |
ReadData_t (_function_readData) | |
SetBufferSource_t (_function_setBufferSource) | |
EXECUTE_ON_DEBUG (std::string _dataFormatClassName) | |
These variables are only for Debugging purposes. More... | |
EXECUTE_ON_DEBUG (std::string _dataFormatConstructor) | |
Protected Attributes | |
void * | _Buffer |
All data formats need to have _Buffer and a Data structure. _Buffer will be common. More... | |
std::vector< uint32_t > | _InternalBuffer |
bool | _shouldBufferBeInternal |
Auxillary variable that holds whether the buffer should be external or internal. More... | |
version_t | _version |
DataFormat Version. More... | |
Private Member Functions | |
void | defaultConstructorGeneral (resetBufferSource_t) |
void | defaultConstructorGeneral (init_t, resetBufferSource_t) |
Friends | |
class | novadaq::datalogger::DataBlockReader |
Definition at line 84 of file RawDAQData.h.
|
protected |
Default Constructor.
Definition at line 14 of file RawDAQData.cpp.
Referenced by RawDAQData().
|
protected |
Definition at line 26 of file RawDAQData.cpp.
|
protected |
|
protected |
Definition at line 37 of file RawDAQData.cpp.
References _Buffer, _shouldBufferBeInternal, _version, daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, init(), init_t, Init_t(), gammaraytel::pr, print_t, Print_t(), printUnknownVersion(), RawDAQData(), readData_t, ReadData_t(), readDataGeneral(), readDataUnknownVersion(), setBufferSource(), setBufferSource_t, SetBufferSource_t(), setBufferSourceUnknownVersion(), sizeofdata_t, and Sizeofdata_t().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Deep copy.
Definition at line 139 of file RawDAQData.cpp.
|
virtual |
Definition at line 169 of file RawDAQData.cpp.
|
virtual |
Add the CRC into the end of fBuffer. CRC of all but the last words of the _Buffer.
Calculate CRC for the buffer, skipping the last word
Do the swab
Write the CRC at the last word of the Buffer
Definition at line 550 of file RawDAQData.cpp.
References _InternalBuffer, calculateCheckSum(), EXECUTE_FUNCTION, isInternalBuffer(), RAWBUFF32, sizeofdata(), and SWAB32.
Referenced by daqdataformats::RawMilliSlice::close().
|
protected |
Add Zeros to internal buffer.
Definition at line 284 of file RawDAQData.cpp.
References _InternalBuffer, and MECModelEnuComparisons::i.
Referenced by daqdataformats::RawMilliSliceIndex::addIndex().
|
inlineprotected |
Conversions from bool to int and backwards We are not going to overload it, so no need to declare virtual
Definition at line 190 of file RawDAQData.h.
uint32_t daqdataformats::RawDAQData::calculateCheckSum | ( | const uint32_t | skip_last_words | ) | const |
Calculate CRC of _Buffer (after skipping last skip_last_words words) using CRC32c algorythm with 0x8F6E37A0 polynomial. Usually use skip_last_words=1 as the _Buffer has an CRC in the end If on calculates with skip_last_words=0 (with CRC at the end), it should calculate to Zero (Property of Check Sum)
Definition at line 541 of file RawDAQData.cpp.
References _Buffer, EXECUTE_FUNCTION, daqdataformats::NOvACheckSum::getInstance(), daqdataformats::NOvACheckSum::processCRC(), and sizeofdata().
Referenced by addCheckSum(), RawMilliSliceTests::testCalculateCheckSum(), RawMilliSliceTests::testCalculateCheckSumCorrupt(), and daqdataformats::MilliSliceUnitTest::testMilliSliceCRC().
|
protected |
If the buffer should be internal, check it's pointers and reassign them.
Definition at line 612 of file RawDAQData.cpp.
References _shouldBufferBeInternal, isInternalBuffer(), and resetBufferSource().
Referenced by daqdataformats::RawMilliSlice::addData(), daqdataformats::RawMicroSlice::addData(), daqdataformats::RawMilliSliceIndex::addIndex(), daqdataformats::RawMilliSliceIndex::close(), daqdataformats::RawMilliSlice::close(), daqdataformats::RawMilliSliceIndex::readData(), daqdataformats::RawMilliSlice::readDataFromBuffer(), and daqdataformats::RawMicroSlice::readDataFromBuffer().
|
virtual |
reset _Buffer to point to InternalBuffer
Clear Internal Buffer
If buffer is internal, need to use assign, because vector may not have been initialized
Loop over the buffer and zero it The buffer could be either internal or external
Reimplemented in daqdataformats::RawMilliSlice.
Definition at line 573 of file RawDAQData.cpp.
References _InternalBuffer, EXECUTE_FUNCTION, MECModelEnuComparisons::i, isInternalBuffer(), PRINT_ON_DEBUG, RAWBUFF32, and sizeofdata().
Referenced by daqdataformats::RawMilliSlice::clear(), daqdataformats::RawMilliSliceHeader::init(), reset(), and daqdataformats::VERSION_NAMESPACE::RawDataBlock::~RawDataBlock().
|
virtual |
Deep copy from the DAQDataFormat.
Get version
Copy the entire internal buffer
Set function pointers
Definition at line 830 of file RawDAQData.cpp.
References _InternalBuffer, _version, lastOperationsInDeepCopy(), and setFunctionPointers().
Referenced by daqdataformats::RawDCMChan::RawDCMChan(), daqdataformats::RawMicroSlice::RawMicroSlice(), daqdataformats::RawMilliSlice::RawMilliSlice(), daqdataformats::RawMilliSliceHeader::RawMilliSliceHeader(), daqdataformats::RawMilliSliceIndex::RawMilliSliceIndex(), daqdataformats::RawMilliSliceIndexHeader::RawMilliSliceIndexHeader(), and daqdataformats::RawTimingMarker::RawTimingMarker().
Shallow copy from the external buffer.
If input version is -1, then we don't really know what version it is and will try to read it
figure out the version
At this point version should be known
Now, need to define functions
Also, we don't initialize internal buffer, because the pointer is set to the external buffer
Definition at line 846 of file RawDAQData.cpp.
References _Buffer, _version, om::cout, EXECUTE_FUNCTION, EXECUTE_ON_DEBUG(), figureOutTheVersion(), isVersionUnknown(), PRINT_ON_DEBUG, setBufferSource(), and setFunctionPointers().
|
protected |
General routines for the default constructor of main class for fixed size data formats, like RawNanoSliceHeader, Timing marker etc. (they can be different from version to version though) But the difference is that we want to clear out the internal buffer for them, whereas for floating data formats don't need to have that, since the data may be overwritten anyways
Definition at line 625 of file RawDAQData.cpp.
References defaultConstructorGeneral(), Init_t(), reset(), and resetBufferSource_t.
Referenced by daqdataformats::RawDCMChan::RawDCMChan(), daqdataformats::RawMilliSliceHeader::RawMilliSliceHeader(), daqdataformats::RawMilliSliceIndexHeader::RawMilliSliceIndexHeader(), and daqdataformats::RawTimingMarker::RawTimingMarker().
|
protected |
General routines for the default constructor of main class for floating size data formats, like RawNanoSlice, RawEvent etc. We don't need to initialize internal buffer
Definition at line 642 of file RawDAQData.cpp.
References _Buffer, _InternalBuffer, _version, om::cout, defaultConstructorGeneral(), EXECUTE_FUNCTION, EXECUTE_GENERAL_FUNCTION, EXECUTE_ON_DEBUG(), init(), Init_t(), isVersionUnknown(), PRINT_ON_DEBUG, resetBufferSource(), ResetBufferSource_t, resetBufferSource_t, resizeInternalBuffer(), setFunctionPointers(), gen_hdf5record::size, and sizeofdata().
Referenced by daqdataformats::RawMicroSlice::RawMicroSlice(), daqdataformats::RawMilliSlice::RawMilliSlice(), and daqdataformats::RawMilliSliceIndex::RawMilliSliceIndex().
|
private |
Default constructor methods with custom reset_buffer_source method so that one can use resetBufferSource or clear
Referenced by defaultConstructorFixedSize(), and defaultConstructorFloatingSize().
|
private |
|
protected |
These variables are only for Debugging purposes.
Referenced by copy(), defaultConstructorFloatingSize(), readDataGeneral(), and reset().
|
protected |
|
protectedpure virtual |
Method which returns the version of the DataFormat given the pointer to the buffer It has to be implemented for all DataFormats.
Implemented in daqdataformats::RawMilliSliceHeader, daqdataformats::RawMicroSlice, daqdataformats::RawMilliSlice, daqdataformats::RawTimingMarker, daqdataformats::RawMilliSliceIndex, daqdataformats::RawDCMChan, and daqdataformats::RawMilliSliceIndexHeader.
Referenced by copy(), readDataUnknownVersion(), and setBufferSourceUnknownVersion().
|
protected |
One can call this function from another function, which usage is not allowed (for a particular version).
The output message string
Generate the exception
Definition at line 962 of file RawDAQData.cpp.
References _version, gen_hdf5record::size, and string.
|
protected |
Generating exception message as the version of DAQDataFormat is greater than the maximum allowed.
Definition at line 950 of file RawDAQData.cpp.
References _version, lem_server::msg, and string.
|
inline |
Get method for the pointer to the internal buffers We are not going to overload it, so no need to declare virtual
Definition at line 131 of file RawDAQData.h.
References clear.
Referenced by mcdatadaq::BufferNodeSimulator::addMilliSlice(), daqdataformats::MilliSliceUnitTest::basicFieldGetAndSetChecks(), daqdataformats::MicroBlockUnitTest::basicFieldGetAndSetChecksForGivenVersion(), daqdataformats::RawMilliSliceIndex::close(), daqdataformats::RawMilliSlice::close(), daqdataformats::MilliSliceConstructor::fillDataFormat(), daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::MicroBlockConstructor::fillDataFormat(), daqdataformats::DataBlockConstructor::fillDataFormat(), daqdataformats::CURRENT_FIELDS_SUB_NAMESPACE::MicroBlockConstructor::getEmptyDataFormat(), daqdataformats::RawMilliSlice::setFloatingMicroSlice(), RawMilliSliceTests::testCalculateCheckSumCorrupt(), and mcdatadaq::Configuration::writeToFile().
|
protected |
Definition at line 910 of file RawDAQData.cpp.
Referenced by daqdataformats::RawTimingMarker::setTime(), daqdataformats::RawMilliSliceHeader::setTimeStart(), and setUint64_t().
|
protected |
Get uint64_t from low and hi word.
Definition at line 908 of file RawDAQData.cpp.
Referenced by daqdataformats::RawTimingMarker::getTime(), and daqdataformats::RawMilliSliceHeader::getTimeStart().
|
inline |
Functions that need to be defined in each class Initialize DAQDataFormats class
Definition at line 145 of file RawDAQData.h.
References om::cout, print, and string.
Referenced by demo.App::__init__(), testem0.App::__init__(), Lesson1.App::__init__(), ExN03.App::__init__(), defaultConstructorFloatingSize(), daqdataformats::RawMilliSliceIndex::init(), daqdataformats::RawMicroSlice::init(), and RawDAQData().
|
protected |
Some common function pointers used in each DAQDataFormats class.
Referenced by defaultConstructorFixedSize(), defaultConstructorFloatingSize(), and RawDAQData().
|
inline |
Is buffer internal We are not going to overload it, so no need to declare virtual
Definition at line 141 of file RawDAQData.h.
Referenced by addCheckSum(), checkBufferInternalness(), clear(), daqdataformats::RawMilliSlice::close(), daqdataformats::RawMilliSlice::init(), lastOperationsInDeepCopy(), printBuffer(), daqdataformats::RawMilliSlice::readData(), readDataGeneral(), readDataUnknownVersion(), daqdataformats::RawMilliSlice::setBufferSource(), daqdataformats::RawMilliSliceIndex::setBufferSource(), and daqdataformats::RawMicroSlice::setBufferSource().
|
inlineprotected |
is current _version unknown?
Definition at line 240 of file RawDAQData.h.
References samweb_client.client::_version, and isVersionUnknown().
Referenced by copy(), defaultConstructorFloatingSize(), and isVersionUnknown().
|
inlineprotected |
is input version unknown?
Definition at line 242 of file RawDAQData.h.
References daqdataformats::rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION, DELEGATE, init_t, resetBufferSource_t, and string.
|
protected |
Need to perform these operations in Deep Copy constructor.
If buffer is null, nothing to do
Definition at line 151 of file RawDAQData.cpp.
References _Buffer, EXECUTE_FUNCTION, isInternalBuffer(), PRINT_ON_DEBUG, resetBufferSource(), and setBufferSource().
Referenced by copy(), daqdataformats::RawDCMChan::RawDCMChan(), daqdataformats::RawMicroSlice::RawMicroSlice(), daqdataformats::RawMilliSlice::RawMilliSlice(), daqdataformats::RawMilliSliceHeader::RawMilliSliceHeader(), daqdataformats::RawMilliSliceIndex::RawMilliSliceIndex(), daqdataformats::RawMilliSliceIndexHeader::RawMilliSliceIndexHeader(), and daqdataformats::RawTimingMarker::RawTimingMarker().
void daqdataformats::RawDAQData::print | ( | std::ostream & | os = std::cout | ) | const |
Method for printing the content of the Buffer.
Definition at line 500 of file RawDAQData.cpp.
References RETURN_FUNCTION.
Referenced by daqdataformats::RawDAQDataUnitTest::compareDataFormats(), daqdataformats::RawDAQDataUnitTest::getDifferenceBetweenStrings(), daqdataformats::RawDAQDataUnitTest::isPrintDataFormatUnknownVersion(), daqdataformats::operator<<(), daqdataformats::VERSION_NAMESPACE::RawMicroBlock::print(), daqdataformats::RawMilliSliceIndex::print(), print(), daqdataformats::RawMilliSlice::printStandard(), and daqdataformats::RawMicroSlice::printStandard().
void daqdataformats::RawDAQData::print | ( | std::string & | output_string | ) | const |
print into the string
Some temporary stream
perform standard print into the stream
Get the string out of the stream
Definition at line 503 of file RawDAQData.cpp.
References EXECUTE_FUNCTION, print(), and submit_syst::str.
|
protected |
Referenced by RawDAQData().
|
protected |
Definition at line 478 of file RawDAQData.cpp.
References printWordBinary(), and gen_hdf5record::size.
|
protected |
Displays the data _Buffer Customazible for debugging purpose
If we havn't printed buffer address, need to print Internal Buffer address
Print whether the buffer is internal/external
print size
Size of data
Current pointer to a word
This is only for ascii buffer printing
Loop over buffer
Write the data word in hex
At the end of the line write the line in ASCII with suppression of non printing characters
printing the ascii for the word
Loop over 4 characters of the line
print the character
At the end of the line, put separation symbol
Definition at line 330 of file RawDAQData.cpp.
References _Buffer, _InternalBuffer, cols, allTimeWatchdog::endl, EXECUTE_FUNCTION, novadaq::HexUtils::format(), MECModelEnuComparisons::i, isInternalBuffer(), calib::j, and sizeofdata().
Referenced by daqdataformats::RawMicroSlice::printStandard().
|
protected |
Print methods Generic print
Definition at line 516 of file RawDAQData.cpp.
References allTimeWatchdog::endl, EXECUTE_FUNCTION, MECModelEnuComparisons::i, printWord(), and sizeofdata().
|
protected |
Definition at line 488 of file RawDAQData.cpp.
References allTimeWatchdog::endl, printWordHex(), and gen_hdf5record::size.
|
inlineprotected |
Definition at line 213 of file RawDAQData.h.
References allTimeWatchdog::endl, init_t, datagram_client::message, and string.
Referenced by RawDAQData().
|
protected |
Print word from Buffer.
Check if we want to print in a bynary mode
Definition at line 440 of file RawDAQData.cpp.
References printWordBinary(), printWordHex(), RAWBUFF32, and SWAB32.
Referenced by daqdataformats::RawMilliSliceIndex::print(), daqdataformats::RawDCMChan::print(), printGeneral(), daqdataformats::RawTimingMarker::printStandard(), daqdataformats::RawMilliSlice::printStandard(), and daqdataformats::RawMilliSliceHeader::printStandard().
|
protected |
! Print the i-th word of _Buffer, is_bynary_printing: true = bynary, false = HEX
Definition at line 456 of file RawDAQData.cpp.
References allTimeWatchdog::endl, and MECModelEnuComparisons::i.
Referenced by printBinary(), and printWord().
|
protected |
Definition at line 473 of file RawDAQData.cpp.
References novadaq::HexUtils::format().
Referenced by printHex(), and printWord().
Shallow copy constructor.
Definition at line 181 of file RawDAQData.cpp.
References RETURN_FUNCTION.
Referenced by daqdataformats::VERSION_NAMESPACE::RawTrigger::getTriggerMask(), daqdataformats::RawMicroSlice::getVersion(), PandAna.core.core.loader::Go(), daqdataformats::RawMilliSlice::readData(), daqdataformats::VERSION_NAMESPACE::RawDataBlock::readData(), daqdataformats::VERSION_NAMESPACE::RawDataBlock::readDataUnknownVersion(), readDataUnknownVersion(), daqdataformats::RawMilliSlice::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawDataBlock::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawSummaryDCMDataHeader::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawTriggerRange::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawSummaryDroppedMicroblock::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawSummaryDCMDataPoint::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawTriggerTimingMarker::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawEventTail::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawTriggerMask::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawTriggerTime::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawTriggerHeader::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawNanoSlice::sizeofdata(), daqdataformats::VERSION_NAMESPACE::RawEventHeader::sizeofdata(), daqdataformats::RawMilliSliceHeader::sizeofdata(), and daqdataformats::VERSION_NAMESPACE::RawRunHeader::sizeofdata().
|
inline |
Read from the buffer if the size of data is known.
Definition at line 114 of file RawDAQData.h.
References fd.
Referenced by PandAna.core.core.loader::Go().
|
virtual |
From the File descriptor.
Reimplemented in daqdataformats::RawMicroSlice, and daqdataformats::RawMilliSlice.
Definition at line 255 of file RawDAQData.cpp.
References _Buffer, EXECUTE_FUNCTION, daqdataformats::rds_complete, daqdataformats::rds_error, daqdataformats::rds_incomplete, sizeofdata(), and ss.
Referenced by PandAna.core.core.loader::Go().
|
protected |
Referenced by RawDAQData().
General ReadData method when the sizeofdata is known.
Definition at line 186 of file RawDAQData.cpp.
References EXECUTE_FUNCTION, and sizeofdata().
Referenced by daqdataformats::RawMilliSlice::addData(), daqdataformats::RawMicroSlice::addData(), daqdataformats::RawMilliSliceIndex::close(), daqdataformats::RawMilliSlice::close(), RawDAQData(), daqdataformats::RawMilliSliceIndex::readData(), daqdataformats::VERSION_NAMESPACE::RawSummaryDCMDataHeader::readData(), daqdataformats::VERSION_NAMESPACE::RawTriggerRange::readData(), daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::readData(), daqdataformats::VERSION_NAMESPACE::RawMicroSliceHeader::readData(), daqdataformats::VERSION_NAMESPACE::RawSummaryDroppedMicroblock::readData(), daqdataformats::VERSION_NAMESPACE::RawConfigurationTail::readData(), daqdataformats::VERSION_NAMESPACE::RawEventTail::readData(), daqdataformats::VERSION_NAMESPACE::RawSummaryDCMDataPoint::readData(), daqdataformats::VERSION_NAMESPACE::RawTriggerTimingMarker::readData(), daqdataformats::VERSION_NAMESPACE::RawTriggerMask::readData(), daqdataformats::VERSION_NAMESPACE::RawTriggerTime::readData(), daqdataformats::VERSION_NAMESPACE::RawDataBlockHeader::readData(), daqdataformats::VERSION_NAMESPACE::RawConfigurationHeader::readData(), daqdataformats::VERSION_NAMESPACE::RawTriggerHeader::readData(), daqdataformats::VERSION_NAMESPACE::RawNanoSlice::readData(), daqdataformats::VERSION_NAMESPACE::RawEventHeader::readData(), daqdataformats::VERSION_NAMESPACE::RawNanoSliceHeader::readData(), daqdataformats::VERSION_NAMESPACE::RawRunHeader::readData(), daqdataformats::RawMilliSlice::readDataFromBuffer(), daqdataformats::RawMicroSlice::readDataFromBuffer(), and readDataGeneral().
|
protected |
Generic readData methods.
Adding stuff to buffer.
Definition at line 191 of file RawDAQData.cpp.
References _InternalBuffer, EXECUTE_FUNCTION, PRINT_ON_DEBUG, readDataGeneral(), and sizeofdata().
|
protected |
If it's negative, then nothing to assign
At first, we are going to be assigning things
Push back the rest
Since, it's the external buffer, then we are going to assign
Definition at line 200 of file RawDAQData.cpp.
References _InternalBuffer, om::cout, EXECUTE_ON_DEBUG(), exit(), MECModelEnuComparisons::i, isInternalBuffer(), std::min(), PRINT_ON_DEBUG, and RAWBUFF32.
Read data from the unknown version.
Read data from the unknown version Reading data to the format with unknown version can only happen when the buffer is set to internal source, because if it was set to external source, then we already figured out the version from it and wouldn't call this method After reading the data, the DataFormat is fully initialized
get the version
Now that we know the version, initialize function pointers, including readData
Resize internal buffer
Reset buffer source, so that we can construct other things (like headers and such)
Don't need to initialize the fields (use init()) because we are going to read new values from the buffer anyways... Like now
Definition at line 805 of file RawDAQData.cpp.
References _version, EXECUTE_FUNCTION, figureOutTheVersion(), isInternalBuffer(), PRINT_ON_DEBUG, readData(), resetBufferSource(), resizeInternalBuffer(), RETURN_FUNCTION, setFunctionPointers(), and sizeofdata().
Referenced by RawDAQData().
|
protected |
Reserve space for the internal buffer to some predetermined size.
We use vector::reserve instead of vector::resize, because resize not only reserves things, it initializes them to zero value. We don't have to do that, because we may overwrite things.
Definition at line 271 of file RawDAQData.cpp.
References _InternalBuffer.
Referenced by daqdataformats::RawMicroSlice::RawMicroSlice(), daqdataformats::RawMilliSlice::RawMilliSlice(), and daqdataformats::RawMilliSliceIndex::RawMilliSliceIndex().
bool daqdataformats::RawDAQData::reset | ( | ) |
Reset.
Definition at line 596 of file RawDAQData.cpp.
References clear(), om::cout, EXECUTE_ON_DEBUG(), PRINT_ON_DEBUG, and resetBufferSource().
Referenced by defaultConstructorFixedSize().
bool daqdataformats::RawDAQData::resetBufferSource | ( | ) |
Definition at line 605 of file RawDAQData.cpp.
References _InternalBuffer, PRINT_ON_DEBUG, RETURN_FUNCTION, and setBufferSource().
Referenced by checkBufferInternalness(), defaultConstructorFloatingSize(), lastOperationsInDeepCopy(), daqdataformats::RawMilliSlice::readData(), readDataUnknownVersion(), and reset().
|
protected |
Resize the internal buffer.
Definition at line 292 of file RawDAQData.cpp.
References _InternalBuffer.
Referenced by defaultConstructorFloatingSize(), daqdataformats::RawMicroSlice::init(), daqdataformats::RawMicroSlice::RawMicroSlice(), daqdataformats::RawMicroSlice::readData(), and readDataUnknownVersion().
bool daqdataformats::RawDAQData::setBufferSource | ( | const void * | pointer | ) |
We are not going to overload these funtions, so no need to declare them virtual.
Set The Buffer pointer to a given location.
Definition at line 880 of file RawDAQData.cpp.
References _Buffer, and PRINT_ON_DEBUG.
Referenced by copy(), lastOperationsInDeepCopy(), RawDAQData(), resetBufferSource(), daqdataformats::RawMilliSlice::setBufferSource(), daqdataformats::RawMilliSliceIndex::setBufferSource(), daqdataformats::VERSION_NAMESPACE::RawMicroBlockHeader::setBufferSource(), daqdataformats::RawMicroSlice::setBufferSource(), setBufferSourceGeneral(), and setBufferSourceUnknownVersion().
|
protected |
Referenced by RawDAQData().
|
protected |
Set BufferSource of the input DataFormat and return pointer to the position right after the end of its buffer.
Definition at line 888 of file RawDAQData.cpp.
References PRINT_ON_DEBUG, setBufferSource(), and sizeofdata().
|
protected |
First, figure out version
Now, set Function pointers accordingly
Now, execute setBuffer Source
Definition at line 896 of file RawDAQData.cpp.
References _version, figureOutTheVersion(), RETURN_FUNCTION, setBufferSource(), and setFunctionPointers().
Referenced by RawDAQData().
|
protectedpure virtual |
Function where we set all function pointers. At this point we don't know it It is to be derived in the final user readable class
Implemented in daqdataformats::RawMilliSliceHeader, daqdataformats::RawMicroSlice, daqdataformats::RawMilliSlice, daqdataformats::RawMilliSliceIndex, daqdataformats::RawTimingMarker, daqdataformats::RawDCMChan, and daqdataformats::RawMilliSliceIndexHeader.
Referenced by copy(), defaultConstructorFloatingSize(), readDataUnknownVersion(), and setBufferSourceUnknownVersion().
|
protected |
Definition at line 937 of file RawDAQData.cpp.
References DELEGATE, EXECUTE_GENERAL_FUNCTION, and getLoAndHi().
uint32_t daqdataformats::RawDAQData::sizeofdata | ( | ) | const |
Sizeof method for the current data block. Returns the size of the data block in 32bit words.
Definition at line 990 of file RawDAQData.cpp.
References RETURN_FUNCTION.
Referenced by addCheckSum(), calculateCheckSum(), clear(), defaultConstructorFloatingSize(), printBuffer(), printGeneral(), readData(), readDataGeneral(), readDataUnknownVersion(), daqdataformats::RawDAQDataUnitTest::resizeBufferToSizeOfDataFormats(), setBufferSourceGeneral(), writeData(), and mcdatadaq::Configuration::writeToFile().
|
protected |
Referenced by RawDAQData().
|
inlineprotected |
Definition at line 191 of file RawDAQData.h.
References cols, om::cout, gen_hdf5record::size, and string.
Write Data to target memory location. Return is the address of the end of the write. NULL on error.
General write method that writes the raw formated data block to the target memory We are not going to overload it, so no need to declare virtual
Loop over words of the buffer
Definition at line 302 of file RawDAQData.cpp.
References EXECUTE_FUNCTION, MECModelEnuComparisons::i, RAWBUFF32, and sizeofdata().
ssize_t daqdataformats::RawDAQData::writeData | ( | const int | fd | ) | const |
Write Data to target file descriptor. Return is the number of bytes written. -1 on error.
Definition at line 320 of file RawDAQData.cpp.
References _Buffer, EXECUTE_FUNCTION, sizeofdata(), and pclistAnalyser::write.
|
friend |
Definition at line 303 of file RawDAQData.h.
|
protected |
All data formats need to have _Buffer and a Data structure. _Buffer will be common.
The internal Buffer for each data format Generalized pointer to the buffer holding the packed data This pointer is used in performing generalized read/write calls and should be set during initialization
Definition at line 276 of file RawDAQData.h.
Referenced by calculateCheckSum(), copy(), defaultConstructorFloatingSize(), lastOperationsInDeepCopy(), printBuffer(), daqdataformats::RawMilliSlice::printStandard(), daqdataformats::RawMicroSlice::printStandard(), RawDAQData(), daqdataformats::RawMilliSlice::readData(), daqdataformats::RawMicroSlice::readData(), readData(), daqdataformats::RawMilliSlice::setBufferSource(), daqdataformats::RawMilliSliceIndex::setBufferSource(), daqdataformats::RawMicroSlice::setBufferSource(), setBufferSource(), and writeData().
|
protected |
The internal buffer to hold data. Not always needed. A data format may have an external buffer.
Definition at line 283 of file RawDAQData.h.
Referenced by addCheckSum(), addToInternalBuffer(), clear(), daqdataformats::RawMilliSlice::close(), copy(), defaultConstructorFloatingSize(), daqdataformats::RawMilliSlice::init(), printBuffer(), daqdataformats::RawMilliSlice::readData(), readDataGeneral(), reserveInternalBuffer(), resetBufferSource(), and resizeInternalBuffer().
|
protected |
Auxillary variable that holds whether the buffer should be external or internal.
Definition at line 286 of file RawDAQData.h.
Referenced by daqdataformats::RawMilliSliceIndex::addIndex(), checkBufferInternalness(), daqdataformats::RawMicroSlice::init(), RawDAQData(), daqdataformats::RawMicroSlice::readData(), daqdataformats::RawMilliSlice::setBufferSource(), daqdataformats::RawMilliSliceIndex::setBufferSource(), and daqdataformats::RawMicroSlice::setBufferSource().
|
protected |
DataFormat Version.
Definition at line 289 of file RawDAQData.h.
Referenced by copy(), defaultConstructorFloatingSize(), functionIsNotAllowed(), generateExceptionForWrongVersion(), RawDAQData(), readDataUnknownVersion(), and setBufferSourceUnknownVersion().