CbmRoot
CbmMQTsaMultiSampler Class Reference

#include <CbmMQTsaMultiSampler.h>

Inheritance diagram for CbmMQTsaMultiSampler:
[legend]
Collaboration diagram for CbmMQTsaMultiSampler:
[legend]

Public Member Functions

 CbmMQTsaMultiSampler ()
 
virtual ~CbmMQTsaMultiSampler ()
 

Protected Member Functions

virtual void InitTask ()
 
virtual bool ConditionalRun ()
 

Protected Attributes

uint64_t fMaxTimeslices
 
std::string fFileName
 
std::string fDirName
 
std::vector< std::string > fInputFileList
 List of input files. More...
 
uint64_t fFileCounter
 
std::string fHost
 
uint64_t fPort
 
uint64_t fHighWaterMark
 
bool fbNoSplitTs = false
 
bool fbSendTsPerSysId = false
 
bool fbSendTsPerChannel = false
 
uint64_t fuPrevTsIndex = 0
 
uint64_t fTSCounter
 
uint64_t fMessageCounter
 
int fMaxMemory = 0
 

Private Member Functions

bool OpenNextFile ()
 
bool CheckTimeslice (const fles::Timeslice &ts)
 
void PrintMicroSliceDescriptor (const fles::MicrosliceDescriptor &mdsc)
 
bool SendData (const fles::StorableTimeslice &component)
 
void CalcRuntime ()
 
bool IsChannelNameAllowed (std::string)
 
bool CreateAndSendComponent (const fles::Timeslice &, int)
 
bool CreateAndCombineComponentsPerSysId (const fles::Timeslice &)
 
bool CreateAndCombineComponentsPerChannel (const fles::Timeslice &)
 
bool CreateAndSendFullTs (const fles::Timeslice &)
 
bool SendData (const fles::StorableTimeslice &, int)
 
bool SendData (const fles::StorableTimeslice &, std::string)
 
bool SendMissedTsIdx (std::vector< uint64_t > vIndices)
 
bool SendCommand (std::string sCommand)
 

Private Attributes

fles::TimesliceSource * fSource
 
std::chrono::steady_clock::time_point fTime
 
std::vector< std::string > fAllowedChannels
 
std::vector< int > fSysId = {0x10, 0x30, 0x40, 0x50, 0x60, 0x90}
 
std::vector< int > fComponentsToSend = {0, 0, 0, 0, 0, 0}
 
std::vector< std::vector< std::string > > fChannelsToSend
 
bool fbListCompPerSysIdReady = false
 
std::vector< std::vector< uint32_t > > fvvCompPerSysId = {{}, {}, {}, {}, {}, {}}
 
bool fbListCompPerChannelReady = false
 
std::vector< std::string > fvChannelsToSend = {}
 
std::vector< std::vector< uint32_t > > fvvCompPerChannel = {}
 
std::string fsChannelNameMissedTs = ""
 
std::string fsChannelNameCommands = ""
 

Detailed Description

CbmMQTsaSampler.h

Since
2017-11-17
Author
F. Uhlig

Definition at line 23 of file CbmMQTsaMultiSampler.h.

Constructor & Destructor Documentation

◆ CbmMQTsaMultiSampler()

CbmMQTsaMultiSampler::CbmMQTsaMultiSampler ( )

Definition at line 48 of file CbmMQTsaMultiSampler.cxx.

◆ ~CbmMQTsaMultiSampler()

CbmMQTsaMultiSampler::~CbmMQTsaMultiSampler ( )
virtual

Definition at line 916 of file CbmMQTsaMultiSampler.cxx.

Member Function Documentation

◆ CalcRuntime()

void CbmMQTsaMultiSampler::CalcRuntime ( )
private

Definition at line 918 of file CbmMQTsaMultiSampler.cxx.

References fTime.

Referenced by ConditionalRun().

◆ CheckTimeslice()

bool CbmMQTsaMultiSampler::CheckTimeslice ( const fles::Timeslice &  ts)
private

Definition at line 945 of file CbmMQTsaMultiSampler.cxx.

◆ ConditionalRun()

bool CbmMQTsaMultiSampler::ConditionalRun ( )
protectedvirtual

Missed TS detection (only if output channel name defined by user)

Add missing TS indices to a vector and send it in appropriate channel

If command channel defined, send command to all "slaves"

Wait 1 s before sending a STOP to let all slaves finish processing previous data

This is a special case for the TOF + T0 => Inefficient as copy the TS as many times as need!

If command channel defined, send command to all "slaves"

Wait 1 s before sending a STOP to let all slaves finish processing previous data

This assumes that the order of the components does NOT change after the first TS That should be the case as the component index correspond to a physical link idx

If command channel defined, send command to all "slaves"

Wait 1 s before sending a STOP to let all slaves finish processing previous data

This assumes that the order of the components does NOT change after the first TS That should be the case as the component index correspond to a physical link idx

If command channel defined, send command to all "slaves"

Wait 1 s before sending a STOP to let all slaves finish processing previous data

If command channel defined, send command to all "slaves"

Wait 1 s before sending a STOP to let all slaves finish processing previous data

If command channel defined, send command to all "slaves"

Wait 1 s before sending an EOF to let all slaves finish processing previous data

If command channel defined, send command to all "slaves"

Wait 1 s before sending an EOF to let all slaves finish processing previous data

Definition at line 375 of file CbmMQTsaMultiSampler.cxx.

References CalcRuntime(), CreateAndCombineComponentsPerChannel(), CreateAndCombineComponentsPerSysId(), CreateAndSendComponent(), CreateAndSendFullTs(), fbNoSplitTs, fbSendTsPerChannel, fbSendTsPerSysId, fMaxTimeslices, FormatDecPrintout(), fsChannelNameCommands, fsChannelNameMissedTs, fSource, fTSCounter, fuPrevTsIndex, SendCommand(), and SendMissedTsIdx().

◆ CreateAndCombineComponentsPerChannel()

bool CbmMQTsaMultiSampler::CreateAndCombineComponentsPerChannel ( const fles::Timeslice &  ts)
private

First build the list of components for each channel name if it was not already done

First add each channel enabled for sending to the list of channels we will use

Now resize the vector in which we will store fo each sending channel the list of components

Check for each component if its system is enabled and if the name of its channel(s) is in the list If yes, add it to the vector of the corresponding channel

Loop on channels Loop on possible SysId and check channels

Then loop on all possible channels and send TS with their respective components if needed

Definition at line 635 of file CbmMQTsaMultiSampler.cxx.

References fbListCompPerChannelReady, fChannelsToSend, fComponentsToSend, fSysId, fvChannelsToSend, fvvCompPerChannel, m, pos, and SendData().

Referenced by ConditionalRun().

◆ CreateAndCombineComponentsPerSysId()

bool CbmMQTsaMultiSampler::CreateAndCombineComponentsPerSysId ( const fles::Timeslice &  ts)
private

First build the list of components for each SysId if it was not already done

Then loop on all possible SysId and send TS with their respective components if needed

Definition at line 561 of file CbmMQTsaMultiSampler.cxx.

References fbListCompPerSysIdReady, fComponentsToSend, fSysId, fvvCompPerSysId, m, pos, and SendData().

Referenced by ConditionalRun().

◆ CreateAndSendComponent()

bool CbmMQTsaMultiSampler::CreateAndSendComponent ( const fles::Timeslice &  ts,
int  nrComp 
)
private

Definition at line 524 of file CbmMQTsaMultiSampler.cxx.

References fComponentsToSend, fSysId, m, pos, and SendData().

Referenced by ConditionalRun().

◆ CreateAndSendFullTs()

bool CbmMQTsaMultiSampler::CreateAndSendFullTs ( const fles::Timeslice &  ts)
private

Send full TS to all enabled channels

Definition at line 749 of file CbmMQTsaMultiSampler.cxx.

References fChannelsToSend, fComponentsToSend, and SendData().

Referenced by ConditionalRun().

◆ InitTask()

void CbmMQTsaMultiSampler::InitTask ( )
protectedvirtual

Extract SysId and channel information if provided in the binary options

Extract SysId

Extract Channel name

Look if SysId is already defined

SysId already there, redefine the corresponding channel name

SysId unknown yet, add both SysId and channe name at end of respective vectors

Catches and ignores the channels for missing TS indices and commands

Definition at line 63 of file CbmMQTsaMultiSampler.cxx.

References fAllowedChannels, fbNoSplitTs, fbSendTsPerChannel, fbSendTsPerSysId, fComponentsToSend, fDirName, fFileName, fHighWaterMark, fHost, fInputFileList, fMaxTimeslices, fPort, fsChannelNameCommands, fsChannelNameMissedTs, fSource, fSysId, fTime, IsChannelNameAllowed(), and pos.

◆ IsChannelNameAllowed()

bool CbmMQTsaMultiSampler::IsChannelNameAllowed ( std::string  channelName)
private

If sending full TS, accept any name!

If sending per channel, do not stop the loop as we allow more than 1 comp type per channel

If sending per channel, do not stop the loop but still check if at least 1 match found

Definition at line 332 of file CbmMQTsaMultiSampler.cxx.

References fAllowedChannels, fbNoSplitTs, fbSendTsPerChannel, fChannelsToSend, fComponentsToSend, and fSysId.

Referenced by InitTask().

◆ OpenNextFile()

bool CbmMQTsaMultiSampler::OpenNextFile ( )
private

◆ PrintMicroSliceDescriptor()

void CbmMQTsaMultiSampler::PrintMicroSliceDescriptor ( const fles::MicrosliceDescriptor &  mdsc)
private

Definition at line 927 of file CbmMQTsaMultiSampler.cxx.

◆ SendCommand()

bool CbmMQTsaMultiSampler::SendCommand ( std::string  sCommand)
private

Definition at line 861 of file CbmMQTsaMultiSampler.cxx.

References fsChannelNameCommands.

Referenced by ConditionalRun().

◆ SendData() [1/3]

bool CbmMQTsaMultiSampler::SendData ( const fles::StorableTimeslice &  component,
int  idx 
)
private

Definition at line 763 of file CbmMQTsaMultiSampler.cxx.

References fChannelsToSend, fComponentsToSend, and fMessageCounter.

◆ SendData() [2/3]

bool CbmMQTsaMultiSampler::SendData ( const fles::StorableTimeslice &  component,
std::string  sChannel 
)
private

Definition at line 801 of file CbmMQTsaMultiSampler.cxx.

References fMessageCounter.

◆ SendData() [3/3]

bool CbmMQTsaMultiSampler::SendData ( const fles::StorableTimeslice &  component)
private

◆ SendMissedTsIdx()

bool CbmMQTsaMultiSampler::SendMissedTsIdx ( std::vector< uint64_t >  vIndices)
private

Definition at line 833 of file CbmMQTsaMultiSampler.cxx.

References fsChannelNameMissedTs.

Referenced by ConditionalRun().

Member Data Documentation

◆ fAllowedChannels

std::vector<std::string> CbmMQTsaMultiSampler::fAllowedChannels
private
Initial value:
= {"stscomponent",
"richcomponent",
"trdcomponent",
"muchcomponent",
"tofcomponent",
"t0component"}

Definition at line 95 of file CbmMQTsaMultiSampler.h.

Referenced by InitTask(), and IsChannelNameAllowed().

◆ fbListCompPerChannelReady

bool CbmMQTsaMultiSampler::fbListCompPerChannelReady = false
private

Definition at line 112 of file CbmMQTsaMultiSampler.h.

Referenced by CreateAndCombineComponentsPerChannel().

◆ fbListCompPerSysIdReady

bool CbmMQTsaMultiSampler::fbListCompPerSysIdReady = false
private

Definition at line 109 of file CbmMQTsaMultiSampler.h.

Referenced by CreateAndCombineComponentsPerSysId().

◆ fbNoSplitTs

bool CbmMQTsaMultiSampler::fbNoSplitTs = false
protected

Definition at line 40 of file CbmMQTsaMultiSampler.h.

Referenced by ConditionalRun(), InitTask(), and IsChannelNameAllowed().

◆ fbSendTsPerChannel

bool CbmMQTsaMultiSampler::fbSendTsPerChannel = false
protected

Definition at line 42 of file CbmMQTsaMultiSampler.h.

Referenced by ConditionalRun(), InitTask(), and IsChannelNameAllowed().

◆ fbSendTsPerSysId

bool CbmMQTsaMultiSampler::fbSendTsPerSysId = false
protected

Definition at line 41 of file CbmMQTsaMultiSampler.h.

Referenced by ConditionalRun(), and InitTask().

◆ fChannelsToSend

std::vector<std::vector<std::string> > CbmMQTsaMultiSampler::fChannelsToSend
private
Initial value:
=
{{}, {}, {}, {}, {}, {}}

Definition at line 106 of file CbmMQTsaMultiSampler.h.

Referenced by CreateAndCombineComponentsPerChannel(), CreateAndSendFullTs(), IsChannelNameAllowed(), and SendData().

◆ fComponentsToSend

std::vector<int> CbmMQTsaMultiSampler::fComponentsToSend = {0, 0, 0, 0, 0, 0}
private

◆ fDirName

std::string CbmMQTsaMultiSampler::fDirName
protected

Definition at line 32 of file CbmMQTsaMultiSampler.h.

Referenced by InitTask().

◆ fFileCounter

uint64_t CbmMQTsaMultiSampler::fFileCounter
protected

Definition at line 35 of file CbmMQTsaMultiSampler.h.

◆ fFileName

std::string CbmMQTsaMultiSampler::fFileName
protected

Definition at line 31 of file CbmMQTsaMultiSampler.h.

Referenced by InitTask().

◆ fHighWaterMark

uint64_t CbmMQTsaMultiSampler::fHighWaterMark
protected

Definition at line 38 of file CbmMQTsaMultiSampler.h.

Referenced by InitTask().

◆ fHost

std::string CbmMQTsaMultiSampler::fHost
protected

Definition at line 36 of file CbmMQTsaMultiSampler.h.

Referenced by InitTask().

◆ fInputFileList

std::vector<std::string> CbmMQTsaMultiSampler::fInputFileList
protected

List of input files.

Definition at line 34 of file CbmMQTsaMultiSampler.h.

Referenced by InitTask().

◆ fMaxMemory

int CbmMQTsaMultiSampler::fMaxMemory = 0
protected

Definition at line 55 of file CbmMQTsaMultiSampler.h.

◆ fMaxTimeslices

uint64_t CbmMQTsaMultiSampler::fMaxTimeslices
protected

Definition at line 29 of file CbmMQTsaMultiSampler.h.

Referenced by ConditionalRun(), and InitTask().

◆ fMessageCounter

uint64_t CbmMQTsaMultiSampler::fMessageCounter
protected

Definition at line 53 of file CbmMQTsaMultiSampler.h.

Referenced by SendData().

◆ fPort

uint64_t CbmMQTsaMultiSampler::fPort
protected

Definition at line 37 of file CbmMQTsaMultiSampler.h.

Referenced by InitTask().

◆ fsChannelNameCommands

std::string CbmMQTsaMultiSampler::fsChannelNameCommands = ""
private

Definition at line 117 of file CbmMQTsaMultiSampler.h.

Referenced by ConditionalRun(), InitTask(), and SendCommand().

◆ fsChannelNameMissedTs

std::string CbmMQTsaMultiSampler::fsChannelNameMissedTs = ""
private

Definition at line 116 of file CbmMQTsaMultiSampler.h.

Referenced by ConditionalRun(), InitTask(), and SendMissedTsIdx().

◆ fSource

fles::TimesliceSource* CbmMQTsaMultiSampler::fSource
private

Definition at line 80 of file CbmMQTsaMultiSampler.h.

Referenced by ConditionalRun(), and InitTask().

◆ fSysId

std::vector<int> CbmMQTsaMultiSampler::fSysId = {0x10, 0x30, 0x40, 0x50, 0x60, 0x90}
private

◆ fTime

std::chrono::steady_clock::time_point CbmMQTsaMultiSampler::fTime
private

Definition at line 81 of file CbmMQTsaMultiSampler.h.

Referenced by CalcRuntime(), and InitTask().

◆ fTSCounter

uint64_t CbmMQTsaMultiSampler::fTSCounter
protected

Definition at line 52 of file CbmMQTsaMultiSampler.h.

Referenced by ConditionalRun().

◆ fuPrevTsIndex

uint64_t CbmMQTsaMultiSampler::fuPrevTsIndex = 0
protected

Definition at line 51 of file CbmMQTsaMultiSampler.h.

Referenced by ConditionalRun().

◆ fvChannelsToSend

std::vector<std::string> CbmMQTsaMultiSampler::fvChannelsToSend = {}
private

Definition at line 113 of file CbmMQTsaMultiSampler.h.

Referenced by CreateAndCombineComponentsPerChannel().

◆ fvvCompPerChannel

std::vector<std::vector<uint32_t> > CbmMQTsaMultiSampler::fvvCompPerChannel = {}
private

Definition at line 114 of file CbmMQTsaMultiSampler.h.

Referenced by CreateAndCombineComponentsPerChannel().

◆ fvvCompPerSysId

std::vector<std::vector<uint32_t> > CbmMQTsaMultiSampler::fvvCompPerSysId = {{}, {}, {}, {}, {}, {}}
private

Definition at line 110 of file CbmMQTsaMultiSampler.h.

Referenced by CreateAndCombineComponentsPerSysId().


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