![]() |
Project
|
Reader for RAW TPC data. More...
#include <RawReaderCRU.h>
Classes | |
class | Error |
class | PacketDescriptor |
helper class to store packet positions inside the file More... | |
Public Types | |
using | PacketDescriptorMap = std::vector< PacketDescriptor > |
using | PacketDescriptorMapArray = std::array< PacketDescriptorMap, MaxNumberOfLinks > |
Public Member Functions | |
RawReaderCRU (const std::string_view inputFileName, uint32_t numTimeBins=0, uint32_t link=0, uint32_t stream=0, uint32_t debugLevel=0, uint32_t verbosity=0, const std::string_view outputFilePrefix="", uint32_t readerNumber=0) | |
int | scanFile () |
void | setLink (uint32_t link) |
void | setVerbosity (uint32_t verbosity=1) |
set verbosity level | |
void | setDebugLevel (uint32_t debugLevel=1) |
set debug level | |
void | setEventNumber (uint32_t eventNumber=0) |
set event number | |
void | setReaderNumber (uint32_t readerNumber) |
set the reader number in the manager | |
void | setFillADCdataMap (bool fill) |
set filling of ADC data map | |
bool | getFillADCdataMap () const |
get filling of ADC data map | |
uint32_t | getEventNumber () const |
get event number | |
size_t | getNumberOfEvents () const |
get number of events | |
bool | checkLinkPresent (uint32_t link) |
status bits of present links | |
int | processDataFile () |
process all data for the selected link reading single 8k packet from file | |
void | processLinkZS () |
process data in case of Link based zero suppression | |
void | processDataMemory () |
Collect data to memory and process data. | |
int | processPacket (GBTFrame &gFrame, uint32_t startPos, uint32_t size, ADCRawData &rawData) |
process single packet | |
int | processMemory (const std::vector< std::byte > &data, ADCRawData &rawData) |
void | processLinks (const uint32_t linkMask=0) |
process links | |
void | findSyncPositions () |
find sync positions for all links | |
bool | syncFoundForLink (const int link) const |
const std::map< PadPos, std::vector< uint16_t > > & | getADCMap () const |
return the ADC data map | |
void | clearMap () |
clear the ADC data map | |
const CRU & | getCRU () const |
return the CRU | |
void | forceCRU (int cru) |
for the CRU id | |
void | setManager (RawReaderCRUManager *manager) |
set the event sync | |
RawReaderCRUManager * | getManager () |
get manager | |
void | copyEvents (const std::vector< uint32_t > &eventNumbers, std::string outputDirectory, std::ios_base::openmode mode=std::ios_base::openmode(0)) |
copy single events to another file | |
void | writeGBTDataPerLink (std::string_view outputDirectory, int maxEvents=-1) |
write GBT data into separate files per link | |
void | runADCDataCallback (const ADCRawData &rawData) |
run a data filling callback function | |
void | setOutputFilePrefix (std::string_view prefix) |
set output file prefix | |
const std::string & | getOutputFilePrefix () const |
output file prefix | |
const PacketDescriptorMapArray & | getPacketDescriptorMaps () const |
get packet descriptor map array | |
std::ifstream & | getFileHandle () |
file handling | |
Static Public Member Functions | |
static void | processFile (const std::string_view inputFile, uint32_t timeBins=0, uint32_t linkMask=0, uint32_t stream=0, uint32_t debugLevel=0, uint32_t verbosity=0, const std::string_view outputFilePrefix="") |
Reader for RAW TPC data.
Definition at line 541 of file RawReaderCRU.h.
using o2::tpc::rawreader::RawReaderCRU::PacketDescriptorMap = std::vector<PacketDescriptor> |
Definition at line 545 of file RawReaderCRU.h.
using o2::tpc::rawreader::RawReaderCRU::PacketDescriptorMapArray = std::array<PacketDescriptorMap, MaxNumberOfLinks> |
Definition at line 546 of file RawReaderCRU.h.
|
inline |
|
inline |
status bits of present links
Definition at line 625 of file RawReaderCRU.h.
|
inline |
clear the ADC data map
Definition at line 667 of file RawReaderCRU.h.
void RawReaderCRU::copyEvents | ( | const std::vector< uint32_t > & | eventNumbers, |
std::string | outputDirectory, | ||
std::ios_base::openmode | mode = std::ios_base::openmode(0) |
||
) |
copy single events to another file
Definition at line 912 of file RawReaderCRU.cxx.
void RawReaderCRU::findSyncPositions | ( | ) |
find sync positions for all links
Definition at line 456 of file RawReaderCRU.cxx.
for the CRU id
Definition at line 673 of file RawReaderCRU.h.
|
inline |
return the ADC data map
Definition at line 664 of file RawReaderCRU.h.
|
inline |
return the CRU
Definition at line 670 of file RawReaderCRU.h.
|
inline |
get event number
Definition at line 619 of file RawReaderCRU.h.
|
inline |
file handling
Definition at line 704 of file RawReaderCRU.h.
|
inline |
get filling of ADC data map
Definition at line 616 of file RawReaderCRU.h.
|
inline |
get manager
Definition at line 683 of file RawReaderCRU.h.
size_t RawReaderCRU::getNumberOfEvents | ( | ) | const |
get number of events
Definition at line 597 of file RawReaderCRU.cxx.
|
inline |
output file prefix
Definition at line 698 of file RawReaderCRU.h.
|
inline |
get packet descriptor map array
Definition at line 701 of file RawReaderCRU.h.
int RawReaderCRU::processDataFile | ( | ) |
process all data for the selected link reading single 8k packet from file
Definition at line 665 of file RawReaderCRU.cxx.
void RawReaderCRU::processDataMemory | ( | ) |
Collect data to memory and process data.
Definition at line 737 of file RawReaderCRU.cxx.
|
static |
test function to process the data
inputFile | input file name |
linkMask | mask of links |
Definition at line 871 of file RawReaderCRU.cxx.
void RawReaderCRU::processLinks | ( | const uint32_t | linkMask = 0 | ) |
process links
Definition at line 821 of file RawReaderCRU.cxx.
void RawReaderCRU::processLinkZS | ( | ) |
process data in case of Link based zero suppression
Definition at line 795 of file RawReaderCRU.cxx.
int RawReaderCRU::processMemory | ( | const std::vector< std::byte > & | data, |
ADCRawData & | rawData | ||
) |
Process data from memory for a single link The data must be collected before, merged over 8k packets
Definition at line 543 of file RawReaderCRU.cxx.
int RawReaderCRU::processPacket | ( | GBTFrame & | gFrame, |
uint32_t | startPos, | ||
uint32_t | size, | ||
ADCRawData & | rawData | ||
) |
process single packet
Definition at line 512 of file RawReaderCRU.cxx.
void RawReaderCRU::runADCDataCallback | ( | const ADCRawData & | rawData | ) |
run a data filling callback function
Definition at line 632 of file RawReaderCRU.cxx.
int RawReaderCRU::scanFile | ( | ) |
scan file for RDH and packet positions
scanFile scans the input file and checks the data for the RawDataHeader (RDH). It assumes that the data is made of 8kB packages for the moment, so it doesn't take the information in the header into account. It also checks the link ID in the RDH link ID field and fills the mLinkPresent variable to indicate which links are present in the data file.
Definition at line 207 of file RawReaderCRU.cxx.
|
inline |
set debug level
Definition at line 604 of file RawReaderCRU.h.
|
inline |
set event number
Definition at line 607 of file RawReaderCRU.h.
|
inline |
set filling of ADC data map
Definition at line 613 of file RawReaderCRU.h.
|
inline |
set the present (global) link to be processed
link | present link |
Global link means the CRU link from 0-23, where 12-23
Definition at line 598 of file RawReaderCRU.h.
|
inline |
set the event sync
Definition at line 680 of file RawReaderCRU.h.
|
inline |
set output file prefix
Definition at line 695 of file RawReaderCRU.h.
|
inline |
set the reader number in the manager
Definition at line 610 of file RawReaderCRU.h.
|
inline |
set verbosity level
Definition at line 601 of file RawReaderCRU.h.
|
inline |
check if sync positions were found for a specific link
link | link to check |
Definition at line 651 of file RawReaderCRU.h.
write GBT data into separate files per link
Definition at line 951 of file RawReaderCRU.cxx.