CbmRoot
|
#include <CbmDeviceBuildDigiEvents.h>
Public Member Functions | |
CbmDeviceBuildDigiEvents () | |
virtual | ~CbmDeviceBuildDigiEvents () |
Protected Member Functions | |
virtual void | InitTask () |
bool | HandleData (FairMQParts &, int) |
bool | HandleCommand (FairMQMessagePtr &, int) |
Private Member Functions | |
bool | IsChannelNameAllowed (std::string channelName) |
Check wether an MQ channel name is among those expected for this device. | |
RawEventBuilderDetector | GetDetectorBuilderCfg (std::string detName) |
Get detector event builder config from string containing name. | |
ECbmModuleId | GetDetectorId (std::string detName) |
Get detector type from string containing name. | |
bool | InitHistograms () |
void | Finish () |
bool | SendEvents (FairMQParts &partsIn) |
bool | SendDigiEvents (FairMQParts &partsIn) |
bool | SendHistoConfAndData () |
bool | SendHistograms () |
Private Attributes | |
Bool_t | fbIgnoreTsOverlap = kFALSE |
Constants. | |
Bool_t | fbFillHistos = kTRUE |
Ignore data in Overlap part of the TS. | |
std::string | fsEvtOverMode = "NoOverlap" |
Switch ON/OFF filling of histograms. | |
std::string | fsRefDet = "kBmon" |
std::vector< std::string > | fvsAddDet = {} |
std::vector< std::string > | fvsDelDet = {} |
std::vector< std::string > | fvsSetTrigWin = {} |
std::vector< std::string > | fvsSetTrigMinNb = {} |
std::vector< std::string > | fvsSetTrigMaxNb = {} |
std::vector< std::string > | fvsSetTrigMinLayersNb = {} |
std::vector< std::string > | fvsSetHistMaxDigiNb = {} |
bool | fbDoNotSend = false |
I/O control. | |
bool | fbDigiEventOutput = false |
std::string | fsChannelNameDataInput = "unpts_0" |
message queues | |
std::string | fsChannelNameDataOutput = "events" |
std::string | fsChannelNameCommands = "commands" |
std::string | fsChannelNameHistosInput = "histogram-in" |
uint32_t | fuPublishFreqTs = 100 |
Histograms management. | |
double_t | fdMinPublishTime = 0.5 |
double_t | fdMaxPublishTime = 5.0 |
std::vector< std::string > | fsAllowedChannels = {fsChannelNameDataInput} |
List of MQ channels names. | |
uint64_t | fulNumMessages = 0 |
Statistics & first TS rejection. | |
uint64_t | fulTsCounter = 0 |
std::chrono::system_clock::time_point | fLastPublishTime = std::chrono::system_clock::now() |
CbmAlgoBuildRawEvents * | fpAlgo = nullptr |
Processing algos. | |
size_t | fuNbCoreMsPerTs = 0 |
TS MetaData stable values storage. | |
size_t | fuNbOverMsPerTs = 0 |
Double_t | fdMsSizeInNs = 1280000 |
Double_t | fdTsCoreSizeInNs = -1.0 |
Size of a single MS, [nanoseconds]. | |
Double_t | fdTsOverSizeInNs = -1.0 |
Total size of the core MS in a TS, [nanoseconds]. | |
Double_t | fdTsFullSizeInNs = -1.0 |
Total size of the overlap MS in a TS, [nanoseconds]. | |
CbmTsEventHeader * | fCbmTsEventHeader = nullptr |
Total size of all MS in a TS, [nanoseconds]. | |
std::vector< CbmBmonDigi > * | fvDigiBmon = nullptr |
Digis storage. | |
std::vector< CbmStsDigi > * | fvDigiSts = nullptr |
std::vector< CbmMuchDigi > * | fvDigiMuch = nullptr |
std::vector< CbmTrdDigi > * | fvDigiTrd = nullptr |
std::vector< CbmTofDigi > * | fvDigiTof = nullptr |
std::vector< CbmRichDigi > * | fvDigiRich = nullptr |
std::vector< CbmPsdDigi > * | fvDigiPsd = nullptr |
TClonesArray * | fTimeSliceMetaDataArray = nullptr |
TS MetaData storage. | |
TimesliceMetaData * | fTsMetaData = nullptr |
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 = {} |
bool | fbConfigSent = false |
Flag indicating whether the histograms and canvases configurations were already published. | |
Definition at line 42 of file CbmDeviceBuildDigiEvents.h.
CbmDeviceBuildDigiEvents::CbmDeviceBuildDigiEvents | ( | ) |
Definition at line 56 of file CbmDeviceBuildDigiEvents.cxx.
References fpAlgo.
|
virtual |
Clear metadata
Clear vectors
Clear metadata
Definition at line 875 of file CbmDeviceBuildDigiEvents.cxx.
References fCbmTsEventHeader, fpAlgo, fTimeSliceMetaDataArray, fTsMetaData, fvDigiBmon, fvDigiMuch, fvDigiPsd, fvDigiRich, fvDigiSts, fvDigiTof, and fvDigiTrd.
|
private |
Definition at line 899 of file CbmDeviceBuildDigiEvents.cxx.
|
private |
Get detector event builder config from string containing name.
FIXME: Disable clang formatting for now as it corrupts all alignment
FIXME: Re-enable clang formatting after formatted lines
Definition at line 398 of file CbmDeviceBuildDigiEvents.cxx.
References kRawEventBuilderDetBmon, kRawEventBuilderDetMuch, kRawEventBuilderDetPsd, kRawEventBuilderDetRich, kRawEventBuilderDetSts, kRawEventBuilderDetTof, kRawEventBuilderDetTrd, kRawEventBuilderDetTrd2D, and kRawEventBuilderDetUndef.
Referenced by InitTask().
|
private |
Get detector type from string containing name.
FIXME: Disable clang formatting for now as it corrupts all alignment
FIXME: Re-enable clang formatting after formatted lines
Definition at line 416 of file CbmDeviceBuildDigiEvents.cxx.
References kBmon, kMuch, kNotExist, kPsd, kRich, kSts, kTof, kTrd, and kTrd2d.
Referenced by InitTask().
|
protected |
|
protected |
Extract unpacked data from input message
TS header
Bmon
STS
MUCH
TRD
BmonF
RICH
PSD
TS metadata
First message received
Call Algo ProcessTs method
Send events vector to ouput
Clear metadata
Clear vectors
Clear event vector after usage
Histograms management
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 479 of file CbmDeviceBuildDigiEvents.cxx.
References CbmAlgoBuildRawEvents::ClearEventVector(), fbConfigSent, fbDigiEventOutput, fbDoNotSend, fbFillHistos, fCbmTsEventHeader, fdMaxPublishTime, fdMinPublishTime, fLastPublishTime, fpAlgo, fTimeSliceMetaDataArray, fTsMetaData, fulNumMessages, fuPublishFreqTs, fvDigiBmon, fvDigiMuch, fvDigiPsd, fvDigiRich, fvDigiSts, fvDigiTof, fvDigiTrd, TimesliceMetaData::GetDuration(), TimesliceMetaData::GetOverlapDuration(), CbmAlgoBuildRawEvents::ProcessTs(), SendDigiEvents(), SendEvents(), SendHistoConfAndData(), SendHistograms(), and CbmAlgoBuildRawEvents::SetTsParameters().
Referenced by InitTask().
|
private |
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 435 of file CbmDeviceBuildDigiEvents.cxx.
References fArrayHisto, first, fpAlgo, fvpsCanvasConfig, fvpsHistosFolder, GenerateCanvasConfigString(), CbmAlgoBuildRawEvents::GetCanvasVector(), and CbmAlgoBuildRawEvents::GetHistoVector().
Referenced by InitTask().
|
protectedvirtual |
Read options from executable
FIXME: Disable clang formatting for now as it corrupts all alignment
Initialize the Algorithm parameters
Extract Event Overlap Mode
Extract refdet
Extract detector to add if any
Extract detector to remove if any
Extract Trigger window to add if any
Detector Enum Tag
Window beginning
Window end
Extract MinNb for trigger if any
Detector Enum Tag
Min number
Extract MaxNb for trigger if any
Detector Enum Tag
Max number
Extract MinLayersNb for trigger if any
Detector Enum Tag
Min number
Extract Histograms Max Digi limits if any
Detector Enum Tag
Min number
FIXME: Re-enable clang formatting after formatted lines
Create input vectors
Digis storage
Now that everything is set, initialize the Algorithm
Histograms management
Comment to prevent clang format single lining
Definition at line 58 of file CbmDeviceBuildDigiEvents.cxx.
References CbmAlgoBuildRawEvents::AddDetector(), AllowOverlap, fbDigiEventOutput, fbDoNotSend, fbFillHistos, fbIgnoreTsOverlap, fCbmTsEventHeader, fdMaxPublishTime, fdMinPublishTime, fpAlgo, fsAllowedChannels, fsChannelNameDataInput, fsChannelNameDataOutput, fsChannelNameHistosInput, fsEvtOverMode, fsRefDet, fTimeSliceMetaDataArray, fuPublishFreqTs, fvDigiBmon, fvDigiMuch, fvDigiPsd, fvDigiRich, fvDigiSts, fvDigiTof, fvDigiTrd, fvsAddDet, fvsDelDet, fvsSetHistMaxDigiNb, fvsSetTrigMaxNb, fvsSetTrigMinLayersNb, fvsSetTrigMinNb, fvsSetTrigWin, GetDetectorBuilderCfg(), GetDetectorId(), HandleData(), CbmAlgoBuildRawEvents::InitAlgo(), InitHistograms(), IsChannelNameAllowed(), kNotExist, kRawEventBuilderDetUndef, MergeOverlap, NoOverlap, CbmAlgoBuildRawEvents::RemoveDetector(), CbmAlgoBuildRawEvents::SetDigis(), CbmAlgoBuildRawEvents::SetEventOverlapMode(), CbmAlgoBuildRawEvents::SetFillHistos(), CbmAlgoBuildRawEvents::SetHistogramMaxDigiNb(), CbmAlgoBuildRawEvents::SetIgnoreTsOverlap(), CbmAlgoBuildRawEvents::SetReferenceDetector(), CbmAlgoBuildRawEvents::SetTimeSliceMetaDataArray(), CbmAlgoBuildRawEvents::SetTriggerMaxNumber(), CbmAlgoBuildRawEvents::SetTriggerMinLayersNumber(), CbmAlgoBuildRawEvents::SetTriggerMinNumber(), and CbmAlgoBuildRawEvents::SetTriggerWindow().
|
private |
Check wether an MQ channel name is among those expected for this device.
Definition at line 380 of file CbmDeviceBuildDigiEvents.cxx.
References fsAllowedChannels, and pos.
Referenced by InitTask().
|
private |
Get vector reference from algo
Move CbmEvent from temporary vector to std::vector of full objects
FIXME: for pure digi based event, we select "continuous slices of digis" => Copy block of [First Digi index, last digi index] with assign(it_start, it_stop) FIXME: Keep TRD1D + TRD2D support, may lead to holes in the digi sequence! => Would need to keep the loop
Get the proper order for block selection as TRD1D and TRD2D may insert indices in separate loops => Needed to ensure that the start and stop of the block copy do not trigger a vector size exception
for each detector, find the data in the Digi vectors and copy them TODO: Template + loop on list of data types? ==> Bmon
==> STS
==> MUCH
==> TRD + TRD2D
==> TOF
==> RICH
==> PSD
Serialize the array of events into a single MQ message
Make a new composed messaged with TsHeader + vector of Digi Event + TsMetaData FIXME: Find out if possible to use only the boost serializer
Definition at line 676 of file CbmDeviceBuildDigiEvents.cxx.
References CbmDigiData::fBmon, CbmDigiEvent::fData, CbmBmonDigiData::fDigis, CbmMuchDigiData::fDigis, CbmPsdDigiData::fDigis, CbmRichDigiData::fDigis, CbmStsDigiData::fDigis, CbmTofDigiData::fDigis, CbmTrdDigiData::fDigis, CbmDigiData::fMuch, CbmDigiEvent::fNumber, fpAlgo, CbmDigiData::fPsd, CbmDigiData::fRich, fsChannelNameDataOutput, CbmDigiData::fSts, CbmDigiEvent::fTime, CbmDigiData::fTof, CbmDigiData::fTrd, fvDigiBmon, fvDigiMuch, fvDigiPsd, fvDigiRich, fvDigiSts, fvDigiTof, fvDigiTrd, CbmAlgoBuildRawEvents::GetEventVector(), kBmonDigi, kMuchDigi, kPsdDigi, kRichDigi, kStsDigi, kTofDigi, and kTrdDigi.
Referenced by HandleData().
|
private |
Get vector reference from algo
Move CbmEvent from temporary vector to std::vector of full objects
Serialize the array of events into a single MQ message FIXME: Find out if possible to use only the boost serializer
Add it at the end of the input composed message FIXME: Find out if possible to use only the boost serializer
Definition at line 629 of file CbmDeviceBuildDigiEvents.cxx.
References fpAlgo, fsChannelNameDataOutput, and CbmAlgoBuildRawEvents::GetEventVector().
Referenced by HandleData().
|
private |
Prepare multiparts message and header
Serialize the vector of histo config into a single MQ message
Catch case where no histos are registered! => Add empty message
Serialize the vector of canvas config into a single MQ message
Catch case where no Canvases are registered! => Add empty 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 799 of file CbmDeviceBuildDigiEvents.cxx.
References fArrayHisto, fpAlgo, fsChannelNameHistosInput, fvpsCanvasConfig, fvpsHistosFolder, and CbmAlgoBuildRawEvents::ResetHistograms().
Referenced by HandleData().
|
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 857 of file CbmDeviceBuildDigiEvents.cxx.
References fArrayHisto, fpAlgo, fsChannelNameHistosInput, and CbmAlgoBuildRawEvents::ResetHistograms().
Referenced by HandleData().
|
private |
Array of histograms to send to the histogram server.
Definition at line 118 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitHistograms(), SendHistoConfAndData(), and SendHistograms().
|
private |
Flag indicating whether the histograms and canvases configurations were already published.
Definition at line 126 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData().
|
private |
Definition at line 72 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), and InitTask().
|
private |
I/O control.
Definition at line 71 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), and InitTask().
|
private |
Ignore data in Overlap part of the TS.
Definition at line 57 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), and InitTask().
|
private |
Constants.
Control flags
Definition at line 56 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().
|
private |
Total size of all MS in a TS, [nanoseconds].
Data reception TS information in header
Definition at line 104 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildDigiEvents().
|
private |
Definition at line 81 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), and InitTask().
|
private |
Definition at line 80 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), and InitTask().
|
private |
Definition at line 97 of file CbmDeviceBuildDigiEvents.h.
|
private |
Size of a single MS, [nanoseconds].
Definition at line 98 of file CbmDeviceBuildDigiEvents.h.
|
private |
Total size of the overlap MS in a TS, [nanoseconds].
Definition at line 100 of file CbmDeviceBuildDigiEvents.h.
|
private |
Total size of the core MS in a TS, [nanoseconds].
Definition at line 99 of file CbmDeviceBuildDigiEvents.h.
|
private |
Definition at line 89 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData().
|
private |
Processing algos.
Definition at line 92 of file CbmDeviceBuildDigiEvents.h.
Referenced by CbmDeviceBuildDigiEvents(), HandleData(), InitHistograms(), InitTask(), SendDigiEvents(), SendEvents(), SendHistoConfAndData(), SendHistograms(), and ~CbmDeviceBuildDigiEvents().
|
private |
List of MQ channels names.
Definition at line 84 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask(), and IsChannelNameAllowed().
|
private |
Definition at line 76 of file CbmDeviceBuildDigiEvents.h.
|
private |
|
private |
Definition at line 75 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask(), SendDigiEvents(), and SendEvents().
|
private |
Definition at line 77 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask(), SendHistoConfAndData(), and SendHistograms().
|
private |
Switch ON/OFF filling of histograms.
User settings parameters Algo enum settings
Definition at line 61 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().
|
private |
Definition at line 62 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().
|
private |
TS MetaData storage.
Definition at line 114 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildDigiEvents().
|
private |
Definition at line 115 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), and ~CbmDeviceBuildDigiEvents().
|
private |
Statistics & first TS rejection.
Definition at line 87 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData().
|
private |
Definition at line 88 of file CbmDeviceBuildDigiEvents.h.
|
private |
TS MetaData stable values storage.
Definition at line 95 of file CbmDeviceBuildDigiEvents.h.
|
private |
Definition at line 96 of file CbmDeviceBuildDigiEvents.h.
|
private |
Histograms management.
Definition at line 79 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), and InitTask().
|
private |
Digis storage.
Definition at line 106 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), InitTask(), SendDigiEvents(), and ~CbmDeviceBuildDigiEvents().
|
private |
Definition at line 108 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), InitTask(), SendDigiEvents(), and ~CbmDeviceBuildDigiEvents().
|
private |
Definition at line 112 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), InitTask(), SendDigiEvents(), and ~CbmDeviceBuildDigiEvents().
|
private |
Definition at line 111 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), InitTask(), SendDigiEvents(), and ~CbmDeviceBuildDigiEvents().
|
private |
Definition at line 107 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), InitTask(), SendDigiEvents(), and ~CbmDeviceBuildDigiEvents().
|
private |
Definition at line 110 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), InitTask(), SendDigiEvents(), and ~CbmDeviceBuildDigiEvents().
|
private |
Definition at line 109 of file CbmDeviceBuildDigiEvents.h.
Referenced by HandleData(), InitTask(), SendDigiEvents(), and ~CbmDeviceBuildDigiEvents().
|
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 124 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitHistograms(), and SendHistoConfAndData().
|
private |
Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.
Definition at line 120 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitHistograms(), and SendHistoConfAndData().
|
private |
Definition at line 63 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().
|
private |
Definition at line 64 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().
|
private |
Definition at line 69 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().
|
private |
Definition at line 67 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().
|
private |
Definition at line 68 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().
|
private |
Definition at line 66 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().
|
private |
Definition at line 65 of file CbmDeviceBuildDigiEvents.h.
Referenced by InitTask().