CbmRoot
CbmDeviceMcbmEventBuilderWin Class Reference

#include <CbmDeviceMcbmEventBuilderWin.h>

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

Public Member Functions

 CbmDeviceMcbmEventBuilderWin ()
 
virtual ~CbmDeviceMcbmEventBuilderWin ()
 

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. More...
 
Bool_t fbFillHistos = kTRUE
 Ignore data in Overlap part of the TS. More...
 
std::string fsEvtOverMode = "NoOverlap"
 Switch ON/OFF filling of histograms. More...
 
std::string fsRefDet = "kT0"
 
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 More...
 
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. More...
 
double_t fdMinPublishTime = 0.5
 
double_t fdMaxPublishTime = 5.0
 
std::vector< std::string > fsAllowedChannels = {fsChannelNameDataInput}
 List of MQ channels names. More...
 
uint64_t fulNumMessages = 0
 Parameters management. More...
 
uint64_t fulTsCounter = 0
 
std::chrono::system_clock::time_point fLastPublishTime
 
CbmMcbm2019TimeWinEventBuilderAlgofpAlgo = nullptr
 Processing algos. More...
 
size_t fuNbCoreMsPerTs = 0
 TS MetaData stable values storage. More...
 
size_t fuNbOverMsPerTs = 0
 
Double_t fdMsSizeInNs = 1280000
 
Double_t fdTsCoreSizeInNs
 Size of a single MS, [nanoseconds]. More...
 
Double_t fdTsOverSizeInNs
 Total size of the core MS in a TS, [nanoseconds]. More...
 
Double_t fdTsFullSizeInNs
 Total size of the overlap MS in a TS, [nanoseconds]. More...
 
TClonesArray * fTimeSliceMetaDataArray = nullptr
 Total size of all MS in a TS, [nanoseconds]. More...
 
TimesliceMetaDatafTsMetaData = nullptr
 
std::vector< CbmTofDigi > * fvDigiT0 = nullptr
 Digis storage. More...
 
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. More...
 
FairRunOnline * fpRun = nullptr
 output container of CbmEvents More...
 
TObjArray fArrayHisto = {}
 Array of histograms to send to the histogram server. More...
 
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder = {}
 Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server. More...
 
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig = {}
 

Detailed Description

Definition at line 38 of file CbmDeviceMcbmEventBuilderWin.h.

Constructor & Destructor Documentation

◆ CbmDeviceMcbmEventBuilderWin()

CbmDeviceMcbmEventBuilderWin::CbmDeviceMcbmEventBuilderWin ( )

Definition at line 51 of file CbmDeviceMcbmEventBuilderWin.cxx.

◆ ~CbmDeviceMcbmEventBuilderWin()

CbmDeviceMcbmEventBuilderWin::~CbmDeviceMcbmEventBuilderWin ( )
virtual

Clear metadata

Clear vectors

Clear events TClonesArray

Definition at line 677 of file CbmDeviceMcbmEventBuilderWin.cxx.

Member Function Documentation

◆ Finish()

void CbmDeviceMcbmEventBuilderWin::Finish ( )
private

Definition at line 702 of file CbmDeviceMcbmEventBuilderWin.cxx.

◆ HandleCommand()

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

◆ HandleData()

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

Extract unpacked data from input message

TS metadata TODO: code order of vectors in the TS MetaData!!

FIXME: Not if this is the proper way to insert the data

T0

STS

MUCH

TRD

T0F

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 476 of file CbmDeviceMcbmEventBuilderWin.cxx.

Referenced by InitTask().

◆ InitTask()

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

Register all input data members with the FairRoot manager

Digis storage

Feint to avoid crash of DigiManager due to missing source pointer validity check in FairRootManager.h at line 461

Create output TClonesArray TODO: remove TObject from CbmEvent and switch to vectors!

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 55 of file CbmDeviceMcbmEventBuilderWin.cxx.

References AllowOverlap, first, GenerateCanvasConfigString(), HandleData(), kEventBuilderDetMuch, kEventBuilderDetPsd, kEventBuilderDetRich, kEventBuilderDetSts, kEventBuilderDetT0, kEventBuilderDetTof, kEventBuilderDetTrd, kEventBuilderDetUndef, kMuch, kNotExist, kPsd, kRich, kSts, kT0, kTof, kTrd, MergeOverlap, and NoOverlap.

◆ IsChannelNameAllowed()

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

Definition at line 392 of file CbmDeviceMcbmEventBuilderWin.cxx.

References pos.

◆ SendEvents()

bool CbmDeviceMcbmEventBuilderWin::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 FIXME: use move or fix addition of new part to avoid full message copy

Send message

Definition at line 607 of file CbmDeviceMcbmEventBuilderWin.cxx.

References Cbm::ToString().

◆ SendHistograms()

bool CbmDeviceMcbmEventBuilderWin::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 660 of file CbmDeviceMcbmEventBuilderWin.cxx.

Member Data Documentation

◆ fArrayHisto

TObjArray CbmDeviceMcbmEventBuilderWin::fArrayHisto = {}
private

Array of histograms to send to the histogram server.

Definition at line 122 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fbFillHistos

Bool_t CbmDeviceMcbmEventBuilderWin::fbFillHistos = kTRUE
private

Ignore data in Overlap part of the TS.

Definition at line 53 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fbIgnoreTsOverlap

Bool_t CbmDeviceMcbmEventBuilderWin::fbIgnoreTsOverlap = kFALSE
private

Constants.

Control flags

Definition at line 52 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fdMaxPublishTime

double_t CbmDeviceMcbmEventBuilderWin::fdMaxPublishTime = 5.0
private

Definition at line 73 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fdMinPublishTime

double_t CbmDeviceMcbmEventBuilderWin::fdMinPublishTime = 0.5
private

Definition at line 72 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fdMsSizeInNs

Double_t CbmDeviceMcbmEventBuilderWin::fdMsSizeInNs = 1280000
private

Definition at line 94 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fdTsCoreSizeInNs

Double_t CbmDeviceMcbmEventBuilderWin::fdTsCoreSizeInNs
private
Initial value:
=
-1.0

Size of a single MS, [nanoseconds].

Definition at line 95 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fdTsFullSizeInNs

Double_t CbmDeviceMcbmEventBuilderWin::fdTsFullSizeInNs
private
Initial value:
=
-1.0

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

Definition at line 99 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fdTsOverSizeInNs

Double_t CbmDeviceMcbmEventBuilderWin::fdTsOverSizeInNs
private
Initial value:
=
-1.0

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

Definition at line 97 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fEvents

TClonesArray* CbmDeviceMcbmEventBuilderWin::fEvents = nullptr
private

Data emission.

Definition at line 115 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fLastPublishTime

std::chrono::system_clock::time_point CbmDeviceMcbmEventBuilderWin::fLastPublishTime
private
Initial value:
=
std::chrono::system_clock::now()

Definition at line 85 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fpAlgo

CbmMcbm2019TimeWinEventBuilderAlgo* CbmDeviceMcbmEventBuilderWin::fpAlgo = nullptr
private

Processing algos.

Definition at line 89 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fpRun

FairRunOnline* CbmDeviceMcbmEventBuilderWin::fpRun = nullptr
private

output container of CbmEvents

Internal data registration (for FairRootManager -> DigiManager links)

Definition at line 119 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fsAllowedChannels

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

List of MQ channels names.

Definition at line 76 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fsChannelNameCanvasConfig

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

Definition at line 69 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fsChannelNameCommands

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

Definition at line 66 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fsChannelNameDataInput

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

message queues

Definition at line 64 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fsChannelNameDataOutput

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

Definition at line 65 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fsChannelNameHistosConfig

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

Definition at line 68 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fsChannelNameHistosInput

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

Definition at line 67 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fsEvtOverMode

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

Switch ON/OFF filling of histograms.

User settings parameters Algo enum settings

Definition at line 57 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fsRefDet

std::string CbmDeviceMcbmEventBuilderWin::fsRefDet = "kT0"
private

Definition at line 58 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fTimeSliceMetaDataArray

TClonesArray* CbmDeviceMcbmEventBuilderWin::fTimeSliceMetaDataArray = nullptr
private

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

Data reception TS MetaData storage

Definition at line 104 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fTsMetaData

TimesliceMetaData* CbmDeviceMcbmEventBuilderWin::fTsMetaData = nullptr
private

Definition at line 105 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fulNumMessages

uint64_t CbmDeviceMcbmEventBuilderWin::fulNumMessages = 0
private

Parameters management.

Statistics & first TS rejection

Definition at line 83 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fulTsCounter

uint64_t CbmDeviceMcbmEventBuilderWin::fulTsCounter = 0
private

Definition at line 84 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fuNbCoreMsPerTs

size_t CbmDeviceMcbmEventBuilderWin::fuNbCoreMsPerTs = 0
private

TS MetaData stable values storage.

Definition at line 92 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fuNbOverMsPerTs

size_t CbmDeviceMcbmEventBuilderWin::fuNbOverMsPerTs = 0
private

Definition at line 93 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fuPublishFreqTs

uint32_t CbmDeviceMcbmEventBuilderWin::fuPublishFreqTs = 100
private

Histograms management.

Definition at line 71 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvDigiMuch

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

Definition at line 109 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvDigiPsd

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

Definition at line 113 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvDigiRich

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

Definition at line 112 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvDigiSts

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

Definition at line 108 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvDigiT0

std::vector<CbmTofDigi>* CbmDeviceMcbmEventBuilderWin::fvDigiT0 = nullptr
private

Digis storage.

Definition at line 107 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvDigiTof

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

Definition at line 111 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvDigiTrd

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

Definition at line 110 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvpsCanvasConfig

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

◆ fvpsHistosFolder

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

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

Definition at line 124 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvsAddDet

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

Definition at line 59 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvsDelDet

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

Definition at line 60 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvsSetTrigMinNb

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

Definition at line 62 of file CbmDeviceMcbmEventBuilderWin.h.

◆ fvsSetTrigWin

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

Definition at line 61 of file CbmDeviceMcbmEventBuilderWin.h.


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