Project
Loading...
Searching...
No Matches
o2::raw::RawFileReader Class Reference

#include <RawFileReader.h>

Classes

struct  LinkBlock
 
struct  LinkData
 
struct  PartStat
 

Public Types

enum  ReadoutCardType { CRU , RORC }
 
enum  ErrTypes {
  ErrWrongPacketCounterIncrement , ErrWrongPageCounterIncrement , ErrHBFStopOnFirstPage , ErrHBFNoStop ,
  ErrWrongFirstPage , ErrWrongHBFsPerTF , ErrWrongNumberOfTF , ErrHBFJump ,
  ErrNoSuperPageForTF , ErrNoSOX , ErrMismatchTF , NErrorsDefined
}
 
enum class  FirstTFDetection : int { Disabled , Pending , Done }
 
using RDHAny = header::RDHAny
 
using RDH = o2::header::RAWDataHeader
 
using OrigDescCard = std::tuple< o2::header::DataOrigin, o2::header::DataDescription, ReadoutCardType >
 
using InputsMap = std::map< OrigDescCard, std::vector< std::string > >
 

Public Member Functions

 RawFileReader (const std::string &config="", int verbosity=0, size_t buffsize=50 *1024UL, const std::string &onlyDet={})
 
 ~RawFileReader ()
 
void loadFromInputsMap (const InputsMap &inp)
 
bool init ()
 
void clear ()
 
bool addFile (const std::string &sname, o2::header::DataOrigin origin, o2::header::DataDescription desc, ReadoutCardType t=CRU)
 
bool addFile (const std::string &sname)
 
void setDefaultReadoutCardType (ReadoutCardType t=CRU)
 
void setDefaultDataOrigin (const std::string &orig)
 
void setDefaultDataDescription (const std::string &desc)
 
void setDefaultDataOrigin (const o2::header::DataOrigin o)
 
void setDefaultDataDescription (const o2::header::DataDescription d)
 
int getNLinks () const
 
int getNFiles () const
 
uint32_t getNextTFToRead () const
 
void setNextTFToRead (uint32_t tf)
 
const std::vector< int > & getLinksOrder () const
 
const LinkDatagetLink (int i) const
 
const LinkDatagetLinkWithSpec (LinkSpec_t s) const
 
LinkDatagetLink (int i)
 
LinkSubSpec_t getLinkSubSpec (int i) const
 
LinkSpec_t getLinkSpec (int i) const
 
void printStat (bool verbose=false) const
 
void setVerbosity (int v=1)
 
void setCheckErrors (uint32_t m=0xffffffff)
 
int getVerbosity () const
 
uint32_t getCheckErrors () const
 
bool isProcessingStopped () const
 
void setNominalSPageSize (int n=0x1<< 20)
 
int getNominalSPageSize () const
 
void setBufferSize (size_t s)
 
size_t getBufferSize () const
 
void setMaxTFToRead (uint32_t n)
 
bool isEmpty () const
 
uint32_t getMaxTFToRead () const
 
uint32_t getNTimeFrames () const
 
uint32_t getOrbitMin () const
 
uint32_t getOrbitMax () const
 
bool getCacheData () const
 
void setCacheData (bool v)
 
o2::header::DataOrigin getDefaultDataOrigin () const
 
o2::header::DataDescription getDefaultDataSpecification () const
 
ReadoutCardType getDefaultReadoutCardType () const
 
void imposeFirstTF (uint32_t orbit)
 
void setTFAutodetect (FirstTFDetection v)
 
void setPreferCalculatedTFStart (bool v)
 
FirstTFDetection getTFAutodetect () const
 
void setIROfSOX (const o2::InteractionRecord &ir)
 

Static Public Member Functions

static o2::header::DataOrigin getDataOrigin (const std::string &ors)
 
static o2::header::DataDescription getDataDescription (const std::string &ors)
 
static InputsMap parseInput (const std::string &confUri, const std::string &onlyDet={}, bool verbose=false)
 
static std::string nochk_opt (ErrTypes e)
 
static std::string nochk_expl (ErrTypes e)
 

Static Public Attributes

static constexpr std::string_view CardNames [] = {"CRU", "RORC"}
 
static constexpr std::string_view ErrNames []
 
static constexpr std::string_view ErrNamesShort []
 
static constexpr bool ErrCheckDefaults []
 

Detailed Description

Definition at line 62 of file RawFileReader.h.

Member Typedef Documentation

◆ InputsMap

using o2::raw::RawFileReader::InputsMap = std::map<OrigDescCard, std::vector<std::string> >

Definition at line 135 of file RawFileReader.h.

◆ OrigDescCard

◆ RDH

◆ RDHAny

Member Enumeration Documentation

◆ ErrTypes

Enumerator
ErrWrongPacketCounterIncrement 
ErrWrongPageCounterIncrement 
ErrHBFStopOnFirstPage 
ErrHBFNoStop 
ErrWrongFirstPage 
ErrWrongHBFsPerTF 
ErrWrongNumberOfTF 
ErrHBFJump 
ErrNoSuperPageForTF 
ErrNoSOX 
ErrMismatchTF 
NErrorsDefined 

Definition at line 71 of file RawFileReader.h.

◆ FirstTFDetection

Enumerator
Disabled 
Pending 
Done 

Definition at line 85 of file RawFileReader.h.

◆ ReadoutCardType

Enumerator
CRU 
RORC 

Definition at line 67 of file RawFileReader.h.

Constructor & Destructor Documentation

◆ RawFileReader()

RawFileReader::RawFileReader ( const std::string &  config = "",
int  verbosity = 0,
size_t  buffsize = 50 * 1024UL,
const std::string &  onlyDet = {} 
)

Definition at line 542 of file RawFileReader.cxx.

◆ ~RawFileReader()

o2::raw::RawFileReader::~RawFileReader ( )
inline

Definition at line 226 of file RawFileReader.h.

Member Function Documentation

◆ addFile() [1/2]

bool o2::raw::RawFileReader::addFile ( const std::string &  sname)
inline

Definition at line 232 of file RawFileReader.h.

◆ addFile() [2/2]

bool RawFileReader::addFile ( const std::string &  sname,
o2::header::DataOrigin  origin,
o2::header::DataDescription  desc,
ReadoutCardType  t = CRU 
)

Definition at line 677 of file RawFileReader.cxx.

◆ clear()

void RawFileReader::clear ( )

Definition at line 660 of file RawFileReader.cxx.

◆ getBufferSize()

size_t o2::raw::RawFileReader::getBufferSize ( ) const
inline

Definition at line 263 of file RawFileReader.h.

◆ getCacheData()

bool o2::raw::RawFileReader::getCacheData ( ) const
inline

Definition at line 272 of file RawFileReader.h.

◆ getCheckErrors()

uint32_t o2::raw::RawFileReader::getCheckErrors ( ) const
inline

Definition at line 256 of file RawFileReader.h.

◆ getDataDescription()

o2h::DataDescription RawFileReader::getDataDescription ( const std::string &  ors)
static

Definition at line 810 of file RawFileReader.cxx.

◆ getDataOrigin()

o2h::DataOrigin RawFileReader::getDataOrigin ( const std::string &  ors)
static

Definition at line 792 of file RawFileReader.cxx.

◆ getDefaultDataOrigin()

o2::header::DataOrigin o2::raw::RawFileReader::getDefaultDataOrigin ( ) const
inline

Definition at line 275 of file RawFileReader.h.

◆ getDefaultDataSpecification()

o2::header::DataDescription o2::raw::RawFileReader::getDefaultDataSpecification ( ) const
inline

Definition at line 276 of file RawFileReader.h.

◆ getDefaultReadoutCardType()

ReadoutCardType o2::raw::RawFileReader::getDefaultReadoutCardType ( ) const
inline

Definition at line 277 of file RawFileReader.h.

◆ getLink() [1/2]

LinkData & o2::raw::RawFileReader::getLink ( int  i)
inline

Definition at line 247 of file RawFileReader.h.

◆ getLink() [2/2]

const LinkData & o2::raw::RawFileReader::getLink ( int  i) const
inline

Definition at line 245 of file RawFileReader.h.

◆ getLinksOrder()

const std::vector< int > & o2::raw::RawFileReader::getLinksOrder ( ) const
inline

Definition at line 244 of file RawFileReader.h.

◆ getLinkSpec()

LinkSpec_t o2::raw::RawFileReader::getLinkSpec ( int  i) const
inline

Definition at line 249 of file RawFileReader.h.

◆ getLinkSubSpec()

LinkSubSpec_t o2::raw::RawFileReader::getLinkSubSpec ( int  i) const
inline

Definition at line 248 of file RawFileReader.h.

◆ getLinkWithSpec()

const LinkData & o2::raw::RawFileReader::getLinkWithSpec ( LinkSpec_t  s) const
inline

Definition at line 246 of file RawFileReader.h.

◆ getMaxTFToRead()

uint32_t o2::raw::RawFileReader::getMaxTFToRead ( ) const
inline

Definition at line 267 of file RawFileReader.h.

◆ getNextTFToRead()

uint32_t o2::raw::RawFileReader::getNextTFToRead ( ) const
inline

Definition at line 241 of file RawFileReader.h.

◆ getNFiles()

int o2::raw::RawFileReader::getNFiles ( ) const
inline

Definition at line 239 of file RawFileReader.h.

◆ getNLinks()

int o2::raw::RawFileReader::getNLinks ( ) const
inline

Definition at line 238 of file RawFileReader.h.

◆ getNominalSPageSize()

int o2::raw::RawFileReader::getNominalSPageSize ( ) const
inline

Definition at line 260 of file RawFileReader.h.

◆ getNTimeFrames()

uint32_t o2::raw::RawFileReader::getNTimeFrames ( ) const
inline

Definition at line 268 of file RawFileReader.h.

◆ getOrbitMax()

uint32_t o2::raw::RawFileReader::getOrbitMax ( ) const
inline

Definition at line 270 of file RawFileReader.h.

◆ getOrbitMin()

uint32_t o2::raw::RawFileReader::getOrbitMin ( ) const
inline

Definition at line 269 of file RawFileReader.h.

◆ getTFAutodetect()

FirstTFDetection o2::raw::RawFileReader::getTFAutodetect ( ) const
inline

Definition at line 282 of file RawFileReader.h.

◆ getVerbosity()

int o2::raw::RawFileReader::getVerbosity ( ) const
inline

Definition at line 255 of file RawFileReader.h.

◆ imposeFirstTF()

void RawFileReader::imposeFirstTF ( uint32_t  orbit)

Definition at line 947 of file RawFileReader.cxx.

◆ init()

bool RawFileReader::init ( )

Definition at line 712 of file RawFileReader.cxx.

◆ isEmpty()

bool o2::raw::RawFileReader::isEmpty ( ) const
inline

Definition at line 266 of file RawFileReader.h.

◆ isProcessingStopped()

bool o2::raw::RawFileReader::isProcessingStopped ( ) const
inline

Definition at line 257 of file RawFileReader.h.

◆ loadFromInputsMap()

void RawFileReader::loadFromInputsMap ( const InputsMap inp)

Definition at line 826 of file RawFileReader.cxx.

◆ nochk_expl()

std::string RawFileReader::nochk_expl ( RawFileReader::ErrTypes  e)
static

Definition at line 965 of file RawFileReader.cxx.

◆ nochk_opt()

std::string RawFileReader::nochk_opt ( RawFileReader::ErrTypes  e)
static

Definition at line 959 of file RawFileReader.cxx.

◆ parseInput()

RawFileReader::InputsMap RawFileReader::parseInput ( const std::string &  confUri,
const std::string &  onlyDet = {},
bool  verbose = false 
)
static

Definition at line 847 of file RawFileReader.cxx.

◆ printStat()

void RawFileReader::printStat ( bool  verbose = false) const

Definition at line 648 of file RawFileReader.cxx.

◆ setBufferSize()

void o2::raw::RawFileReader::setBufferSize ( size_t  s)
inline

Definition at line 262 of file RawFileReader.h.

◆ setCacheData()

void o2::raw::RawFileReader::setCacheData ( bool  v)
inline

Definition at line 273 of file RawFileReader.h.

◆ setCheckErrors()

void o2::raw::RawFileReader::setCheckErrors ( uint32_t  m = 0xffffffff)
inline

Definition at line 254 of file RawFileReader.h.

◆ setDefaultDataDescription() [1/2]

void o2::raw::RawFileReader::setDefaultDataDescription ( const o2::header::DataDescription  d)
inline

Definition at line 237 of file RawFileReader.h.

◆ setDefaultDataDescription() [2/2]

void o2::raw::RawFileReader::setDefaultDataDescription ( const std::string &  desc)
inline

Definition at line 235 of file RawFileReader.h.

◆ setDefaultDataOrigin() [1/2]

void o2::raw::RawFileReader::setDefaultDataOrigin ( const o2::header::DataOrigin  o)
inline

Definition at line 236 of file RawFileReader.h.

◆ setDefaultDataOrigin() [2/2]

void o2::raw::RawFileReader::setDefaultDataOrigin ( const std::string &  orig)
inline

Definition at line 234 of file RawFileReader.h.

◆ setDefaultReadoutCardType()

void o2::raw::RawFileReader::setDefaultReadoutCardType ( ReadoutCardType  t = CRU)
inline

Definition at line 233 of file RawFileReader.h.

◆ setIROfSOX()

void o2::raw::RawFileReader::setIROfSOX ( const o2::InteractionRecord ir)

◆ setMaxTFToRead()

void o2::raw::RawFileReader::setMaxTFToRead ( uint32_t  n)
inline

Definition at line 265 of file RawFileReader.h.

◆ setNextTFToRead()

void o2::raw::RawFileReader::setNextTFToRead ( uint32_t  tf)
inline

Definition at line 242 of file RawFileReader.h.

◆ setNominalSPageSize()

void o2::raw::RawFileReader::setNominalSPageSize ( int  n = 0x1 << 20)
inline

Definition at line 259 of file RawFileReader.h.

◆ setPreferCalculatedTFStart()

void o2::raw::RawFileReader::setPreferCalculatedTFStart ( bool  v)
inline

Definition at line 281 of file RawFileReader.h.

◆ setTFAutodetect()

void o2::raw::RawFileReader::setTFAutodetect ( FirstTFDetection  v)
inline

Definition at line 280 of file RawFileReader.h.

◆ setVerbosity()

void o2::raw::RawFileReader::setVerbosity ( int  v = 1)
inline

Definition at line 253 of file RawFileReader.h.

Member Data Documentation

◆ CardNames

constexpr std::string_view o2::raw::RawFileReader::CardNames[] = {"CRU", "RORC"}
staticconstexpr

Definition at line 69 of file RawFileReader.h.

◆ ErrCheckDefaults

constexpr bool o2::raw::RawFileReader::ErrCheckDefaults[]
staticconstexpr
Initial value:
= {
true,
true,
false,
true,
true,
true,
true,
true,
false,
false,
true,
}

Definition at line 117 of file RawFileReader.h.

◆ ErrNames

constexpr std::string_view o2::raw::RawFileReader::ErrNames[]
staticconstexpr
Initial value:
= {
"Wrong RDH.packetCounter increment",
"Wrong RDH.pageCnt increment",
"RDH.stop set of 1st HBF page",
"New HBF starts w/o closing old one",
"Data does not start with TF/HBF",
"Number of HBFs per TF not as expected",
"Number of TFs is less than expected",
"Wrong HBF orbit increment",
"TF does not start by new superpage",
"No SOX found on 1st page",
"Mismatch between flagged and calculated new TF start"
}

Definition at line 89 of file RawFileReader.h.

◆ ErrNamesShort

constexpr std::string_view o2::raw::RawFileReader::ErrNamesShort[]
staticconstexpr
Initial value:
= {
"packet-increment",
"page-increment",
"stop-on-page0",
"missing-stop",
"starts-with-tf",
"hbf-per-tf",
"tf-per-link",
"hbf-jump",
"no-spage-for-tf",
"no-sox",
"tf-start-mismatch"
}

Definition at line 103 of file RawFileReader.h.


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