CbmRoot
Loading...
Searching...
No Matches
CbmDeviceDigiEventSink.cxx
Go to the documentation of this file.
1/* Copyright (C) 2020-2021 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
16#include "CbmEvent.h"
17#include "CbmFlesCanvasTools.h"
18#include "CbmMQDefs.h"
19
20#include "TimesliceMetaData.h"
21
23#include "FairMQLogger.h"
24#include "FairMQProgOptions.h" // device->fConfig
25#include "FairParGenericSet.h"
26#include "FairRootFileSink.h"
27#include "FairRootManager.h"
28#include "FairRunOnline.h"
29#include "FairSource.h"
30
31#include "BoostSerializer.h"
32
33#include "RootSerializer.h"
34
36#include "TCanvas.h"
37#include "TFile.h"
38#include "TH1.h"
39#include "TList.h"
40#include "TNamed.h"
41#include "TProfile.h"
42
43#include <boost/archive/binary_iarchive.hpp>
44#include <boost/serialization/utility.hpp>
45
47#include <array>
48#include <iomanip>
49#include <stdexcept>
50#include <string>
51#include <thread> // this_thread::sleep_for
52struct InitTaskError : std::runtime_error {
53 using std::runtime_error::runtime_error;
54};
55
56using namespace std;
57
58//Bool_t bMcbm2018MonitorTaskBmonResetHistos = kFALSE;
59
61
63try {
65 LOG(info) << "Init options for CbmDeviceDigiEventSink.";
66
67 fbStoreFullTs = fConfig->GetValue<bool>("StoreFullTs");
68 fsOutputFileName = fConfig->GetValue<std::string>("OutFileName");
69
70 fsChannelNameDataInput = fConfig->GetValue<std::string>("EvtNameIn");
72
73 fbBypassConsecutiveTs = fConfig->GetValue<bool>("BypassConsecutiveTs");
74 fbWriteMissingTs = fConfig->GetValue<bool>("WriteMissingTs");
75 fbDisableCompression = fConfig->GetValue<bool>("DisableCompression");
76 fiTreeFileMaxSize = fConfig->GetValue<int64_t>("TreeFileMaxSize");
77 fbDigiEventInput = fConfig->GetValue<bool>("DigiEventInput");
78 fbExclusiveTrdExtract = fConfig->GetValue<bool>("ExclusiveTrdExtract");
79
80 fbFillHistos = fConfig->GetValue<bool>("FillHistos");
81 fuPublishFreqTs = fConfig->GetValue<uint32_t>("PubFreqTs");
82 fdMinPublishTime = fConfig->GetValue<double_t>("PubTimeMin");
83 fdMaxPublishTime = fConfig->GetValue<double_t>("PubTimeMax");
84 fsHistosSuffix = fConfig->GetValue<std::string>("HistosSuffix");
85 fsChannelNameHistosInput = fConfig->GetValue<std::string>("ChNameIn");
86
89
92
94 // Get the information about created channels from the device
95 // Check if the defined channels from the topology (by name)
96 // are in the list of channels which are possible/allowed
97 // for the device
98 // The idea is to check at initilization if the devices are
99 // properly connected. For the time beeing this is done with a
100 // nameing convention. It is not avoided that someone sends other
101 // data on this channel.
102 //logger::SetLogLevel("INFO");
103 int noChannel = fChannels.size();
104 LOG(info) << "Number of defined channels: " << noChannel;
105 for (auto const& entry : fChannels) {
106 LOG(info) << "Channel name: " << entry.first;
107 if (std::string::npos != entry.first.find(fsChannelNameDataInput)) {
108 if (!IsChannelNameAllowed(entry.first)) throw InitTaskError("Channel name does not match.");
109 OnData(entry.first, &CbmDeviceDigiEventSink::HandleData);
110 } // if( entry.first.find( "ts" )
111 } // for( auto const &entry : fChannels )
112
113 // InitContainers();
114
117 fTimeSliceMetaDataArray = new TClonesArray("TimesliceMetaData", 1);
118 if (NULL == fTimeSliceMetaDataArray) {
119 throw InitTaskError("Failed creating the TS meta data TClonesarray ");
120 } // if( NULL == fTimeSliceMetaDataArray )
123 fEventsSel = new std::vector<CbmDigiEvent>();
124
126 if ("" != fsOutputFileName) {
127 fpRun = new FairRunOnline();
128 FairRootFileSink* pSink = new FairRootFileSink(fsOutputFileName);
129 fpFairRootMgr = FairRootManager::Instance();
130 fpFairRootMgr->SetSink(pSink);
131 if (nullptr == fpFairRootMgr->GetOutFile()) {
132 throw InitTaskError("Could not open root file");
133 } // if( nullptr == fpFairRootMgr->GetOutFile() )
136 pSink->GetRootFile()->SetCompressionLevel(0);
137 }
139 TTree::SetMaxTreeSize(fiTreeFileMaxSize);
140 } // if( "" != fsOutputFileName )
141 else {
142 throw InitTaskError("Empty output filename!");
143 } // else of if( "" != fsOutputFileName )
144
145 LOG(info) << "Init Root Output to " << fsOutputFileName;
146
147 fpFairRootMgr->InitSink();
149 fpFairRootMgr->Register("EventHeader.", "Event", fEvtHeader, kTRUE);
150
153 fpFairRootMgr->Register("TimesliceMetaData", "TS Meta Data", fTimeSliceMetaDataArray, kTRUE);
155 fpFairRootMgr->RegisterAny("DigiEvent", fEventsSel, kTRUE);
156
158 if (fbStoreFullTs) {
159 fvDigiBmon = new std::vector<CbmBmonDigi>();
160 fvDigiSts = new std::vector<CbmStsDigi>();
161 fvDigiMuch = new std::vector<CbmMuchDigi>();
162 fvDigiTrd = new std::vector<CbmTrdDigi>();
163 fvDigiTof = new std::vector<CbmTofDigi>();
164 fvDigiRich = new std::vector<CbmRichDigi>();
165 fvDigiPsd = new std::vector<CbmPsdDigi>();
166
168 fpFairRootMgr->RegisterAny(CbmStsDigi::GetBranchName(), fvDigiSts, kTRUE);
170 fpFairRootMgr->RegisterAny(CbmTrdDigi::GetBranchName(), fvDigiTrd, kTRUE);
171 fpFairRootMgr->RegisterAny(CbmTofDigi::GetBranchName(), fvDigiTof, kTRUE);
173 fpFairRootMgr->RegisterAny(CbmPsdDigi::GetBranchName(), fvDigiPsd, kTRUE);
174 }
175
176 fpFairRootMgr->WriteFolder();
177
178 LOG(info) << "Initialized outTree with rootMgr at " << fpFairRootMgr;
179
181 if (kTRUE == fbFillHistos) {
183 if (kFALSE == InitHistograms()) { throw InitTaskError("Failed to initialize the histograms."); }
184 } // if( kTRUE == fbFillHistos )
185 fbInitDone = true;
186}
187catch (InitTaskError& e) {
188 LOG(error) << e.what();
189 // Wrapper defined in CbmMQDefs.h to support different FairMQ versions
191}
192
194{
195 for (auto const& entry : fsAllowedChannels) {
196 std::size_t pos1 = channelName.find(entry);
197 if (pos1 != std::string::npos) {
198 const vector<std::string>::const_iterator pos =
199 std::find(fsAllowedChannels.begin(), fsAllowedChannels.end(), entry);
200 const vector<std::string>::size_type idx = pos - fsAllowedChannels.begin();
201 LOG(info) << "Found " << entry << " in " << channelName;
202 LOG(info) << "Channel name " << channelName << " found in list of allowed channel names at position " << idx;
203 return true;
204 } // if (pos1!=std::string::npos)
205 } // for(auto const &entry : fsAllowedChannels)
206 LOG(info) << "Channel name " << channelName << " not found in list of allowed channel names.";
207 LOG(error) << "Stop device.";
208 return false;
209}
210
212{
215 // bool initOK =CreateHistograms();
216 bool initOK = true;
217
219 // ALGO: std::vector<std::pair<TNamed*, std::string>> vHistos = fMonitorAlgo->GetHistoVector();
220 std::vector<std::pair<TNamed*, std::string>> vHistos = {};
221
222 /* clang-format off */
223 fhFullTsBuffSizeEvo = new TProfile(Form("hFullTsBuffSizeEvo%s", fsHistosSuffix.data()),
224 "Evo. of the full TS buffer size; Time in run [s]; Size []",
225 720, 0, 7200);
226 fhMissTsBuffSizeEvo = new TProfile(Form("hMissTsBuffSizeEvo%s", fsHistosSuffix.data()),
227 "Evo. of the missed TS buffer size; Time in run [s]; Size []",
228 720, 0, 7200);
229 fhFullTsProcEvo = new TH1I(Form("hFullTsProcEvo%s", fsHistosSuffix.data()),
230 "Processed full TS; Time in run [s]; # []",
231 720, 0, 7200);
232 fhMissTsProcEvo = new TH1I(Form("hMissTsProcEvo%s", fsHistosSuffix.data()),
233 "Processed missing TS; Time in run [s]; # []",
234 720, 0, 7200);
235 fhTotalTsProcEvo = new TH1I(Form("hTotalTsProcEvo%s", fsHistosSuffix.data()),
236 "Total processed TS; Time in run [s]; # []",
237 720, 0, 7200);
238 fhTotalEventsEvo = new TH1I(Form("hTotalEventsEvo%s", fsHistosSuffix.data()),
239 "Processed events; Time in run [s]; # []",
240 720, 0, 7200);
241 /* clang-format on */
242
243 std::string sFolder = std::string("EvtSink") + fsHistosSuffix;
244 vHistos.push_back(std::pair<TNamed*, std::string>(fhFullTsBuffSizeEvo, sFolder));
245 vHistos.push_back(std::pair<TNamed*, std::string>(fhMissTsBuffSizeEvo, sFolder));
246 vHistos.push_back(std::pair<TNamed*, std::string>(fhFullTsProcEvo, sFolder));
247 vHistos.push_back(std::pair<TNamed*, std::string>(fhMissTsProcEvo, sFolder));
248 vHistos.push_back(std::pair<TNamed*, std::string>(fhTotalTsProcEvo, sFolder));
249 vHistos.push_back(std::pair<TNamed*, std::string>(fhTotalEventsEvo, sFolder));
250
252 // ALGO: std::vector<std::pair<TCanvas*, std::string>> vCanvases = fMonitorAlgo->GetCanvasVector();
253 std::vector<std::pair<TCanvas*, std::string>> vCanvases = {};
254
255 fcEventSinkAllHist = new TCanvas(Form("cEventSinkAllHist%s", fsHistosSuffix.data()), "Event Sink Monitoring");
256 fcEventSinkAllHist->Divide(3, 2);
257
258 fcEventSinkAllHist->cd(1);
259 gPad->SetGridx();
260 gPad->SetGridy();
261 fhFullTsBuffSizeEvo->Draw("hist");
262
263 fcEventSinkAllHist->cd(2);
264 gPad->SetGridx();
265 gPad->SetGridy();
266 fhMissTsBuffSizeEvo->Draw("hist");
267
268 fcEventSinkAllHist->cd(3);
269 gPad->SetGridx();
270 gPad->SetGridy();
271 fhFullTsProcEvo->Draw("hist");
272
273 fcEventSinkAllHist->cd(4);
274 gPad->SetGridx();
275 gPad->SetGridy();
276 fhMissTsProcEvo->Draw("hist");
277
278 fcEventSinkAllHist->cd(5);
279 gPad->SetGridx();
280 gPad->SetGridy();
281 fhTotalTsProcEvo->Draw("hist");
282
283 fcEventSinkAllHist->cd(6);
284 gPad->SetGridx();
285 gPad->SetGridy();
286 gPad->SetLogy();
287 fhTotalEventsEvo->Draw("hist");
288
289 vCanvases.push_back(std::pair<TCanvas*, std::string>(fcEventSinkAllHist, std::string("canvases") + fsHistosSuffix));
290
295 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
296 // LOG(info) << "Registering " << vHistos[ uHisto ].first->GetName()
297 // << " in " << vHistos[ uHisto ].second.data()
298 // ;
299 fArrayHisto.Add(vHistos[uHisto].first);
300 std::pair<std::string, std::string> psHistoConfig(vHistos[uHisto].first->GetName(), vHistos[uHisto].second);
301 fvpsHistosFolder.push_back(psHistoConfig);
302
303 LOG(info) << "Config of hist " << psHistoConfig.first.data() << " in folder " << psHistoConfig.second.data();
304 } // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto )
305
309 for (UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv) {
310 // LOG(info) << "Registering " << vCanvases[ uCanv ].first->GetName()
311 // << " in " << vCanvases[ uCanv ].second.data();
312 std::string sCanvName = (vCanvases[uCanv].first)->GetName();
313 std::string sCanvConf = GenerateCanvasConfigString(vCanvases[uCanv].first);
314
315 std::pair<std::string, std::string> psCanvConfig(sCanvName, sCanvConf);
316
317 fvpsCanvasConfig.push_back(psCanvConfig);
318
319 LOG(info) << "Config string of Canvas " << psCanvConfig.first.data() << " is " << psCanvConfig.second.data();
320 } // for( UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv )
321
322 return initOK;
323}
325{
326 fhFullTsBuffSizeEvo->Reset();
327 fhMissTsBuffSizeEvo->Reset();
328 fhFullTsProcEvo->Reset();
329 fhMissTsProcEvo->Reset();
330 fhTotalTsProcEvo->Reset();
331 fhTotalEventsEvo->Reset();
332 if (bResetStartTime) {
334 fStartTime = std::chrono::system_clock::now();
335 }
336 return true;
337}
338
339//--------------------------------------------------------------------//
340// handler is called whenever a message arrives on fsChannelNameMissedTs, with a reference to the message and a sub-channel index (here 0)
341bool CbmDeviceDigiEventSink::HandleMissTsData(FairMQMessagePtr& msg, int /*index*/)
342{
343 std::vector<uint64_t> vIndices;
344 std::string msgStrMissTs(static_cast<char*>(msg->GetData()), msg->GetSize());
345 std::istringstream issMissTs(msgStrMissTs);
346 boost::archive::binary_iarchive inputArchiveMissTs(issMissTs);
347 inputArchiveMissTs >> vIndices;
348
349 fvulMissedTsIndices.insert(fvulMissedTsIndices.end(), vIndices.begin(), vIndices.end());
350
355 }
356
357 return true;
358}
359//--------------------------------------------------------------------//
360// handler is called whenever a message arrives on "data", with a reference to the message and a sub-channel index (here 0)
361bool CbmDeviceDigiEventSink::HandleData(FairMQParts& parts, int /*index*/)
362{
364 LOG(debug) << "Received message number " << fulNumMessages << " with " << parts.Size() << " parts"
365 << ", size0: " << parts.At(0)->GetSize();
366
367 if (0 == fulNumMessages % 10000) LOG(info) << "Received " << fulNumMessages << " messages";
368
371
373 LOG(debug) << "Next TS check " << fuPrevTsIndex << " " << fulTsCounter << " " << unpTs.fTsMetaData.GetIndex()
374 << " Storage size: " << fmFullTsStorage.size();
376 || (0 == fuPrevTsIndex && 0 == fulTsCounter && 0 == unpTs.fTsMetaData.GetIndex())) {
377 LOG(debug) << "TS direct to dump";
379 PrepareTreeEntry(unpTs);
384 fulTsCounter++;
385 }
386 else {
387 LOG(debug) << "TS direct to storage";
389 fmFullTsStorage.emplace_hint(fmFullTsStorage.end(),
390 std::pair<uint64_t, CbmEventTimeslice>(unpTs.fTsMetaData.GetIndex(), unpTs));
391 }
392 LOG(debug) << "TS metadata checked";
393
395 // delete fTsMetaData;
396
400 if (fbReceivedEof) {
404 LOG(info) << "CbmDeviceDigiEventSink::HandleData => "
405 << "Found all expected TS (" << fulTsCounter << ") and total nb of TS " << fuTotalTsCount
406 << " after accounting for the ones reported as missing by the source (" << fvulMissedTsIndices.size()
407 << ")";
408 Finish();
409 } // if ((fulTsCounter + fvulMissedTsIndices.size()) == fuTotalTsCount)
410 }
411 }
412 else {
415 LOG(debug) << "TS queues checked";
416 }
417
419 if (kTRUE == fbFillHistos) {
420 std::chrono::system_clock::time_point currentTime = std::chrono::system_clock::now();
421
424 std::chrono::duration<double_t> elapsedSecondsFill = currentTime - fLastFillTime;
425 if (1.0 < elapsedSecondsFill.count()) {
426 std::chrono::duration<double_t> secInRun = currentTime - fStartTime;
427
429 /*
430 int32_t iBinIndex = fhFullTsBuffSizeEvo->FindBin(secInRun.count());
431 fhFullTsBuffSizeEvo->SetBinContent(iBinIndex, fmFullTsStorage.size());
432 fhMissTsBuffSizeEvo->SetBinContent(iBinIndex, fvulMissedTsIndices.size());
433 fhFullTsProcEvo->SetBinContent(iBinIndex, fulTsCounter);
434 fhMissTsProcEvo->SetBinContent(iBinIndex, fulMissedTsCounter);
435 fhTotalTsProcEvo->SetBinContent(iBinIndex, (fulTsCounter + fulMissedTsCounter));
436 fhTotalEventsEvo->SetBinContent(iBinIndex, fulProcessedEvents);
437 */
438 fhFullTsBuffSizeEvo->Fill(secInRun.count(), fmFullTsStorage.size());
439 fhMissTsBuffSizeEvo->Fill(secInRun.count(), fvulMissedTsIndices.size());
440 fhFullTsProcEvo->Fill(secInRun.count(), (fulTsCounter - fulLastFullTsCounter));
441 fhMissTsProcEvo->Fill(secInRun.count(), (fulMissedTsCounter - fulLastMissTsCounter));
442 fhTotalTsProcEvo->Fill(secInRun.count(),
445
446 fLastFillTime = currentTime;
450 }
451
455 std::chrono::duration<double_t> elapsedSeconds = currentTime - fLastPublishTime;
456 if ((fdMaxPublishTime < elapsedSeconds.count())
457 || (0 == fulNumMessages % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count())) {
458 if (!fbConfigSent) {
459 // Send the configuration only once per run!
461 } // if( !fbConfigSent )
462 else
464
465 fLastPublishTime = currentTime;
466 } // if( ( fdMaxPublishTime < elapsedSeconds.count() ) || ( 0 == fulNumMessages % fuPublishFreqTs && fdMinPublishTime < elapsedSeconds.count() ) )
467 } // if( kTRUE == fbFillHistos )
468
469 LOG(debug) << "Processed TS with saving " << (fulTsCounter + fulMissedTsCounter) << " TS (" << fulTsCounter
470 << " full ones and " << fulMissedTsCounter << " missed/empty ones)";
471 LOG(debug) << "Buffers are " << fmFullTsStorage.size() << " full TS and " << fvulMissedTsIndices.size()
472 << " missed/empty ones)";
473
474 return true;
475}
476//--------------------------------------------------------------------//
477bool CbmDeviceDigiEventSink::HandleCommand(FairMQMessagePtr& msg, int /*index*/)
478{
479 /*
480 std::string sCommand( static_cast< char * >( msg->GetData() ),
481 msg->GetSize() );
482*/
483 std::string sCommand;
484 std::string msgStrCmd(static_cast<char*>(msg->GetData()), msg->GetSize());
485 std::istringstream issCmd(msgStrCmd);
486 boost::archive::binary_iarchive inputArchiveCmd(issCmd);
487 inputArchiveCmd >> sCommand;
488
489 std::string sCmdTag = sCommand;
490 size_t charPosDel = sCommand.find(' ');
491 if (std::string::npos != charPosDel) {
492 sCmdTag = sCommand.substr(0, charPosDel);
493 } // if( std::string::npos != charPosDel )
494
495 if ("EOF" == sCmdTag) {
496 fbReceivedEof = true;
497
499 if (std::string::npos == charPosDel) {
500 LOG(fatal) << "CbmDeviceDigiEventSink::HandleCommand => "
501 << "Incomplete EOF command received: " << sCommand;
502 return false;
503 } // if( std::string::npos == charPosDel )
505 charPosDel++;
506 std::string sNext = sCommand.substr(charPosDel);
507 charPosDel = sNext.find(' ');
508
509 if (std::string::npos == charPosDel) {
510 LOG(fatal) << "CbmDeviceDigiEventSink::HandleCommand => "
511 << "Incomplete EOF command received: " << sCommand;
512 return false;
513 } // if( std::string::npos == charPosDel )
514 fuLastTsIndex = std::stoul(sNext.substr(0, charPosDel));
516 charPosDel++;
517 fuTotalTsCount = std::stoul(sNext.substr(charPosDel));
518
519 LOG(info) << "CbmDeviceDigiEventSink::HandleCommand => "
520 << "Received EOF command with final TS index " << fuLastTsIndex << " and total nb TS " << fuTotalTsCount;
523 LOG(info) << "CbmDeviceDigiEventSink::HandleCommand => "
524 << "Found final TS index " << fuLastTsIndex << " and total nb TS " << fuTotalTsCount;
525 Finish();
526 } // if( fuPrevTsIndex == fuLastTsIndex && fulTsCounter == fuTotalTsCount )
527 } // if( "EOF" == sCmdTag )
528 else if ("STOP" == sCmdTag) {
531 Finish();
532 } // else if( "STOP" == sCmdTag )
533 else {
534 LOG(warning) << "Unknown command received: " << sCmdTag << " => will be ignored!";
535 } // else if command not recognized
536
537 return true;
538}
539//--------------------------------------------------------------------//
541{
542 bool bHoleFoundInBothQueues = false;
543
544 std::map<uint64_t, CbmEventTimeslice>::iterator itFullTs = fmFullTsStorage.begin();
545 std::vector<uint64_t>::iterator itMissTs = fvulMissedTsIndices.begin();
546
547 while (!bHoleFoundInBothQueues) {
549 if (fmFullTsStorage.end() != itFullTs && fuPrevTsIndex + 1 == (*itFullTs).first) {
551 PrepareTreeEntry((*itFullTs).second);
554
556 fuPrevTsIndex = (*itFullTs).first;
557 fulTsCounter++;
558
560 ++itFullTs;
561 continue;
562 } // if( fmFullTsStorage.end() != itFullTs && fuPrevTsIndex + 1 == (*itFullTs).first() )
563 if (fmFullTsStorage.end() != itFullTs)
564 LOG(debug) << "CbmDeviceDigiEventSink::CheckTsQueues => Full TS " << (*itFullTs).first << " VS "
565 << (fuPrevTsIndex + 1);
567 if (fvulMissedTsIndices.end() != itMissTs
568 && ((0 == fuPrevTsIndex && fuPrevTsIndex == (*itMissTs))
569 || ((0 < fulTsCounter || 0 < fulMissedTsCounter) && fuPrevTsIndex + 1 == (*itMissTs)))) {
570
571 if (fbWriteMissingTs) {
573 new ((*fTimeSliceMetaDataArray)[fTimeSliceMetaDataArray->GetEntriesFast()])
574 TimesliceMetaData(0, 0, 0, (*itMissTs));
575
578 }
579
581 fuPrevTsIndex = (*itMissTs);
583
585 ++itMissTs;
586 continue;
587 } // if( fvulMissedTsIndices.end() != itMissTs && fuPrevTsIndex + 1 == (*itMissTs ) )
588 if (fvulMissedTsIndices.end() != itMissTs)
589 LOG(debug) << "CbmDeviceDigiEventSink::CheckTsQueues => Empty TS " << (*itMissTs) << " VS "
590 << (fuPrevTsIndex + 1);
591
593 bHoleFoundInBothQueues = true;
594 } // while( !bHoleFoundInBothQueues )
595
596 LOG(debug) << "CbmDeviceDigiEventSink::CheckTsQueues => buffered TS " << fmFullTsStorage.size()
597 << " buffered empties " << fvulMissedTsIndices.size();
598 for (auto it = fmFullTsStorage.begin(); it != fmFullTsStorage.end(); ++it) {
599 LOG(debug) << "CbmDeviceDigiEventSink::CheckTsQueues => buffered TS index " << (*it).first;
600 }
601
603 fmFullTsStorage.erase(fmFullTsStorage.begin(), itFullTs);
604 fvulMissedTsIndices.erase(fvulMissedTsIndices.begin(), itMissTs);
605
608 LOG(info) << "CbmDeviceDigiEventSink::CheckTsQueues => "
609 << "Found final TS index " << fuLastTsIndex << " and total nb TS " << fuTotalTsCount;
610 Finish();
611 } // if( fbReceivedEof && fuPrevTsIndex == fuLastTsIndex && fulTsCounter == fuTotalTsCount )
612}
613//--------------------------------------------------------------------//
615{
618
619 (*fEvtHeader) = std::move(unpTs.fCbmTsEventHeader);
620
622 new ((*fTimeSliceMetaDataArray)[fTimeSliceMetaDataArray->GetEntriesFast()])
623 TimesliceMetaData(std::move(unpTs.fTsMetaData));
624
626 // FU, 29.06.22 Remove std::move to allow copy ellision
627 (*fEventsSel) = unpTs.GetSelectedData(fbExclusiveTrdExtract);
628 if (kTRUE == fbFillHistos) {
631 }
632
634 if (fbStoreFullTs) {
635 if (0 < unpTs.fvDigiBmon.size()) fvDigiBmon->assign(unpTs.fvDigiBmon.begin(), unpTs.fvDigiBmon.end());
636 if (0 < unpTs.fvDigiSts.size()) fvDigiSts->assign(unpTs.fvDigiSts.begin(), unpTs.fvDigiSts.end());
637 if (0 < unpTs.fvDigiMuch.size()) fvDigiMuch->assign(unpTs.fvDigiMuch.begin(), unpTs.fvDigiMuch.end());
638 if (0 < unpTs.fvDigiTrd.size()) fvDigiTrd->assign(unpTs.fvDigiTrd.begin(), unpTs.fvDigiTrd.end());
639 if (0 < unpTs.fvDigiTof.size()) fvDigiTof->assign(unpTs.fvDigiTof.begin(), unpTs.fvDigiTof.end());
640 if (0 < unpTs.fvDigiRich.size()) fvDigiRich->assign(unpTs.fvDigiRich.begin(), unpTs.fvDigiRich.end());
641 if (0 < unpTs.fvDigiPsd.size()) fvDigiPsd->assign(unpTs.fvDigiPsd.begin(), unpTs.fvDigiPsd.end());
642 }
643}
645{
646 // Unpacked digis + CbmEvent output to root file
647 /*
648 * NH style
649// fpFairRootMgr->FillEventHeader(fEvtHeader);
650// LOG(info) << "Fill WriteOutBuffer with FairRootManager at " << fpFairRootMgr;
651// fpOutRootFile->cd();
652 fpFairRootMgr->Fill();
653 fpFairRootMgr->StoreWriteoutBufferData( fpFairRootMgr->GetEventTime() );
654 //fpFairRootMgr->StoreAllWriteoutBufferData();
655 fpFairRootMgr->DeleteOldWriteoutBufferData();
656*/
658 fpFairRootMgr->StoreWriteoutBufferData(fpFairRootMgr->GetEventTime());
659 auto source = fpFairRootMgr->GetSource();
660 if (source) { source->FillEventHeader(fEvtHeader); }
661 fpFairRootMgr->Fill();
662 fpFairRootMgr->DeleteOldWriteoutBufferData();
663 // fpFairRootMgr->Write();
664
667
669 fEventsSel->clear();
671 if (fbStoreFullTs) {
672 fvDigiBmon->clear();
673 fvDigiSts->clear();
674 fvDigiMuch->clear();
675 fvDigiTrd->clear();
676 fvDigiTof->clear();
677 fvDigiRich->clear();
678 fvDigiPsd->clear();
679 }
680}
681
682//--------------------------------------------------------------------//
683
685{
687 std::pair<uint32_t, uint32_t> pairHeader(fvpsHistosFolder.size(), fvpsCanvasConfig.size());
688 FairMQMessagePtr messageHeader(NewMessage());
689 // Serialize<BoostSerializer<std::pair<uint32_t, uint32_t>>>(*messageHeader, pairHeader);
690 BoostSerializer<std::pair<uint32_t, uint32_t>>().Serialize(*messageHeader, pairHeader);
691
692 FairMQParts partsOut;
693 partsOut.AddPart(std::move(messageHeader));
694
695 for (UInt_t uHisto = 0; uHisto < fvpsHistosFolder.size(); ++uHisto) {
697 FairMQMessagePtr messageHist(NewMessage());
698 // Serialize<BoostSerializer<std::pair<std::string, std::string>>>(*messageHist, fvpsHistosFolder[uHisto]);
699 BoostSerializer<std::pair<std::string, std::string>>().Serialize(*messageHist, fvpsHistosFolder[uHisto]);
700
701 partsOut.AddPart(std::move(messageHist));
702 } // for (UInt_t uHisto = 0; uHisto < fvpsHistosFolder.size(); ++uHisto)
703
706 if (0 == fvpsHistosFolder.size()) {
707 FairMQMessagePtr messageHist(NewMessage());
708 partsOut.AddPart(std::move(messageHist));
709 }
710
711 for (UInt_t uCanv = 0; uCanv < fvpsCanvasConfig.size(); ++uCanv) {
713 FairMQMessagePtr messageCan(NewMessage());
714 // Serialize<BoostSerializer<std::pair<std::string, std::string>>>(*messageCan, fvpsCanvasConfig[uCanv]);
715 BoostSerializer<std::pair<std::string, std::string>>().Serialize(*messageCan, fvpsCanvasConfig[uCanv]);
716
717 partsOut.AddPart(std::move(messageCan));
718 } // for (UInt_t uCanv = 0; uCanv < fvpsCanvasConfig.size(); ++uCanv)
719
722 if (0 == fvpsCanvasConfig.size()) {
723 FairMQMessagePtr messageHist(NewMessage());
724 partsOut.AddPart(std::move(messageHist));
725 }
726
728 FairMQMessagePtr msgHistos(NewMessage());
729 RootSerializer().Serialize(*msgHistos, &fArrayHisto);
730
731 partsOut.AddPart(std::move(msgHistos));
732
734 if (Send(partsOut, fsChannelNameHistosInput) < 0) {
735 LOG(error) << "CbmTsConsumerReqDevExample::SendHistoConfAndData => Problem sending data";
736 return false;
737 } // if( Send( partsOut, fsChannelNameHistosInput ) < 0 )
738
740 ResetHistograms(false);
741
742 return true;
743}
744
746{
748 FairMQMessagePtr message(NewMessage());
749 RootSerializer().Serialize(*message, &fArrayHisto);
750
752 if (Send(message, fsChannelNameHistosInput) < 0) {
753 LOG(error) << "Problem sending data";
754 return false;
755 } // if( Send( message, fsChannelNameHistosInput ) < 0 )
756
758 ResetHistograms(false);
759
760 return true;
761}
762
763//--------------------------------------------------------------------//
765{
766 // Needed to avoid due to other end of ZMQ channel being already gone if called during Finish/destructor
767 if (kTRUE == fbFillHistos) {
769 fLastPublishTime = std::chrono::system_clock::now();
770 } // if( kTRUE == fbFillHistos )
771}
772
773//--------------------------------------------------------------------//
775{
777
779 if (fbInitDone && !fbFinishDone) Finish();
780
782 if (fbInitDone) {
783 fEventsSel->clear();
784 delete fEventsSel;
785 }
786
787 delete fpRun;
788}
789
791{
792 LOG(info) << "Performing clean close of the file";
793 // Clean closure of output to root file
794 fpFairRootMgr->Write(); // Broken due to FileMaxSize?!?
795 fpFairRootMgr->CloseSink();
796 LOG(info) << "File closed after saving " << (fulTsCounter + fulMissedTsCounter) << " TS (" << fulTsCounter
797 << " full ones and " << fulMissedTsCounter << " missed/empty ones)";
798 LOG(info) << "Still buffered TS " << fmFullTsStorage.size() << " and still buffered empties "
799 << fvulMissedTsIndices.size();
800
801 if (fair::mq::State::Running == GetCurrentState()) {
803 ChangeState(fair::mq::Transition::Stop);
804 std::this_thread::sleep_for(std::chrono::milliseconds(3000));
805 ChangeState(fair::mq::Transition::End);
806 }
807
808 fbFinishDone = kTRUE;
809}
810
811
812CbmEventTimeslice::CbmEventTimeslice(FairMQParts& parts, bool bDigiEvtInput)
813{
814 fbDigiEvtInput = bDigiEvtInput;
815
816 uint32_t uPartIdx = 0;
817
818 if (fbDigiEvtInput) {
820 if (3 != parts.Size()) {
821 LOG(error) << "CbmEventTimeslice::CbmEventTimeslice => Wrong number of parts to deserialize DigiEvents: "
822 << parts.Size() << " VS 3!";
823 LOG(fatal) << "Probably the wrong value was used for the option DigiEventInput of the Sink or DigiEventOutput of "
824 << "the event builder";
825 }
826
828 TObject* tempObjectPointer = nullptr;
829 RootSerializer().Deserialize(*parts.At(uPartIdx), tempObjectPointer);
830 if (tempObjectPointer && TString(tempObjectPointer->ClassName()).EqualTo("CbmTsEventHeader")) {
831 fCbmTsEventHeader = *(static_cast<CbmTsEventHeader*>(tempObjectPointer));
832 }
833 else {
834 LOG(fatal) << "Failed to deserialize the TS header";
835 }
836 ++uPartIdx;
837
839 tempObjectPointer = nullptr;
840 RootSerializer().Deserialize(*parts.At(uPartIdx), tempObjectPointer);
841
842 if (tempObjectPointer && TString(tempObjectPointer->ClassName()).EqualTo("TimesliceMetaData")) {
843 fTsMetaData = *(static_cast<TimesliceMetaData*>(tempObjectPointer));
844 }
845 else {
846 LOG(fatal) << "Failed to deserialize the TS metadata";
847 }
848 ++uPartIdx;
849
851 std::string msgStrEvt(static_cast<char*>(parts.At(uPartIdx)->GetData()), (parts.At(uPartIdx))->GetSize());
852 std::istringstream issEvt(msgStrEvt);
853 boost::archive::binary_iarchive inputArchiveEvt(issEvt);
854 inputArchiveEvt >> fvDigiEvents;
855 ++uPartIdx;
856
857 LOG(debug) << "Input event array " << fvDigiEvents.size();
858 }
859 else {
861 if (10 != parts.Size()) {
862 LOG(error) << "CbmEventTimeslice::CbmEventTimeslice => Wrong number of parts to deserialize raw data + events: "
863 << parts.Size() << " VS 10!";
864 LOG(fatal) << "Probably the wrong value was used for the option DigiEventInput of the Sink or DigiEventOutput of "
865 << "the event builder";
866 }
867
869 TObject* tempObjectPointer = nullptr;
870 RootSerializer().Deserialize(*parts.At(uPartIdx), tempObjectPointer);
871 if (tempObjectPointer && TString(tempObjectPointer->ClassName()).EqualTo("CbmTsEventHeader")) {
872 fCbmTsEventHeader = *(static_cast<CbmTsEventHeader*>(tempObjectPointer));
873 }
874 else {
875 LOG(fatal) << "Failed to deserialize the TS header";
876 }
877 ++uPartIdx;
878
880 std::string msgStrBmon(static_cast<char*>(parts.At(uPartIdx)->GetData()), (parts.At(uPartIdx))->GetSize());
881 std::istringstream issBmon(msgStrBmon);
882 boost::archive::binary_iarchive inputArchiveBmon(issBmon);
883 inputArchiveBmon >> fvDigiBmon;
884 ++uPartIdx;
885
887 std::string msgStrSts(static_cast<char*>(parts.At(uPartIdx)->GetData()), (parts.At(uPartIdx))->GetSize());
888 std::istringstream issSts(msgStrSts);
889 boost::archive::binary_iarchive inputArchiveSts(issSts);
890 inputArchiveSts >> fvDigiSts;
891 ++uPartIdx;
892
894 std::string msgStrMuch(static_cast<char*>(parts.At(uPartIdx)->GetData()), (parts.At(uPartIdx))->GetSize());
895 std::istringstream issMuch(msgStrMuch);
896 boost::archive::binary_iarchive inputArchiveMuch(issMuch);
897 inputArchiveMuch >> fvDigiMuch;
898 ++uPartIdx;
899
901 std::string msgStrTrd(static_cast<char*>(parts.At(uPartIdx)->GetData()), (parts.At(uPartIdx))->GetSize());
902 std::istringstream issTrd(msgStrTrd);
903 boost::archive::binary_iarchive inputArchiveTrd(issTrd);
904 inputArchiveTrd >> fvDigiTrd;
905 ++uPartIdx;
906
908 std::string msgStrTof(static_cast<char*>(parts.At(uPartIdx)->GetData()), (parts.At(uPartIdx))->GetSize());
909 std::istringstream issTof(msgStrTof);
910 boost::archive::binary_iarchive inputArchiveTof(issTof);
911 inputArchiveTof >> fvDigiTof;
912 ++uPartIdx;
913
915 std::string msgStrRich(static_cast<char*>(parts.At(uPartIdx)->GetData()), (parts.At(uPartIdx))->GetSize());
916 std::istringstream issRich(msgStrRich);
917 boost::archive::binary_iarchive inputArchiveRich(issRich);
918 inputArchiveRich >> fvDigiRich;
919 ++uPartIdx;
920
922 std::string msgStrPsd(static_cast<char*>(parts.At(uPartIdx)->GetData()), (parts.At(uPartIdx))->GetSize());
923 std::istringstream issPsd(msgStrPsd);
924 boost::archive::binary_iarchive inputArchivePsd(issPsd);
925 inputArchivePsd >> fvDigiPsd;
926 ++uPartIdx;
927
929 tempObjectPointer = nullptr;
930 RootSerializer().Deserialize(*parts.At(uPartIdx), tempObjectPointer);
931
932 if (tempObjectPointer && TString(tempObjectPointer->ClassName()).EqualTo("TimesliceMetaData")) {
933 fTsMetaData = *(static_cast<TimesliceMetaData*>(tempObjectPointer));
934 }
935 else {
936 LOG(fatal) << "Failed to deserialize the TS metadata";
937 }
938 ++uPartIdx;
939
942 /*
943 std::string msgStrEvt(static_cast<char*>(parts.At(uPartIdx)->GetData()), (parts.At(uPartIdx))->GetSize());
944 std::istringstream issEvt(msgStrEvt);
945 boost::archive::binary_iarchive inputArchiveEvt(issEvt);
946 inputArchiveEvt >> fvEvents;
947 ++uPartIdx;
948 LOG(info) << "Input event array " << fvEvents.size();
949 */
950 std::vector<CbmEvent>* pvOutEvents = nullptr;
951 RootSerializer().Deserialize(*parts.At(uPartIdx), pvOutEvents);
952 fvEvents = std::move(*pvOutEvents);
953 LOG(debug) << "Input event array " << fvEvents.size();
954 }
955}
956
958{
959 fvDigiBmon.clear();
960 fvDigiSts.clear();
961 fvDigiMuch.clear();
962 fvDigiTrd.clear();
963 fvDigiTof.clear();
964 fvDigiRich.clear();
965 fvDigiPsd.clear();
966 fvEvents.clear();
967 fvDigiEvents.clear();
968}
969
970void CbmEventTimeslice::ExtractSelectedData(bool bExclusiveTrdExtract)
971{
972 fvDigiEvents.reserve(fvEvents.size());
973
975 for (CbmEvent event : fvEvents) {
976 CbmDigiEvent selEvent;
977 selEvent.fTime = event.GetStartTime();
978 selEvent.fNumber = event.GetNumber();
979
985
988 event.SortIndices();
989
993 uint32_t uNbDigis = (0 < event.GetNofData(ECbmDataType::kBmonDigi) ? event.GetNofData(ECbmDataType::kBmonDigi) : 0);
994 if (uNbDigis) {
995 auto startIt = fvDigiBmon.begin() + event.GetIndex(ECbmDataType::kBmonDigi, 0);
996 auto stopIt = fvDigiBmon.begin() + event.GetIndex(ECbmDataType::kBmonDigi, uNbDigis - 1);
997 ++stopIt;
998 selEvent.fData.fBmon.fDigis.assign(startIt, stopIt);
999 }
1000
1002 uNbDigis = (0 < event.GetNofData(ECbmDataType::kStsDigi) ? event.GetNofData(ECbmDataType::kStsDigi) : 0);
1003 if (uNbDigis) {
1004 auto startIt = fvDigiSts.begin() + event.GetIndex(ECbmDataType::kStsDigi, 0);
1005 auto stopIt = fvDigiSts.begin() + event.GetIndex(ECbmDataType::kStsDigi, uNbDigis - 1);
1006 ++stopIt;
1007 selEvent.fData.fSts.fDigis.assign(startIt, stopIt);
1008 }
1009
1011 uNbDigis = (0 < event.GetNofData(ECbmDataType::kMuchDigi) ? event.GetNofData(ECbmDataType::kMuchDigi) : 0);
1012 if (uNbDigis) {
1013 auto startIt = fvDigiMuch.begin() + event.GetIndex(ECbmDataType::kMuchDigi, 0);
1014 auto stopIt = fvDigiMuch.begin() + event.GetIndex(ECbmDataType::kMuchDigi, uNbDigis - 1);
1015 ++stopIt;
1016 selEvent.fData.fMuch.fDigis.assign(startIt, stopIt);
1017 }
1018
1020 uNbDigis = (0 < event.GetNofData(ECbmDataType::kTrdDigi) ? event.GetNofData(ECbmDataType::kTrdDigi) : 0);
1021 if (uNbDigis) {
1022 if (bExclusiveTrdExtract) {
1023 for (uint32_t uDigiInEvt = 0; uDigiInEvt < uNbDigis; ++uDigiInEvt) {
1028 selEvent.fData.fTrd.fDigis.push_back(fvDigiTrd[event.GetIndex(ECbmDataType::kTrdDigi, uDigiInEvt)]);
1029 }
1030 }
1031 else {
1036 auto startIt = fvDigiTrd.begin() + event.GetIndex(ECbmDataType::kTrdDigi, 0);
1037 auto stopIt = fvDigiTrd.begin() + event.GetIndex(ECbmDataType::kTrdDigi, uNbDigis - 1);
1038 ++stopIt;
1039 selEvent.fData.fTrd.fDigis.assign(startIt, stopIt);
1040 }
1041 }
1042
1044 uNbDigis = (0 < event.GetNofData(ECbmDataType::kTofDigi) ? event.GetNofData(ECbmDataType::kTofDigi) : 0);
1045 if (uNbDigis) {
1046 auto startIt = fvDigiTof.begin() + event.GetIndex(ECbmDataType::kTofDigi, 0);
1047 auto stopIt = fvDigiTof.begin() + event.GetIndex(ECbmDataType::kTofDigi, uNbDigis - 1);
1048 ++stopIt;
1049 selEvent.fData.fTof.fDigis.assign(startIt, stopIt);
1050 }
1051
1053 uNbDigis = (0 < event.GetNofData(ECbmDataType::kRichDigi) ? event.GetNofData(ECbmDataType::kRichDigi) : 0);
1054 if (uNbDigis) {
1055 auto startIt = fvDigiRich.begin() + event.GetIndex(ECbmDataType::kRichDigi, 0);
1056 auto stopIt = fvDigiRich.begin() + event.GetIndex(ECbmDataType::kRichDigi, uNbDigis - 1);
1057 ++stopIt;
1058 selEvent.fData.fRich.fDigis.assign(startIt, stopIt);
1059 }
1060
1062 uNbDigis = (0 < event.GetNofData(ECbmDataType::kPsdDigi) ? event.GetNofData(ECbmDataType::kPsdDigi) : 0);
1063 if (uNbDigis) {
1064 auto startIt = fvDigiPsd.begin() + event.GetIndex(ECbmDataType::kPsdDigi, 0);
1065 auto stopIt = fvDigiPsd.begin() + event.GetIndex(ECbmDataType::kPsdDigi, uNbDigis - 1);
1066 ++stopIt;
1067 selEvent.fData.fPsd.fDigis.assign(startIt, stopIt);
1068 }
1069
1070 fvDigiEvents.push_back(selEvent);
1071 }
1072}
std::string GenerateCanvasConfigString(TCanvas *pCanv)
bool first
std::vector< CbmBmonDigi > fDigis
Data vector.
static const char * GetBranchName()
Get the desired name of the branch for this objects in the cbm output tree (static)
Definition CbmBmonDigi.h:63
std::vector< CbmStsDigi > * fvDigiSts
bool fbBypassConsecutiveTs
If true, store digis vectors with full TS in addition to selected events.
std::vector< std::string > fsAllowedChannels
List of MQ channels names.
std::vector< CbmRichDigi > * fvDigiRich
bool fbFillHistos
Switch ON/OFF loop based extraction of TRD digis due to 1D/2D.
FairRunOnline * fpRun
Data storage.
bool HandleCommand(FairMQMessagePtr &, int)
std::chrono::system_clock::time_point fLastPublishTime
bool HandleMissTsData(FairMQMessagePtr &, int)
void PrepareTreeEntry(CbmEventTimeslice unpTs)
uint32_t fuPublishFreqTs
Histograms management.
uint64_t fuPrevTsIndex
Parameters management.
bool fbReceivedEof
Control Commands reception.
bool fbWriteMissingTs
Switch ON/OFF the bypass of the consecutive TS buffer before writing to file.
std::vector< CbmMuchDigi > * fvDigiMuch
std::chrono::system_clock::time_point fLastFillTime
bool fbInitDone
Switch ON/OFF filling of histograms.
bool fbExclusiveTrdExtract
Switch ON/OFF the input of CbmDigiEvents instead of raw data + CbmEvents.
TObjArray fArrayHisto
Array of histograms to send to the histogram server.
std::map< uint64_t, CbmEventTimeslice > fmFullTsStorage
Buffered TS.
int64_t fiTreeFileMaxSize
Output file/tree management.
TClonesArray * fTimeSliceMetaDataArray
TS MetaData storage.
std::string fsOutputFileName
Keep track of whether the Finish was already called.
bool HandleData(FairMQParts &, int)
bool IsChannelNameAllowed(std::string channelName)
Internal methods.
std::vector< std::pair< std::string, std::string > > fvpsCanvasConfig
std::vector< CbmPsdDigi > * fvDigiPsd
bool ResetHistograms(bool bResetStartTime=false)
std::vector< CbmDigiEvent > * fEventsSel
CbmEvents.
std::vector< uint64_t > fvulMissedTsIndices
std::vector< CbmBmonDigi > * fvDigiBmon
Full TS Digis storage (optional usage, controlled by fbStoreFullTs!)
std::string fsChannelNameMissedTs
message queues
std::vector< std::pair< std::string, std::string > > fvpsHistosFolder
Vector of string pairs with ( HistoName, FolderPath ) to send to the histogram server.
bool fbFinishDone
Keep track of whether the Init was already fully completed.
std::vector< CbmTofDigi > * fvDigiTof
bool fbConfigSent
Flag indicating whether the histograms and canvases configurations were already published.
std::vector< CbmTrdDigi > * fvDigiTrd
bool fbDigiEventInput
Switch ON/OFF the ROOT file compression.
std::chrono::system_clock::time_point fStartTime
bool fbDisableCompression
Switch ON/OFF writing of empty TS to file for the missing ones (if no bypass)
CbmPsdDigiData fPsd
PSD data.
Definition CbmDigiData.h:42
CbmTrdDigiData fTrd
TRD data.
Definition CbmDigiData.h:39
CbmTofDigiData fTof
TOF data.
Definition CbmDigiData.h:41
CbmStsDigiData fSts
STS data.
Definition CbmDigiData.h:36
CbmRichDigiData fRich
RICH data.
Definition CbmDigiData.h:38
CbmMuchDigiData fMuch
MUCH data.
Definition CbmDigiData.h:37
CbmBmonDigiData fBmon
Beam monitor data.
Definition CbmDigiData.h:35
Collection of digis from all detector systems within one event.
double fTime
Event trigger time [ns].
CbmDigiData fData
Event data.
uint64_t fNumber
Event identifier.
CbmTsEventHeader fCbmTsEventHeader
TS information in header.
std::vector< CbmRichDigi > fvDigiRich
bool fbDigiEvtInput
Input Type.
std::vector< CbmEvent > fvEvents
Raw events.
CbmEventTimeslice(FairMQParts &parts, bool bDigiEvtInput=false)
TODO: rename to CbmTsWithEvents.
std::vector< CbmDigiEvent > & GetSelectedData(bool bExclusiveTrdExtract=true)
std::vector< CbmTofDigi > fvDigiTof
std::vector< CbmDigiEvent > fvDigiEvents
Digi events.
std::vector< CbmStsDigi > fvDigiSts
std::vector< CbmPsdDigi > fvDigiPsd
void ExtractSelectedData(bool bExclusiveTrdExtract=true)
TimesliceMetaData fTsMetaData
extra Metadata
std::vector< CbmMuchDigi > fvDigiMuch
std::vector< CbmBmonDigi > fvDigiBmon
Raw data.
std::vector< CbmTrdDigi > fvDigiTrd
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
std::vector< CbmMuchDigi > fDigis
Data vector.
static const char * GetBranchName()
Get the desired name of the branch for this obj in the cbm output tree (static)
Definition CbmMuchDigi.h:87
std::vector< CbmPsdDigi > fDigis
Data vector.
static const char * GetBranchName()
Get the desired name of the branch for this obj in the cbm output tree (static)
Definition CbmPsdDigi.h:99
std::vector< CbmRichDigi > fDigis
Data vector.
static const char * GetBranchName()
Get the desired name of the branch for this obj in the cbm output tree (static)
Definition CbmRichDigi.h:48
std::vector< CbmStsDigi > fDigis
Data vector.
static const char * GetBranchName()
Get the desired name of the branch for this obj in the cbm output tree (static)
Definition CbmStsDigi.h:87
std::vector< CbmTofDigi > fDigis
Data vector.
static const char * GetBranchName()
Get the desired name of the branch for this obj in the cbm output tree (static)
Definition CbmTofDigi.h:118
std::vector< CbmTrdDigi > fDigis
Data vector.
static const char * GetBranchName()
Get the desired name of the branch for this obj in the cbm output tree (static)
Definition CbmTrdDigi.h:149
uint64_t GetIndex() const
void ChangeState(FairMQDevice *device, cbm::mq::Transition transition)
Definition CbmMQDefs.h:26
Hash for CbmL1LinkKey.