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

#include <CbmDeviceBuildRawEvents.h>

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

Public Member Functions

 CbmDeviceBuildRawEvents ()
 
virtual ~CbmDeviceBuildRawEvents ()
 

Protected Member Functions

virtual void InitTask ()
 
bool HandleData (FairMQParts &, int)
 
bool HandleCommand (FairMQMessagePtr &, int)
 

Private Member Functions

bool IsChannelNameAllowed (std::string channelName)
 
void Finish ()
 
bool SendEvents (FairMQParts &partsIn)
 
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::string fsChannelNameDataInput = "unpts_0"
 message queues
 
std::string fsChannelNameDataOutput = "events"
 
std::string fsChannelNameCommands = "commands"
 
std::string fsChannelNameHistosInput = "histogram-in"
 
std::string fsChannelNameHistosConfig = "histo-conf"
 
std::string fsChannelNameCanvasConfig = "canvas-conf"
 
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()
 
CbmAlgoBuildRawEventsfpAlgo = 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].
 
TClonesArray * fTimeSliceMetaDataArray = nullptr
 Total size of all MS in a TS, [nanoseconds].
 
TimesliceMetaDatafTsMetaData = nullptr
 
std::vector< CbmBmonDigi > * fvDigiBmon = nullptr
 Digis storage.
 
std::vector< CbmStsDigi > * fvDigiSts = nullptr
 
std::vector< CbmMuchBeamTimeDigi > * fvDigiMuch = nullptr
 
std::vector< CbmTrdDigi > * fvDigiTrd = nullptr
 
std::vector< CbmTofDigi > * fvDigiTof = nullptr
 
std::vector< CbmRichDigi > * fvDigiRich = nullptr
 
std::vector< CbmPsdDigi > * fvDigiPsd = nullptr
 
TClonesArray * fEvents = nullptr
 Data emission.
 
FairRunOnline * fpRun = nullptr
 output container of CbmEvents
 
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 = {}
 

Detailed Description

Definition at line 42 of file CbmDeviceBuildRawEvents.h.

Constructor & Destructor Documentation

◆ CbmDeviceBuildRawEvents()

CbmDeviceBuildRawEvents::CbmDeviceBuildRawEvents ( )

Definition at line 54 of file CbmDeviceBuildRawEvents.cxx.

References fpAlgo.

◆ ~CbmDeviceBuildRawEvents()

CbmDeviceBuildRawEvents::~CbmDeviceBuildRawEvents ( )
virtual

Clear metadata

Clear vectors

Clear events TClonesArray

Definition at line 537 of file CbmDeviceBuildRawEvents.cxx.

References fEvents, fpAlgo, fpRun, fTimeSliceMetaDataArray, fTsMetaData, fvDigiBmon, fvDigiMuch, fvDigiPsd, fvDigiRich, fvDigiSts, fvDigiTof, and fvDigiTrd.

Member Function Documentation

◆ Finish()

void CbmDeviceBuildRawEvents::Finish ( )
private

Definition at line 561 of file CbmDeviceBuildRawEvents.cxx.

◆ HandleCommand()

bool CbmDeviceBuildRawEvents::HandleCommand ( FairMQMessagePtr & ,
int  )
protected

◆ HandleData()

bool CbmDeviceBuildRawEvents::HandleData ( FairMQParts & parts,
int  )
protected

Extract unpacked data from input message

TS metadata

Bmon

STS

MUCH

TRD

BmonF

RICH

PSD

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 380 of file CbmDeviceBuildRawEvents.cxx.

References CbmAlgoBuildRawEvents::ClearEventVector(), fbFillHistos, fdMaxPublishTime, fdMinPublishTime, fEvents, fLastPublishTime, fpAlgo, fTimeSliceMetaDataArray, fTsMetaData, fulNumMessages, fuPublishFreqTs, fvDigiBmon, fvDigiMuch, fvDigiPsd, fvDigiRich, fvDigiSts, fvDigiTof, fvDigiTrd, CbmAlgoBuildRawEvents::ProcessTs(), SendEvents(), and SendHistograms().

Referenced by InitTask().

◆ InitTask()

void CbmDeviceBuildRawEvents::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

FIXME: Re-enable clang formatting after formatted lines

Create input vectors

Digis storage

Create output TClonesArray

Now that everything is set, initialize the Algorithm

Histograms management

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

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 56 of file CbmDeviceBuildRawEvents.cxx.

References CbmAlgoBuildRawEvents::AddDetector(), AllowOverlap, fArrayHisto, fbFillHistos, fbIgnoreTsOverlap, fdMaxPublishTime, fdMinPublishTime, fEvents, first, fpAlgo, fsAllowedChannels, fsChannelNameCanvasConfig, fsChannelNameDataInput, fsChannelNameDataOutput, fsChannelNameHistosConfig, fsChannelNameHistosInput, fsEvtOverMode, fsRefDet, fTimeSliceMetaDataArray, fuPublishFreqTs, fvDigiBmon, fvDigiMuch, fvDigiPsd, fvDigiRich, fvDigiSts, fvDigiTof, fvDigiTrd, fvpsCanvasConfig, fvpsHistosFolder, fvsAddDet, fvsDelDet, fvsSetTrigMinNb, fvsSetTrigWin, GenerateCanvasConfigString(), CbmAlgoBuildRawEvents::GetCanvasVector(), CbmAlgoBuildRawEvents::GetHistoVector(), HandleData(), CbmAlgoBuildRawEvents::InitAlgo(), IsChannelNameAllowed(), kBmon, kMuch, kNotExist, kPsd, kRawEventBuilderDetBmon, kRawEventBuilderDetMuch, kRawEventBuilderDetPsd, kRawEventBuilderDetRich, kRawEventBuilderDetSts, kRawEventBuilderDetTof, kRawEventBuilderDetTrd, kRawEventBuilderDetUndef, kRich, kSts, kTof, kTrd, MergeOverlap, NoOverlap, CbmAlgoBuildRawEvents::RemoveDetector(), CbmAlgoBuildRawEvents::SetDigis(), CbmAlgoBuildRawEvents::SetEventOverlapMode(), CbmAlgoBuildRawEvents::SetFillHistos(), CbmAlgoBuildRawEvents::SetIgnoreTsOverlap(), CbmAlgoBuildRawEvents::SetReferenceDetector(), CbmAlgoBuildRawEvents::SetTimeSliceMetaDataArray(), CbmAlgoBuildRawEvents::SetTriggerMinNumber(), and CbmAlgoBuildRawEvents::SetTriggerWindow().

◆ IsChannelNameAllowed()

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

Definition at line 361 of file CbmDeviceBuildRawEvents.cxx.

References fsAllowedChannels, and pos.

Referenced by InitTask().

◆ SendEvents()

bool CbmDeviceBuildRawEvents::SendEvents ( FairMQParts & partsIn)
private

Clear events TClonesArray before usage.

Get vector reference from algo

Move CbmEvent from temporary vector to TClonesArray

Serialize the array of events into a single MQ message

Add it at the end of the input composed message

Definition at line 486 of file CbmDeviceBuildRawEvents.cxx.

References fEvents, fpAlgo, fsChannelNameDataOutput, CbmAlgoBuildRawEvents::GetEventVector(), and CbmEvent::ToString().

Referenced by HandleData().

◆ SendHistograms()

bool CbmDeviceBuildRawEvents::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 518 of file CbmDeviceBuildRawEvents.cxx.

References fArrayHisto, fpAlgo, fsChannelNameHistosInput, and CbmAlgoBuildRawEvents::ResetHistograms().

Referenced by HandleData().

Member Data Documentation

◆ fArrayHisto

TObjArray CbmDeviceBuildRawEvents::fArrayHisto = {}
private

Array of histograms to send to the histogram server.

Definition at line 118 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask(), and SendHistograms().

◆ fbFillHistos

Bool_t CbmDeviceBuildRawEvents::fbFillHistos = kTRUE
private

Ignore data in Overlap part of the TS.

Definition at line 57 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), and InitTask().

◆ fbIgnoreTsOverlap

Bool_t CbmDeviceBuildRawEvents::fbIgnoreTsOverlap = kFALSE
private

Constants.

Control flags

Definition at line 56 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fdMaxPublishTime

double_t CbmDeviceBuildRawEvents::fdMaxPublishTime = 5.0
private

Definition at line 77 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), and InitTask().

◆ fdMinPublishTime

double_t CbmDeviceBuildRawEvents::fdMinPublishTime = 0.5
private

Definition at line 76 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), and InitTask().

◆ fdMsSizeInNs

Double_t CbmDeviceBuildRawEvents::fdMsSizeInNs = 1280000
private

Definition at line 93 of file CbmDeviceBuildRawEvents.h.

◆ fdTsCoreSizeInNs

Double_t CbmDeviceBuildRawEvents::fdTsCoreSizeInNs = -1.0
private

Size of a single MS, [nanoseconds].

Definition at line 94 of file CbmDeviceBuildRawEvents.h.

◆ fdTsFullSizeInNs

Double_t CbmDeviceBuildRawEvents::fdTsFullSizeInNs = -1.0
private

Total size of the overlap MS in a TS, [nanoseconds].

Definition at line 96 of file CbmDeviceBuildRawEvents.h.

◆ fdTsOverSizeInNs

Double_t CbmDeviceBuildRawEvents::fdTsOverSizeInNs = -1.0
private

Total size of the core MS in a TS, [nanoseconds].

Definition at line 95 of file CbmDeviceBuildRawEvents.h.

◆ fEvents

TClonesArray* CbmDeviceBuildRawEvents::fEvents = nullptr
private

Data emission.

Definition at line 111 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), InitTask(), SendEvents(), and ~CbmDeviceBuildRawEvents().

◆ fLastPublishTime

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

Definition at line 85 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData().

◆ fpAlgo

CbmAlgoBuildRawEvents* CbmDeviceBuildRawEvents::fpAlgo = nullptr
private

◆ fpRun

FairRunOnline* CbmDeviceBuildRawEvents::fpRun = nullptr
private

output container of CbmEvents

Internal data registration (for FairRootManager -> DigiManager links)

Definition at line 115 of file CbmDeviceBuildRawEvents.h.

Referenced by ~CbmDeviceBuildRawEvents().

◆ fsAllowedChannels

std::vector<std::string> CbmDeviceBuildRawEvents::fsAllowedChannels = {fsChannelNameDataInput}
private

List of MQ channels names.

Definition at line 80 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask(), and IsChannelNameAllowed().

◆ fsChannelNameCanvasConfig

std::string CbmDeviceBuildRawEvents::fsChannelNameCanvasConfig = "canvas-conf"
private

Definition at line 73 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fsChannelNameCommands

std::string CbmDeviceBuildRawEvents::fsChannelNameCommands = "commands"
private

Definition at line 70 of file CbmDeviceBuildRawEvents.h.

◆ fsChannelNameDataInput

std::string CbmDeviceBuildRawEvents::fsChannelNameDataInput = "unpts_0"
private

message queues

Definition at line 68 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fsChannelNameDataOutput

std::string CbmDeviceBuildRawEvents::fsChannelNameDataOutput = "events"
private

Definition at line 69 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask(), and SendEvents().

◆ fsChannelNameHistosConfig

std::string CbmDeviceBuildRawEvents::fsChannelNameHistosConfig = "histo-conf"
private

Definition at line 72 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fsChannelNameHistosInput

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

Definition at line 71 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask(), and SendHistograms().

◆ fsEvtOverMode

std::string CbmDeviceBuildRawEvents::fsEvtOverMode = "NoOverlap"
private

Switch ON/OFF filling of histograms.

User settings parameters Algo enum settings

Definition at line 61 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fsRefDet

std::string CbmDeviceBuildRawEvents::fsRefDet = "kBmon"
private

Definition at line 62 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fTimeSliceMetaDataArray

TClonesArray* CbmDeviceBuildRawEvents::fTimeSliceMetaDataArray = nullptr
private

Total size of all MS in a TS, [nanoseconds].

Data reception TS MetaData storage

Definition at line 100 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildRawEvents().

◆ fTsMetaData

TimesliceMetaData* CbmDeviceBuildRawEvents::fTsMetaData = nullptr
private

Definition at line 101 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), and ~CbmDeviceBuildRawEvents().

◆ fulNumMessages

uint64_t CbmDeviceBuildRawEvents::fulNumMessages = 0
private

Statistics & first TS rejection.

Definition at line 83 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData().

◆ fulTsCounter

uint64_t CbmDeviceBuildRawEvents::fulTsCounter = 0
private

Definition at line 84 of file CbmDeviceBuildRawEvents.h.

◆ fuNbCoreMsPerTs

size_t CbmDeviceBuildRawEvents::fuNbCoreMsPerTs = 0
private

TS MetaData stable values storage.

Definition at line 91 of file CbmDeviceBuildRawEvents.h.

◆ fuNbOverMsPerTs

size_t CbmDeviceBuildRawEvents::fuNbOverMsPerTs = 0
private

Definition at line 92 of file CbmDeviceBuildRawEvents.h.

◆ fuPublishFreqTs

uint32_t CbmDeviceBuildRawEvents::fuPublishFreqTs = 100
private

Histograms management.

Definition at line 75 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), and InitTask().

◆ fvDigiBmon

std::vector<CbmBmonDigi>* CbmDeviceBuildRawEvents::fvDigiBmon = nullptr
private

Digis storage.

Definition at line 103 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildRawEvents().

◆ fvDigiMuch

std::vector<CbmMuchBeamTimeDigi>* CbmDeviceBuildRawEvents::fvDigiMuch = nullptr
private

Definition at line 105 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildRawEvents().

◆ fvDigiPsd

std::vector<CbmPsdDigi>* CbmDeviceBuildRawEvents::fvDigiPsd = nullptr
private

Definition at line 109 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildRawEvents().

◆ fvDigiRich

std::vector<CbmRichDigi>* CbmDeviceBuildRawEvents::fvDigiRich = nullptr
private

Definition at line 108 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildRawEvents().

◆ fvDigiSts

std::vector<CbmStsDigi>* CbmDeviceBuildRawEvents::fvDigiSts = nullptr
private

Definition at line 104 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildRawEvents().

◆ fvDigiTof

std::vector<CbmTofDigi>* CbmDeviceBuildRawEvents::fvDigiTof = nullptr
private

Definition at line 107 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildRawEvents().

◆ fvDigiTrd

std::vector<CbmTrdDigi>* CbmDeviceBuildRawEvents::fvDigiTrd = nullptr
private

Definition at line 106 of file CbmDeviceBuildRawEvents.h.

Referenced by HandleData(), InitTask(), and ~CbmDeviceBuildRawEvents().

◆ fvpsCanvasConfig

std::vector<std::pair<std::string, std::string> > CbmDeviceBuildRawEvents::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 124 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fvpsHistosFolder

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

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

Definition at line 120 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fvsAddDet

std::vector<std::string> CbmDeviceBuildRawEvents::fvsAddDet = {}
private

Definition at line 63 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fvsDelDet

std::vector<std::string> CbmDeviceBuildRawEvents::fvsDelDet = {}
private

Definition at line 64 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fvsSetTrigMinNb

std::vector<std::string> CbmDeviceBuildRawEvents::fvsSetTrigMinNb = {}
private

Definition at line 66 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().

◆ fvsSetTrigWin

std::vector<std::string> CbmDeviceBuildRawEvents::fvsSetTrigWin = {}
private

Definition at line 65 of file CbmDeviceBuildRawEvents.h.

Referenced by InitTask().


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