CbmRoot
|
#include <CbmMQTsaMultiSampler.h>
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. | |
uint64_t | fFileCounter |
std::string | fHost |
uint64_t | fPort |
uint64_t | fHighWaterMark |
bool | fbNoSplitTs = false |
bool | fbSendTsPerSysId = false |
bool | fbSendTsPerChannel = false |
std::string | fsChannelNameHistosInput = "histogram-in" |
std::string | fsChannelNameHistosConfig = "histo-conf" |
std::string | fsChannelNameCanvasConfig = "canvas-conf" |
uint32_t | fuPublishFreqTs = 0 |
double_t | fdMinPublishTime = 0.5 |
double_t | fdMaxPublishTime = 5 |
uint64_t | fuPrevTsIndex = 0 |
uint64_t | fTSCounter |
uint64_t | fMessageCounter |
int | fMaxMemory = 0 |
Private Member Functions | |
bool | InitHistograms () |
bool | CheckTimeslice (const fles::Timeslice &ts) |
void | PrintMicroSliceDescriptor (const fles::MicrosliceDescriptor &mdsc) |
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) |
bool | SendHistograms () |
bool | ResetHistograms () |
Private Attributes | |
fles::TimesliceSource * | fSource |
std::chrono::steady_clock::time_point | fTime |
std::chrono::system_clock::time_point | fLastPublishTime |
std::vector< std::string > | fAllowedChannels |
std::vector< int > | fSysId = {0x10, 0x30, 0x40, 0x50, 0x60, 0x90, 0x80} |
std::vector< int > | fComponentsToSend = {0, 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 = "" |
TObjArray | fArrayHisto = {} |
Array of histograms to send to the histogram server. | |
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 = {} |
TH1I * | fhTsRate = nullptr |
Histograms. | |
TH1I * | fhTsSize = nullptr |
TProfile * | fhTsSizeEvo = nullptr |
TH1F * | fhTsMaxSizeEvo = nullptr |
TH1I * | fhMissedTS = nullptr |
TProfile * | fhMissedTSEvo = nullptr |
TCanvas * | fcSummary = nullptr |
uint64_t | fuStartTime = 0 |
double_t | fdTimeToStart = 0. |
double_t | fdLastMaxTime = 0. |
double_t | fdTsMaxSize = 0. |
Definition at line 34 of file CbmMQTsaMultiSampler.h.
CbmMQTsaMultiSampler::CbmMQTsaMultiSampler | ( | ) |
Definition at line 61 of file CbmMQTsaMultiSampler.cxx.
|
virtual |
Definition at line 989 of file CbmMQTsaMultiSampler.cxx.
|
private |
Definition at line 991 of file CbmMQTsaMultiSampler.cxx.
References fTime.
Referenced by ConditionalRun().
|
private |
Definition at line 1014 of file CbmMQTsaMultiSampler.cxx.
|
protectedvirtual |
initialize the source (connect to emitter, ...)
Fill max size per s (assumes the histo binning is 1 second!)
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 + Bmon => 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
Send histograms periodically. Use also runtime checker to trigger sending after M s if processing too slow or delay sending if processing too fast
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 435 of file CbmMQTsaMultiSampler.cxx.
References CalcRuntime(), CreateAndCombineComponentsPerChannel(), CreateAndCombineComponentsPerSysId(), CreateAndSendComponent(), CreateAndSendFullTs(), fbNoSplitTs, fbSendTsPerChannel, fbSendTsPerSysId, fdLastMaxTime, fdMaxPublishTime, fdMinPublishTime, fdTimeToStart, fdTsMaxSize, fhMissedTS, fhMissedTSEvo, fhTsMaxSizeEvo, fhTsRate, fhTsSize, fhTsSizeEvo, fLastPublishTime, fMaxTimeslices, FormatDecPrintout(), fsChannelNameCommands, fsChannelNameMissedTs, fSource, fTSCounter, fuPrevTsIndex, fuPublishFreqTs, fuStartTime, InitHistograms(), SendCommand(), SendHistograms(), and SendMissedTsIdx().
|
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 728 of file CbmMQTsaMultiSampler.cxx.
References fbListCompPerChannelReady, fChannelsToSend, fComponentsToSend, fSysId, fvChannelsToSend, fvvCompPerChannel, pos, SendData(), and size().
Referenced by ConditionalRun().
|
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 666 of file CbmMQTsaMultiSampler.cxx.
References fbListCompPerSysIdReady, fComponentsToSend, fSysId, fvvCompPerSysId, pos, SendData(), and size().
Referenced by ConditionalRun().
|
private |
Definition at line 633 of file CbmMQTsaMultiSampler.cxx.
References fComponentsToSend, fSysId, pos, and SendData().
Referenced by ConditionalRun().
|
private |
Send full TS to all enabled channels
Definition at line 821 of file CbmMQTsaMultiSampler.cxx.
References fChannelsToSend, fComponentsToSend, and SendData().
Referenced by ConditionalRun().
|
private |
Vector of pointers on each histo (+ optionally desired folder)
Vector of pointers on each canvas (+ optionally desired folder)
Histos creation and obtain pointer on them
Add histo pointers to the histo vector
Canvases creation
Add canvas pointers to the canvas vector
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
Serialize the vector of histo config into a single MQ message
Send message to the common histogram config messages queue
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
Serialize the vector of canvas config into a single MQ message
Send message to the common canvas config messages queue
Definition at line 313 of file CbmMQTsaMultiSampler.cxx.
References fArrayHisto, fcSummary, fdMaxPublishTime, fdMinPublishTime, fhMissedTS, fhMissedTSEvo, fhTsMaxSizeEvo, fhTsRate, fhTsSize, fhTsSizeEvo, first, fsChannelNameCanvasConfig, fsChannelNameHistosConfig, fuPublishFreqTs, fvpsCanvasConfig, fvpsHistosFolder, and GenerateCanvasConfigString().
Referenced by ConditionalRun().
|
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 Same for the histogram channels
Definition at line 79 of file CbmMQTsaMultiSampler.cxx.
References fAllowedChannels, fbNoSplitTs, fbSendTsPerChannel, fbSendTsPerSysId, fComponentsToSend, fDirName, fdMaxPublishTime, fdMinPublishTime, fFileName, fHighWaterMark, fHost, fInputFileList, fMaxTimeslices, fPort, fsChannelNameCanvasConfig, fsChannelNameCommands, fsChannelNameHistosConfig, fsChannelNameHistosInput, fsChannelNameMissedTs, fSource, fSysId, fTime, fuPublishFreqTs, IsChannelNameAllowed(), pos, and size().
|
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 272 of file CbmMQTsaMultiSampler.cxx.
References fAllowedChannels, fbNoSplitTs, fbSendTsPerChannel, fChannelsToSend, fComponentsToSend, and fSysId.
Referenced by InitTask().
|
private |
Definition at line 1000 of file CbmMQTsaMultiSampler.cxx.
|
private |
Definition at line 977 of file CbmMQTsaMultiSampler.cxx.
References fhMissedTS, fhMissedTSEvo, fhTsMaxSizeEvo, fhTsRate, fhTsSize, and fhTsSizeEvo.
Referenced by SendHistograms().
|
private |
Definition at line 925 of file CbmMQTsaMultiSampler.cxx.
References fsChannelNameCommands.
Referenced by ConditionalRun().
|
private |
Definition at line 835 of file CbmMQTsaMultiSampler.cxx.
References fChannelsToSend, fComponentsToSend, and fMessageCounter.
Referenced by CreateAndCombineComponentsPerChannel(), CreateAndCombineComponentsPerSysId(), CreateAndSendComponent(), and CreateAndSendFullTs().
|
private |
Definition at line 870 of file CbmMQTsaMultiSampler.cxx.
References fMessageCounter.
|
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 957 of file CbmMQTsaMultiSampler.cxx.
References fArrayHisto, fsChannelNameHistosInput, and ResetHistograms().
Referenced by ConditionalRun().
|
private |
Definition at line 899 of file CbmMQTsaMultiSampler.cxx.
References fsChannelNameMissedTs.
Referenced by ConditionalRun().
|
private |
Definition at line 105 of file CbmMQTsaMultiSampler.h.
Referenced by InitTask(), and IsChannelNameAllowed().
|
private |
Array of histograms to send to the histogram server.
Definition at line 124 of file CbmMQTsaMultiSampler.h.
Referenced by InitHistograms(), and SendHistograms().
|
private |
Definition at line 116 of file CbmMQTsaMultiSampler.h.
Referenced by CreateAndCombineComponentsPerChannel().
|
private |
Definition at line 113 of file CbmMQTsaMultiSampler.h.
Referenced by CreateAndCombineComponentsPerSysId().
|
protected |
Definition at line 51 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitTask(), and IsChannelNameAllowed().
|
protected |
Definition at line 53 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitTask(), and IsChannelNameAllowed().
|
protected |
Definition at line 52 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), and InitTask().
|
private |
Definition at line 111 of file CbmMQTsaMultiSampler.h.
Referenced by CreateAndCombineComponentsPerChannel(), CreateAndSendFullTs(), IsChannelNameAllowed(), and SendData().
|
private |
Definition at line 110 of file CbmMQTsaMultiSampler.h.
Referenced by CreateAndCombineComponentsPerChannel(), CreateAndCombineComponentsPerSysId(), CreateAndSendComponent(), CreateAndSendFullTs(), InitTask(), IsChannelNameAllowed(), and SendData().
|
private |
Definition at line 139 of file CbmMQTsaMultiSampler.h.
Referenced by InitHistograms().
|
protected |
Definition at line 43 of file CbmMQTsaMultiSampler.h.
Referenced by InitTask().
|
private |
Definition at line 142 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun().
|
protected |
Definition at line 60 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitHistograms(), and InitTask().
|
protected |
Definition at line 59 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitHistograms(), and InitTask().
|
private |
Definition at line 141 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun().
|
private |
Definition at line 143 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun().
|
protected |
Definition at line 46 of file CbmMQTsaMultiSampler.h.
|
protected |
Definition at line 42 of file CbmMQTsaMultiSampler.h.
Referenced by InitTask().
|
protected |
Definition at line 49 of file CbmMQTsaMultiSampler.h.
Referenced by InitTask().
|
private |
Definition at line 137 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitHistograms(), and ResetHistograms().
|
private |
Definition at line 138 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitHistograms(), and ResetHistograms().
|
protected |
Definition at line 47 of file CbmMQTsaMultiSampler.h.
Referenced by InitTask().
|
private |
Definition at line 136 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitHistograms(), and ResetHistograms().
|
private |
Histograms.
Definition at line 133 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitHistograms(), and ResetHistograms().
|
private |
Definition at line 134 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitHistograms(), and ResetHistograms().
|
private |
Definition at line 135 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitHistograms(), and ResetHistograms().
|
protected |
List of input files.
Definition at line 45 of file CbmMQTsaMultiSampler.h.
Referenced by InitTask().
|
private |
Definition at line 90 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun().
|
protected |
Definition at line 66 of file CbmMQTsaMultiSampler.h.
|
protected |
Definition at line 40 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), and InitTask().
|
protected |
Definition at line 64 of file CbmMQTsaMultiSampler.h.
Referenced by SendData(), and SendData().
|
protected |
Definition at line 48 of file CbmMQTsaMultiSampler.h.
Referenced by InitTask().
|
protected |
Definition at line 57 of file CbmMQTsaMultiSampler.h.
Referenced by InitHistograms(), and InitTask().
|
private |
Definition at line 121 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitTask(), and SendCommand().
|
protected |
Definition at line 56 of file CbmMQTsaMultiSampler.h.
Referenced by InitHistograms(), and InitTask().
|
protected |
Definition at line 55 of file CbmMQTsaMultiSampler.h.
Referenced by InitTask(), and SendHistograms().
|
private |
Definition at line 120 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitTask(), and SendMissedTsIdx().
|
private |
Definition at line 88 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), and InitTask().
|
private |
Definition at line 108 of file CbmMQTsaMultiSampler.h.
Referenced by CreateAndCombineComponentsPerChannel(), CreateAndCombineComponentsPerSysId(), CreateAndSendComponent(), InitTask(), and IsChannelNameAllowed().
|
private |
Definition at line 89 of file CbmMQTsaMultiSampler.h.
Referenced by CalcRuntime(), and InitTask().
|
protected |
Definition at line 63 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun().
|
protected |
Definition at line 62 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun().
|
protected |
Definition at line 58 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun(), InitHistograms(), and InitTask().
|
private |
Definition at line 140 of file CbmMQTsaMultiSampler.h.
Referenced by ConditionalRun().
|
private |
Definition at line 117 of file CbmMQTsaMultiSampler.h.
Referenced by CreateAndCombineComponentsPerChannel().
|
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 130 of file CbmMQTsaMultiSampler.h.
Referenced by InitHistograms().
|
private |
Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.
Definition at line 126 of file CbmMQTsaMultiSampler.h.
Referenced by InitHistograms().
|
private |
Definition at line 118 of file CbmMQTsaMultiSampler.h.
Referenced by CreateAndCombineComponentsPerChannel().
|
private |
Definition at line 114 of file CbmMQTsaMultiSampler.h.
Referenced by CreateAndCombineComponentsPerSysId().