Project
Loading...
Searching...
No Matches
o2::tpc::rawreader::RawReaderCRU Class Reference

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 CRUgetCRU () const
 return the CRU
 
void forceCRU (int cru)
 for the CRU id
 
void setManager (RawReaderCRUManager *manager)
 set the event sync
 
RawReaderCRUManagergetManager ()
 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 PacketDescriptorMapArraygetPacketDescriptorMaps () 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="")
 

Detailed Description

Member Typedef Documentation

◆ PacketDescriptorMap

◆ PacketDescriptorMapArray

Definition at line 546 of file RawReaderCRU.h.

Constructor & Destructor Documentation

◆ RawReaderCRU()

o2::tpc::rawreader::RawReaderCRU::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 
)
inline

constructor

Parameters

Definition at line 550 of file RawReaderCRU.h.

Member Function Documentation

◆ checkLinkPresent()

bool o2::tpc::rawreader::RawReaderCRU::checkLinkPresent ( uint32_t  link)
inline

status bits of present links

Definition at line 625 of file RawReaderCRU.h.

◆ clearMap()

void o2::tpc::rawreader::RawReaderCRU::clearMap ( )
inline

clear the ADC data map

Definition at line 667 of file RawReaderCRU.h.

◆ copyEvents()

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.

◆ findSyncPositions()

void RawReaderCRU::findSyncPositions ( )

find sync positions for all links

Definition at line 456 of file RawReaderCRU.cxx.

◆ forceCRU()

void o2::tpc::rawreader::RawReaderCRU::forceCRU ( int  cru)
inline

for the CRU id

Definition at line 673 of file RawReaderCRU.h.

◆ getADCMap()

const std::map< PadPos, std::vector< uint16_t > > & o2::tpc::rawreader::RawReaderCRU::getADCMap ( ) const
inline

return the ADC data map

Definition at line 664 of file RawReaderCRU.h.

◆ getCRU()

const CRU & o2::tpc::rawreader::RawReaderCRU::getCRU ( ) const
inline

return the CRU

Definition at line 670 of file RawReaderCRU.h.

◆ getEventNumber()

uint32_t o2::tpc::rawreader::RawReaderCRU::getEventNumber ( ) const
inline

get event number

Definition at line 619 of file RawReaderCRU.h.

◆ getFileHandle()

std::ifstream & o2::tpc::rawreader::RawReaderCRU::getFileHandle ( )
inline

file handling

Definition at line 704 of file RawReaderCRU.h.

◆ getFillADCdataMap()

bool o2::tpc::rawreader::RawReaderCRU::getFillADCdataMap ( ) const
inline

get filling of ADC data map

Definition at line 616 of file RawReaderCRU.h.

◆ getManager()

RawReaderCRUManager * o2::tpc::rawreader::RawReaderCRU::getManager ( )
inline

get manager

Definition at line 683 of file RawReaderCRU.h.

◆ getNumberOfEvents()

size_t RawReaderCRU::getNumberOfEvents ( ) const

get number of events

Definition at line 597 of file RawReaderCRU.cxx.

◆ getOutputFilePrefix()

const std::string & o2::tpc::rawreader::RawReaderCRU::getOutputFilePrefix ( ) const
inline

output file prefix

Definition at line 698 of file RawReaderCRU.h.

◆ getPacketDescriptorMaps()

const PacketDescriptorMapArray & o2::tpc::rawreader::RawReaderCRU::getPacketDescriptorMaps ( ) const
inline

get packet descriptor map array

Definition at line 701 of file RawReaderCRU.h.

◆ processDataFile()

int RawReaderCRU::processDataFile ( )

process all data for the selected link reading single 8k packet from file

Definition at line 665 of file RawReaderCRU.cxx.

◆ processDataMemory()

void RawReaderCRU::processDataMemory ( )

Collect data to memory and process data.

Definition at line 737 of file RawReaderCRU.cxx.

◆ processFile()

void RawReaderCRU::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 = "" 
)
static

test function to process the data

Parameters
inputFileinput file name
linkMaskmask of links

Definition at line 871 of file RawReaderCRU.cxx.

◆ processLinks()

void RawReaderCRU::processLinks ( const uint32_t  linkMask = 0)

process links

Definition at line 821 of file RawReaderCRU.cxx.

◆ processLinkZS()

void RawReaderCRU::processLinkZS ( )

process data in case of Link based zero suppression

Definition at line 795 of file RawReaderCRU.cxx.

◆ processMemory()

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.

◆ processPacket()

int RawReaderCRU::processPacket ( GBTFrame gFrame,
uint32_t  startPos,
uint32_t  size,
ADCRawData rawData 
)

process single packet

Definition at line 512 of file RawReaderCRU.cxx.

◆ runADCDataCallback()

void RawReaderCRU::runADCDataCallback ( const ADCRawData rawData)

run a data filling callback function

Definition at line 632 of file RawReaderCRU.cxx.

◆ scanFile()

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.

◆ setDebugLevel()

void o2::tpc::rawreader::RawReaderCRU::setDebugLevel ( uint32_t  debugLevel = 1)
inline

set debug level

Definition at line 604 of file RawReaderCRU.h.

◆ setEventNumber()

void o2::tpc::rawreader::RawReaderCRU::setEventNumber ( uint32_t  eventNumber = 0)
inline

set event number

Definition at line 607 of file RawReaderCRU.h.

◆ setFillADCdataMap()

void o2::tpc::rawreader::RawReaderCRU::setFillADCdataMap ( bool  fill)
inline

set filling of ADC data map

Definition at line 613 of file RawReaderCRU.h.

◆ setLink()

void o2::tpc::rawreader::RawReaderCRU::setLink ( uint32_t  link)
inline

set the present (global) link to be processed

Parameters
linkpresent link

Global link means the CRU link from 0-23, where 12-23

Definition at line 598 of file RawReaderCRU.h.

◆ setManager()

void o2::tpc::rawreader::RawReaderCRU::setManager ( RawReaderCRUManager manager)
inline

set the event sync

Definition at line 680 of file RawReaderCRU.h.

◆ setOutputFilePrefix()

void o2::tpc::rawreader::RawReaderCRU::setOutputFilePrefix ( std::string_view  prefix)
inline

set output file prefix

Definition at line 695 of file RawReaderCRU.h.

◆ setReaderNumber()

void o2::tpc::rawreader::RawReaderCRU::setReaderNumber ( uint32_t  readerNumber)
inline

set the reader number in the manager

Definition at line 610 of file RawReaderCRU.h.

◆ setVerbosity()

void o2::tpc::rawreader::RawReaderCRU::setVerbosity ( uint32_t  verbosity = 1)
inline

set verbosity level

Definition at line 601 of file RawReaderCRU.h.

◆ syncFoundForLink()

bool o2::tpc::rawreader::RawReaderCRU::syncFoundForLink ( const int  link) const
inline

check if sync positions were found for a specific link

Parameters
linklink to check

Definition at line 651 of file RawReaderCRU.h.

◆ writeGBTDataPerLink()

void RawReaderCRU::writeGBTDataPerLink ( std::string_view  outputDirectory,
int  maxEvents = -1 
)

write GBT data into separate files per link

Definition at line 951 of file RawReaderCRU.cxx.


The documentation for this class was generated from the following files: