CbmRoot
Loading...
Searching...
No Matches
CbmDeviceBmonMonitor.cxx
Go to the documentation of this file.
1/* Copyright (C) 2022 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
13
14#include "CbmBmonUnpackConfig.h"
15#include "CbmFlesCanvasTools.h"
16#include "CbmMQDefs.h"
17#include "CbmMuchUnpackConfig.h"
18#include "CbmPsdUnpackConfig.h"
19#include "CbmRichUnpackConfig.h"
20#include "CbmSetup.h"
21#include "CbmStsUnpackConfig.h"
22#include "CbmTofUnpackConfig.h"
23#include "CbmTofUnpackMonitor.h"
24#include "CbmTrdUnpackConfig.h"
26
27#include "StorableTimeslice.hpp"
28#include "TimesliceMetaData.h"
29
30#include "FairMQLogger.h"
31#include "FairMQProgOptions.h" // device->fConfig
32#include "FairParGenericSet.h"
33
34#include "TCanvas.h"
35#include "TFile.h"
36#include "TH1.h"
37#include "TList.h"
38#include "TNamed.h"
39
40#include "BoostSerializer.h"
41#include <boost/archive/binary_iarchive.hpp>
42#include <boost/serialization/utility.hpp>
43
44#include <array>
45#include <iomanip>
46#include <stdexcept>
47#include <string>
48#include <utility>
49
50#include "RootSerializer.h"
51struct InitTaskError : std::runtime_error {
52 using std::runtime_error::runtime_error;
53};
54
55using namespace std;
56
57//Bool_t bMcbm2018MonitorTaskBmonResetHistos = kFALSE;
58
60
62try {
64 LOG(info) << "Init options for CbmDeviceBmonMonitor.";
65 fsSetupName = fConfig->GetValue<std::string>("Setup");
66 fuRunId = fConfig->GetValue<uint32_t>("RunId");
67 fbUnpBmon = fConfig->GetValue<bool>("UnpBmon");
68 fbIgnoreOverlapMs = fConfig->GetValue<bool>("IgnOverMs");
69 fbOutputFullTimeSorting = fConfig->GetValue<bool>("FullTimeSort");
70 fvsSetTimeOffs = fConfig->GetValue<std::vector<std::string>>("SetTimeOffs");
71 fsChannelNameDataInput = fConfig->GetValue<std::string>("TsNameIn");
72 fsChannelNameDataOutput = fConfig->GetValue<std::string>("TsNameOut");
73 fuPublishFreqTs = fConfig->GetValue<uint32_t>("PubFreqTs");
74 fdMinPublishTime = fConfig->GetValue<double_t>("PubTimeMin");
75 fdMaxPublishTime = fConfig->GetValue<double_t>("PubTimeMax");
76 fsChannelNameHistosInput = fConfig->GetValue<std::string>("ChNameIn");
77}
78catch (InitTaskError& e) {
79 LOG(error) << e.what();
80 // Wrapper defined in CbmMQDefs.h to support different FairMQ versions
82}
83
85{
86 LOG(info) << "Init parameter containers for CbmDeviceBmonMonitor.";
87
88 // ----- FIXME: Environment settings? or binary option?
89 TString srcDir = std::getenv("VMCWORKDIR"); // top source directory, standard C++ library
90 // TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory
91
92 // ----- CbmSetup -----------------------------------------------------
93 // TODO: support for multiple setups on Par Server? with request containing setup name?
94 CbmSetup* cbmsetup = CbmSetup::Instance();
95 FairMQMessagePtr req(NewSimpleMessage("setup"));
96 FairMQMessagePtr rep(NewMessage());
97
98 if (Send(req, "parameters") > 0) {
99 if (Receive(rep, "parameters") >= 0) {
100 if (0 != rep->GetSize()) {
101 CbmSetupStorable* exchangableSetup;
102
103 CbmMqTMessage tmsg(rep->GetData(), rep->GetSize());
104 exchangableSetup = dynamic_cast<CbmSetupStorable*>(tmsg.ReadObject(tmsg.GetClass()));
105
106 if (nullptr != exchangableSetup) {
108 cbmsetup->LoadStoredSetup(exchangableSetup);
109 }
110 else {
111 LOG(error) << "Received corrupt reply. Setup not available";
112 throw InitTaskError("Setup not received from par-server.");
113 }
114 } // if( 0 != rep->GetSize() )
115 else {
116 LOG(error) << "Received empty reply. Setup not available";
117 throw InitTaskError("Setup not received from par-server.");
118 } // else of if( 0 != rep->GetSize() )
119 } // if( Receive( rep, "parameters" ) >= 0)
120 } // if( Send(req, "parameters") > 0 )
121 // ------------------------------------------------------------------------
122
124 // ---- BMON ----
125 std::shared_ptr<CbmBmonUnpackConfig> bmonconfig = nullptr;
126 if (fbUnpBmon) {
127 bmonconfig = std::make_shared<CbmBmonUnpackConfig>("", fuRunId);
128 if (bmonconfig) {
129 // bmonconfig->SetDebugState();
130 bmonconfig->SetDoWriteOutput();
131 // bmonconfig->SetDoWriteOptOutA("CbmBmonErrors");
132 std::string parfilesbasepathBmon = Form("%s/macro/beamtime/mcbm2022/", srcDir.Data());
133 bmonconfig->SetParFilesBasePath(parfilesbasepathBmon);
134 bmonconfig->SetParFileName("mBmonCriPar.par");
135 bmonconfig->SetSystemTimeOffset(-1220); // [ns] value to be updated
136
138 auto monitor = std::make_shared<CbmTofUnpackMonitor>();
139 monitor->SetBmonMode(true);
140 monitor->SetInternalHttpMode(false);
141 if (2337 <= fuRunId) {
142 monitor->SetSpillThreshold(250);
143 monitor->SetSpillThresholdNonPulser(100);
144 }
145 bmonconfig->SetMonitor(monitor);
146 }
147 }
148 // -------------
149
151 if (bmonconfig) SetUnpackConfig(bmonconfig);
152
154 for (std::vector<std::string>::iterator itStrOffs = fvsSetTimeOffs.begin(); itStrOffs != fvsSetTimeOffs.end();
155 ++itStrOffs) {
156 size_t charPosDel = (*itStrOffs).find(',');
157 if (std::string::npos == charPosDel) {
158 LOG(info) << "CbmDeviceBmonMonitor::InitContainers => "
159 << "Trying to set trigger window with invalid option pattern, ignored! "
160 << " (Should be ECbmModuleId,dWinBeg,dWinEnd but instead found " << (*itStrOffs) << " )";
161 } // if( std::string::npos == charPosDel )
162
164 std::string sSelDet = (*itStrOffs).substr(0, charPosDel);
166 charPosDel++;
167 int32_t iOffset = std::stoi((*itStrOffs).substr(charPosDel));
168
169 if ("kBmon" == sSelDet && fBmonConfig) { //
170 fBmonConfig->SetSystemTimeOffset(iOffset);
171 } // else if( "kBmon" == sSelDet )
172 else {
173 LOG(info) << "CbmDeviceBmonMonitor::InitContainers => Trying to set time "
174 "offset for unsupported detector, ignored! "
175 << (sSelDet);
176 continue;
177 } // else of detector enum detection
178 } // for( std::vector< std::string >::iterator itStrAdd = fvsAddDet.begin(); itStrAdd != fvsAddDet.end(); ++itStrAdd )
179
180 Bool_t initOK = kTRUE;
181 // --- Bmon
182 if (fBmonConfig) {
183 fBmonConfig->InitOutput();
184 // RegisterOutputs(ioman, fBmonConfig); /// Framework bound work = kept in this Task
185 fBmonConfig->SetAlgo();
186 fBmonConfig->LoadParFileName();
187 initOK &= InitParameters(fBmonConfig->GetParContainerRequest());
188 fBmonConfig->InitAlgo();
189 // initPerformanceMaps(fkFlesBmon, "Bmon");
190 }
191
194
195 return initOK;
196}
197
198Bool_t
199CbmDeviceBmonMonitor::InitParameters(std::vector<std::pair<std::string, std::shared_ptr<FairParGenericSet>>>* reqparvec)
200{
201 LOG(info) << "CbmDeviceBmonMonitor::InitParameters";
202 if (!reqparvec) {
203 LOG(info) << "CbmDeviceBmonMonitor::InitParameters - empty requirements vector no parameters initialized.";
204 return kTRUE;
205 }
206
207 // Now get the actual ascii files and init the containers with the asciiIo
208 for (auto& pair : *reqparvec) {
209 /*
210 auto filepath = pair.first;
211 auto parset = pair.second;
212 FairParAsciiFileIo asciiInput;
213 if (!filepath.empty()) {
214 if (asciiInput.open(filepath.data())) { parset->init(&asciiInput); }
215 }
216 * */
217 std::string paramName {pair.second->GetName()};
218 // NewSimpleMessage creates a copy of the data and takes care of its destruction (after the transfer takes place).
219 // Should only be used for small data because of the cost of an additional copy
220
221 // Here must come the proper Runid
222 std::string message = paramName + ",111";
223 LOG(info) << "Requesting parameter container " << paramName << ", sending message: " << message;
224
225 FairMQMessagePtr req(NewSimpleMessage(message));
226 FairMQMessagePtr rep(NewMessage());
227
228 FairParGenericSet* newObj = nullptr;
229
230 if (Send(req, "parameters") > 0) {
231 if (Receive(rep, "parameters") >= 0) {
232 if (0 != rep->GetSize()) {
233 CbmMqTMessage tmsg(rep->GetData(), rep->GetSize());
234 newObj = static_cast<FairParGenericSet*>(tmsg.ReadObject(tmsg.GetClass()));
235 LOG(info) << "Received unpack parameter from the server: " << newObj->GetName();
236 newObj->print();
237 } // if( 0 != rep->GetSize() )
238 else {
239 LOG(error) << "Received empty reply. Parameter not available";
240 return kFALSE;
241 } // else of if( 0 != rep->GetSize() )
242 } // if( Receive( rep, "parameters" ) >= 0)
243 } // if( Send(req, "parameters") > 0 )
244 pair.second.reset(newObj);
245 //delete newObj;
246 }
247 return kTRUE;
248}
249
251{
254 // ALGO: bool initOK = fMonitorAlgo->CreateHistograms();
255 bool initOK = true;
256
258 // ALGO: std::vector<std::pair<TNamed*, std::string>> vHistos = fMonitorAlgo->GetHistoVector();
259 std::vector<std::pair<TNamed*, std::string>> vHistos = fBmonConfig->GetMonitor()->GetHistoVector();
261 // ALGO: std::vector<std::pair<TCanvas*, std::string>> vCanvases = fMonitorAlgo->GetCanvasVector();
262 std::vector<std::pair<TCanvas*, std::string>> vCanvases = fBmonConfig->GetMonitor()->GetCanvasVector();
263
268 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
269 // LOG(info) << "Registering " << vHistos[ uHisto ].first->GetName()
270 // << " in " << vHistos[ uHisto ].second.data()
271 // ;
272 fArrayHisto.Add(vHistos[uHisto].first);
273 std::pair<std::string, std::string> psHistoConfig(vHistos[uHisto].first->GetName(), vHistos[uHisto].second);
274 fvpsHistosFolder.push_back(psHistoConfig);
275
276 LOG(info) << "Config of hist " << psHistoConfig.first.data() << " in folder " << psHistoConfig.second.data();
277 } // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto )
278
282 for (UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv) {
283 // LOG(info) << "Registering " << vCanvases[ uCanv ].first->GetName()
284 // << " in " << vCanvases[ uCanv ].second.data();
285 std::string sCanvName = (vCanvases[uCanv].first)->GetName();
286 std::string sCanvConf = GenerateCanvasConfigString(vCanvases[uCanv].first);
287
288 std::pair<std::string, std::string> psCanvConfig(sCanvName, sCanvConf);
289
290 fvpsCanvasConfig.push_back(psCanvConfig);
291
292 LOG(info) << "Config string of Canvas " << psCanvConfig.first.data() << " is " << psCanvConfig.second.data();
293 } // for( UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv )
294
295 return initOK;
296}
297
298// Method called by run loop and requesting new data from the TS source whenever
300{
302 if (0 == fulNumMessages) {
303 try {
305 }
306 catch (InitTaskError& e) {
307 LOG(error) << e.what();
308 ChangeState(fair::mq::Transition::ErrorFound);
309 }
310 } // if( 0 == fulNumMessages)
311
312 if (0 == fulNumMessages) InitHistograms();
313
315 if (!fbStartTimeSet) {
317 std::string message = "SendFirstTimesliceIndex";
318 LOG(debug) << "Requesting start time by sending message: SendFirstTimesliceIndex" << message;
319 FairMQMessagePtr req(NewSimpleMessage(message));
320 FairMQMessagePtr rep(NewMessage());
321
322 if (Send(req, fsChannelNameDataInput) <= 0) {
323 LOG(error) << "Failed to send the request! message was " << message;
324 return false;
325 } // if (Send(req, fsChannelNameDataInput) <= 0)
326 else if (Receive(rep, fsChannelNameDataInput) < 0) {
327 LOG(error) << "Failed to receive a reply to the request! message was " << message;
328 return false;
329 } // else if (Receive(rep, fsChannelNameDataInput) < 0)
330 else if (rep->GetSize() == 0) {
331 LOG(error) << "Received empty reply. Something went wrong with the timeslice generation! message was " << message;
332 return false;
333 } // else if (rep->GetSize() == 0)
334 std::string sReply;
335 std::string msgStrRep(static_cast<char*>(rep->GetData()), rep->GetSize());
336 std::istringstream issRep(msgStrRep);
337 boost::archive::binary_iarchive inputArchiveRep(issRep);
338 inputArchiveRep >> sReply;
339
340 fBmonConfig->GetMonitor()->SetHistosStartTime((1e-9) * static_cast<double>(std::stoul(sReply)));
341 fbStartTimeSet = true;
342 }
343
345 std::string message = "full";
346 LOG(debug) << "Requesting new TS by sending message: full" << message;
347 FairMQMessagePtr req(NewSimpleMessage(message));
348 FairMQMessagePtr rep(NewMessage());
349
350 if (Send(req, fsChannelNameDataInput) <= 0) {
351 LOG(error) << "Failed to send the request! message was " << message;
352 return false;
353 } // if (Send(req, fsChannelNameDataInput) <= 0)
354 else if (Receive(rep, fsChannelNameDataInput) < 0) {
355 LOG(error) << "Failed to receive a reply to the request! message was " << message;
356 return false;
357 } // else if (Receive(rep, fsChannelNameDataInput) < 0)
358 else if (rep->GetSize() == 0) {
359 LOG(error) << "Received empty reply. Something went wrong with the timeslice generation! message was " << message;
360 return false;
361 } // else if (rep->GetSize() == 0)
362
364 LOG(debug) << "Received message number " << fulNumMessages << " with size " << rep->GetSize();
365
366 if (0 == fulNumMessages % 10000) LOG(info) << "Received " << fulNumMessages << " messages";
367
368 std::string msgStr(static_cast<char*>(rep->GetData()), rep->GetSize());
369 std::istringstream iss(msgStr);
370 boost::archive::binary_iarchive inputArchive(iss);
371
373 fles::StorableTimeslice ts {0};
374 inputArchive >> ts;
375
377 if (-1.0 == fdTsCoreSizeInNs) {
378 fuNbCoreMsPerTs = ts.num_core_microslices();
379 fuNbOverMsPerTs = ts.num_microslices(0) - ts.num_core_microslices();
380 fdMsSizeInNs = (ts.descriptor(0, fuNbCoreMsPerTs).idx - ts.descriptor(0, 0).idx) / fuNbCoreMsPerTs;
384 LOG(info) << "Timeslice parameters: each TS has " << fuNbCoreMsPerTs << " Core MS and " << fuNbOverMsPerTs
385 << " Overlap MS, for a MS duration of " << fdMsSizeInNs << " ns, a core duration of " << fdTsCoreSizeInNs
386 << " ns and a full duration of " << fdTsFullSizeInNs << " ns";
387 fTsMetaData = new TimesliceMetaData(ts.descriptor(0, 0).idx, fdTsCoreSizeInNs, fdTsOverSizeInNs, ts.index());
388 } // if( -1.0 == fdTsCoreSizeInNs )
389 else {
391 fTsMetaData->SetStartTime(ts.descriptor(0, 0).idx);
392 fTsMetaData->SetIndex(ts.index());
393 }
394
396 DoUnpack(ts, 0);
397
398 // Reset the event header for a new timeslice
400
401 // Reset the unpackers for a new timeslice, e.g. clear the output vectors
402 // ---- Bmon ----
403 if (fBmonConfig) fBmonConfig->Reset();
404
408 std::chrono::system_clock::time_point currentTime = std::chrono::system_clock::now();
409 std::chrono::duration<double_t> elapsedSeconds = currentTime - fLastPublishTime;
410 if ((fdMaxPublishTime < elapsedSeconds.count())
411 || (0 == fulNumMessages % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count())) {
412 if (!fbConfigSent) {
413 // Send the configuration only once per run!
415 } // if( !fbConfigSent )
416 else
418
419 fLastPublishTime = std::chrono::system_clock::now();
420 } // if( ( fdMaxPublishTime < elapsedSeconds.count() ) || ( 0 == fulNumMessages % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count() ) )
421
422 return true;
423}
424
426{
427 FairMQParts parts;
428
430 FairMQMessagePtr messTsHeader(NewMessage());
431 // Serialize<RootSerializer>(*messTsHeader, fCbmTsEventHeader);
432 RootSerializer().Serialize(*messTsHeader, fCbmTsEventHeader);
433
434 parts.AddPart(std::move(messTsHeader));
435
436 // ---- Bmon ----
437 std::stringstream ossBmon;
438 boost::archive::binary_oarchive oaBmon(ossBmon);
439 if (fBmonConfig) { //
440 oaBmon << *(fBmonConfig->GetOutputVec());
441 }
442 else {
443 oaBmon << (std::vector<CbmTofDigi>());
444 }
445 std::string* strMsgBmon = new std::string(ossBmon.str());
446
447 parts.AddPart(NewMessage(
448 const_cast<char*>(strMsgBmon->c_str()), // data
449 strMsgBmon->length(), // size
450 [](void*, void* object) { delete static_cast<std::string*>(object); },
451 strMsgBmon)); // object that manages the data
452
456 FairMQMessagePtr messTsMeta(NewMessage());
457 // Serialize<RootSerializer>(*messTsMeta, fTsMetaData);
458 RootSerializer().Serialize(*messTsMeta, fTsMetaData);
459 parts.AddPart(std::move(messTsMeta));
460
461 if (Send(parts, fsChannelNameDataOutput) < 0) {
462 LOG(error) << "Problem sending data to " << fsChannelNameDataOutput;
463 return false;
464 }
465
466 return true;
467}
468
469
471{
473 std::pair<uint32_t, uint32_t> pairHeader(fvpsHistosFolder.size(), fvpsCanvasConfig.size());
474 FairMQMessagePtr messageHeader(NewMessage());
475 // Serialize<BoostSerializer<std::pair<uint32_t, uint32_t>>>(*messageHeader, pairHeader);
476 BoostSerializer<std::pair<uint32_t, uint32_t>>().Serialize(*messageHeader, pairHeader);
477 FairMQParts partsOut;
478 partsOut.AddPart(std::move(messageHeader));
479
480 for (UInt_t uHisto = 0; uHisto < fvpsHistosFolder.size(); ++uHisto) {
482 FairMQMessagePtr messageHist(NewMessage());
483 // Serialize<BoostSerializer<std::pair<std::string, std::string>>>(*messageHist, fvpsHistosFolder[uHisto]);
484 BoostSerializer<std::pair<std::string, std::string>>().Serialize(*messageHist, fvpsHistosFolder[uHisto]);
485
486 partsOut.AddPart(std::move(messageHist));
487 } // for (UInt_t uHisto = 0; uHisto < fvpsHistosFolder.size(); ++uHisto)
488
491 if (0 == fvpsHistosFolder.size()) {
492 FairMQMessagePtr messageHist(NewMessage());
493 partsOut.AddPart(std::move(messageHist));
494 }
495
496 for (UInt_t uCanv = 0; uCanv < fvpsCanvasConfig.size(); ++uCanv) {
498 FairMQMessagePtr messageCan(NewMessage());
499 // Serialize<BoostSerializer<std::pair<std::string, std::string>>>(*messageCan, fvpsCanvasConfig[uCanv]);
500 BoostSerializer<std::pair<std::string, std::string>>().Serialize(*messageCan, fvpsCanvasConfig[uCanv]);
501
502 partsOut.AddPart(std::move(messageCan));
503 } // for (UInt_t uCanv = 0; uCanv < fvpsCanvasConfig.size(); ++uCanv)
504
507 if (0 == fvpsCanvasConfig.size()) {
508 FairMQMessagePtr messageHist(NewMessage());
509 partsOut.AddPart(std::move(messageHist));
510 }
511
513 FairMQMessagePtr msgHistos(NewMessage());
514 // Serialize<RootSerializer>(*msgHistos, &fArrayHisto);
515 RootSerializer().Serialize(*msgHistos, &fArrayHisto);
516 partsOut.AddPart(std::move(msgHistos));
517
519 if (Send(partsOut, fsChannelNameHistosInput) < 0) {
520 LOG(error) << "CbmTsConsumerReqDevExample::SendHistoConfAndData => Problem sending data";
521 return false;
522 } // if( Send( partsOut, fsChannelNameHistosInput ) < 0 )
523
525 // ALGO: fMonitorAlgo->ResetHistograms(kFALSE);
526 fBmonConfig->GetMonitor()->ResetHistograms();
527 fBmonConfig->GetMonitor()->ResetBmonHistograms(kFALSE);
528
529 return true;
530}
531
533{
535 FairMQMessagePtr message(NewMessage());
536 // Serialize<RootSerializer>(*message, &fArrayHisto);
537 RootSerializer().Serialize(*message, &fArrayHisto);
538
540 if (Send(message, fsChannelNameHistosInput) < 0) {
541 LOG(error) << "Problem sending data";
542 return false;
543 } // if( Send( message, fsChannelNameHistosInput ) < 0 )
544
546 // ALGO: fMonitorAlgo->ResetHistograms(kFALSE);
547
548 return true;
549}
550
551
553{
554 if (fBmonConfig) fBmonConfig->GetUnpacker()->Finish();
555}
556
557Bool_t CbmDeviceBmonMonitor::DoUnpack(const fles::Timeslice& ts, size_t /*component*/)
558{
559 fulTsCounter++;
560 // Prepare timeslice
561 // const fles::Timeslice& timeslice = *ts;
562
563 fCbmTsEventHeader->SetTsIndex(ts.index());
564 fCbmTsEventHeader->SetTsStartTime(ts.start_time());
565
566 uint64_t nComponents = ts.num_components();
567 // if (fDoDebugPrints) LOG(info) << "Unpack: TS index " << ts.index() << " components " << nComponents;
568 LOG(debug) << "Unpack: TS index " << ts.index() << " components " << nComponents;
569
570 for (uint64_t component = 0; component < nComponents; component++) {
571 auto systemId = static_cast<std::uint16_t>(ts.descriptor(component, 0).sys_id);
572
573 switch (systemId) {
574 case fkFlesBmon: {
575 if (fBmonConfig) {
577 unpack(systemId, &ts, component, fBmonConfig, fBmonConfig->GetOptOutAVec(), fBmonConfig->GetOptOutBVec()));
578 }
579 break;
580 }
581 default: {
582 if (fDoDebugPrints) LOG(error) << "Unpack: Unknown system ID " << systemId << " for component " << component;
583 break;
584 }
585 }
586 }
587
588 if (0 == fulTsCounter % 10000) LOG(info) << "Processed " << fulTsCounter << " time slices";
589
590 return kTRUE;
591}
596std::shared_ptr<CbmTrdSpadic> CbmDeviceBmonMonitor::GetTrdSpadic(bool useAvgBaseline)
597{
598 auto spadic = std::make_shared<CbmTrdSpadic>();
599 spadic->SetUseBaselineAverage(useAvgBaseline);
600 spadic->SetMaxAdcToEnergyCal(1.0);
601
602 return spadic;
603}
604
std::string GenerateCanvasConfigString(TCanvas *pCanv)
Configuration class for an unpacker algorithm.
Configuration class for an unpacker algorithm.
Configuration class for an unpacker algorithm.
Configuration class for an unpacker algorithm.
Configuration class for an unpacker algorithm.
Configuration class for an unpacker algorithm.
Configuration class for an unpacker algorithm.
bool first
std::chrono::system_clock::time_point fLastPublishTime
bool fDoDebugPrints
Flag if extended debug output is to be printed or not.
Double_t fdTsFullSizeInNs
Total size of the overlap MS in a TS, [nanoseconds].
Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Bool_t InitParameters(std::vector< std::pair< std::string, std::shared_ptr< FairParGenericSet > > > *reqparvec)
Parameters management.
TObjArray fArrayHisto
Array of histograms to send to the histogram server.
uint32_t fuPublishFreqTs
Histograms management.
std::shared_ptr< CbmTrdSpadic > GetTrdSpadic(bool useAvgBaseline)
Get the Trd Spadic.
CbmTsEventHeader * fCbmTsEventHeader
Pointer to the Timeslice header conatining start time and index.
bool fbOutputFullTimeSorting
Flag to Enable/disable a full time sorting. If off, time sorting happens per link/FLIM source.
Double_t fdTsCoreSizeInNs
Size of a single MS, [nanoseconds].
std::shared_ptr< CbmBmonUnpackConfig > fBmonConfig
Configuration of the unpackers. Provides the configured algorithm.
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder
Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.
Double_t fdTsOverSizeInNs
Total size of the core MS in a TS, [nanoseconds].
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig
void SetUnpackConfig(std::shared_ptr< CbmBmonUnpackConfig > config)
Set the Bmon Unpack Config.
std::vector< std::string > fvsSetTimeOffs
Time offsets.
size_t fuNbCoreMsPerTs
TS MetaData storage: stable so should be moved somehow to parameters handling (not transmitted with e...
std::string fsSetupName
User settings parameters.
uint64_t fulNumMessages
Statistics & first TS rejection.
static constexpr std::uint16_t fkFlesBmon
Constants.
std::string fsChannelNameDataInput
message queues
size_t unpack(const std::uint16_t subsysid, const fles::Timeslice *ts, std::uint16_t icomp, TConfig config, std::vector< TOptOutA > *optouttargetvecA=nullptr, std::vector< TOptOutB > *optouttargetvecB=nullptr)
Template for the unpacking call of a given algorithm.
bool fbConfigSent
Flag indicating whether the histograms and canvases configurations were already published.
TimesliceMetaData * fTsMetaData
Total size of all MS in a TS, [nanoseconds].
bool fbUnpBmon
---> for selective unpacking
Bool_t fbIgnoreOverlapMs
Control flags.
void LoadStoredSetup(CbmSetupStorable *setupIn)
Definition CbmSetup.cxx:46
static CbmSetup * Instance()
Definition CbmSetup.cxx:160
void AddNDigisBmon(uint64_t value)
Add a number of digis from this Ts.
void Reset()
Resets counters and variables for a new Timeslice, e.g. the NDigis counter are set back to 0.
void SetTsStartTime(uint64_t value)
Set the Ts Start Time.
void SetTsIndex(uint64_t value)
Set the Ts Start Time.
void SetStartTime(uint64_t ulStart)
void SetIndex(uint64_t ulIdx)
void ChangeState(FairMQDevice *device, cbm::mq::Transition transition)
Definition CbmMQDefs.h:26
Hash for CbmL1LinkKey.