CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018MonitorMcbmSync.cxx
Go to the documentation of this file.
1/* Copyright (C) 2018-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
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmMcbm2018MonitorMcbmSync -----
8// ----- Created 11/05/18 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
13
14// Data
15
16// CbmRoot
17#include "CbmMcbm2018StsPar.h"
18#include "CbmMcbm2018TofPar.h"
19
20// FairRoot
21#include "FairRootManager.h"
22#include "FairRun.h"
23#include "FairRunOnline.h"
24#include "FairRuntimeDb.h"
25#include <Logger.h>
26
27// Root
28#include "TClonesArray.h"
29#include "TF1.h"
30#include "THttpServer.h"
31#include "TMath.h"
32#include "TROOT.h"
33#include "TRandom.h"
34#include "TString.h"
35#include "TStyle.h"
36#include <TFile.h>
37
38// C++11
39
40// C/C++
41#include <cstdint>
42#include <iomanip>
43#include <iostream>
44
47/*
48Bool_t bMcbm2018ResetSync = kFALSE;
49Bool_t bMcbm2018WriteSync = kFALSE;
50*/
51/*
52Bool_t bMcbm2018SyncResetHistosTof = kFALSE;
53Bool_t bMcbm2018SyncSaveHistosTof = kFALSE;
54Bool_t bMcbm2018SyncUpdateZoomedFit = kFALSE;
55*/
56
63 , fbIgnoreOverlapMs(kFALSE)
64 , fUnpackParSts(nullptr)
65 , fuStsNrOfDpbs(0)
67 , fuMuchDpbIdx(1)
68 , fUnpackParTof(nullptr)
69 , fuTofNrOfDpbs(0)
73 , fdStsTofOffsetNs(0.0)
75 , fbUseBestPair(kFALSE)
76 , fbTsLevelAna(kFALSE)
77 , fsHistoFileFullname("data/mCBMsyncHistos.root")
78 , fbPrintMessages(kFALSE)
79 , fPrintMessCtrlSts(stsxyter::MessagePrintMask::msg_print_Human)
82 , fmMsgCounter()
84 , fuCurrDpbId(0)
85 , fuCurrDpbIdx(0)
94 , fdTofMsIndex(0)
95 , fuTofGdpbId(0)
96 , fuTofGdpbNr(0)
98 , fviTofMsgCounter(1 + gdpbv100::MSG_STAR_TRI_D, 0)
119 , fdSpillStartA(0.0)
120 , fdSpillStartB(0.0)
121 , fdSpillStartC(-1.0)
128{
129}
130
132
134{
135 LOG(info) << "Initializing flib StsXyter unpacker for STS";
136
137 FairRootManager* ioman = FairRootManager::Instance();
138 if (ioman == nullptr) { LOG(fatal) << "No FairRootManager instance"; }
139
140 return kTRUE;
141}
142
144{
145 LOG(info) << "Setting parameter containers for " << GetName();
146 fUnpackParSts = (CbmMcbm2018StsPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer("CbmMcbm2018StsPar"));
147 fUnpackParTof = (CbmMcbm2018TofPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer("CbmMcbm2018TofPar"));
148}
149
150
152{
153 LOG(info) << "Init parameter containers for " << GetName();
154
155 Bool_t bReInit = ReInitContainers();
159
160 return bReInit;
161}
162
164{
165 LOG(info) << "ReInit parameter containers for " << GetName();
166
167 /***************** STS parameters *************************************/
168 fuStsNrOfDpbs = fUnpackParSts->GetNrOfDpbs();
169 LOG(info) << "Nr. of STS DPBs: " << fuStsNrOfDpbs;
170
171 fmStsDpbIdIndexMap.clear();
172 for (UInt_t uDpb = 0; uDpb < fuStsNrOfDpbs; ++uDpb) {
173 fmStsDpbIdIndexMap[fUnpackParSts->GetDpbId(uDpb)] = uDpb;
174 LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = 0x" << std::setw(4) << std::hex
175 << fUnpackParSts->GetDpbId(uDpb) << std::dec << " => "
176 << fmStsDpbIdIndexMap[fUnpackParSts->GetDpbId(uDpb)];
177 } // for( UInt_t uDpb = 0; uDpb < fuStsNrOfDpbs; ++uDpb )
178
183 /***************** STS parameters *************************************/
184
185 /***************** TOF parameters *************************************/
186 fuTofNrOfDpbs = fUnpackParTof->GetNrOfGdpbs();
187 LOG(info) << "Nr. of Tof GDPBs: " << fuTofNrOfDpbs;
188
189 fmTofDpbIdIndexMap.clear();
190 for (UInt_t i = 0; i < fuTofNrOfDpbs; ++i) {
191 fmTofDpbIdIndexMap[fUnpackParTof->GetGdpbId(i)] = i;
192 LOG(info) << "GDPB Id of TOF " << i << " : " << std::hex << fUnpackParTof->GetGdpbId(i) << std::dec;
193 } // for( UInt_t i = 0; i < fuTofNrOfDpbs; ++i )
194
202 /***************** TOF parameters *************************************/
203
204 return kTRUE;
205}
206
207void CbmMcbm2018MonitorMcbmSync::AddMsComponentToList(size_t component, UShort_t usDetectorId)
208{
209 switch (usDetectorId) {
210 case 0x10: //fles::Subsystem::STS:
211 {
212 AddMsComponentToListSts(component);
213 break;
214 } // case 0x10:
215 case 0x60: //fles::Subsystem::TOF:
216 {
217 AddMsComponentToListTof(component);
218 break;
219 } // case 0x60:
220 default: {
221 LOG(warning) << "CbmMcbm2018MonitorStsSync::AddMsComponentToList => "
222 << "Ignore component " << component << " as detector id " << usDetectorId
223 << " is not supported by this unpacker.";
224 break;
225 } // default:
226 } // switch( iDetectorId )
227}
229{
231 for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsListSts.size(); ++uCompIdx)
232 if (component == fvMsComponentsListSts[uCompIdx]) return;
233
235 fvMsComponentsListSts.push_back(component);
236}
238{
240 for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsListTof.size(); ++uCompIdx)
241 if (component == fvMsComponentsListTof[uCompIdx]) return;
242
244 fvMsComponentsListTof.push_back(component);
245}
246void CbmMcbm2018MonitorMcbmSync::SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
247{
248 fuNbCoreMsPerTs = uCoreMsNb;
249 fuNbOverMsPerTs = uOverlapMsNb;
250
251 // UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
252}
253
254/***************** STS Histograms *************************************/
256{
257 TString sHistName {""};
258 TString title {""};
259 /*
260 sHistName = "hPulserMessageType";
261 title = "Nb of message for each type; Type";
262 fhStsMessType = new TH1I(sHistName, title, 5, 0., 5.);
263 fhStsMessType->GetXaxis()->SetBinLabel( 1, "Dummy");
264 fhStsMessType->GetXaxis()->SetBinLabel( 2, "Hit");
265 fhStsMessType->GetXaxis()->SetBinLabel( 3, "TsMsb");
266 fhStsMessType->GetXaxis()->SetBinLabel( 4, "Epoch");
267 fhStsMessType->GetXaxis()->SetBinLabel( 5, "Empty");
268
269 // Online histo browser commands
270 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
271 if( server )
272 {
273 server->Register("/StsRaw", fhStsMessType );
274
275 server->RegisterCommand("/Reset_All_Pulser", "bMcbm2018ResetSync=kTRUE");
276 server->RegisterCommand("/Write_All_Pulser", "bMcbm2018WriteSync=kTRUE");
277
278 server->Restrict("/Reset_All_Pulser", "allow=admin");
279 server->Restrict("/Write_All_Pulser", "allow=admin");
280 } // if( server )
281*/
283 /*
284 Double_t w = 10;
285 Double_t h = 10;
286
287 // Summary per StsXyter
288 for( UInt_t uXyterIdx = 0; uXyterIdx < fuStsNbStsXyters; ++uXyterIdx )
289 {
290 TCanvas* cStsSumm = new TCanvas( Form("cStsSum_%03u", uXyterIdx ),
291 Form("Summary plots for StsXyter %03u", uXyterIdx ),
292 w, h);
293 cStsSumm->Divide( 2, 2 );
294
295 cStsSumm->cd(1);
296 gPad->SetLogy();
297 fhStsChanCntRaw[ uXyterIdx ]->Draw();
298
299 cStsSumm->cd(2);
300 gPad->SetLogz();
301 fhStsChanAdcRaw[ uXyterIdx ]->Draw( "colz" );
302
303 cStsSumm->cd(3);
304 gPad->SetLogz();
305 fhStsChanHitRateEvo[ uXyterIdx ]->Draw( "colz" );
306
307 cStsSumm->cd(4);
308// gPad->SetLogy();
309 fhStsChanAdcRawProf[ uXyterIdx ]->Draw();
310 } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuStsNbStsXyters; ++uXyterIdx )
311
312//====================================================================//
313*/
314 /*****************************/
315 LOG(info) << "Done Creating STS Histograms";
316}
317/***************** STS Histograms *************************************/
318
319/***************** TOF Histograms *************************************/
321{
322 TString sHistName {""};
323 TString title {""};
324
325 /*******************************************************************/
326 /*
327
328 sHistName = "hMessageType";
329 title = "Nb of message for each type; Type";
330 // Test Big Data readout with plotting
331 fhTofMessType = new TH1I(sHistName, title, 1 + gdpbv100::MSG_STAR_TRI_A, 0., 1 + gdpbv100::MSG_STAR_TRI_A);
332 fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_HIT, "HIT");
333 fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_EPOCH, "EPOCH");
334 fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SLOWC, "SLOWC");
335 fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SYST, "SYST");
336 fhTofMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_A, "MSG_STAR_TRI");
337*/
338 /*******************************************************************/
339 /*
340 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
341 if( server )
342 {
343 server->Register("/TofRaw", fhTofMessType );
344
345 server->RegisterCommand("/Reset_All_TOF", "bMcbm2018SyncResetHistosTof=kTRUE");
346 server->RegisterCommand("/Save_All_Tof", "bMcbm2018SyncSaveHistosTof=kTRUE");
347 server->RegisterCommand("/Update_PulsFit", "bMcbm2018SyncUpdateZoomedFit=kTRUE");
348
349 server->Restrict("/Reset_All_Tof", "allow=admin");
350 server->Restrict("/Save_All_Tof", "allow=admin");
351 server->Restrict("/Update_PulsFit", "allow=admin");
352 } // if( server )
353*/
355 /*
356 Double_t w = 10;
357 Double_t h = 10;
358 TCanvas* cSummary = new TCanvas("cSummary", "gDPB Monitoring Summary", w, h);
359 cSummary->Divide(2, 3);
360
361 // 1st Column: Messages types
362 cSummary->cd(1);
363 gPad->SetLogy();
364 fhTofMessType->Draw();
365
366 cSummary->cd(2);
367 gPad->SetLogy();
368 fhTofSysMessType->Draw();
369
370 cSummary->cd(3);
371 gPad->SetLogz();
372 fhTofGet4MessType->Draw("colz");
373
374 // 2nd Column: GET4 Errors + Epoch flags + SCm
375 cSummary->cd(4);
376 gPad->SetLogz();
377 fhTofGet4ChanErrors->Draw("colz");
378
379 cSummary->cd(5);
380 gPad->SetLogz();
381 fhTofGet4EpochFlags->Draw("colz");
382
383 cSummary->cd(6);
384 fhTofGet4ChanScm->Draw("colz");
385*/
386 /*****************************/
387
388 LOG(info) << "Done Creating TOF Histograms";
389}
390/***************** TOF Histograms *************************************/
391
392/***************** mCBM Histograms ************************************/
394{
395 TString sHistName {""};
396 TString sHistTitle {""};
397
399
400 sHistName = "hMcbmHitsNbPerMs";
401 sHistTitle = "Nb of hits per DPB; Nb of hits []; DPB []";
402 fhMcbmHitsNbPerMs = new TH2D(sHistName, sHistTitle, 1000.0, 0., 1000., fuTotalNrOfDpb, 0., fuTotalNrOfDpb);
403
404 sHistName = "hMcbmTimeDiffToDiamond";
405 sHistTitle = "Time difference for STS and TOF hits, per DPB, against any "
406 "Diamond hit; <tn - tDia> [ns]; DPB []";
407 fhMcbmTimeDiffToDiamond = new TH2D(sHistName, sHistTitle, 1001, -500.5 * stsxyter::kdClockCycleNs,
409 sHistName = "hMcbmTimeDiffToDiamondWide";
410 sHistTitle = "Time difference for STS and TOF hits, per DPB, against any "
411 "Diamond hit, wide range; <tn - tDia> [us]; DPB []";
413 new TH2D(sHistName, sHistTitle, 6000.0, -300., 300., fuTotalNrOfDpb, 0., fuTotalNrOfDpb);
414 sHistName = "hMcbmTimeDiffToDiamondTs";
415 sHistTitle = "Time difference for STS and TOF hits, per DPB, against any "
416 "Diamond hit, TS range; <tn - tDia> [ms]; DPB []";
417 fhMcbmTimeDiffToDiamondTs = new TH2D(sHistName, sHistTitle, 2000.0, -10., 10., fuTotalNrOfDpb, 0., fuTotalNrOfDpb);
418
419 sHistName = "hMcbmTimeDiffToMuch";
420 sHistTitle = "Time difference for STS and TOF hits, per DPB, against any "
421 "Much hit; <tn - tMuch> [ns]; DPB []";
422 fhMcbmTimeDiffToMuch = new TH2D(sHistName, sHistTitle, 1001, -500.5 * stsxyter::kdClockCycleNs,
424 sHistName = "hMcbmTimeDiffToMuchWide";
425 sHistTitle = "Time difference for STS and TOF hits, per DPB, against any "
426 "Much hit, wide range; <tn - tMuch> [us]; DPB []";
427 fhMcbmTimeDiffToMuchWide = new TH2D(sHistName, sHistTitle, 6000.0, -300., 300., fuTotalNrOfDpb, 0., fuTotalNrOfDpb);
428 sHistName = "hMcbmTimeDiffToMuchTs";
429 sHistTitle = "Time difference for STS and TOF hits, per DPB, against any "
430 "Much hit, TS range; <tn - tMuch> [ms]; DPB []";
431 fhMcbmTimeDiffToMuchTs = new TH2D(sHistName, sHistTitle, 2000.0, -10., 10., fuTotalNrOfDpb, 0., fuTotalNrOfDpb);
432
434 sHistName = "hMcbmStsTimeDiffToMuchVsAdc";
435 sHistTitle = "Time difference for STS hits against any Much hit vs STS hit "
436 "ADC; <tSts - tMuch> [ns]; ADC Sts [bin]";
438 new TH2D(sHistName, sHistTitle, 1001, -500.5 * stsxyter::kdClockCycleNs, 500.5 * stsxyter::kdClockCycleNs,
440 sHistName = "hMcbmStsTimeDiffToMuchWideVsAdc";
441 sHistTitle = "Time difference for STS hits against any Much hit vs STS hit "
442 "ADC, wide range; <tSts - tMuch> [us]; ADC Sts [bin]";
443 fhMcbmStsTimeDiffToMuchWideVsAdc = new TH2D(sHistName, sHistTitle, 6000.0, -300., 300., stsxyter::kuHitNbAdcBins,
444 -0.5, stsxyter::kuHitNbAdcBins - 0.5);
445 sHistName = "hMcbmStsTimeDiffToMuchTsVsAdc";
446 sHistTitle = "Time difference for STS hits against any Much hit vs STS hit "
447 "ADC, TS range; <tSts - tMuch> [ms]; ADC Sts [bin]";
449 new TH2D(sHistName, sHistTitle, 2000.0, -10., 10., stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5);
450
451 for (UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb) {
452
453 sHistName = Form("hMcbmTimeDiffToDiamondEvoDpb%02u", uDpb);
454 sHistTitle = Form("Evolution of time difference for STS or TOF hits from DPB %02u "
455 "against any Diamond hit; TS []; <tn - tDia> [ns]",
456 uDpb);
457 fvhMcbmTimeDiffToDiamondEvoDpb.push_back(new TH2D(sHistName, sHistTitle, 2000.0, 0., 200000., 1001,
459 500.5 * stsxyter::kdClockCycleNs));
460
461 sHistName = Form("hMcbmTimeDiffToDiamondWideEvoDpb%02u", uDpb);
462 sHistTitle = Form("Evolution of time difference for STS or TOF hits from DPB %02u "
463 "against any Diamond hit, wide range; TS []; <tn - tDia> [us]",
464 uDpb);
466 new TH2D(sHistName, sHistTitle, 2000.0, 0., 200000., 4000.0, -200., 200.));
467
468 sHistName = Form("hMcbmTimeDiffToDiamondTsEvoDpb%02u", uDpb);
469 sHistTitle = Form("Evolution of time difference for STS or TOF hits from DPB %02u "
470 "against any Diamond hit, TS range; TS []; <tn - tDia> [ms]",
471 uDpb);
472 fvhMcbmTimeDiffToDiamondTsEvoDpb.push_back(new TH2D(sHistName, sHistTitle, 2000.0, 0., 200000., 200.0, -10., 10.));
473
475 sHistName = Form("hHitsTimeEvoSpillADpb%02u", uDpb);
476 sHistTitle = Form("Evolution of hit counts VS time for DPB %02u in the "
477 "first spill; tHit [s]; counts",
478 uDpb);
479 fvhHitsTimeEvoSpillA.push_back(
480 new TH1D(sHistName, sHistTitle, (fdSpillStartB - fdSpillStartA) * 1e5, fdSpillStartA - 0.1, fdSpillStartB));
481
482 sHistName = Form("hHitsTimeEvoSpillBDpb%02u", uDpb);
483 sHistTitle = Form("Evolution of hit counts VS time for DPB %02u in the "
484 "second spill; tHit [s]; counts",
485 uDpb);
486 fvhHitsTimeEvoSpillB.push_back(
487 new TH1D(sHistName, sHistTitle, (fdSpillStartC - fdSpillStartB) * 1e5, fdSpillStartB - 0.1, fdSpillStartC));
488
489 sHistName = Form("hMcbmTimeDiffToDiamondEvoSpillADpb%02u", uDpb);
490 sHistTitle = Form("Evolution of Time Diff to diam VS time for DPB %02u "
491 "in the first spill; tHit [s]; <tn - tDia> [us]",
492 uDpb);
493 fvhMcbmTimeDiffToDiamondEvoSpillA.push_back(new TH2D(sHistName, sHistTitle, (fdSpillStartB - fdSpillStartA) * 1e2,
494 fdSpillStartA - 0.1, fdSpillStartB, 6000.0, -300., 300.));
495
496 sHistName = Form("hMcbmTimeDiffToDiamondEvoSpillBDpb%02u", uDpb);
497 sHistTitle = Form("Evolution of Time Diff to diam VS time for DPB %02u "
498 "in the second spill; tHit [s]; <tn - tDia> [us]",
499 uDpb);
500 fvhMcbmTimeDiffToDiamondEvoSpillB.push_back(new TH2D(sHistName, sHistTitle, (fdSpillStartC - fdSpillStartB) * 1e2,
501 fdSpillStartB - 0.1, fdSpillStartC, 6000.0, -300., 300.));
502
503 sHistName = Form("hMcbmTimeDiffToMuchEvoSpillADpb%02u", uDpb);
504 sHistTitle = Form("Evolution of Time Diff to MUCH VS time for DPB %02u "
505 "in the first spill; tHit [s]; <tn - tDia> [us]",
506 uDpb);
507 fvhMcbmTimeDiffToMuchEvoSpillA.push_back(new TH2D(sHistName, sHistTitle, (fdSpillStartB - fdSpillStartA) * 1e2,
508 fdSpillStartA - 0.1, fdSpillStartB, 6000.0, -300., 300.));
509
510 sHistName = Form("hMcbmTimeDiffToMuchEvoSpillBDpb%02u", uDpb);
511 sHistTitle = Form("Evolution of Time Diff to MUCH VS time for DPB %02u "
512 "in the second spill; tHit [s]; <tn - tDia> [us]",
513 uDpb);
514 fvhMcbmTimeDiffToMuchEvoSpillB.push_back(new TH2D(sHistName, sHistTitle, (fdSpillStartC - fdSpillStartB) * 1e2,
515 fdSpillStartB - 0.1, fdSpillStartC, 6000.0, -300., 300.));
516 } // if( fdSpillStartA < fdSpillStartC )
517 } // for( UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb )
518 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
519 if (server) {
520 server->Register("/mCbmDt", fhMcbmTimeDiffToDiamond);
521 server->Register("/mCbmDt", fhMcbmTimeDiffToDiamondWide);
522 server->Register("/mCbmDt", fhMcbmTimeDiffToDiamondTs);
523
524 server->Register("/mCbmDt", fhMcbmTimeDiffToMuch);
525 server->Register("/mCbmDt", fhMcbmTimeDiffToMuchWide);
526 server->Register("/mCbmDt", fhMcbmTimeDiffToMuchTs);
527
528 server->Register("/mCbmDt", fhMcbmStsTimeDiffToMuchVsAdc);
529 server->Register("/mCbmDt", fhMcbmStsTimeDiffToMuchWideVsAdc);
530 server->Register("/mCbmDt", fhMcbmStsTimeDiffToMuchTsVsAdc);
531
532 for (UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb) {
533 server->Register("/mCbmDt", fvhMcbmTimeDiffToDiamondEvoDpb[uDpb]);
534 server->Register("/mCbmDt", fvhMcbmTimeDiffToDiamondWideEvoDpb[uDpb]);
535 server->Register("/mCbmDt", fvhMcbmTimeDiffToDiamondTsEvoDpb[uDpb]);
536 } // for( UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb )
537
538 server->RegisterCommand("/Reset_All", "bMcbm2018ResetSync=kTRUE");
539 server->RegisterCommand("/Save_All", "bMcbm2018WriteSync=kTRUE");
540
541 server->Restrict("/Reset_All", "allow=admin");
542 server->Restrict("/Save_All", "allow=admin");
543 } // if( server )
544
545 Double_t w = 10;
546 Double_t h = 10;
548 TCanvas* cSyncMcbm =
549 new TCanvas("cSyncMcbm", "Time difference for STS and TOF hits, per DPB, against any Diamond hit", w, h);
550 cSyncMcbm->Divide(2);
551
552 cSyncMcbm->cd(1);
553 gPad->SetGridx();
554 gPad->SetGridy();
555 gPad->SetLogz();
556 fhMcbmTimeDiffToDiamond->Draw("colz");
557
558 cSyncMcbm->cd(2);
559 gPad->SetGridx();
560 gPad->SetGridy();
561 gPad->SetLogz();
562 fhMcbmTimeDiffToDiamondWide->Draw("colz");
563 /*****************************/
564 LOG(info) << "Done Creating mCBM Histograms";
565}
566/***************** mCBM Histograms ************************************/
567
568Bool_t CbmMcbm2018MonitorMcbmSync::DoUnpack(const fles::Timeslice& ts, size_t component)
569{
571 if (bMcbm2018ResetSync) {
573 bMcbm2018ResetSync = kFALSE;
574 } // if( bMcbm2018ResetSync )
575 if (bMcbm2018WriteSync) {
577 bMcbm2018WriteSync = kFALSE;
578 } // if( bMcbm2018WriteSync )
579
580 LOG(debug) << "Timeslice contains " << ts.num_microslices(component) << "microslices.";
581 fulCurrentTsIdx = ts.index();
582
584 if (0 == fulCurrentTsIdx) return kTRUE;
585
586 if (fulCurrentTsIdx < 30) LOG(info) << Form("TS %2llu", fulCurrentTsIdx);
587
588 // Ignore overlap ms if flag set by user
589 UInt_t uNbMsLoop = fuNbCoreMsPerTs;
590 if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
591
592 // Loop over core microslices (and overlap ones if chosen)
593 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
594 // Loop over registered STS components
595 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsListSts.size(); ++uMsCompIdx) {
596 UInt_t uMsComp = fvMsComponentsListSts[uMsCompIdx];
597
598 if (kFALSE == ProcessStsMs(ts, uMsComp, uMsIdx)) return kFALSE;
599 } // for( UInt_t uMsComp = 0; uMsComp < fvMsComponentsListSts.size(); ++uMsComp )
600
601 // Loop over registered TOF components
602 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsListTof.size(); ++uMsCompIdx) {
603 UInt_t uMsComp = fvMsComponentsListTof[uMsCompIdx];
604
605 if (kFALSE == ProcessTofMs(ts, uMsComp, uMsIdx)) return kFALSE;
606 } // for( UInt_t uMsComp = 0; uMsComp < fvMsComponentsListSts.size(); ++uMsComp )
607
610 if (fulCurrentMsIdx * 1e-9 < fdSpillStartA - 0.2) {
612 for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
613 fhMcbmHitsNbPerMs->Fill(fvmStsSdpbHitsInMs[uSdpb].size(), uSdpb);
614 fvmStsSdpbHitsInMs[uSdpb].clear();
615 } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
616 for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
618 fvmTofGdpbHitsInMs[uGdpb].clear();
619 } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
620 continue;
621 } // if( fulCurrentMsIdx * 1e-9 < fdSpillStartA - 0.2 )
622 } // if( fdSpillStartA < fdSpillStartC )
623
624 /****************** STS Sync ******************************************/
626 for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb)
627 std::sort(fvmStsSdpbHitsInMs[uSdpb].begin(), fvmStsSdpbHitsInMs[uSdpb].end());
628 /****************** STS Sync ******************************************/
629
630 /****************** TOF Sync ******************************************/
632 for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb)
633 std::sort(fvmTofGdpbHitsInMs[uGdpb].begin(), fvmTofGdpbHitsInMs[uGdpb].end());
634 /****************** TOF Sync ******************************************/
635
636 /****************** mCBM Sync *****************************************/
638 UInt_t uNbDiaHits = fvmTofGdpbHitsInMs[fuDiamondDpbIdx].size();
639 for (UInt_t uHitDia = 0; uHitDia < uNbDiaHits; uHitDia++) {
640 Double_t dDiaTime = fvmTofGdpbHitsInMs[fuDiamondDpbIdx][uHitDia].GetFullTimeNs();
641
643 fvhHitsTimeEvoSpillA[fuDiamondDpbIdx + fuStsNrOfDpbs]->Fill(dDiaTime * 1e-9);
644 fvhHitsTimeEvoSpillB[fuDiamondDpbIdx + fuStsNrOfDpbs]->Fill(dDiaTime * 1e-9);
645 } // if( fdSpillStartA < fdSpillStartC )
646
647 for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
648 UInt_t uNbHits = fvmStsSdpbHitsInMs[uSdpb].size();
649 Double_t dBestDt = 1e9;
650 UInt_t uNbIncrDt = 0;
651
652 for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
653 Double_t dHitTime = stsxyter::kdClockCycleNs * fvmStsSdpbHitsInMs[uSdpb][uHit].GetTs();
654 if (fuMuchDpbIdx == uSdpb) dHitTime -= fdMuchTofOffsetNs;
655 else
656 dHitTime -= fdStsTofOffsetNs;
657
659 fvhHitsTimeEvoSpillA[uSdpb]->Fill(dHitTime * 1e-9);
660 fvhHitsTimeEvoSpillB[uSdpb]->Fill(dHitTime * 1e-9);
661 } // if( fdSpillStartA < fdSpillStartC )
662
663 Double_t dDt = dHitTime - dDiaTime;
664
665 if (kTRUE == fbUseBestPair) {
667 if (TMath::Abs(dDt) < TMath::Abs(dBestDt)) dBestDt = dDt;
668 else if (dBestDt < dDt)
669 uNbIncrDt++;
670
672 if (5 == dBestDt) break;
673 } // if( kTRUE == fbUseBestPair )
674 else {
675 fhMcbmTimeDiffToDiamond->Fill(dDt, uSdpb);
676 fhMcbmTimeDiffToDiamondWide->Fill(dDt / 1000.0, uSdpb);
677
679 fvhMcbmTimeDiffToDiamondWideEvoDpb[uSdpb]->Fill(fulCurrentTsIdx, dDt / 1000.0);
680 } // else of if( kTRUE == fbUseBestPair )
681 } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
682
683 if (kTRUE == fbUseBestPair) {
684 fhMcbmTimeDiffToDiamond->Fill(dBestDt, uSdpb);
685 fhMcbmTimeDiffToDiamondWide->Fill(dBestDt / 1000.0, uSdpb);
686
687 fvhMcbmTimeDiffToDiamondEvoDpb[uSdpb]->Fill(fulCurrentTsIdx, dBestDt);
688 fvhMcbmTimeDiffToDiamondWideEvoDpb[uSdpb]->Fill(fulCurrentTsIdx, dBestDt / 1000.0);
689 } // if( kTRUE == fbUseBestPair )
690 } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
691
692 for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
693 if (fuDiamondDpbIdx == uGdpb) continue;
694
695 UInt_t uNbHits = fvmTofGdpbHitsInMs[uGdpb].size();
696 Double_t dBestDt = 1e9;
697 UInt_t uNbIncrDt = 0;
698
699 for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
700 Double_t dHitTime = fvmTofGdpbHitsInMs[uGdpb][uHit].GetFullTimeNs();
701
703 fvhHitsTimeEvoSpillA[uGdpb + fuStsNrOfDpbs]->Fill(dHitTime * 1e-9);
704 fvhHitsTimeEvoSpillB[uGdpb + fuStsNrOfDpbs]->Fill(dHitTime * 1e-9);
705 } // if( fdSpillStartA < fdSpillStartC )
706
707 Double_t dDt = dHitTime - dDiaTime;
708
709 if (kTRUE == fbUseBestPair) {
711 if (TMath::Abs(dDt) < TMath::Abs(dBestDt)) dBestDt = dDt;
712 else if (dBestDt < dDt)
713 uNbIncrDt++;
714
716 if (5 == dBestDt) break;
717 } // if( kTRUE == fbUseBestPair )
718 else {
719 fhMcbmTimeDiffToDiamond->Fill(dDt, uGdpb + fuStsNrOfDpbs);
720 fhMcbmTimeDiffToDiamondWide->Fill(dDt / 1000.0, uGdpb + fuStsNrOfDpbs);
721
724 } // else of if( kTRUE == fbUseBestPair )
725 } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
726
727 if (kTRUE == fbUseBestPair) {
728 fhMcbmTimeDiffToDiamond->Fill(dBestDt, uGdpb + fuStsNrOfDpbs);
729 fhMcbmTimeDiffToDiamondWide->Fill(dBestDt / 1000.0, uGdpb + fuStsNrOfDpbs);
730
732 fvhMcbmTimeDiffToDiamondWideEvoDpb[uGdpb + fuStsNrOfDpbs]->Fill(fulCurrentTsIdx, dBestDt / 1000.0);
733 } // if( kTRUE == fbUseBestPair )
734 } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
735 } // for( UInt_t uHitDia = 0; uHitDia < uNbDiaHits; uHitDia++)
736
738 UInt_t uNbMuchHits = fvmStsSdpbHitsInMs[fuMuchDpbIdx].size();
739 for (UInt_t uHitMuch = 0; uHitMuch < uNbMuchHits; uHitMuch++) {
740 Double_t dMuchTime =
742
743 for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
744 if (fuMuchDpbIdx == uSdpb) continue;
745
746 UInt_t uNbHits = fvmStsSdpbHitsInMs[uSdpb].size();
747 Double_t dBestDt = 1e9;
748 UInt_t uBestAdc = 0;
749 UInt_t uNbIncrDt = 0;
750
751 for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
752 Double_t dHitTime = stsxyter::kdClockCycleNs * fvmStsSdpbHitsInMs[uSdpb][uHit].GetTs();
753 if (fuMuchDpbIdx == uSdpb) dHitTime -= fdMuchTofOffsetNs;
754 else
755 dHitTime -= fdStsTofOffsetNs;
756
757 Double_t dDt = dHitTime - dMuchTime;
758
759 if (kTRUE == fbUseBestPair) {
761 if (TMath::Abs(dDt) < TMath::Abs(dBestDt)) {
762 dBestDt = dDt;
763 uBestAdc = fvmStsSdpbHitsInMs[uSdpb][uHit].GetAdc();
764 } // if( TMath::Abs( dDt ) < TMath::Abs( dBestDt ) )
765 else if (dBestDt < dDt)
766 uNbIncrDt++;
767
769 if (5 == dBestDt) break;
770 } // if( kTRUE == fbUseBestPair )
771 else {
772 fhMcbmTimeDiffToMuch->Fill(dDt, uSdpb);
773 fhMcbmTimeDiffToMuchWide->Fill(dDt / 1000.0, uSdpb);
774
775 fhMcbmStsTimeDiffToMuchVsAdc->Fill(dDt, fvmStsSdpbHitsInMs[uSdpb][uHit].GetAdc());
776 fhMcbmStsTimeDiffToMuchWideVsAdc->Fill(dDt / 1000.0, fvmStsSdpbHitsInMs[uSdpb][uHit].GetAdc());
777 } // else of if( kTRUE == fbUseBestPair )
778 } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
779
780 if (kTRUE == fbUseBestPair) {
781 fhMcbmTimeDiffToMuch->Fill(dBestDt, uSdpb);
782 fhMcbmTimeDiffToMuchWide->Fill(dBestDt / 1000.0, uSdpb);
783
784 fhMcbmStsTimeDiffToMuchVsAdc->Fill(dBestDt, uBestAdc);
785 fhMcbmStsTimeDiffToMuchWideVsAdc->Fill(dBestDt / 1000.0, uBestAdc);
786 } // if( kTRUE == fbUseBestPair )
787 } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
788
789 for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
790 UInt_t uNbHits = fvmTofGdpbHitsInMs[uGdpb].size();
791 Double_t dBestDt = 1e9;
792 UInt_t uNbIncrDt = 0;
793
794 for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
795 Double_t dHitTime = fvmTofGdpbHitsInMs[uGdpb][uHit].GetFullTimeNs();
796
797 Double_t dDt = dHitTime - dMuchTime;
798
799 if (kTRUE == fbUseBestPair) {
801 if (TMath::Abs(dDt) < TMath::Abs(dBestDt)) dBestDt = dDt;
802 else if (dBestDt < dDt)
803 uNbIncrDt++;
804
806 if (5 == dBestDt) break;
807 } // if( kTRUE == fbUseBestPair )
808 else {
809 fhMcbmTimeDiffToMuch->Fill(dDt, uGdpb + fuStsNrOfDpbs);
810 fhMcbmTimeDiffToMuchWide->Fill(dDt / 1000.0, uGdpb + fuStsNrOfDpbs);
811 } // else of if( kTRUE == fbUseBestPair )
812 } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
813
814 if (kTRUE == fbUseBestPair) {
815 fhMcbmTimeDiffToMuch->Fill(dBestDt, uGdpb + fuStsNrOfDpbs);
816 fhMcbmTimeDiffToMuchWide->Fill(dBestDt / 1000.0, uGdpb + fuStsNrOfDpbs);
817 } // if( kTRUE == fbUseBestPair )
818 } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
819 } // for( UInt_t uHitMuch = 0; uHitMuch < uNbMuchHits; uHitMuch++)
820
822 for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
823 fhMcbmHitsNbPerMs->Fill(fvmStsSdpbHitsInMs[uSdpb].size(), uSdpb);
824
825 if (fbTsLevelAna)
826 fvmStsSdpbHitsInTs[uSdpb].insert(fvmStsSdpbHitsInTs[uSdpb].end(), fvmStsSdpbHitsInMs[uSdpb].begin(),
827 fvmStsSdpbHitsInMs[uSdpb].end());
828
829 fvmStsSdpbHitsInMs[uSdpb].clear();
830 } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
831 for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
833
834 if (fbTsLevelAna)
835 fvmTofGdpbHitsInTs[uGdpb].insert(fvmTofGdpbHitsInTs[uGdpb].end(), fvmTofGdpbHitsInMs[uGdpb].begin(),
836 fvmTofGdpbHitsInMs[uGdpb].end());
837
838 fvmTofGdpbHitsInMs[uGdpb].clear();
839 } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
840 /****************** mCBM Sync *****************************************/
841
844 if (fdSpillStartC < fulCurrentMsIdx * 1e-9) {
846 LOG(fatal) << "Done with the spills";
847 } // if( fdSpillStartC < fulCurrentMsIdx * 1e-9 )
848 } // if( fdSpillStartA < fdSpillStartC )
849
850 } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
851
852 /****************** mCBM Sync *****************************************/
853
855 UInt_t uNbDiaHits = fvmTofGdpbHitsInTs[fuDiamondDpbIdx].size();
856 for (UInt_t uHitDia = 0; uHitDia < uNbDiaHits; uHitDia++) {
857 Double_t dDiaTime = fvmTofGdpbHitsInTs[fuDiamondDpbIdx][uHitDia].GetFullTimeNs();
858
859 for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
860 UInt_t uNbHits = fvmStsSdpbHitsInTs[uSdpb].size();
861 for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
862 Double_t dHitTime = stsxyter::kdClockCycleNs * fvmStsSdpbHitsInTs[uSdpb][uHit].GetTs();
863
864 Double_t dDt = dHitTime - dDiaTime;
865
867 if (300e3 < dDt) break;
868
869 fhMcbmTimeDiffToDiamondTs->Fill(dDt / 1e6, uSdpb);
870
871 fvhMcbmTimeDiffToDiamondTsEvoDpb[uSdpb]->Fill(fulCurrentTsIdx, dDt / 1e6);
872
874 Double_t dDiaTimeSec = dDiaTime * 1e-9;
875 if (fdSpillStartA - 0.1 < dDiaTimeSec && dDiaTimeSec < fdSpillStartC + 0.1) {
876 fvhMcbmTimeDiffToDiamondEvoSpillA[uSdpb]->Fill(dDiaTimeSec, dDt / 1e3);
877 fvhMcbmTimeDiffToDiamondEvoSpillB[uSdpb]->Fill(dDiaTimeSec, dDt / 1e3);
878 } // if( fdSpillStartA - 0.1 < dDiaTimeSec && dDiaTimeSec < fdSpillStartC + 0.1 )
879 } // if( fdSpillStartA < fdSpillStartC )
880 } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
881 } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
882
883 for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
884 if (fuDiamondDpbIdx == uGdpb) continue;
885
886 UInt_t uNbHits = fvmTofGdpbHitsInTs[uGdpb].size();
887 for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
888 Double_t dHitTime = fvmTofGdpbHitsInTs[uGdpb][uHit].GetFullTimeNs();
889
890 Double_t dDt = dHitTime - dDiaTime;
891
893 if (300e3 < dDt) break;
894
895 fhMcbmTimeDiffToDiamondTs->Fill(dDt / 1e6, uGdpb + fuStsNrOfDpbs);
896
898
900 Double_t dDiaTimeSec = dDiaTime * 1e-9;
901 if (fdSpillStartA - 0.1 < dDiaTimeSec && dDiaTimeSec < fdSpillStartC + 0.1) {
902 fvhMcbmTimeDiffToDiamondEvoSpillA[uGdpb + fuStsNrOfDpbs]->Fill(dDiaTimeSec, dDt / 1e3);
903 fvhMcbmTimeDiffToDiamondEvoSpillB[uGdpb + fuStsNrOfDpbs]->Fill(dDiaTimeSec, dDt / 1e3);
904 } // if( fdSpillStartA - 0.1 < dDiaTimeSec && dDiaTimeSec < fdSpillStartC + 0.1 )
905 } // if( fdSpillStartA < fdSpillStartC )
906 } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
907 } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
908 } // for( UInt_t uHitDia = 0; uHitDia < uNbDiaHits; uHitDia++)
909
911 UInt_t uNbMuchHits = fvmStsSdpbHitsInTs[fuMuchDpbIdx].size();
912 for (UInt_t uHitMuch = 0; uHitMuch < uNbMuchHits; uHitMuch++) {
913 Double_t dMuchTime =
915
916 for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
917 if (fuMuchDpbIdx == uSdpb) continue;
918
919 UInt_t uNbHits = fvmStsSdpbHitsInTs[uSdpb].size();
920 // Double_t dBestDt = 1e9;
921 // UInt_t uBestAdc = 0;
922 // UInt_t uNbIncrDt = 0;
923
924 for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
925 Double_t dHitTime = stsxyter::kdClockCycleNs * fvmStsSdpbHitsInTs[uSdpb][uHit].GetTs();
926 if (fuMuchDpbIdx == uSdpb) dHitTime -= fdMuchTofOffsetNs;
927 else
928 dHitTime -= fdStsTofOffsetNs;
929
930 Double_t dDt = dHitTime - dMuchTime;
931
933 if (300e3 < dDt) break;
934
935 fhMcbmTimeDiffToMuchTs->Fill(dDt / 1e6, uSdpb);
936 fhMcbmStsTimeDiffToMuchTsVsAdc->Fill(dDt / 1e6, fvmStsSdpbHitsInTs[uSdpb][uHit].GetAdc());
937
939 Double_t dMuchTimeSec = dMuchTime * 1e-9;
940 if (fdSpillStartA - 0.1 < dMuchTimeSec && dMuchTimeSec < fdSpillStartC + 0.1) {
941 fvhMcbmTimeDiffToMuchEvoSpillA[uSdpb]->Fill(dMuchTimeSec, dDt / 1e3);
942 fvhMcbmTimeDiffToMuchEvoSpillB[uSdpb]->Fill(dMuchTimeSec, dDt / 1e3);
943 } // if( fdSpillStartA - 0.1 < dDiaTimeSec && dDiaTimeSec < fdSpillStartC + 0.1 )
944 } // if( fdSpillStartA < fdSpillStartC )
945 } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
946 } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
947
948 for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
949 UInt_t uNbHits = fvmTofGdpbHitsInTs[uGdpb].size();
950 // Double_t dBestDt = 1e9;
951 // UInt_t uNbIncrDt = 0;
952
953 for (UInt_t uHit = 0; uHit < uNbHits; ++uHit) {
954 Double_t dHitTime = fvmTofGdpbHitsInTs[uGdpb][uHit].GetFullTimeNs();
955
956 Double_t dDt = dHitTime - dMuchTime;
957
959 if (300e3 < dDt) break;
960
961 fhMcbmTimeDiffToMuchTs->Fill(dDt / 1e6, uGdpb + fuStsNrOfDpbs);
963 Double_t dMuchTimeSec = dMuchTime * 1e-9;
964 if (fdSpillStartA - 0.1 < dMuchTimeSec && dMuchTimeSec < fdSpillStartC + 0.1) {
965 fvhMcbmTimeDiffToMuchEvoSpillA[uGdpb + fuStsNrOfDpbs]->Fill(dMuchTimeSec, dDt / 1e3);
966 fvhMcbmTimeDiffToMuchEvoSpillB[uGdpb + fuStsNrOfDpbs]->Fill(dMuchTimeSec, dDt / 1e3);
967 } // if( fdSpillStartA - 0.1 < dDiaTimeSec && dDiaTimeSec < fdSpillStartC + 0.1 )
968 } // if( fdSpillStartA < fdSpillStartC )
969 } // for( UInt_t uHit = 0; uHit < uNbHits; ++uHit )
970 } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
971 } // for( UInt_t uHitMuch = 0; uHitMuch < uNbMuchHits; uHitMuch++)
972
974 for (UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb) {
975 fvmStsSdpbHitsInTs[uSdpb].clear();
976 } // for( UInt_t uSdpb = 0; uSdpb < fuStsNrOfDpbs; ++uSdpb )
977 for (UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb) {
978 fvmTofGdpbHitsInTs[uGdpb].clear();
979 } // for( UInt_t uGdpb = 0; uGdpb < fuTofNrOfDpbs; ++uGdpb )
980
981 /****************** mCBM Sync *****************************************/
982
983 if (0 == ts.index() % 1000) {
984 LOG(info) << "End of TS " << std::setw(7) << ts.index();
985 } // if( 0 == ts.index() % 1000 )
986
987 return kTRUE;
988}
989
990/****************** STS Sync ******************************************/
991Bool_t CbmMcbm2018MonitorMcbmSync::ProcessStsMs(const fles::Timeslice& ts, size_t uMsComp, UInt_t uMsIdx)
992{
993 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
994 fuCurrentEquipmentId = msDescriptor.eq_id;
995 const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
996
997 uint32_t uSize = msDescriptor.size;
998 fulCurrentMsIdx = msDescriptor.idx;
999 // Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
1000 LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec
1001 << " has size: " << uSize;
1002
1003 fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
1005
1007 UInt_t uTsMsbCycleHeader = std::floor(fulCurrentMsIdx / (stsxyter::kulTsCycleNbBins * stsxyter::kdClockCycleNs));
1008
1009 if (0 == uMsIdx) {
1010 fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
1012 } // if( 0 == uMsIdx )
1013 else if (uTsMsbCycleHeader != fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] && 4194303 != fvulStsCurrentTsMsb[fuCurrDpbIdx]) {
1014 LOG(warning) << "TS MSB cycle from MS header does not match current cycle from data "
1015 << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx
1016 << " MsInTs " << std::setw(3) << uMsIdx << " ====> " << fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] << " VS "
1017 << uTsMsbCycleHeader;
1018 fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
1019 }
1020
1021 // If not integer number of message in input buffer, print warning/error
1022 if (0 != (uSize % kuStsBytesPerMessage))
1023 LOG(error) << "The input microslice buffer does NOT "
1024 << "contain only complete nDPB messages!";
1025
1026 // Compute the number of complete messages in the input microslice buffer
1027 uint32_t uNbMessages = (uSize - (uSize % kuStsBytesPerMessage)) / kuStsBytesPerMessage;
1028
1029 // Prepare variables for the loop on contents
1030 const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>(msContent);
1031
1032 for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
1033 // Fill message
1034 uint32_t ulData = static_cast<uint32_t>(pInBuff[uIdx]);
1035
1036 stsxyter::Message mess(static_cast<uint32_t>(ulData & 0xFFFFFFFF));
1037
1038 // Print message if requested
1039 if (fbPrintMessages) mess.PrintMess(std::cout, fPrintMessCtrlSts);
1040
1041 stsxyter::MessType typeMess = mess.GetMessType();
1042 fmMsgCounter[typeMess]++;
1043
1044 switch (typeMess) {
1046
1047 FillStsHitInfo(mess, uMsIdx);
1048 break;
1049 } // case stsxyter::MessType::Hit :
1051 FillStsTsMsbInfo(mess, uIdx, uMsIdx);
1052 break;
1053 } // case stsxyter::MessType::TsMsb :
1055 // The first message in the TS is a special ones: EPOCH
1056 FillStsEpochInfo(mess);
1057
1058 if (0 < uIdx)
1059 LOG(info) << "CbmMcbm2018MonitorMcbmSync::DoUnpack => "
1060 << "EPOCH message at unexpected position in MS: message " << uIdx << " VS message 0 expected!";
1061 break;
1062 } // case stsxyter::MessType::TsMsb :
1066 break;
1067 } // case stsxyter::MessType::Dummy / ReadDataAck / Ack :
1068 default: {
1069 LOG(fatal) << "CbmMcbm2018MonitorMcbmSync::DoUnpack => "
1070 << "Unknown message type, should never happen, stopping here!";
1071 }
1072 } // switch( mess.GetMessType() )
1073 } // for( uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx )
1074 return kTRUE;
1075}
1076
1078{
1079 UShort_t usChan = mess.GetHitChannel();
1080 UShort_t usRawAdc = mess.GetHitAdc();
1081 // UShort_t usFullTs = mess.GetHitTimeFull();
1082 // UShort_t usTsOver = mess.GetHitTimeOver();
1083 UShort_t usRawTs = mess.GetHitTime();
1084
1085 UInt_t uAsicIdx = 0;
1086
1087 if (fuCurrDpbIdx == fuMuchDpbIdx) {
1089 switch (usChan) {
1090 case 101:
1091 case 99:
1092 case 91:
1093 case 89:
1094 case 88:
1095 case 86:
1096 case 84:
1097 case 83:
1098 case 80:
1099 case 78:
1100 case 76:
1101 case 50:
1102 case 39:
1103 case 37:
1104 case 35:
1105 case 20: {
1106 return;
1107 break;
1108 } // if bad channel
1109 default: break;
1110 } // switch( usChan )
1111 } // if( fuCurrDpbIdx == fuMuchDpbIdx )
1112 else {
1114 if (usRawAdc < 15) return;
1115
1117 uAsicIdx = fUnpackParSts->ElinkIdxToAsicIdx(kFALSE, mess.GetLinkIndex());
1118 UInt_t uChanIdx = usChan + fUnpackParSts->GetNbChanPerAsic() * uAsicIdx;
1119 switch (uChanIdx) {
1120 case 781:
1121 case 270:
1122 case 411:
1123 case 518: {
1124 return;
1125 break;
1126 } // if bad channel
1127 default: break;
1128 } // switch( mess.GetLinkIndex() )
1129 if ((0 == uChanIdx % 2) && (543 < uChanIdx) && (uChanIdx < 633)) { return; } // if bad channel
1130 } // else of if( fuCurrDpbIdx == fuMuchDpbIdx )
1131
1132 // Compute the Full time stamp
1133 // Use TS w/o overlap bits as they will anyway come from the TS_MSB
1134 Long64_t ulStsHitTime = usRawTs;
1135
1136 ulStsHitTime +=
1137 static_cast<ULong64_t>(stsxyter::kuHitNbTsBins) * static_cast<ULong64_t>(fvulStsCurrentTsMsb[fuCurrDpbIdx])
1138 + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
1139 * static_cast<ULong64_t>(fvuStsCurrentTsMsbCycle[fuCurrDpbIdx]);
1140
1141 // Convert the Hit time in bins to Hit time in ns
1142 // Double_t dHitTimeNs = ulStsHitTime * stsxyter::kdClockCycleNs;
1143
1144
1145 // Pulser and MS
1146 fvmStsSdpbHitsInMs[fuCurrDpbIdx].push_back(stsxyter::FinalHit(ulStsHitTime, usRawAdc, uAsicIdx, usChan));
1147}
1148
1149void CbmMcbm2018MonitorMcbmSync::FillStsTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx, UInt_t uMsIdx)
1150{
1151 UInt_t uVal = mess.GetTsMsbVal();
1152
1153 // Update Status counters
1154 if (uVal < fvulStsCurrentTsMsb[fuCurrDpbIdx]) {
1155
1156 LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx << " DPB "
1157 << std::setw(2) << fuCurrDpbIdx << " Old TsMsb " << std::setw(5) << fvulStsCurrentTsMsb[fuCurrDpbIdx]
1158 << " Old MsbCy " << std::setw(5) << fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] << " new TsMsb " << std::setw(5)
1159 << uVal;
1160
1162 } // if( uVal < fvulStsCurrentTsMsb[fuCurrDpbIdx] )
1163 if (uVal != fvulStsCurrentTsMsb[fuCurrDpbIdx] + 1 && 0 != uVal && 4194303 != fvulStsCurrentTsMsb[fuCurrDpbIdx]
1164 && 1 != uMessIdx) {
1165 LOG(info) << "TS MSb Jump in "
1166 << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx << " MS Idx "
1167 << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " DPB " << std::setw(2)
1168 << fuCurrDpbIdx << " => Old TsMsb " << std::setw(5) << fvulStsCurrentTsMsb[fuCurrDpbIdx] << " new TsMsb "
1169 << std::setw(5) << uVal;
1170 } // if( uVal + 1 != fvulStsCurrentTsMsb[fuCurrDpbIdx] && 4194303 != uVal && 0 != fvulStsCurrentTsMsb[fuCurrDpbIdx] )
1172 /*
1173 ULong64_t ulNewTsMsbTime = static_cast< ULong64_t >( stsxyter::kuHitNbTsBins )
1174 * static_cast< ULong64_t >( fvulStsCurrentTsMsb[fuCurrDpbIdx])
1175 + static_cast< ULong64_t >( stsxyter::kulTsCycleNbBins )
1176 * static_cast< ULong64_t >( fvuStsCurrentTsMsbCycle[fuCurrDpbIdx] );
1177*/
1178}
1179
1181{
1182 // UInt_t uVal = mess.GetTsMsbVal();
1183}
1184/****************** STS Sync ******************************************/
1185
1186/****************** TOF Sync ******************************************/
1187
1188Bool_t CbmMcbm2018MonitorMcbmSync::ProcessTofMs(const fles::Timeslice& ts, size_t uMsComp, UInt_t uMsIdx)
1189{
1190 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1191 fuCurrentEquipmentId = msDescriptor.eq_id;
1192 fdTofMsIndex = static_cast<double>(msDescriptor.idx);
1193 const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
1194
1195 uint32_t size = msDescriptor.size;
1196 // fulLastMsIdx = msDescriptor.idx;
1197 if (size > 0) LOG(debug) << "Microslice: " << msDescriptor.idx << " has size: " << size;
1198
1199 Int_t messageType = -111;
1200
1201 // If not integer number of message in input buffer, print warning/error
1202 if (0 != (size % kuTofBytesPerMessage))
1203 LOG(error) << "The input microslice buffer does NOT "
1204 << "contain only complete nDPB messages!";
1205
1206 // Compute the number of complete messages in the input microslice buffer
1207 uint32_t uNbMessages = (size - (size % kuTofBytesPerMessage)) / kuTofBytesPerMessage;
1208
1209 // Get the gDPB ID from the MS header
1212
1213 // Prepare variables for the loop on contents
1214 const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent);
1215 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
1216 // Fill message
1217 uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]);
1218 gdpbv100::Message mess(ulData);
1219
1221 if (0 == uIdx) {
1222 FillTofEpochCycle(ulData);
1223 continue;
1224 } // if( 0 == uIdx )
1225
1226 if (fair::Logger::Logging(fair::Severity::debug2)) {
1227 mess.printDataCout();
1228 } // if (fair::Logger::Logging( fair::Severity::debug2 ))
1229
1230 // Increment counter for different message types
1231 // and fill the corresponding histogram
1232 messageType = mess.getMessageType();
1233 fviTofMsgCounter[messageType]++;
1234
1235 switch (messageType) {
1236 case gdpbv100::MSG_HIT: {
1237 if (!mess.getGdpbHitIs24b()) { fvmTofEpSupprBuffer[fuTofGdpbNr].push_back(mess); } // if( !getGdpbHitIs24b() )
1238 break;
1239 } // case gdpbv100::MSG_HIT:
1240 case gdpbv100::MSG_EPOCH: {
1242 FillTofEpochInfo(mess);
1243 } // if this epoch message is a merged one valiud for all chips
1244 else
1245 LOG(fatal) << "Bad epoch: " << mess.getGdpbGenChipId();
1246 break;
1247 } // case gdpbv100::MSG_EPOCH:
1249 case gdpbv100::MSG_SYST:
1253 case gdpbv100::MSG_STAR_TRI_D: break;
1254 default:
1255 LOG(error) << "Message type " << std::hex << std::setw(2) << static_cast<uint16_t>(messageType)
1256 << " not included in Get4 unpacker.";
1257 } // switch( mess.getMessageType() )
1258 } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
1259
1260 return kTRUE;
1261}
1262
1264{
1265 uint64_t ulEpochCycleVal = ulCycleData & gdpbv100::kulEpochCycleFieldSz;
1266 fvulTofCurrentEpochCycle[fuTofGdpbNr] = ulEpochCycleVal;
1267
1268 return;
1269}
1270
1272{
1273 // UInt_t uChannel = mess.getGdpbHitChanId();
1274 // UInt_t uTot = mess.getGdpbHit32Tot();
1275 // UInt_t uFts = mess.getGdpbHitFineTs();
1276
1277 ULong64_t ulCurEpochGdpbGet4 = fvulTofCurrentEpochFull[fuTofGdpbNr];
1278
1279 // In Ep. Suppr. Mode, receive following epoch instead of previous
1280 if (0 < ulCurEpochGdpbGet4) ulCurEpochGdpbGet4--;
1281 else
1282 ulCurEpochGdpbGet4 = gdpbv100::kuEpochCounterSz; // Catch epoch cycle!
1283
1284 // ULong_t ulHitTime = mess.getMsgFullTime(ulCurEpochGdpbGet4);
1285 // Double_t dHitTime = mess.getMsgFullTimeD(ulCurEpochGdpbGet4);
1286
1287 // In 32b mode the coarse counter is already computed back to 112 FTS bins
1288 // => need to hide its contribution from the Finetime
1289 // => FTS = Fullt TS modulo 112
1290 // uFts = mess.getGdpbHitFullTs() % 112;
1291
1293 fvmTofGdpbHitsInMs[fuTofGdpbNr].push_back(gdpbv100::FullMessage(mess, ulCurEpochGdpbGet4));
1294}
1295
1297{
1298 ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
1299
1300 fvulTofCurrentEpoch[fuTofGdpbNr] = ulEpochNr;
1303
1304 fulTofCurrentEpochTime = mess.getMsgFullTime(ulEpochNr);
1305
1308 if (0 < ulEpochNr) mess.setGdpbEpEpochNb(ulEpochNr - 1);
1309 else
1311
1312 Int_t iBufferSize = fvmTofEpSupprBuffer[fuTofGdpbNr].size();
1313 if (0 < iBufferSize) {
1314 LOG(debug) << "Now processing stored messages for for gDPB " << fuTofGdpbNr << " with epoch number "
1316
1319 std::stable_sort(fvmTofEpSupprBuffer[fuTofGdpbNr].begin(), fvmTofEpSupprBuffer[fuTofGdpbNr].begin());
1320
1321 for (Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++) {
1323 } // for( Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++ )
1324
1326 } // if( 0 < fvmTofEpSupprBuffer[fuTofGdpbNr] )
1327}
1328/****************** TOF Sync ******************************************/
1329
1330/****************** STS histos ****************************************/
1331/****************** STS histos ****************************************/
1332
1333/****************** TOF histos ****************************************/
1334/****************** TOF Histos ****************************************/
1335
1337
1339{
1340 /*
1341 LOG(info) << "-------------------------------------";
1342 LOG(info) << "CbmMcbm2018MonitorMcbmSync statistics are ";
1343 LOG(info) << " Hit messages: " << fmMsgCounter[ stsxyter::MessType::Hit ] << "\n"
1344 << " Ts MSB messages: " << fmMsgCounter[ stsxyter::MessType::TsMsb ] << "\n"
1345 << " Dummy messages: " << fmMsgCounter[ stsxyter::MessType::Dummy ] << "\n"
1346 << " Epoch messages: " << fmMsgCounter[ stsxyter::MessType::Epoch ] << "\n"
1347 << " Empty messages: " << fmMsgCounter[ stsxyter::MessType::Empty ];
1348*/
1349 LOG(info) << "-------------------------------------";
1350
1352 SaveAllHistos();
1353}
1354
1355
1357{
1359 TFile* oldFile = gFile;
1360 TDirectory* oldDir = gDirectory;
1361
1362 TFile* histoFile = nullptr;
1363 if ("" != sFileName) {
1364 // open separate histo file in recreate mode
1365 histoFile = new TFile(sFileName, "RECREATE");
1366 histoFile->cd();
1367 } // if( "" != sFileName )
1368
1369 /****************** STS Sync ******************************************/
1370 /****************** STS Sync ******************************************/
1371
1372 /****************** TOF Sync ******************************************/
1373 /****************** TOF Sync ******************************************/
1374
1375 /****************** mCBM Sync *****************************************/
1376 gDirectory->mkdir("mcbmDt");
1377 gDirectory->cd("mcbmDt");
1378 fhMcbmHitsNbPerMs->Write();
1379 fhMcbmTimeDiffToDiamond->Write();
1382
1383 fhMcbmTimeDiffToMuch->Write();
1384 fhMcbmTimeDiffToMuchWide->Write();
1385 fhMcbmTimeDiffToMuchTs->Write();
1386
1390
1391 for (UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb) {
1392 fvhMcbmTimeDiffToDiamondEvoDpb[uDpb]->Write();
1394 fvhMcbmTimeDiffToDiamondTsEvoDpb[uDpb]->Write();
1395
1397 fvhHitsTimeEvoSpillA[uDpb]->Write();
1398 fvhHitsTimeEvoSpillB[uDpb]->Write();
1399
1400 fvhMcbmTimeDiffToDiamondEvoSpillA[uDpb]->Write();
1401 fvhMcbmTimeDiffToDiamondEvoSpillB[uDpb]->Write();
1402
1403 fvhMcbmTimeDiffToMuchEvoSpillA[uDpb]->Write();
1404 fvhMcbmTimeDiffToMuchEvoSpillB[uDpb]->Write();
1405 } // if( fdSpillStartA < fdSpillStartC )
1406 } // for( UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb )
1407
1408 gDirectory->cd("..");
1409 /****************** mCBM Sync *****************************************/
1410
1411 if ("" != sFileName) {
1412 // Restore original directory position
1413 histoFile->Close();
1414 } // if( "" != sFileName )
1415
1417 gFile = oldFile;
1418 gDirectory = oldDir;
1419}
1421{
1422 /****************** STS Sync ******************************************/
1423 /****************** STS Sync ******************************************/
1424
1425 /****************** TOF Sync ******************************************/
1426
1427 /****************** TOF Sync ******************************************/
1428
1429 /****************** mCBM Sync *****************************************/
1430 fhMcbmHitsNbPerMs->Reset();
1431 fhMcbmTimeDiffToDiamond->Reset();
1434
1435 fhMcbmTimeDiffToMuch->Reset();
1436 fhMcbmTimeDiffToMuchWide->Reset();
1437 fhMcbmTimeDiffToMuchTs->Reset();
1438
1442
1443 for (UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb) {
1444 fvhMcbmTimeDiffToDiamondEvoDpb[uDpb]->Reset();
1446 fvhMcbmTimeDiffToDiamondTsEvoDpb[uDpb]->Reset();
1447
1449 fvhHitsTimeEvoSpillA[uDpb]->Reset();
1450 fvhHitsTimeEvoSpillB[uDpb]->Reset();
1451
1452 fvhMcbmTimeDiffToDiamondEvoSpillA[uDpb]->Reset();
1453 fvhMcbmTimeDiffToDiamondEvoSpillB[uDpb]->Reset();
1454
1455 fvhMcbmTimeDiffToMuchEvoSpillA[uDpb]->Reset();
1456 fvhMcbmTimeDiffToMuchEvoSpillB[uDpb]->Reset();
1457 } // if( fdSpillStartA < fdSpillStartC )
1458 } // for( UInt_t uDpb = 0; uDpb < fuTotalNrOfDpb; ++uDpb )
1459 /****************** mCBM Sync *****************************************/
1460}
1461
ClassImp(CbmConverterManager)
Bool_t bMcbm2018WriteSync
Bool_t bMcbm2018ResetSync
static constexpr size_t size()
Definition KfSimdPseudo.h:2
int Int_t
bool Bool_t
void SaveAllHistos(TString sFileName="")
void CreateStsHistograms()
All hits (time in bins, ADC in bins, asic, channel) in last TS, sorted with "<" operator.
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
std::vector< size_t > fvMsComponentsListTof
std::map< UInt_t, UInt_t > fmStsDpbIdIndexMap
Total number of Sts DPBs in system.
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::map< UInt_t, UInt_t > fmTofDpbIdIndexMap
Total number of GDPBs in the system.
std::vector< TH2 * > fvhMcbmTimeDiffToDiamondEvoSpillB
Bool_t ProcessStsMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
std::vector< std::vector< stsxyter::FinalHit > > fvmStsSdpbHitsInMs
Current TS MSB cycle for DPB.
std::vector< ULong64_t > fvulTofCurrentEpochCycle
UInt_t fuTotalNrOfDpb
Global parameters.
std::vector< TH2 * > fvhMcbmTimeDiffToMuchEvoSpillA
std::vector< size_t > fvMsComponentsListSts
void AddMsComponentToListTof(size_t component)
std::vector< ULong64_t > fvulTofCurrentEpochFull
std::vector< TH2 * > fvhMcbmTimeDiffToDiamondEvoDpb
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
void AddMsComponentToListSts(size_t component)
CbmMcbm2018TofPar * fUnpackParTof
Unpacking and mapping parameters for TOF.
std::vector< UInt_t > fvuStsCurrentTsMsbCycle
Current TS MSB for each DPB.
Bool_t ProcessTofMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
void FillTofEpochCycle(uint64_t ulCycleData)
std::vector< TH2 * > fvhMcbmTimeDiffToDiamondEvoSpillA
std::vector< TH2 * > fvhMcbmTimeDiffToMuchEvoSpillB
UInt_t fuMuchDpbIdx
Map of DPB Identifier to DPB index.
std::vector< std::vector< gdpbv100::FullMessage > > fvmTofGdpbHitsInTs
uint64_t fulTofCurrentTsIndex
Running indices.
std::vector< ULong64_t > fvulTofCurrentEpoch
std::vector< ULong64_t > fvulStsCurrentTsMsb
Bin size in s for the plots with date as X axis.
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
std::vector< std::vector< gdpbv100::FullMessage > > fvmTofGdpbHitsInMs
Buffer for system sync check.
void FillStsTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
void FillStsEpochInfo(stsxyter::Message mess)
void FillStsHitInfo(stsxyter::Message mess, const UInt_t &uMsIdx)
std::vector< std::vector< stsxyter::FinalHit > > fvmStsSdpbHitsInTs
All hits (time in bins, ADC in bins, asic, channel) in last TS, sorted with "<" operator.
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
static const UInt_t kuTofBytesPerMessage
TODO => move to the message class!!
stsxyter::MessagePrintMask fPrintMessCtrlSts
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
std::vector< TH2 * > fvhMcbmTimeDiffToDiamondWideEvoDpb
std::vector< std::vector< gdpbv100::Message > > fvmTofEpSupprBuffer
Buffer for suppressed epoch processing.
void CreateTofHistograms()
Processing methods.
std::vector< TH2 * > fvhMcbmTimeDiffToDiamondTsEvoDpb
Data class with information on a STS local track.
uint16_t getGdpbHitIs24b() const
uint32_t getGdpbEpEpochNb() const
void setGdpbEpEpochNb(uint32_t v)
uint16_t getGdpbGenChipId() const
void printDataCout(unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
Print message in human readable format to cout.
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 4 bit.
uint64_t getMsgFullTime(uint64_t epoch) const
Returns expanded and adjusted time of message (in ns)
XPU_D uint16_t GetHitAdc() const
For Hit data: Returns ADC value (5 bit field)
XPU_D uint16_t GetHitChannel() const
For Hit data: Returns StsXYTER channel number (7 bit field)
bool PrintMess(std::ostream &os, MessagePrintMask ctrl=MessagePrintMask::msg_print_Human, bool bBinning=true) const
XPU_D uint16_t GetLinkIndex() const
For all data: Returns the (global) index of the eLink on which the message was received (n bit field)
XPU_D MessType GetMessType() const
Returns the message type, see enum MessType.
XPU_D uint16_t GetHitTime() const
For Hit data: Returns timestamp (8 bit field, 2 MSB bits overlap removed)
XPU_D uint32_t GetTsMsbVal() const
For TS MSB data: Returns the TS MSB 22 bit field)
const uint64_t kulEpochCycleBins
const uint32_t kuChipIdMergedEpoch
const uint32_t kuEpochCounterSz
const uint64_t kulEpochCycleFieldSz
static constexpr uint64_t kulTsCycleNbBins
static constexpr uint32_t kuHitNbTsBins
static constexpr uint32_t kuHitNbAdcBins
Status/properties constants.
static constexpr double kdClockCycleNs
MessType
Message types.