CbmRoot
Loading...
Searching...
No Matches
CbmTsConsumerReqDevExample Class Reference

#include <CbmTsConsumerReqDevExample.h>

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

Public Member Functions

 CbmTsConsumerReqDevExample ()
 
virtual ~CbmTsConsumerReqDevExample ()
 

Protected Member Functions

virtual void InitTask ()
 
virtual bool ConditionalRun ()
 

Private Member Functions

bool InitContainers ()
 
bool InitHistograms ()
 
bool DoUnpack (const fles::Timeslice &ts, size_t component)
 
void Finish ()
 
bool SendHistoConfAndData ()
 
bool SendHistograms ()
 

Private Attributes

Bool_t fbIgnoreOverlapMs = kFALSE
 Control flags.
 
Bool_t fbComponentsAddedToList = kFALSE
 Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice.
 
std::string fsChannelNameDataInput = "ts-request"
 User settings parameters.
 
std::string fsTsBlockName = "exampleblock"
 
std::string fsChannelNameHistosInput = "histogram-in"
 
uint32_t fuPublishFreqTs = 100
 
double_t fdMinPublishTime = 0.5
 
double_t fdMaxPublishTime = 5.0
 
TList * fParCList = nullptr
 Parameters management.
 
uint64_t fulNumMessages = 0
 Statistics & first TS rejection.
 
uint64_t fulTsCounter = 0
 
std::chrono::system_clock::time_point fLastPublishTime = std::chrono::system_clock::now()
 
TObjArray fArrayHisto = {}
 Processing algo.
 
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder = {}
 Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.
 
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig = {}
 
bool fbConfigSent = false
 Flag indicating whether the histograms and canvases configurations were already published.
 

Static Private Attributes

static const uint16_t kusSysId = 0xFF
 Constants.
 

Detailed Description

Definition at line 23 of file CbmTsConsumerReqDevExample.h.

Constructor & Destructor Documentation

◆ CbmTsConsumerReqDevExample()

CbmTsConsumerReqDevExample::CbmTsConsumerReqDevExample ( )

Definition at line 39 of file CbmTsConsumerReqDevExample.cxx.

◆ ~CbmTsConsumerReqDevExample()

CbmTsConsumerReqDevExample::~CbmTsConsumerReqDevExample ( )
virtual

Definition at line 304 of file CbmTsConsumerReqDevExample.cxx.

Member Function Documentation

◆ ConditionalRun()

bool CbmTsConsumerReqDevExample::ConditionalRun ( )
protectedvirtual

First request a new TS (full or single system components or multi-syst components block)

Message received, do Algo related Initialization steps if needed

Create an empty TS and fill it with the incoming message

Process the Timeslice

Send histograms each 100 time slices. Should be each ~1s Use also runtime checker to trigger sending after M s if processing too slow or delay sending if processing too fast

Definition at line 165 of file CbmTsConsumerReqDevExample.cxx.

References DoUnpack(), fbConfigSent, fdMaxPublishTime, fdMinPublishTime, fLastPublishTime, fsChannelNameDataInput, fsTsBlockName, fulNumMessages, fuPublishFreqTs, InitContainers(), InitHistograms(), kusSysId, SendHistoConfAndData(), and SendHistograms().

◆ DoUnpack()

Bool_t CbmTsConsumerReqDevExample::DoUnpack ( const fles::Timeslice & ts,
size_t component )
private

Do something here

Clear the digis vector in case it was filled

Definition at line 307 of file CbmTsConsumerReqDevExample.cxx.

References fbComponentsAddedToList, fulTsCounter, and kusSysId.

Referenced by ConditionalRun().

◆ Finish()

void CbmTsConsumerReqDevExample::Finish ( )
private

Definition at line 338 of file CbmTsConsumerReqDevExample.cxx.

◆ InitContainers()

bool CbmTsConsumerReqDevExample::InitContainers ( )
private

Apply options to the processing algo

Definition at line 65 of file CbmTsConsumerReqDevExample.cxx.

References fParCList.

Referenced by ConditionalRun().

◆ InitHistograms()

bool CbmTsConsumerReqDevExample::InitHistograms ( )
private

Histos creation and obtain pointer on them Trigger histo creation on all associated algos

Obtain vector of pointers on each histo from the algo (+ optionally desired folder)

Obtain vector of pointers on each canvas from the algo (+ optionally desired folder)

Add pointers to each histo in the histo array Create histo config vector ===> Use an std::vector< std::pair< std::string, std::string > > with < Histo name, Folder > and send it through a separate channel using the BoostSerializer

Create canvas config vector ===> Use an std::vector< std::pair< std::string, std::string > > with < Canvas name, config > and send it through a separate channel using the BoostSerializer

Definition at line 116 of file CbmTsConsumerReqDevExample.cxx.

References fArrayHisto, first, fvpsCanvasConfig, fvpsHistosFolder, and GenerateCanvasConfigString().

Referenced by ConditionalRun().

◆ InitTask()

void CbmTsConsumerReqDevExample::InitTask ( )
protectedvirtual

◆ SendHistoConfAndData()

bool CbmTsConsumerReqDevExample::SendHistoConfAndData ( )
private

Prepare multiparts message and header

Serialize the vector of histo config into a single MQ message

Serialize the vector of canvas config into a single MQ message

Serialize the array of histos into a single MQ message

Send the multi-parts message to the common histogram messages queue

Reset the histograms after sending them (but do not reset the time)

Definition at line 236 of file CbmTsConsumerReqDevExample.cxx.

References fArrayHisto, fsChannelNameHistosInput, fvpsCanvasConfig, and fvpsHistosFolder.

Referenced by ConditionalRun().

◆ SendHistograms()

bool CbmTsConsumerReqDevExample::SendHistograms ( )
private

Serialize the array of histos into a single MQ message

Send message to the common histogram messages queue

Reset the histograms after sending them (but do not reset the time)

Definition at line 284 of file CbmTsConsumerReqDevExample.cxx.

References fArrayHisto, and fsChannelNameHistosInput.

Referenced by ConditionalRun().

Member Data Documentation

◆ fArrayHisto

TObjArray CbmTsConsumerReqDevExample::fArrayHisto = {}
private

Processing algo.

Array of histograms to send to the histogram server

Definition at line 60 of file CbmTsConsumerReqDevExample.h.

Referenced by InitHistograms(), SendHistoConfAndData(), and SendHistograms().

◆ fbComponentsAddedToList

Bool_t CbmTsConsumerReqDevExample::fbComponentsAddedToList = kFALSE
private

Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice.

Definition at line 38 of file CbmTsConsumerReqDevExample.h.

Referenced by DoUnpack().

◆ fbConfigSent

bool CbmTsConsumerReqDevExample::fbConfigSent = false
private

Flag indicating whether the histograms and canvases configurations were already published.

Definition at line 68 of file CbmTsConsumerReqDevExample.h.

Referenced by ConditionalRun().

◆ fbIgnoreOverlapMs

Bool_t CbmTsConsumerReqDevExample::fbIgnoreOverlapMs = kFALSE
private

Control flags.

Definition at line 37 of file CbmTsConsumerReqDevExample.h.

Referenced by InitTask().

◆ fdMaxPublishTime

double_t CbmTsConsumerReqDevExample::fdMaxPublishTime = 5.0
private

Definition at line 46 of file CbmTsConsumerReqDevExample.h.

Referenced by ConditionalRun(), and InitTask().

◆ fdMinPublishTime

double_t CbmTsConsumerReqDevExample::fdMinPublishTime = 0.5
private

Definition at line 45 of file CbmTsConsumerReqDevExample.h.

Referenced by ConditionalRun(), and InitTask().

◆ fLastPublishTime

std::chrono::system_clock::time_point CbmTsConsumerReqDevExample::fLastPublishTime = std::chrono::system_clock::now()
private

Definition at line 54 of file CbmTsConsumerReqDevExample.h.

Referenced by ConditionalRun().

◆ fParCList

TList* CbmTsConsumerReqDevExample::fParCList = nullptr
private

Parameters management.

Definition at line 49 of file CbmTsConsumerReqDevExample.h.

Referenced by InitContainers().

◆ fsChannelNameDataInput

std::string CbmTsConsumerReqDevExample::fsChannelNameDataInput = "ts-request"
private

User settings parameters.

Definition at line 41 of file CbmTsConsumerReqDevExample.h.

Referenced by ConditionalRun(), and InitTask().

◆ fsChannelNameHistosInput

std::string CbmTsConsumerReqDevExample::fsChannelNameHistosInput = "histogram-in"
private

Definition at line 43 of file CbmTsConsumerReqDevExample.h.

Referenced by InitTask(), SendHistoConfAndData(), and SendHistograms().

◆ fsTsBlockName

std::string CbmTsConsumerReqDevExample::fsTsBlockName = "exampleblock"
private

Definition at line 42 of file CbmTsConsumerReqDevExample.h.

Referenced by ConditionalRun(), and InitTask().

◆ fulNumMessages

uint64_t CbmTsConsumerReqDevExample::fulNumMessages = 0
private

Statistics & first TS rejection.

Definition at line 52 of file CbmTsConsumerReqDevExample.h.

Referenced by ConditionalRun().

◆ fulTsCounter

uint64_t CbmTsConsumerReqDevExample::fulTsCounter = 0
private

Definition at line 53 of file CbmTsConsumerReqDevExample.h.

Referenced by DoUnpack().

◆ fuPublishFreqTs

uint32_t CbmTsConsumerReqDevExample::fuPublishFreqTs = 100
private

Definition at line 44 of file CbmTsConsumerReqDevExample.h.

Referenced by ConditionalRun(), and InitTask().

◆ fvpsCanvasConfig

std::vector<std::pair<std::string, std::string> > CbmTsConsumerReqDevExample::fvpsCanvasConfig = {}
private

Vector of string pairs with ( CanvasName, CanvasConfig ) to send to the histogram server Format of Can config is "NbPadX(U);NbPadY(U);ConfigPad1(s);....;ConfigPadXY(s)" Format of Pad config is "GrixX(b),GridY(b),LogX(b),LogY(b),LogZ(b),HistoName(s),DrawOptions(s)"

Definition at line 66 of file CbmTsConsumerReqDevExample.h.

Referenced by InitHistograms(), and SendHistoConfAndData().

◆ fvpsHistosFolder

std::vector<std::pair<std::string, std::string> > CbmTsConsumerReqDevExample::fvpsHistosFolder = {}
private

Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.

Definition at line 62 of file CbmTsConsumerReqDevExample.h.

Referenced by InitHistograms(), and SendHistoConfAndData().

◆ kusSysId

const uint16_t CbmTsConsumerReqDevExample::kusSysId = 0xFF
staticprivate

Constants.

Definition at line 34 of file CbmTsConsumerReqDevExample.h.

Referenced by ConditionalRun(), and DoUnpack().


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