Project
Loading...
Searching...
No Matches
o2::tpc::RawReader Class Reference

Reader for RAW TPC data. More...

#include <RawReader.h>

Classes

struct  EventInfo
 Data struct. More...
 
struct  Header
 Data header struct. More...
 

Public Member Functions

 RawReader (int region=-1, int link=-1, int run=-1, int sampaVersion=-1)
 
 RawReader (const RawReader &other)=default
 Copy constructor.
 
 ~RawReader ()=default
 Destructor.
 
int loadNextEvent ()
 
int loadNextEventNoWrap ()
 
int loadPreviousEvent ()
 
int loadPreviousEventNoWrap ()
 
bool loadEvent (int64_t event)
 
bool addInputFile (std::string infile)
 
bool addInputFile (const std::vector< std::string > *infiles)
 
bool addInputFile (int region, int link, int sampaVersion, std::string path, int run=-1)
 
int64_t getFirstEvent () const
 
int64_t getLastEvent () const
 
int64_t getNumberOfEvents () const
 
uint64_t getTimeStamp (short hf) const
 
std::shared_ptr< std::vector< uint16_t > > getData (const PadPos &padPos)
 
std::shared_ptr< std::vector< uint16_t > > getNextData (PadPos &padPos)
 
int getRegion () const
 
int getLink () const
 
int getEventNumber () const
 
int getRunNumber () const
 
short getSyncPos (short hf) const
 
void setUseRawInMode3 (bool useRaw)
 
void setApplyChannelMask (bool applyMask)
 
void setChannelMask (std::shared_ptr< CalDet< bool > > channelMask)
 
void setCheckAdcClock (bool checkAdc)
 
void setSampaVersion (int sampaVerson)
 
std::shared_ptr< std::vector< EventInfo > > getEventInfo (uint64_t event) const
 
void addEventSynchronizer (std::shared_ptr< RawReaderEventSync > eventSync)
 
std::shared_ptr< std::vector< std::tuple< short, short, short > > > getAdcError ()
 

Detailed Description

Reader for RAW TPC data.

Author
Sebastian Klewin (Sebas.nosp@m.tian.nosp@m..Klew.nosp@m.in@c.nosp@m.ern.c.nosp@m.h)

Definition at line 37 of file RawReader.h.

Constructor & Destructor Documentation

◆ RawReader() [1/2]

RawReader::RawReader ( int  region = -1,
int  link = -1,
int  run = -1,
int  sampaVersion = -1 
)

Default constructor

Parameters
regionRegion of the data
linkFEC of the data
runRUN number of the data
sampaVersionVersion of SAMPA chips, -1 is latest

Definition at line 30 of file RawReader.cxx.

◆ RawReader() [2/2]

o2::tpc::RawReader::RawReader ( const RawReader other)
default

Copy constructor.

◆ ~RawReader()

o2::tpc::RawReader::~RawReader ( )
default

Destructor.

Member Function Documentation

◆ addEventSynchronizer()

void o2::tpc::RawReader::addEventSynchronizer ( std::shared_ptr< RawReaderEventSync eventSync)
inline

Add Event Synchronizer

Parameters
eventSyncSynchronizer instance

Definition at line 199 of file RawReader.h.

◆ addInputFile() [1/3]

bool RawReader::addInputFile ( const std::vector< std::string > *  infiles)

Add several input files for decoding

Parameters
infilesVector of input file strings, each formatted as "path_to_file:#region:#fec[:sampaVersion]", where
Returns
True if at least one string has correct format and file can be opened

Definition at line 51 of file RawReader.cxx.

◆ addInputFile() [2/3]

bool RawReader::addInputFile ( int  region,
int  link,
int  sampaVersion,
std::string  path,
int  run = -1 
)

Add input file for decoding

Parameters
regionRegion of the data
linkFEC of the data
sampaVersionVersion of SAMPA chip
pathPath to data
runRun number
Returns
True file can be opened

Definition at line 107 of file RawReader.cxx.

◆ addInputFile() [3/3]

bool RawReader::addInputFile ( std::string  infile)

Add input file for decoding

Parameters
infileInput file string in the format "path_to_file:#region:#fec[:sampaVersion]", where
Returns
True if string has correct format and file can be opened

Definition at line 61 of file RawReader.cxx.

◆ getAdcError()

std::shared_ptr< std::vector< std::tuple< short, short, short > > > o2::tpc::RawReader::getAdcError ( )
inline

Returns the result of the ADC clock check for the last loaded event

Returns
shared pointer to the clock check results. The tuples consist of the SAMPA ID, index in data stream and sync pattern position

Definition at line 203 of file RawReader.h.

◆ getData()

std::shared_ptr< std::vector< uint16_t > > o2::tpc::RawReader::getData ( const PadPos padPos)
inline

Get data

Parameters
padPoslocal pad position (row starts with 0 in each region)
Returns
shared pointer to data vector, each element is one time bin

Definition at line 239 of file RawReader.h.

◆ getEventInfo()

std::shared_ptr< std::vector< RawReader::EventInfo > > o2::tpc::RawReader::getEventInfo ( uint64_t  event) const
inline

Returns some information about the event, e.g. the header

Parameters
eventEvent number
Returns
shared pointer to vector with event informations

Definition at line 229 of file RawReader.h.

◆ getEventNumber()

int o2::tpc::RawReader::getEventNumber ( ) const
inline

Definition at line 170 of file RawReader.h.

◆ getFirstEvent()

int64_t o2::tpc::RawReader::getFirstEvent ( ) const
inline

Get the first event

Returns
Event number of first event in data

Definition at line 143 of file RawReader.h.

◆ getLastEvent()

int64_t o2::tpc::RawReader::getLastEvent ( ) const
inline

Get the last event

Returns
Event number of last event in data

Definition at line 147 of file RawReader.h.

◆ getLink()

int o2::tpc::RawReader::getLink ( ) const
inline

Definition at line 169 of file RawReader.h.

◆ getNextData()

std::shared_ptr< std::vector< uint16_t > > o2::tpc::RawReader::getNextData ( PadPos padPos)
inline

Get data of next pad position

Parameters
padPoslocal pad position (row starts with 0 in each region)
Returns
shared pointer to data vector, each element is one time bin

Definition at line 249 of file RawReader.h.

◆ getNumberOfEvents()

int64_t o2::tpc::RawReader::getNumberOfEvents ( ) const
inline

Get number of events

Returns
If events are continuous, it's the number of stored events

Definition at line 151 of file RawReader.h.

◆ getRegion()

int o2::tpc::RawReader::getRegion ( ) const
inline

Definition at line 168 of file RawReader.h.

◆ getRunNumber()

int o2::tpc::RawReader::getRunNumber ( ) const
inline

Definition at line 171 of file RawReader.h.

◆ getSyncPos()

short o2::tpc::RawReader::getSyncPos ( short  hf) const
inline

Definition at line 172 of file RawReader.h.

◆ getTimeStamp()

uint64_t o2::tpc::RawReader::getTimeStamp ( short  hf) const
inline

Get time stamp of first data

Parameters
hfhalf SAMPA
Returns
Time stamp of first decoded ADC value

Definition at line 156 of file RawReader.h.

◆ loadEvent()

bool RawReader::loadEvent ( int64_t  event)

Reads (and decodes) given event

Parameters
eventEvent number to read
Returns
Indicator of success

Definition at line 189 of file RawReader.cxx.

◆ loadNextEvent()

int o2::tpc::RawReader::loadNextEvent ( )
inline

Reads (and decodes) the next event, starts again with event 0 after last one

Returns
loaded event number

Definition at line 260 of file RawReader.h.

◆ loadNextEventNoWrap()

int o2::tpc::RawReader::loadNextEventNoWrap ( )
inline

Reads (and decodes) the next event

Returns
loaded event number, -1 after last event

Definition at line 313 of file RawReader.h.

◆ loadPreviousEvent()

int o2::tpc::RawReader::loadPreviousEvent ( )
inline

Reads (and decodes) the previous event, starts again with last one after event 0

Returns
loaded event number

Definition at line 286 of file RawReader.h.

◆ loadPreviousEventNoWrap()

int o2::tpc::RawReader::loadPreviousEventNoWrap ( )
inline

Reads (and decodes) the previous event

Returns
loaded event number, -1 after first event

Definition at line 335 of file RawReader.h.

◆ setApplyChannelMask()

void o2::tpc::RawReader::setApplyChannelMask ( bool  applyMask)
inline

Apply a channel mask

Parameters
applyMaskThe channel mask set via setChannelMask() is applied

Definition at line 180 of file RawReader.h.

◆ setChannelMask()

void o2::tpc::RawReader::setChannelMask ( std::shared_ptr< CalDet< bool > >  channelMask)
inline

Set a channel mask

Parameters
channelMaskPointer to a existing mask, is applied only if enable flag is set

Definition at line 184 of file RawReader.h.

◆ setCheckAdcClock()

void o2::tpc::RawReader::setCheckAdcClock ( bool  checkAdc)
inline

Does the ADC clock check

Parameters
checkAdcChecks for a valid ADC clock in the data stream

Definition at line 188 of file RawReader.h.

◆ setSampaVersion()

void o2::tpc::RawReader::setSampaVersion ( int  sampaVerson)
inline

Set the SAMPA version

Parameters
sampaVersionVersion to be set

Definition at line 191 of file RawReader.h.

◆ setUseRawInMode3()

void o2::tpc::RawReader::setUseRawInMode3 ( bool  useRaw)
inline

Set type of decoding for data in readout mode 3

Parameters
useRawIf true, raw GBT frames are decoded, if false, pre-decoded data is used

Definition at line 176 of file RawReader.h.


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