CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018MonitorTof.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// ----- CbmMcbm2018MonitorTof -----
8// ----- Created 10.07.2018 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
13
16#include "CbmHistManager.h"
17#include "CbmMcbm2018TofPar.h"
18#include "FairRootManager.h"
19#include "FairRun.h"
20#include "FairRunOnline.h"
21#include "FairRuntimeDb.h"
22#include "Rtypes.h"
23#include "TCanvas.h"
24#include "TClonesArray.h"
25#include "TF1.h"
26#include "TH1.h"
27#include "TH2.h"
28#include "THStack.h"
29#include "THttpServer.h"
30#include "TMath.h"
31#include "TPaveStats.h"
32#include "TProfile.h"
33#include "TProfile2D.h"
34#include "TROOT.h"
35#include "TString.h"
36#include "TStyle.h"
37
38#include <Logger.h>
39
40#include <TFile.h>
41
42#include <algorithm>
43#include <cstdint>
44#include <ctime>
45#include <iomanip>
46#include <iostream>
47
54
60 , fbIgnoreOverlapMs(kFALSE)
62 , fuTotalMsNb(0)
63 , fuOverlapMsNb(0)
64 , fuCoreMs(0)
65 , fdMsSizeInNs(0.0)
66 , fdTsCoreSizeInNs(0.0)
67 , fuMinNbGdpb(0)
68 , fuCurrNbGdpb(0)
69 , fUnpackPar()
70 , fuNrOfGdpbs(0)
75 , fuNrOfGet4(0)
78 , fuRawDataPrintMsgNb(100000)
80 , fbPrintAllHitsEnable(kFALSE)
82 , fbPulserModeEnable(kFALSE)
83 , fbCoincMapsEnable(kFALSE)
84 , fbOldFwData(kFALSE)
85 , fuDiamondDpbIdx(10000)
86 , // Crazy default value => should never make troubles given the price
87 fsHistoFilename("data/HistosMonitorTof.root")
89 , fuCurrentMs(0)
91 , fdMsIndex(0)
92 , fuGdpbId(0)
93 , fuGdpbNr(0)
94 , fuGet4Id(0)
95 , fuGet4Nr(0)
96 , fiEquipmentId(0)
97 , fviMsgCounter(11, 0)
98 , // length of enum MessageTypes initialized with 0
100 , fvulGdpbTsLsb()
101 , fvulStarTsMsb()
102 , fvulStarTsMid()
119 , dMinDt(-1. * (kuNbBinsDt * gdpbv100::kdBinSize / 2.) - gdpbv100::kdBinSize / 2.)
120 , dMaxDt(1. * (kuNbBinsDt * gdpbv100::kdBinSize / 2.) + gdpbv100::kdBinSize / 2.)
121 , fuNbFeePlot(2)
123 , fdStartTime(-1.)
124 , fdStartTimeLong(-1.)
125 , fdStartTimeMsSz(-1.)
126 , fuHistoryHistoSize(1800)
129 , fdFitZoomWidthPs(0.0)
130 , fcMsSizeAll(NULL)
131 , fvhMsSzPerLink(12, NULL)
132 , fvhMsSzTimePerLink(12, NULL)
133 , fhMessType(NULL)
134 , fhSysMessType(NULL)
135 , fhGet4MessType(NULL)
136 , fhGet4ChanScm(NULL)
137 , fhGet4ChanErrors(NULL)
138 , fhGet4EpochFlags(NULL)
139 , fhGdpbMessType(NULL)
140 , fhGdpbSysMessType(NULL)
142 , fhGdpbEpochFlags(NULL)
143 , fhGdpbEpochSyncEvo(NULL)
144 , fhGdpbEpochMissEvo(NULL)
148 , fhScmScalerCounters(NULL)
150 , fhScmSeuCounters(NULL)
151 , fhScmSeuCountersEvo(NULL)
152 , fhPatternMissmatch(NULL)
153 , fhPatternEnable(NULL)
154 , fhPatternResync(NULL)
167 , fvhRawFt_gDPB()
180 ,
181 /*
182 fvhRemapTotSideA_mod(),
183 fvhRemapTotSideB_mod(),
184 fvhModRate(),
185 fvhModErrorRate(),
186 fvhModErrorRatio(),
187*/
198 , fhTimeMeanPulser(NULL)
199 , fhTimeRmsPulser(NULL)
201 , fhTimeResFitPuls(NULL)
204 , fvuPadiToGet4()
205 , fvuGet4ToPadi()
209{
210}
211
213
215{
216 LOG(info) << "Initializing Get4 monitor";
217
218 FairRootManager* ioman = FairRootManager::Instance();
219 if (ioman == NULL) { LOG(fatal) << "No FairRootManager instance"; } // if( ioman == NULL )
220
221 return kTRUE;
222}
223
225{
226 LOG(info) << "Setting parameter containers for " << GetName();
227 fUnpackPar = (CbmMcbm2018TofPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer("CbmMcbm2018TofPar"));
228}
229
231{
232 LOG(info) << "Init parameter containers for " << GetName();
233 Bool_t initOK = ReInitContainers();
234
236
241 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
242 for (UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j) {
246 } // for( UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j )
247 } // for( UInt_t i = 0; i < fuNrOfGdpbs; ++i )
248
249 return initOK;
250}
251
253{
254 LOG(info) << "ReInit parameter containers for " << GetName();
255
256 fuNrOfGdpbs = fUnpackPar->GetNrOfGdpbs();
257 LOG(info) << "Nr. of Tof GDPBs: " << fuNrOfGdpbs;
259
260 fuNrOfFeePerGdpb = fUnpackPar->GetNrOfFeesPerGdpb();
261 LOG(info) << "Nr. of FEEs per Tof GDPB: " << fuNrOfFeePerGdpb;
262
263 fuNrOfGet4PerFee = fUnpackPar->GetNrOfGet4PerFee();
264 LOG(info) << "Nr. of GET4 per Tof FEE: " << fuNrOfGet4PerFee;
265
266 fuNrOfChannelsPerGet4 = fUnpackPar->GetNrOfChannelsPerGet4();
267 LOG(info) << "Nr. of channels per GET4: " << fuNrOfChannelsPerGet4;
268
270 LOG(info) << "Nr. of channels per FEE: " << fuNrOfChannelsPerFee;
271
273 LOG(info) << "Nr. of GET4s: " << fuNrOfGet4;
274
276 LOG(info) << "Nr. of GET4s per GDPB: " << fuNrOfGet4PerGdpb;
277
279 LOG(info) << "Nr. of channels per GDPB: " << fuNrOfChannelsPerGdpb;
280
281 fGdpbIdIndexMap.clear();
282 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
283 fGdpbIdIndexMap[fUnpackPar->GetGdpbId(i)] = i;
284 LOG(info) << "GDPB Id of TOF " << i << " : " << std::hex << fUnpackPar->GetGdpbId(i) << std::dec;
285 } // for( UInt_t i = 0; i < fuNrOfGdpbs; ++i )
286
287 fuNrOfGbtx = fUnpackPar->GetNrOfGbtx();
288 LOG(info) << "Nr. of GBTx: " << fuNrOfGbtx;
289
290 fuNrOfModules = fUnpackPar->GetNrOfModules();
291 LOG(info) << "Nr. of GBTx: " << fuNrOfModules;
292
293 fviRpcType.resize(fuNrOfGbtx);
294 fviModuleId.resize(fuNrOfGbtx);
295 fviNrOfRpc.resize(fuNrOfGbtx);
296 fviRpcSide.resize(fuNrOfGbtx);
297 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx) {
298 fviNrOfRpc[uGbtx] = fUnpackPar->GetNrOfRpc(uGbtx);
299 fviRpcType[uGbtx] = fUnpackPar->GetRpcType(uGbtx);
300 fviRpcSide[uGbtx] = fUnpackPar->GetRpcSide(uGbtx);
301 fviModuleId[uGbtx] = fUnpackPar->GetModuleId(uGbtx);
302 } // for( UInt_t uGbtx = 0; uGbtx < uNrOfGbtx; ++uGbtx)
303
304 TString sPrintoutLine = "Nr. of RPCs per GBTx: ";
305 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
306 sPrintoutLine += Form(" %2d", fviNrOfRpc[uGbtx]);
307 LOG(info) << sPrintoutLine;
308
309 sPrintoutLine = "RPC type per GBTx: ";
310 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
311 sPrintoutLine += Form(" %2d", fviRpcType[uGbtx]);
312 LOG(info) << sPrintoutLine;
313
314 sPrintoutLine = "RPC side per GBTx: ";
315 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
316 sPrintoutLine += Form(" %2d", fviRpcSide[uGbtx]);
317 LOG(info) << sPrintoutLine;
318
319 sPrintoutLine = "Module ID per GBTx: ";
320 for (UInt_t uGbtx = 0; uGbtx < fuNrOfGbtx; ++uGbtx)
321 sPrintoutLine += Form(" %2d", fviModuleId[uGbtx]);
322 LOG(info) << sPrintoutLine;
323
324 fuTotalMsNb = fUnpackPar->GetNbMsTot();
325 fuOverlapMsNb = fUnpackPar->GetNbMsOverlap();
327 fdMsSizeInNs = fUnpackPar->GetSizeMsInNs();
329 LOG(info) << "Timeslice parameters: " << fuTotalMsNb << " MS per link, of which " << fuOverlapMsNb
330 << " overlap MS, each MS is " << fdMsSizeInNs << " ns";
331
342 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
343 fvulGdpbTsMsb[uGdpb] = 0;
344 fvulGdpbTsLsb[uGdpb] = 0;
345 fvulStarTsMsb[uGdpb] = 0;
346 fvulStarTsMid[uGdpb] = 0;
347 fvulGdpbTsFullLast[uGdpb] = 0;
348 fvulStarTsFullLast[uGdpb] = 0;
349 fvuStarTokenLast[uGdpb] = 0;
350 fvuStarDaqCmdLast[uGdpb] = 0;
351 fvuStarTrigCmdLast[uGdpb] = 0;
352 } // for (Int_t iGdpb = 0; iGdpb < fuNrOfGdpbs; ++iGdpb)
353
355
357 if (kTRUE == fbPulserModeEnable) {
360 } // if( kTRUE == fbPulserModeEnable )
361
363 if (kTRUE == fbCoincMapsEnable) {
366 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
368 fvdCoincTsLastHit[uGdpb].resize(fuNrOfChannelsPerGdpb, 0.0);
369 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
370 } // if( kTRUE == fbCoincMapsEnable )
371
375 /*
376 UInt_t uGet4topadi[32] = {
377 4, 3, 2, 1, // provided by Jochen
378 24, 23, 22, 21,
379 8, 7, 6, 5,
380 28, 27, 26, 25,
381 12, 11, 10, 9,
382 32, 31, 30, 29,
383 16, 15, 14, 13,
384 20, 19, 18, 17 };
385*/
386
388 UInt_t uGet4topadi[32] = {4, 3, 2, 1, // provided by Jochen
389 8, 7, 6, 5, 12, 11, 10, 9, 16, 15, 14, 13, 20, 19,
390 18, 17, 24, 23, 22, 21, 28, 27, 26, 25, 32, 31, 30, 29};
391
392
393 UInt_t uPaditoget4[32] = {4, 3, 2, 1, // provided by Jochen
394 12, 11, 10, 9, 20, 19, 18, 17, 28, 27, 26, 25, 32, 31,
395 30, 29, 8, 7, 6, 5, 16, 15, 14, 13, 24, 23, 22, 21};
396
397 for (UInt_t uChan = 0; uChan < fuNrOfChannelsPerFee; ++uChan) {
398 fvuPadiToGet4[uChan] = uPaditoget4[uChan] - 1;
399 fvuGet4ToPadi[uChan] = uGet4topadi[uChan] - 1;
400 } // for( UInt_t uChan = 0; uChan < fuNrOfChannelsPerFee; ++uChan )
401
402
406 UInt_t kuElinkToGet4[kuNbGet4PerGbtx] = {27, 2, 7, 3, 31, 26, 30, 1, 33, 37, 32, 13, 9, 14,
407 10, 15, 17, 21, 16, 35, 34, 38, 25, 24, 0, 6, 20, 23,
408 18, 22, 28, 4, 29, 5, 19, 36, 39, 8, 12, 11};
409 UInt_t kuGet4ToElink[kuNbGet4PerGbtx] = {24, 7, 1, 3, 31, 33, 25, 2, 37, 12, 14, 39, 38, 11,
410 13, 15, 18, 16, 28, 34, 26, 17, 29, 27, 23, 22, 5, 0,
411 30, 32, 6, 4, 10, 8, 20, 19, 35, 9, 21, 36};
412
413 for (UInt_t uLinkAsic = 0; uLinkAsic < kuNbGet4PerGbtx; ++uLinkAsic) {
414 fvuElinkToGet4[uLinkAsic] = kuElinkToGet4[uLinkAsic];
415 fvuGet4ToElink[uLinkAsic] = kuGet4ToElink[uLinkAsic];
416 } // for( UInt_t uChan = 0; uChan < fuNrOfChannelsPerFee; ++uChan )
417
418 return kTRUE;
419}
420
421
422void CbmMcbm2018MonitorTof::AddMsComponentToList(size_t component, UShort_t /*usDetectorId*/)
423{
425 for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
426 if (component == fvMsComponentsList[uCompIdx]) return;
427
429 fvMsComponentsList.push_back(component);
430
432 if (NULL == fvhMsSzPerLink[component]) {
433 TString sMsSzName = Form("MsSz_link_%02lu", component);
434 TString sMsSzTitle = Form("Size of MS from link %02lu; Ms Size [bytes]", component);
435 fvhMsSzPerLink[component] = new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 160000, 0., 20000.);
436
437 sMsSzName = Form("MsSzTime_link_%02lu", component);
438 sMsSzTitle = Form("Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]", component);
439 fvhMsSzTimePerLink[component] =
440 new TProfile(sMsSzName.Data(), sMsSzTitle.Data(), 100 * fuHistoryHistoSize, 0., 2 * fuHistoryHistoSize);
441 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
442 if (server) {
443 server->Register("/FlibRaw", fvhMsSzPerLink[component]);
444 server->Register("/FlibRaw", fvhMsSzTimePerLink[component]);
445 } // if( server )
446 if (NULL != fcMsSizeAll) {
447 fcMsSizeAll->cd(1 + component);
448 gPad->SetLogy();
449 fvhMsSzTimePerLink[component]->Draw("hist le0");
450 } // if( NULL != fcMsSizeAll )
451 LOG(info) << "Added MS size histo for component (link): " << component;
452 } // if( NULL == fvhMsSzPerLink[ component ] )
453}
454void CbmMcbm2018MonitorTof::SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
455{
456 fuNbCoreMsPerTs = uCoreMsNb;
457 fuNbOverMsPerTs = uOverlapMsNb;
458
459 // UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
460}
461
463{
464 LOG(info) << "create Histos for " << fuNrOfGdpbs << " gDPBs ";
465
466 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
467
468 TString name {""};
469 TString title {""};
470
471 // Full Fee time difference test
472 UInt_t uNbBinsDt = kuNbBinsDt + 1; // To account for extra bin due to shift by 1/2 bin of both ranges
473
475 Double_t dBinSzG4v2 = (6250. / 112.);
476 dMinDt = -1. * (kuNbBinsDt * dBinSzG4v2 / 2.) - dBinSzG4v2 / 2.;
477 dMaxDt = 1. * (kuNbBinsDt * dBinSzG4v2 / 2.) + dBinSzG4v2 / 2.;
478
479 /*******************************************************************/
480 name = "hMessageType";
481 title = "Nb of message for each type; Type";
482 // Test Big Data readout with plotting
483 fhMessType = new TH1I(name, title, 1 + gdpbv100::MSG_STAR_TRI_D, 0., 1 + gdpbv100::MSG_STAR_TRI_D);
484 fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_HIT, "HIT");
485 fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_EPOCH, "EPOCH");
486 fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SLOWC, "SLOWC");
487 fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SYST, "SYST");
488 fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_A, "TRI_A");
489 fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_B, "TRI_B");
490 fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_C, "TRI_C");
491 fhMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_D, "TRI_D");
492
493 /*******************************************************************/
494 name = "hSysMessType";
495 title = "Nb of system message for each type; System Type";
496 fhSysMessType = new TH1I(name, title, 1 + gdpbv100::SYS_PATTERN, 0., 1 + gdpbv100::SYS_PATTERN);
497 fhSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GET4_ERROR, "GET4 ERROR");
498 fhSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GDPB_UNKWN, "UNKW GET4 MSG");
499 fhSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GET4_SYNC_MISS, "SYS_GET4_SYNC_MISS");
500 fhSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_PATTERN, "SYS_PATTERN");
501
502 /*******************************************************************/
503 name = "hGet4MessType";
504 title = "Nb of message for each type per GET4; GET4 chip # ; Type";
505 fhGet4MessType = new TH2I(name, title, fuNrOfGet4, 0., fuNrOfGet4, 4, 0., 4.);
506 fhGet4MessType->GetYaxis()->SetBinLabel(1, "DATA 32b");
507 fhGet4MessType->GetYaxis()->SetBinLabel(2, "EPOCH");
508 fhGet4MessType->GetYaxis()->SetBinLabel(3, "S.C. M");
509 fhGet4MessType->GetYaxis()->SetBinLabel(4, "ERROR");
510 // fhGet4MessType->GetYaxis()->SetBinLabel( 5, "DATA 24b");
511 // fhGet4MessType->GetYaxis()->SetBinLabel( 6, "STAR Trigger");
512
513 /*******************************************************************/
514 name = "hGet4ChanScm";
515 title = "SC messages per GET4 channel; GET4 channel # ; SC type";
517 new TH2I(name, title, 2 * fuNrOfGet4 * fuNrOfChannelsPerGet4, 0., fuNrOfGet4 * fuNrOfChannelsPerGet4, 5, 0., 5.);
518 fhGet4ChanScm->GetYaxis()->SetBinLabel(1, "Hit Scal");
519 fhGet4ChanScm->GetYaxis()->SetBinLabel(2, "Deadtime");
520 fhGet4ChanScm->GetYaxis()->SetBinLabel(3, "SPI");
521 fhGet4ChanScm->GetYaxis()->SetBinLabel(4, "SEU Scal");
522 fhGet4ChanScm->GetYaxis()->SetBinLabel(5, "START");
523
524 /*******************************************************************/
525 name = "hGet4ChanErrors";
526 title = "Error messages per GET4 channel; GET4 channel # ; Error";
528 new TH2I(name, title, fuNrOfGet4 * fuNrOfChannelsPerGet4, 0., fuNrOfGet4 * fuNrOfChannelsPerGet4, 21, 0., 21.);
529 fhGet4ChanErrors->GetYaxis()->SetBinLabel(1, "0x00: Readout Init ");
530 fhGet4ChanErrors->GetYaxis()->SetBinLabel(2, "0x01: Sync ");
531 fhGet4ChanErrors->GetYaxis()->SetBinLabel(3, "0x02: Epoch count sync");
532 fhGet4ChanErrors->GetYaxis()->SetBinLabel(4, "0x03: Epoch ");
533 fhGet4ChanErrors->GetYaxis()->SetBinLabel(5, "0x04: FIFO Write ");
534 fhGet4ChanErrors->GetYaxis()->SetBinLabel(6, "0x05: Lost event ");
535 fhGet4ChanErrors->GetYaxis()->SetBinLabel(7, "0x06: Channel state ");
536 fhGet4ChanErrors->GetYaxis()->SetBinLabel(8, "0x07: Token Ring state");
537 fhGet4ChanErrors->GetYaxis()->SetBinLabel(9, "0x08: Token ");
538 fhGet4ChanErrors->GetYaxis()->SetBinLabel(10, "0x09: Error Readout ");
539 fhGet4ChanErrors->GetYaxis()->SetBinLabel(11, "0x0a: SPI ");
540 fhGet4ChanErrors->GetYaxis()->SetBinLabel(12, "0x0b: DLL Lock error "); // <- From GET4 v1.2
541 fhGet4ChanErrors->GetYaxis()->SetBinLabel(13, "0x0c: DLL Reset invoc."); // <- From GET4 v1.2
542 fhGet4ChanErrors->GetYaxis()->SetBinLabel(14, "0x11: Overwrite ");
543 fhGet4ChanErrors->GetYaxis()->SetBinLabel(15, "0x12: ToT out of range");
544 fhGet4ChanErrors->GetYaxis()->SetBinLabel(16, "0x13: Event Discarded ");
545 fhGet4ChanErrors->GetYaxis()->SetBinLabel(17, "0x14: Add. Rising edge"); // <- From GET4 v1.3
546 fhGet4ChanErrors->GetYaxis()->SetBinLabel(18, "0x15: Unpaired Falling"); // <- From GET4 v1.3
547 fhGet4ChanErrors->GetYaxis()->SetBinLabel(19, "0x16: Sequence error "); // <- From GET4 v1.3
548 fhGet4ChanErrors->GetYaxis()->SetBinLabel(20, "0x7f: Unknown ");
549 fhGet4ChanErrors->GetYaxis()->SetBinLabel(21, "Corrupt/unsuprtd error");
550
551 /*******************************************************************/
552 name = "hGet4EpochFlags";
553 title = "Epoch flags per GET4; GET4 chip # ; Type";
554 fhGet4EpochFlags = new TH2I(name, title, fuNrOfGet4, 0., fuNrOfGet4, 4, 0., 4.);
555 fhGet4EpochFlags->GetYaxis()->SetBinLabel(1, "SYNC");
556 fhGet4EpochFlags->GetYaxis()->SetBinLabel(2, "Ep LOSS");
557 fhGet4EpochFlags->GetYaxis()->SetBinLabel(3, "Da LOSS");
558 fhGet4EpochFlags->GetYaxis()->SetBinLabel(4, "MISSMAT");
559
560 /*******************************************************************/
561 name = "hGdpbMessageType";
562 title = "Nb of message for each type per Gdpb; Type; Gdpb Idx []";
563 // Test Big Data readout with plotting
565 -0.5, fuNrOfGdpbs - 0.5);
566 fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_HIT, "HIT");
567 fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_EPOCH, "EPOCH");
568 fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SLOWC, "SLOWC");
569 fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_SYST, "SYST");
570 fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_A, "TRI_A");
571 fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_B, "TRI_B");
572 fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_C, "TRI_C");
573 fhGdpbMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::MSG_STAR_TRI_D, "TRI_D");
574
575 /*******************************************************************/
576 name = "hGdpbSysMessType";
577 title = "Nb of system message for each type per Gdpb; System Type; Gdpb Idx []";
578 fhGdpbSysMessType = new TH2I(name, title, 1 + gdpbv100::SYS_PATTERN, 0., 1 + gdpbv100::SYS_PATTERN, fuNrOfGdpbs, -0.5,
579 fuNrOfGdpbs - 0.5);
580 fhGdpbSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GET4_ERROR, "GET4 ERROR");
581 fhGdpbSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GDPB_UNKWN, "UNKW GET4 MSG");
582 fhGdpbSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_GET4_SYNC_MISS, "SYS_GET4_SYNC_MISS");
583 fhGdpbSysMessType->GetXaxis()->SetBinLabel(1 + gdpbv100::SYS_PATTERN, "SYS_PATTERN");
584
585 /*******************************************************************/
586 name = "hGdpbSysMessPattType";
587 title = "Nb of pattern message for each type per Gdpb; Pattern Type; Gdpb Idx []";
589 -0.5, fuNrOfGdpbs - 0.5);
590 fhGdpbSysMessPattType->GetXaxis()->SetBinLabel(1 + gdpbv100::PATT_MISSMATCH, "PATT_MISSMATCH");
591 fhGdpbSysMessPattType->GetXaxis()->SetBinLabel(1 + gdpbv100::PATT_ENABLE, "PATT_ENABLE");
592 fhGdpbSysMessPattType->GetXaxis()->SetBinLabel(1 + gdpbv100::PATT_RESYNC, "PATT_RESYNC");
593
594 /*******************************************************************/
595 name = "hGdpbEpochFlags";
596 title = "Epoch flags per gDPB; gDPB # ; Type";
597 fhGdpbEpochFlags = new TH2I(name, title, fuNrOfGdpbs, 0., fuNrOfGdpbs, 4, 0., 4.);
598 fhGdpbEpochFlags->GetYaxis()->SetBinLabel(1, "SYNC");
599 fhGdpbEpochFlags->GetYaxis()->SetBinLabel(2, "Ep LOSS");
600 fhGdpbEpochFlags->GetYaxis()->SetBinLabel(3, "Da LOSS");
601 fhGdpbEpochFlags->GetYaxis()->SetBinLabel(4, "MISSMAT");
602
603 /*******************************************************************/
604 name = Form("hGdpbEpochSyncEvo");
605 title = Form("Epoch SYNC per second and gDPB; Time[s]; gDPB #; SYNC Nb");
607 new TH2D(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize, fuNrOfGdpbs, 0., fuNrOfGdpbs);
608
609 /*******************************************************************/
610 name = Form("hGdpbEpochMissEvo");
611 title = Form("Epoch Missmatch per second and gDPB; Time[s]; gDPB #; Missmatch Nb");
613 new TH2D(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize, fuNrOfGdpbs, 0., fuNrOfGdpbs);
614
615 /*******************************************************************/
616 // Slow control messages analysis
617 name = "hScmScalerCounters";
618 title = "Content of Scaler counter SC messages; Scaler counter [hit]; Channel []";
619 fhScmScalerCounters = new TH2I(name, title, fuNrOfGet4 * fuNrOfChannelsPerGet4 * 2, 0.,
620 fuNrOfGet4 * fuNrOfChannelsPerGet4, 8192, 0., 8192.);
621
622 name = "hScmDeadtimeCounters";
623 title = "Content of Deadtime counter SC messages; Deadtime [Clk Cycles]; "
624 "Channel []";
625 fhScmDeadtimeCounters = new TH2I(name, title, fuNrOfGet4 * fuNrOfChannelsPerGet4 * 2, 0.,
626 fuNrOfGet4 * fuNrOfChannelsPerGet4, 8192, 0., 8192.);
627
628 name = "hScmSeuCounters";
629 title = "Content of SEU counter SC messages; SEU []; Channel []";
630 fhScmSeuCounters = new TH2I(name, title, fuNrOfGet4 * fuNrOfChannelsPerGet4 * 2, 0.,
631 fuNrOfGet4 * fuNrOfChannelsPerGet4, 8192, 0., 8192.);
632
633 name = "hScmSeuCountersEvo";
634 title = "SEU counter rate from SC messages; Time in Run [s]; Channel []; SEU []";
635 fhScmSeuCountersEvo = new TH2I(name, title, fuNrOfGet4 * fuNrOfChannelsPerGet4 * 2, 0.,
637
638 /*******************************************************************/
639 name = "hPatternMissmatch";
640 title = "Missmatch pattern integral per Gdpb; ASIC Pattern []; Gdpb Idx []";
642 new TH2I(name, title, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb, fuNrOfGdpbs, -0.5, fuNrOfGdpbs - 0.5);
643 name = "hPatternEnable";
644 title = "Enable pattern integral per Gdpb; ASIC Pattern []; Gdpb Idx []";
646 new TH2I(name, title, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb, fuNrOfGdpbs, -0.5, fuNrOfGdpbs - 0.5);
647 name = "hPatternResync";
648 title = "Resync pattern integral per Gdpb; ASIC Pattern []; Gdpb Idx []";
650 new TH2I(name, title, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb, fuNrOfGdpbs, -0.5, fuNrOfGdpbs - 0.5);
651
652
653 /*******************************************************************/
654
659 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
660
661 /*******************************************************************/
662 name = Form("hGdpbGet4MessType_%02u", uGdpb);
663 title = Form("Nb of message for each type per GET4 in gDPB %02u; GET4 chip # ; Type", uGdpb);
664 fvhGdpbGet4MessType.push_back(new TH2I(name, title, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb, 4, 0., 4.));
665 fvhGdpbGet4MessType[uGdpb]->GetYaxis()->SetBinLabel(1, "DATA 32b");
666 fvhGdpbGet4MessType[uGdpb]->GetYaxis()->SetBinLabel(2, "EPOCH");
667 fvhGdpbGet4MessType[uGdpb]->GetYaxis()->SetBinLabel(3, "S.C. M");
668 fvhGdpbGet4MessType[uGdpb]->GetYaxis()->SetBinLabel(4, "ERROR");
669
670 /*******************************************************************/
671 name = Form("hGdpbGet4ChanScm_%02u", uGdpb);
672 title = Form("SC messages per GET4 channel in gDPB %02u; GET4 channel # ; SC type", uGdpb);
673 fvhGdpbGet4ChanScm.push_back(
674 new TH2I(name, title, 2 * fuNrOfChannelsPerGdpb, 0., fuNrOfChannelsPerGdpb, 5, 0., 5.));
675 fvhGdpbGet4ChanScm[uGdpb]->GetYaxis()->SetBinLabel(1, "Hit Scal");
676 fvhGdpbGet4ChanScm[uGdpb]->GetYaxis()->SetBinLabel(2, "Deadtime");
677 fvhGdpbGet4ChanScm[uGdpb]->GetYaxis()->SetBinLabel(3, "SPI");
678 fvhGdpbGet4ChanScm[uGdpb]->GetYaxis()->SetBinLabel(4, "SEU Scal");
679 fvhGdpbGet4ChanScm[uGdpb]->GetYaxis()->SetBinLabel(5, "START");
680
681 /*******************************************************************/
682 name = Form("hGdpbGet4ChanErrors_%02u", uGdpb);
683 title = Form("Error messages per GET4 channel in gDPB %02u; GET4 channel # ; Error", uGdpb);
684 fvhGdpbGet4ChanErrors.push_back(
685 new TH2I(name, title, fuNrOfChannelsPerGdpb, 0., fuNrOfChannelsPerGdpb, 22, 0., 22.));
686 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(1, "0x00: Readout Init ");
687 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(2, "0x01: Sync ");
688 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(3, "0x02: Epoch count sync");
689 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(4, "0x03: Epoch ");
690 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(5, "0x04: FIFO Write ");
691 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(6, "0x05: Lost event ");
692 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(7, "0x06: Channel state ");
693 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(8, "0x07: Token Ring state");
694 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(9, "0x08: Token ");
695 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(10, "0x09: Error Readout ");
696 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(11, "0x0a: SPI ");
697 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(12, "0x0b: DLL Lock error "); // <- From GET4 v1.2
698 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(13, "0x0c: DLL Reset invoc."); // <- From GET4 v1.2
699 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(14, "0x11: Overwrite "); // <- From GET4 v1.0 to 1.3
700 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(15, "0x12: ToT out of range");
701 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(16, "0x13: Event Discarded ");
702 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(17, "0x14: Add. Rising edge"); // <- From GET4 v1.3
703 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(18, "0x15: Unpaired Falling"); // <- From GET4 v1.3
704 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(19, "0x16: Sequence error "); // <- From GET4 v1.3
705 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(20, "0x17: Epoch Overflow "); // <- From GET4 v2.0
706 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(21, "0x7f: Unknown ");
707 fvhGdpbGet4ChanErrors[uGdpb]->GetYaxis()->SetBinLabel(22, "Corrupt/unsuprtd error");
708
709 /*******************************************************************/
710 name = Form("hGdpbPatternMissmatchEvo_%02u", uGdpb);
711 title = Form("Missmatch pattern vs TS index in gDPB %02u; TS # ; ASIC Pattern []", uGdpb);
713 new TH2I(name, title, 10000, 0., 100000, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb));
714
715 name = Form("hGdpbPatternEnableEvo_%02u", uGdpb);
716 title = Form("Enable pattern vs TS index in gDPB %02u; TS # ; ASIC Pattern []", uGdpb);
717 fvhGdpbPatternEnableEvo.push_back(
718 new TH2I(name, title, 10000, 0., 100000, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb));
719
720 name = Form("hGdpbPatternResyncEvo%02u", uGdpb);
721 title = Form("Resync pattern vs TS index in gDPB %02u; TS # ; ASIC Pattern []", uGdpb);
722 fvhGdpbPatternResyncEvo.push_back(
723 new TH2I(name, title, 10000, 0., 100000, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb));
724
725 fvvbGdpbLastMissmatchPattern[uGdpb].resize(fuNrOfGet4PerGdpb, kFALSE);
726 fvvbGdpbLastEnablePattern[uGdpb].resize(fuNrOfGet4PerGdpb, kTRUE);
727 fvvbGdpbLastResyncPattern[uGdpb].resize(fuNrOfGet4PerGdpb, kFALSE);
728
729 name = Form("hGdpbMissmatchEvoPerTs%02u", uGdpb);
730 title = Form("Missmatch vs TS index in gDPB %02u; TS # ; Asic []; Missmatch? []", uGdpb);
731 fvhGdpbMissmatchEvoPerTs.push_back(
732 new TH2I(name, title, 10000, 0., 100000, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb));
733 name = Form("hGdpbMissmatchEnaEvoPerTs%02u", uGdpb);
734 title = Form("Enable+Missmatch vs TS index in gDPB %02u; TS # ; Asic []; "
735 "Enabled & Missmatch? []",
736 uGdpb);
738 new TH2I(name, title, 10000, 0., 100000, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb));
739
740 name = Form("hGdpbEnableEvoPerTs%02u", uGdpb);
741 title = Form("Enable vs TS index in gDPB %02u; TS # ; Asic []; Enabled? []", uGdpb);
742 fvhGdpbEnableEvoPerTs.push_back(
743 new TH2I(name, title, 100000, 0., 100000, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb));
744
745 name = Form("hGdpbResyncEvoPerTs%02u", uGdpb);
746 title = Form("Resync vs TS index in gDPB %02u; TS # ; Asic []; Resync? []", uGdpb);
747 fvhGdpbResyncEvoPerTs.push_back(new TH2I(name, title, 10000, 0., 100000, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb));
748 name = Form("hGdpbResyncEnaEvoPerTs%02u", uGdpb);
749 title = Form("Enable+Resync vs TS index in gDPB %02u; TS # ; Asic []; "
750 "Enabled & Resync? []",
751 uGdpb);
752 fvhGdpbResyncEnaEvoPerTs.push_back(
753 new TH2I(name, title, 10000, 0., 100000, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb));
754
755 name = Form("hGdpbStateEvoPerTs%02u", uGdpb);
756 title = Form("ASIC State vs TS index in gDPB %02u; TS # ; Asic []; 0 = "
757 "Off, 1 = OK, 2 = Miss, 3 = Resync, 4 = Miss + Resync []",
758 uGdpb);
759 fvhGdpbStateEvoPerTs.push_back(new TH2I(name, title, 100000, 0., 100000, fuNrOfGet4PerGdpb, 0., fuNrOfGet4PerGdpb));
760
762 name = Form("RawFt_gDPB_%02u", uGdpb);
763 title = Form("Raw FineTime gDPB %02u Plot 0; channel; FineTime [bin]", uGdpb);
764 fvhRawFt_gDPB.push_back(
765 new TH2F(name.Data(), title.Data(), fuNrOfChannelsPerGdpb, 0, fuNrOfChannelsPerGdpb, 128, 0, 128));
766
768 name = Form("RawTot_gDPB_%02u", uGdpb);
769 title = Form("Raw TOT gDPB %02u; channel; TOT [bin]", uGdpb);
770 fvhRawTot_gDPB.push_back(
771 new TH2F(name.Data(), title.Data(), fuNrOfChannelsPerGdpb, 0, fuNrOfChannelsPerGdpb, 256, 0, 256));
772
774 name = Form("ChCount_gDPB_%02u", uGdpb);
775 title = Form("Channel counts gDPB %02u; channel; Hits", uGdpb);
776 fvhChCount_gDPB.push_back(new TH1I(name.Data(), title.Data(), fuNrOfFeePerGdpb * fuNrOfChannelsPerFee, 0,
778
780 name = Form("ChRate_gDPB_%02u", uGdpb);
781 title = Form("Channel rate gDPB %02u; Time in run [s]; channel; Rate [1/s]", uGdpb);
782 fvhChannelRate_gDPB.push_back(new TH2D(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize,
785
787 name = Form("RemapTot_gDPB_%02u", uGdpb);
788 title = Form("Raw TOT gDPB %02u remapped; PADI channel; TOT [bin]", uGdpb);
789 fvhRemapTot_gDPB.push_back(
790 new TH2F(name.Data(), title.Data(), fuNrOfChannelsPerGdpb, 0, fuNrOfChannelsPerGdpb, 256, 0, 256));
791
793 name = Form("RemapChCount_gDPB_%02u", uGdpb);
794 title = Form("Channel counts gDPB %02u remapped; PADI channel; Hits", uGdpb);
795 fvhRemapChCount_gDPB.push_back(new TH1I(name.Data(), title.Data(), fuNrOfFeePerGdpb * fuNrOfChannelsPerFee, 0,
797
799 name = Form("RemapChRate_gDPB_%02u", uGdpb);
800 title = Form("PADI channel rate gDPB %02u; Time in run [s]; PADI channel; Rate [1/s]", uGdpb);
801 fvhRemapChRate_gDPB.push_back(new TH2D(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize,
804
806 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee) {
807 name = Form("FeeRate_gDPB_g%02u_f%1u", uGdpb, uFee);
808 title = Form("Counts per second in Fee %1u of gDPB %02u; Time[s] ; Counts", uFee, uGdpb);
809 fvhFeeRate_gDPB.push_back(new TH1D(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize));
810
811 name = Form("FeeErrorRate_gDPB_g%02u_f%1u", uGdpb, uFee);
812 title = Form("Error Counts per second in Fee %1u of gDPB %02u; Time[s] ; "
813 "Error Counts",
814 uFee, uGdpb);
815 fvhFeeErrorRate_gDPB.push_back(new TH1D(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize));
816
817 name = Form("FeeErrorRatio_gDPB_g%02u_f%1u", uGdpb, uFee);
818 title = Form("Error to data ratio per second in Fee %1u of gDPB %02u; "
819 "Time[s] ; Error ratio[]",
820 uFee, uGdpb);
821 fvhFeeErrorRatio_gDPB.push_back(
822 new TProfile(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize));
823
824 name = Form("FeeRateLong_gDPB_g%02u_f%1u", uGdpb, uFee);
825 title = Form("Counts per minutes in Fee %1u of gDPB %02u; Time[min] ; Counts", uFee, uGdpb);
826 fvhFeeRateLong_gDPB.push_back(
827 new TH1D(name.Data(), title.Data(), fuHistoryHistoSizeLong, 0, fuHistoryHistoSizeLong));
828
829 name = Form("FeeErrorRateLong_gDPB_g%02u_f%1u", uGdpb, uFee);
830 title = Form("Error Counts per minutes in Fee %1u of gDPB %02u; "
831 "Time[min] ; Error Counts",
832 uFee, uGdpb);
833 fvhFeeErrorRateLong_gDPB.push_back(
834 new TH1D(name.Data(), title.Data(), fuHistoryHistoSizeLong, 0, fuHistoryHistoSizeLong));
835
836 name = Form("FeeErrorRatioLong_gDPB_g%02u_f%1u", uGdpb, uFee);
837 title = Form("Error to data ratio per minutes in Fee %1u of gDPB %02u; "
838 "Time[min] ; Error ratio[]",
839 uFee, uGdpb);
841 new TProfile(name.Data(), title.Data(), fuHistoryHistoSizeLong, 0, fuHistoryHistoSizeLong));
842 } // for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; uFee++)
843
845 fhHitsPerMsFirstChan_gDPB.push_back(new TH2D(Form("hHitsPerMsFirstChan_gDPB%02u", uGdpb),
846 Form("Hit Counts per MS in first channel in gDPB %02u; TS []; "
847 "Hits/MS []; MS nb[]",
848 uGdpb),
849 10000, 0, 10000, 150, -0.5, 149.5));
850 fvhChannelRatePerMs_gDPB.push_back(new TProfile2D(Form("hChannelRatePerMs_gDPB%02u", uGdpb),
851 Form("Mean Hit count per MS and channel vs Time in gDPB "
852 "%02u; TS []; Channel []; <Hits/Ms> []",
853 uGdpb),
854 10000, 0, 10000, fuNrOfChannelsPerGdpb, -0.5,
855 fuNrOfChannelsPerGdpb - 0.5));
856
859 name = Form("hTokenMsgType_gDPB_%02u", uGdpb);
860 title = Form("STAR trigger Messages type gDPB %02u; Type ; Counts", uGdpb);
861 fvhTokenMsgType.push_back(new TH1F(name, title, 4, 0, 4));
862 fvhTokenMsgType[uGdpb]->GetXaxis()->SetBinLabel(1, "A"); // gDPB TS high
863 fvhTokenMsgType[uGdpb]->GetXaxis()->SetBinLabel(2, "B"); // gDPB TS low, STAR TS high
864 fvhTokenMsgType[uGdpb]->GetXaxis()->SetBinLabel(3, "C"); // STAR TS mid
865 fvhTokenMsgType[uGdpb]->GetXaxis()->SetBinLabel(4, "D"); // STAR TS low, token, CMDs
866 if (server) server->Register("/StarRaw", fvhTokenMsgType[uGdpb]);
867
868 name = Form("hTriggerRate_gDPB_%02u", uGdpb);
869 title = Form("STAR trigger signals per second gDPB %02u; Time[s] ; Counts", uGdpb);
870 fvhTriggerRate.push_back(new TH1F(name, title, fuHistoryHistoSize, 0, fuHistoryHistoSize));
871 if (server) server->Register("/StarRaw", fvhTriggerRate[uGdpb]);
872
873 name = Form("hCmdDaqVsTrig_gDPB_%02u", uGdpb);
874 title = Form("STAR daq command VS STAR trigger command gDPB %02u; DAQ ; TRIGGER", uGdpb);
875 fvhCmdDaqVsTrig.push_back(new TH2I(name, title, 16, 0, 16, 16, 0, 16));
876 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(1, "0x0: no-trig "); // idle link
877 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(
878 2, "0x1: clear "); // clears redundancy counters on the readout boards
879 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(3, "0x2: mast-rst"); // general reset of the whole front-end logic
880 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(4, "0x3: spare "); // reserved
881 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(
882 5, "0x4: trigg. 0"); // Default physics readout, all det support required
883 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(6, "0x5: trigg. 1"); //
884 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(7, "0x6: trigg. 2"); //
885 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(8, "0x7: trigg. 3"); //
886 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(9, "0x8: puls. 0"); //
887 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(10, "0x9: puls. 1"); //
888 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(11, "0xA: puls. 2"); //
889 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(12, "0xB: puls. 3"); //
890 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(
891 13,
892 "0xC: config "); // housekeeping trigger: return geographic info of FE
893 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(14, "0xD: abort "); // aborts and clears an active event
894 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(15, "0xE: L1accept"); //
895 fvhCmdDaqVsTrig[uGdpb]->GetXaxis()->SetBinLabel(16, "0xF: L2accept"); //
896 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(1, "0x0: 0"); // To be filled at STAR
897 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(2, "0x1: 1"); // To be filled at STAR
898 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(3, "0x2: 2"); // To be filled at STAR
899 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(4, "0x3: 3"); // To be filled at STAR
900 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(5, "0x4: 4"); // To be filled at STAR
901 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(6, "0x5: 5"); // To be filled at STAR
902 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(7, "0x6: 6"); // To be filled at STAR
903 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(8, "0x7: 7"); // To be filled at STAR
904 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(9, "0x8: 8"); // To be filled at STAR
905 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(10, "0x9: 9"); // To be filled at STAR
906 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(11, "0xA: 10"); // To be filled at STAR
907 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(12, "0xB: 11"); // To be filled at STAR
908 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(13, "0xC: 12"); // To be filled at STAR
909 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(14, "0xD: 13"); // To be filled at STAR
910 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(15, "0xE: 14"); // To be filled at STAR
911 fvhCmdDaqVsTrig[uGdpb]->GetYaxis()->SetBinLabel(16, "0xF: 15"); // To be filled at STAR
912 if (server) server->Register("/StarRaw", fvhCmdDaqVsTrig[uGdpb]);
913
914 name = Form("hStarTokenEvo_gDPB_%02u", uGdpb);
915 title = Form("STAR token value VS time gDPB %02u; Time in Run [s] ; STAR "
916 "Token; Counts",
917 uGdpb);
918 fvhStarTokenEvo.push_back(new TH2I(name, title, fuHistoryHistoSize, 0, fuHistoryHistoSize, 410, 0, 4100));
919
920
921 name = Form("hStarTrigGdpbTsEvo_gDPB_%02u", uGdpb);
922 title = Form("gDPB TS in STAR triger tokens for gDPB %02u; Time in Run [s] ; gDPB TS;", uGdpb);
923 fvhStarTrigGdpbTsEvo.push_back(new TProfile(name, title, fuHistoryHistoSize, 0, fuHistoryHistoSize));
924
925 name = Form("hStarTrigStarTsEvo_gDPB_%02u", uGdpb);
926 title = Form("STAR TS in STAR triger tokens for gDPB %02u; Time in Run [s] ; STAR TS;", uGdpb);
927 fvhStarTrigStarTsEvo.push_back(new TProfile(name, title, fuHistoryHistoSize, 0, fuHistoryHistoSize));
928 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
929
930 /*******************************************************************/
932 /*
933 for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
934 {
935 name = Form("RemapTotSideA_mod_%02u", uMod);
936 title = Form("Raw TOT module %02u Side A; PADI channel; TOT [bin]", uMod);
937 fvhRemapTotSideA_mod.push_back(
938 new TH2F(name.Data(), title.Data(),
939 kuNbFeeSide * fuNrOfChannelsPerFee, 0, kuNbFeeSide * fuNrOfChannelsPerFee,
940 256, 0, 256 ) );
941 name = Form("RemapTotSideB_mod_%02u", uMod);
942 title = Form("Raw TOT module %02u Side B; PADI channel; TOT [bin]", uMod);
943 fvhRemapTotSideB_mod.push_back(
944 new TH2F(name.Data(), title.Data(),
945 kuNbFeeSide * fuNrOfChannelsPerFee, 0, kuNbFeeSide * fuNrOfChannelsPerFee,
946 256, 0, 256 ) );
947
948 name = Form("ModRate_gDPB_m%02u", uMod);
949 title = Form( "Counts per second in Module %02u; Time[s] ; Counts", uMod);
950 fvhModRate.push_back( new TH1D(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize) );
951
952 name = Form("ModErrorRate_m%02u", uMod);
953 title = Form( "Error Counts per second in Module %02u; Time[s] ; Error Counts", uMod);
954 fvhModErrorRate.push_back( new TH1D(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize) );
955
956 name = Form("ModErrorRatio_m%02u", uMod);
957 title = Form( "Error to data ratio per second in Module %02u; Time[s] ; Error ratio[]", uMod);
958 fvhModErrorRatio.push_back( new TProfile(name.Data(), title.Data(), fuHistoryHistoSize, 0, fuHistoryHistoSize) );
959 } // for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
960*/
961 /*******************************************************************/
963 if (kTRUE == fbPulserModeEnable) {
965 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++) {
967 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++) {
968 if (uFeeA < uFeeB) {
969 UInt_t uGdpbA = uFeeA / (fuNrOfFeePerGdpb);
970 UInt_t uFeeIdA = uFeeA - (fuNrOfFeePerGdpb * uGdpbA);
971 UInt_t uGdpbB = uFeeB / (fuNrOfFeePerGdpb);
972 UInt_t uFeeIdB = uFeeB - (fuNrOfFeePerGdpb * uGdpbB);
973 fvhTimeDiffPulser[uFeeA][uFeeB] =
974 new TH1I(Form("hTimeDiffPulser_g%02u_f%1u_g%02u_f%1u", uGdpbA, uFeeIdA, uGdpbB, uFeeIdB),
975 Form("Time difference for pulser on gDPB %02u FEE %1u and "
976 "gDPB %02u FEE %1u; DeltaT [ps]; Counts",
977 uGdpbA, uFeeIdA, uGdpbB, uFeeIdB),
978 uNbBinsDt, dMinDt, dMaxDt);
979 } // if( uFeeA < uFeeB )
980 else
981 fvhTimeDiffPulser[uFeeA][uFeeB] = NULL;
982 } // for( UInt_t uFeeB = uFeeA; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs - 1; uFeeB++)
983 } // for( UInt_t uFeeA = 0; uFeeA < kuNbChanTest - 1; uFeeA++)
984
985 name = "hTimeMeanPulser";
986 fhTimeMeanPulser = new TH2D(name.Data(), "Time difference Mean for each FEE pairs; FEE A; FEE B ; Mean [ps]",
989
990 name = "hTimeRmsPulser";
991 fhTimeRmsPulser = new TH2D(name.Data(), "Time difference RMS for each FEE pairs; FEE A; FEE B ; RMS [ps]",
994
995 name = "hTimeRmsZoomFitPuls";
996 fhTimeRmsZoomFitPuls = new TH2D(name.Data(),
997 "Time difference RMS after zoom for each "
998 "FEE pairs; FEE A; FEE B ; RMS [ps]",
1001
1002 name = "hTimeResFitPuls";
1003 fhTimeResFitPuls = new TH2D(name.Data(),
1004 "Time difference Res from fit for each FEE "
1005 "pairs; FEE A; FEE B ; Sigma [ps]",
1008
1011 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1012 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx) {
1013 name = Form("hPulserTimeDiffEvoGdpb%02uGbtx00Gbtx%02u", uGdpb, uGbtx + 1);
1014 fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx] =
1015 new TProfile(name.Data(),
1016 Form("Time difference of the 1st FEE in the 1st GBTx of gDPB %02u "
1017 "vs GBTx %02u; time in run [min]; dt [ps]",
1018 uGdpb, uGbtx + 1),
1020 } // for( UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb; ++uGbtx )
1021
1022 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb].resize(fuNrOfGdpbs, NULL);
1023 for (UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB) {
1024 name = Form("hPulserTimeDiffEvoGdpb%02uGdpb%02u", uGdpb, uGdpbB);
1025 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB] =
1026 new TProfile(name.Data(),
1027 Form("Time difference of the 1st FEE in the 1st GBTx of "
1028 "gDPB %02u vs %02u; time in run [min]; dt [ps]",
1029 uGdpb, uGdpbB),
1031 } // for( UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB )
1032 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1033 } // if( kTRUE == fbPulserModeEnable )
1034
1036 if (kTRUE == fbCoincMapsEnable) {
1037 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1038 name = Form("hCoincMapAllChanGdpb%02u", uGdpb);
1039 fvhCoincMapAllChanGdpb.push_back(new TH2D(name.Data(),
1040 Form("Coincidence map of all channels of gDPB %02u; Chan A "
1041 "[]; Chan B[]; Coinc. []",
1042 uGdpb),
1045
1046 name = Form("hCoincMeanAllChanGdpb%02u", uGdpb);
1047 fvhCoincMeanAllChanGdpb.push_back(new TProfile2D(name.Data(),
1048 Form("Coincidence mean of all channels of gDPB %02u; "
1049 "Chan A []; Chan B[]; Mean dt [ps]",
1050 uGdpb),
1053 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1054 } // if( kTRUE == fbCoincMapsEnable )
1055
1056 if (server) {
1057 server->Register("/TofRaw", fhMessType);
1058 server->Register("/TofRaw", fhSysMessType);
1059 server->Register("/TofRaw", fhGet4MessType);
1060 server->Register("/TofRaw", fhGet4ChanScm);
1061 server->Register("/TofRaw", fhGet4ChanErrors);
1062 server->Register("/TofRaw", fhGet4EpochFlags);
1063
1064 server->Register("/TofRaw", fhGdpbMessType);
1065 server->Register("/TofRaw", fhGdpbSysMessType);
1066 server->Register("/TofRaw", fhGdpbSysMessPattType);
1067 server->Register("/TofRaw", fhGdpbEpochFlags);
1068 server->Register("/TofRaw", fhGdpbEpochSyncEvo);
1069 server->Register("/TofRaw", fhGdpbEpochMissEvo);
1070
1071 server->Register("/TofRaw", fhScmScalerCounters);
1072 server->Register("/TofRaw", fhScmDeadtimeCounters);
1073 server->Register("/TofRaw", fhScmSeuCounters);
1074 server->Register("/TofRaw", fhScmSeuCountersEvo);
1075
1076 server->Register("/TofRaw", fhPatternMissmatch);
1077 server->Register("/TofRaw", fhPatternEnable);
1078 server->Register("/TofRaw", fhPatternResync);
1079
1080 for (UInt_t uTotPlot = 0; uTotPlot < fvhRawTot_gDPB.size(); ++uTotPlot)
1081 server->Register("/TofRaw", fvhRawTot_gDPB[uTotPlot]);
1082
1083 for (UInt_t uTotPlot = 0; uTotPlot < fvhRemapTot_gDPB.size(); ++uTotPlot)
1084 server->Register("/TofRaw", fvhRemapTot_gDPB[uTotPlot]);
1085 /*
1086 for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
1087 {
1088 server->Register("/TofRaw", fvhRemapTotSideA_mod[ uMod ] );
1089 server->Register("/TofRaw", fvhRemapTotSideB_mod[ uMod ] );
1090 server->Register("/TofMod", fvhModRate[ uMod ] );
1091 server->Register("/TofMod", fvhModErrorRate[ uMod ] );
1092 server->Register("/TofMod", fvhModErrorRatio[ uMod ] );
1093 } // for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
1094*/
1095 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1096 server->Register("/TofRaw", fvhGdpbGet4MessType[uGdpb]);
1097 server->Register("/TofRaw", fvhGdpbGet4ChanScm[uGdpb]);
1098 server->Register("/TofRaw", fvhGdpbGet4ChanErrors[uGdpb]);
1099
1100 server->Register("/TofRaw", fvhGdpbPatternMissmatchEvo[uGdpb]);
1101 server->Register("/TofRaw", fvhGdpbPatternEnableEvo[uGdpb]);
1102 server->Register("/TofRaw", fvhGdpbPatternResyncEvo[uGdpb]);
1103
1104 server->Register("/TofEna", fvhGdpbMissmatchEvoPerTs[uGdpb]);
1105 server->Register("/TofEna", fvhGdpbMissmatchEnaEvoPerTs[uGdpb]);
1106 server->Register("/TofEna", fvhGdpbEnableEvoPerTs[uGdpb]);
1107 server->Register("/TofEna", fvhGdpbResyncEvoPerTs[uGdpb]);
1108 server->Register("/TofEna", fvhGdpbResyncEnaEvoPerTs[uGdpb]);
1109 server->Register("/TofEna", fvhGdpbStateEvoPerTs[uGdpb]);
1110
1111 server->Register("/TofRaw", fvhRawFt_gDPB[uGdpb]);
1112 server->Register("/TofRaw", fvhChCount_gDPB[uGdpb]);
1113 server->Register("/TofRates", fvhChannelRate_gDPB[uGdpb]);
1114 server->Register("/TofRaw", fvhRemapChCount_gDPB[uGdpb]);
1115 server->Register("/TofRates", fvhRemapChRate_gDPB[uGdpb]);
1116
1117 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee) {
1118 server->Register("/TofRates", fvhFeeRate_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]);
1119 server->Register("/TofRates", fvhFeeErrorRate_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]);
1120 server->Register("/TofRates", fvhFeeErrorRatio_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]);
1121 server->Register("/TofRates", fvhFeeRateLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]);
1122 server->Register("/TofRates", fvhFeeErrorRateLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]);
1123 server->Register("/TofRates", fvhFeeErrorRatioLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]);
1124 } // for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++ uFee)
1125
1126 server->Register("/ChanFineRate", fhHitsPerMsFirstChan_gDPB[uGdpb]);
1127 server->Register("/ChanFineRate", fvhChannelRatePerMs_gDPB[uGdpb]);
1128
1129 server->Register("/StarRaw", fvhTokenMsgType[uGdpb]);
1130 server->Register("/StarRaw", fvhTriggerRate[uGdpb]);
1131 server->Register("/StarRaw", fvhCmdDaqVsTrig[uGdpb]);
1132 server->Register("/StarRaw", fvhStarTokenEvo[uGdpb]);
1133 server->Register("/StarRaw", fvhStarTrigGdpbTsEvo[uGdpb]);
1134 server->Register("/StarRaw", fvhStarTrigStarTsEvo[uGdpb]);
1135 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1136
1137 if (kTRUE == fbPulserModeEnable) {
1138 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
1139 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
1140 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) server->Register("/TofDt", fvhTimeDiffPulser[uFeeA][uFeeB]);
1141
1142 server->Register("/TofRaw", fhTimeMeanPulser);
1143 server->Register("/TofRaw", fhTimeRmsPulser);
1144 server->Register("/TofRaw", fhTimeRmsZoomFitPuls);
1145 server->Register("/TofRaw", fhTimeResFitPuls);
1146
1147 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1148 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx)
1149 if (NULL != fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx])
1150 server->Register("/TofDtEvo", fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx]);
1151
1152 for (UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB)
1153 if (NULL != fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB])
1154 server->Register("/TofDtEvo", fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB]);
1155 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1156 } // if( kTRUE == fbPulserModeEnable )
1157 if (kTRUE == fbCoincMapsEnable) {
1158 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1159 server->Register("/TofCoinc", fvhCoincMapAllChanGdpb[uGdpb]);
1160 server->Register("/TofCoinc", fvhCoincMeanAllChanGdpb[uGdpb]);
1161 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1162 } // if( kTRUE == fbCoincMapsEnable )
1163
1164 server->RegisterCommand("/Reset_All_eTOF", "bMcbmMoniTofResetHistos=kTRUE");
1165 server->RegisterCommand("/Save_All_eTof", "bMcbmMoniTofSaveHistos=kTRUE");
1166 server->RegisterCommand("/Update_PulsFit", "bMcbmMoniTofUpdateZoomedFit=kTRUE");
1167 server->RegisterCommand("/Print_Raw_Data", "bMcbmMoniTofRawDataPrint=kTRUE");
1168 server->RegisterCommand("/Print_AllHits", "bMcbmMoniTofPrintAllHitsEna=kTRUE");
1169 server->RegisterCommand("/Print_AllEps", "bMcbmMoniTofPrintAllEpochsEna=kTRUE");
1170
1171 server->Restrict("/Reset_All_eTof", "allow=admin");
1172 server->Restrict("/Save_All_eTof", "allow=admin");
1173 server->Restrict("/Update_PulsFit", "allow=admin");
1174 server->Restrict("/Print_Raw_Data", "allow=admin");
1175 server->Restrict("/Print_AllHits", "allow=admin");
1176 server->Restrict("/Print_AllEps", "allow=admin");
1177 } // if( server )
1178
1180 Double_t w = 10;
1181 Double_t h = 10;
1182 fcSummary = new TCanvas("cSummary", "gDPB Monitoring Summary");
1183 fcSummary->Divide(2, 3);
1184
1185 // 1st Column: Messages types
1186 fcSummary->cd(1);
1187 gPad->SetLogy();
1188 fhMessType->Draw();
1189
1190 fcSummary->cd(2);
1191 gPad->SetLogy();
1192 fhSysMessType->Draw();
1193
1194 fcSummary->cd(3);
1195 gPad->SetLogz();
1196 fhGet4MessType->Draw("colz");
1197
1198 // 2nd Column: GET4 Errors + Epoch flags + SCm
1199 fcSummary->cd(4);
1200 gPad->SetLogz();
1201 fhGet4ChanErrors->Draw("colz");
1202
1203 fcSummary->cd(5);
1204 gPad->SetLogz();
1205 fhGet4EpochFlags->Draw("colz");
1206
1207 fcSummary->cd(6);
1208 fhGet4ChanScm->Draw("colz");
1209
1210 server->Register("/canvases", fcSummary);
1211 /*****************************/
1212
1214 fcSummaryGdpb = new TCanvas("cSummaryGdpb", "gDPB Monitoring Summary");
1215 fcSummaryGdpb->Divide(2, 3);
1216
1217 fcSummaryGdpb->cd(1);
1218 gPad->SetLogz();
1219 fhGdpbMessType->Draw("colz");
1220
1221 fcSummaryGdpb->cd(3);
1222 gPad->SetLogz();
1223 fhGdpbSysMessType->Draw("colz");
1224
1225 fcSummaryGdpb->cd(5);
1226 gPad->SetLogz();
1227 fhGdpbEpochFlags->Draw("text colz");
1228
1229 fcSummaryGdpb->cd(4);
1230 fhGdpbEpochSyncEvo->Draw("colz");
1231
1232 fcSummaryGdpb->cd(6);
1233 gPad->SetLogz();
1234 fhGdpbEpochMissEvo->Draw("colz");
1235
1236 server->Register("/canvases", fcSummaryGdpb);
1237 /*****************************/
1238
1240 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1241 TCanvas* cSumGdpbGet4 =
1242 new TCanvas(Form("cSumGdpbGet4_g%02u", uGdpb), Form("Summary per GET4 or channel for gDPB %02u", uGdpb), w, h);
1243 cSumGdpbGet4->Divide(2, 2);
1244
1245 cSumGdpbGet4->cd(1);
1246 gPad->SetLogz();
1247 fvhGdpbGet4MessType[uGdpb]->Draw("colz");
1248
1249 cSumGdpbGet4->cd(2);
1250 gPad->SetLogz();
1251 fvhGdpbGet4ChanScm[uGdpb]->Draw("colz");
1252
1253 cSumGdpbGet4->cd(3);
1254 gPad->SetLogz();
1255 fvhGdpbGet4ChanErrors[uGdpb]->Draw("colz");
1256
1257 server->Register("/canvases", cSumGdpbGet4);
1258 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1259 /*****************************/
1260
1262 TCanvas* cFeeRates = new TCanvas("cFeeRates", "gDPB Monitoring FEE rates", w, h);
1263 // cFeeRates->Divide(fuNrOfFeePerGdpb, fuNrOfGdpbs );
1264 cFeeRates->Divide(kuNbFeePerGbtx, kuNbGbtxPerGdpb * fuNrOfGdpbs);
1265 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1266 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee) {
1267 cFeeRates->cd(1 + uGdpb * fuNrOfFeePerGdpb + uFee);
1268 gPad->SetLogy();
1269 fvhFeeRate_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Draw("hist");
1270
1271 fvhFeeErrorRate_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->SetLineColor(kRed);
1272 fvhFeeErrorRate_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Draw("same hist");
1273 } // for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee )
1274 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1275
1276 server->Register("/canvases", cFeeRates);
1277 /*****************************/
1278
1280 TCanvas* cFeeErrRatio = new TCanvas("cFeeErrRatio", "gDPB Monitoring FEE error ratios", w, h);
1281 // cFeeErrRatio->Divide(fuNrOfFeePerGdpb, fuNrOfGdpbs );
1282 cFeeErrRatio->Divide(kuNbFeePerGbtx, kuNbGbtxPerGdpb * fuNrOfGdpbs);
1283 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1284 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee) {
1285 cFeeErrRatio->cd(1 + uGdpb * fuNrOfFeePerGdpb + uFee);
1286 gPad->SetLogy();
1287 fvhFeeErrorRatio_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Draw("hist le0");
1288 } // for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee )
1289 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1290
1291 server->Register("/canvases", cFeeErrRatio);
1292 /*****************************/
1293
1294
1296 TCanvas* cFeeRatesLong = new TCanvas("cFeeRatesLong", "gDPB Monitoring FEE rates", w, h);
1297 // cFeeRatesLong->Divide(fuNrOfFeePerGdpb, fuNrOfGdpbs );
1298 cFeeRatesLong->Divide(kuNbFeePerGbtx, kuNbGbtxPerGdpb * fuNrOfGdpbs);
1299 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1300 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee) {
1301 cFeeRatesLong->cd(1 + uGdpb * fuNrOfFeePerGdpb + uFee);
1302 gPad->SetLogy();
1303 fvhFeeRateLong_gDPB[uGdpb]->Draw("hist");
1304
1305 fvhFeeErrorRateLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->SetLineColor(kRed);
1306 fvhFeeErrorRateLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Draw("same hist");
1307 } // for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee )
1308 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1309
1310 server->Register("/canvases", cFeeRatesLong);
1311 /*****************************/
1312
1314 TCanvas* cFeeErrRatioLong = new TCanvas("cFeeErrRatioLong", "gDPB Monitoring FEE error ratios", w, h);
1315 // cFeeErrRatioLong->Divide(fuNrOfFeePerGdpb, fuNrOfGdpbs );
1316 cFeeErrRatioLong->Divide(kuNbFeePerGbtx, kuNbGbtxPerGdpb * fuNrOfGdpbs);
1317 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1318 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee) {
1319 cFeeErrRatioLong->cd(1 + uGdpb * fuNrOfFeePerGdpb + uFee);
1320 gPad->SetLogy();
1321 fvhFeeErrorRatioLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Draw("hist le0");
1322 } // for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee )
1323 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1324
1325 server->Register("/canvases", cFeeErrRatioLong);
1326 /*****************************/
1327
1329 fcGdpbChannelCount = new TCanvas("cGdpbChannelCount", "Integrated Get4 channel counts per gDPB");
1330 fcGdpbChannelCount->Divide(1, fuNrOfGdpbs);
1331 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1332 fcGdpbChannelCount->cd(1 + uGdpb);
1333 gPad->SetGridx();
1334 gPad->SetGridy();
1335 gPad->SetLogy();
1336 fvhChCount_gDPB[uGdpb]->Draw();
1337 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1338
1339 server->Register("/canvases", fcGdpbChannelCount);
1340 /*****************************/
1341
1343 fcGdpbRemapChCount = new TCanvas("cGdpbRemapChCount", "Integrated PADI channel counts per gDPB");
1344 fcGdpbRemapChCount->Divide(1, fuNrOfGdpbs);
1345 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1346 fcGdpbRemapChCount->cd(1 + uGdpb);
1347 gPad->SetGridx();
1348 gPad->SetGridy();
1349 gPad->SetLogy();
1350 fvhRemapChCount_gDPB[uGdpb]->Draw();
1351 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1352
1353 server->Register("/canvases", fcGdpbRemapChCount);
1354 /*****************************/
1355
1357 fcGdpbChannelRate = new TCanvas("cGdpbChannelRate", "Get4 channel rate per gDPB");
1358 fcGdpbChannelRate->Divide(1, fuNrOfGdpbs);
1359 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1360 fcGdpbChannelRate->cd(1 + uGdpb);
1361 gPad->SetGridx();
1362 gPad->SetGridy();
1363 gPad->SetLogz();
1364 fvhChannelRate_gDPB[uGdpb]->Draw("colz");
1365 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1366
1367 server->Register("/canvases", fcGdpbChannelRate);
1368 /*****************************/
1369
1371 fcGdpbRemapChRate = new TCanvas("cGdpbRemapChRate", "PADI channel rate per gDPB");
1372 fcGdpbRemapChRate->Divide(1, fuNrOfGdpbs);
1373 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1374 fcGdpbRemapChRate->cd(1 + uGdpb);
1375 gPad->SetGridx();
1376 gPad->SetGridy();
1377 gPad->SetLogz();
1378 fvhRemapChRate_gDPB[uGdpb]->Draw("colz");
1379 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1380
1381 server->Register("/canvases", fcGdpbRemapChRate);
1382 /*****************************/
1383
1385 TCanvas* cTotPnt = NULL;
1386 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1387 cTotPnt = new TCanvas(Form("cTot_g%02u", uGdpb), Form("gDPB %02u TOT distributions", uGdpb), w, h);
1388
1389 cTotPnt->cd();
1390 gPad->SetGridx();
1391 gPad->SetGridy();
1392 gPad->SetLogz();
1393
1394 fvhRawTot_gDPB[uGdpb]->Draw("colz");
1395
1396 server->Register("/canvases", cTotPnt);
1397 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1398
1399 cTotPnt = new TCanvas("cTot_all", "TOT distributions", w, h);
1400 cTotPnt->Divide(fuNrOfGdpbs);
1401 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1402 cTotPnt->cd(1 + uGdpb);
1403 gPad->SetGridx();
1404 gPad->SetGridy();
1405 gPad->SetLogz();
1406
1407 fvhRawTot_gDPB[uGdpb]->Draw("colz");
1408 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1409
1410 server->Register("/canvases", cTotPnt);
1411 /**************************************************/
1412
1414 cTotPnt = NULL;
1415 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1416 cTotPnt = new TCanvas(Form("cTotRemap_g%02u", uGdpb), Form("PADI ch gDPB %02u TOT distributions", uGdpb), w, h);
1417
1418 cTotPnt->cd();
1419 gPad->SetGridx();
1420 gPad->SetGridy();
1421 gPad->SetLogz();
1422
1423 fvhRemapTot_gDPB[uGdpb]->Draw("colz");
1424
1425 server->Register("/canvases", cTotPnt);
1426 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1427 cTotPnt = new TCanvas("cTotRemap_all", "TOT distributions", w, h);
1428 cTotPnt->Divide(fuNrOfGdpbs);
1429 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
1430 cTotPnt->cd(1 + uGdpb);
1431 gPad->SetGridx();
1432 gPad->SetGridy();
1433 gPad->SetLogz();
1434
1435 fvhRemapTot_gDPB[uGdpb]->Draw("colz");
1436 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
1437
1438 server->Register("/canvases", cTotPnt);
1439 /**************************************************/
1440
1442 /*
1443 cTotPnt = NULL;
1444 for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
1445 {
1446 cTotPnt = new TCanvas( Form("cTotRemapSides_m%02u", uMod),
1447 Form("Sides ch module %02u TOT distributions", uMod),
1448 w, h);
1449 cTotPnt->Divide( 1, 2 );
1450
1451 cTotPnt->cd( 1 );
1452 gPad->SetGridx();
1453 gPad->SetGridy();
1454 gPad->SetLogz();
1455
1456 fvhRemapTotSideA_mod[ uMod ]->Draw( "colz" );
1457
1458 cTotPnt->cd( 2 );
1459 gPad->SetGridx();
1460 gPad->SetGridy();
1461 gPad->SetLogz();
1462 fvhRemapTotSideB_mod[ uMod ]->Draw( "colz" );
1463
1464 server->Register("/canvases", cTotPnt );
1465 } // for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
1466*/
1467 /**************************************************/
1468
1470 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; uGdpb++) {
1471 TCanvas* cStarToken =
1472 new TCanvas(Form("cStarToken_g%02u", uGdpb), Form("STAR token detection info for gDPB %02u", uGdpb), w, h);
1473 cStarToken->Divide(2, 2);
1474
1475 cStarToken->cd(1);
1476 fvhTriggerRate[uGdpb]->Draw();
1477
1478 cStarToken->cd(2);
1479 fvhCmdDaqVsTrig[uGdpb]->Draw("colz");
1480
1481 cStarToken->cd(3);
1482 fvhStarTokenEvo[uGdpb]->Draw();
1483
1484 cStarToken->cd(4);
1485 fvhStarTrigGdpbTsEvo[uGdpb]->Draw("hist le0");
1486 fvhStarTrigStarTsEvo[uGdpb]->SetLineColor(kRed);
1487 fvhStarTrigStarTsEvo[uGdpb]->Draw("same hist le0");
1488 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; uGdpb ++)
1489 /*****************************/
1490
1491 if (kTRUE == fbPulserModeEnable) {
1493 TCanvas* cPulser =
1494 new TCanvas("cPulser", "Time difference RMS for pulser channels when FEE pulser mode is ON", w, h);
1495 cPulser->Divide(2, 2);
1496
1497 cPulser->cd(1);
1498 gPad->SetGridx();
1499 gPad->SetGridy();
1500 fhTimeRmsPulser->Draw("colz");
1501
1502 cPulser->cd(2);
1503 gPad->SetGridx();
1504 gPad->SetGridy();
1505 fhTimeMeanPulser->Draw("colz");
1506
1507 cPulser->cd(3);
1508 gPad->SetGridx();
1509 gPad->SetGridy();
1510 fhTimeRmsZoomFitPuls->Draw("colz");
1511
1512 cPulser->cd(4);
1513 gPad->SetGridx();
1514 gPad->SetGridy();
1515 fhTimeResFitPuls->Draw("colz");
1516
1517 server->Register("/canvases", cPulser);
1518 /*****************************/
1519
1521 TCanvas* cPulserEvo =
1522 new TCanvas("cPulserEvo", "Time difference evolution between 1st FEE of 1st GBTx of gDPB pairs", w, h);
1523 cPulserEvo->Divide(1, fuNrOfGdpbs - 1);
1524 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs - 1; uGdpb++) {
1525 cPulserEvo->cd(1 + uGdpb);
1526 gPad->SetGridx();
1527 gPad->SetGridy();
1528 if (NULL != fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpb + 1])
1529 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpb + 1]->Draw();
1530
1531 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs - 1; uGdpb ++)
1532
1533 server->Register("/canvases", cPulserEvo);
1534 /*****************************/
1536 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; uGdpb++) {
1537 TCanvas* cPulserEvoGbtx = new TCanvas(Form("cPulserEvoGbtx%02u", uGdpb),
1538 Form("Time difference evolution between 1st FEE of GBTx "
1539 "pairs in gDPB %02u",
1540 uGdpb),
1541 w, h);
1542 cPulserEvoGbtx->Divide(1, kuNbGbtxPerGdpb - 1);
1543
1544 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx) {
1545 cPulserEvoGbtx->cd(1 + uGbtx);
1546 gPad->SetGridx();
1547 gPad->SetGridy();
1548
1549 if (NULL != fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx])
1550 fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx]->Draw();
1551 } // for( UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx )
1552
1553 server->Register("/canvases", cPulserEvoGbtx);
1554 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; uGdpb ++)
1555 /*****************************/
1556 } // if( kTRUE == fbPulserModeEnable )
1557
1559 /*
1560 for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
1561 {
1562 TCanvas* cModRates = new TCanvas( Form("cModRate_m%02u", uMod),
1563 Form( "Hit and error Rates for module %02u", uMod),
1564 w, h);
1565 cModRates->cd();
1566 gPad->SetLogy();
1567 fvhModRate[ uMod ]->Draw("hist");
1568
1569 fvhModErrorRate[ uMod ]->SetLineColor( kRed );
1570 fvhModErrorRate[ uMod ]->Draw("same hist");
1571
1572 server->Register("/canvases", cModRates );
1573 } // for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
1574*/
1575 /*****************************/
1576
1578 // Try to recover canvas in case it was created already by another monitor
1579 // If not existing, create it
1580 fcMsSizeAll = dynamic_cast<TCanvas*>(gROOT->FindObject("cMsSizeAll"));
1581 if (NULL == fcMsSizeAll) {
1582 fcMsSizeAll = new TCanvas("cMsSizeAll", "Evolution of MS size in last 300 s", w, h);
1583 fcMsSizeAll->Divide(4, 3);
1584 LOG(info) << "Created MS size canvas in TOF monitor";
1585 } // if( NULL == fcMsSizeAll )
1586 else
1587 LOG(info) << "Recovered MS size canvas in TOF monitor";
1588
1589 server->Register("/canvases", fcMsSizeAll);
1590
1591 LOG(info) << "Leaving CreateHistograms";
1592}
1593
1594Bool_t CbmMcbm2018MonitorTof::DoUnpack(const fles::Timeslice& ts, size_t component)
1595{
1597 LOG(info) << "Reset eTOF STAR histos ";
1599 bMcbmMoniTofResetHistos = kFALSE;
1600 } // if( bMcbmMoniTofResetHistos )
1602 LOG(info) << "Start saving eTOF STAR histos ";
1603 SaveAllHistos("data/histos_Shift_StarTof.root");
1604 bMcbmMoniTofSaveHistos = kFALSE;
1605 } // if( bSaveStsHistos )
1609 } // if (bMcbmMoniTofUpdateZoomedFit)
1612 bMcbmMoniTofRawDataPrint = kFALSE;
1613 } // if( bMcbmMoniTofRawDataPrint )
1617 } // if( bMcbmMoniTofPrintAllHitsEna )
1621 } // if( bMcbmMoniTofPrintAllEpochsEna )
1622
1624 /*
1625 std::chrono::time_point<std::chrono::system_clock> timeCurrent = std::chrono::system_clock::now();
1626 std::chrono::duration<double> elapsed_seconds = timeCurrent - fTimeLastHistoSaving;
1627 if( 0 == fTimeLastHistoSaving.time_since_epoch().count() )
1628 {
1629 fTimeLastHistoSaving = timeCurrent;
1630// fulNbBuiltSubEventLastPrintout = fulNbBuiltSubEvent;
1631// fulNbStarSubEventLastPrintout = fulNbStarSubEvent;
1632 } // if( 0 == fTimeLastHistoSaving.time_since_epoch().count() )
1633 else if( 300 < elapsed_seconds.count() )
1634 {
1635 std::time_t cTimeCurrent = std::chrono::system_clock::to_time_t( timeCurrent );
1636 char tempBuff[80];
1637 std::strftime( tempBuff, 80, "%F %T", localtime (&cTimeCurrent) );
1638 fTimeLastHistoSaving = timeCurrent;
1639 SaveAllHistos( "data/histos_shift.root" );
1640 } // else if( 300 < elapsed_seconds.count() )
1641*/
1642 LOG(debug1) << "Timeslice contains " << ts.num_microslices(component) << "microslices.";
1643
1645 if (0 == ts.index()) return kTRUE;
1646
1648 UInt_t uNbMsLoop = fuNbCoreMsPerTs;
1649 if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
1650
1651 Int_t messageType = -111;
1652 Double_t dTsStartTime = -1;
1653
1655 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
1656 if (fuMsAcceptsPercent < uMsIdx) continue;
1657
1658 fuCurrentMs = uMsIdx;
1659
1660 if (0 == fulCurrentTsIndex && 0 == uMsIdx) {
1661 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
1662 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
1663 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1664 /*
1665 LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
1666 LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
1667 static_cast<unsigned int>(msDescriptor.hdr_id),
1668 static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
1669 static_cast<unsigned int>(msDescriptor.sys_id),
1670 static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
1671 msDescriptor.size, msDescriptor.offset );
1672*/
1673 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
1674 } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
1675 } // if( 0 == fulCurrentTsIndex && 0 == uMsIdx )
1676
1678 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
1679 constexpr uint32_t kuBytesPerMessage = 8;
1680
1681 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
1682 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
1683 fiEquipmentId = msDescriptor.eq_id;
1684 fdMsIndex = static_cast<double>(msDescriptor.idx);
1685 fuCurrentMsSysId = static_cast<unsigned int>(msDescriptor.sys_id);
1686 const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
1687
1688 uint32_t size = msDescriptor.size;
1689 // fulLastMsIdx = msDescriptor.idx;
1690 if (size > 0) LOG(debug) << "Microslice: " << msDescriptor.idx << " has size: " << size;
1691 /*
1692 if( numCompMsInTs - fuOverlapMsNb <= m )
1693 {
1694// LOG(info) << "Ignore overlap Microslice: " << msDescriptor.idx;
1695 continue;
1696 } // if( numCompMsInTs - fuOverlapMsNb <= m )
1697*/
1698 if (0 == uMsIdx && 0 == uMsCompIdx) dTsStartTime = (1e-9) * fdMsIndex;
1699
1700 if (fdStartTimeMsSz < 0) fdStartTimeMsSz = (1e-9) * fdMsIndex;
1701 fvhMsSzPerLink[uMsComp]->Fill(size);
1702 if (2 * fuHistoryHistoSize < (1e-9) * fdMsIndex - fdStartTimeMsSz) {
1703 // Reset the evolution Histogram and the start time when we reach the end of the range
1704 fvhMsSzTimePerLink[uMsComp]->Reset();
1705 fdStartTimeMsSz = (1e-9) * fdMsIndex;
1706 } // if( 2 * fuHistoryHistoSize < (1e-9) * fdMsIndex - fdStartTimeMsSz )
1707 fvhMsSzTimePerLink[uMsComp]->Fill((1e-9) * fdMsIndex - fdStartTimeMsSz, size);
1708
1709 // If not integer number of message in input buffer, print warning/error
1710 if (0 != (size % kuBytesPerMessage))
1711 LOG(error) << "The input microslice buffer does NOT "
1712 << "contain only complete nDPB messages!";
1713
1714 // Compute the number of complete messages in the input microslice buffer
1715 uint32_t uNbMessages = (size - (size % kuBytesPerMessage)) / kuBytesPerMessage;
1716
1717 // Get the gDPB ID from the MS header
1719
1721 auto it = fGdpbIdIndexMap.find(fuGdpbId);
1722 if (it == fGdpbIdIndexMap.end()) {
1723 LOG(info) << "---------------------------------------------------------------";
1724 /*
1725 LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
1726 LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
1727 static_cast<unsigned int>(msDescriptor.hdr_id),
1728 static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
1729 static_cast<unsigned int>(msDescriptor.sys_id),
1730 static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
1731 msDescriptor.size, msDescriptor.offset );
1732*/
1733 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
1734 LOG(error) << "Could not find the gDPB index for AFCK id 0x" << std::hex << fuGdpbId << std::dec
1735 << " in timeslice " << fulCurrentTsIndex << " in microslice " << fdMsIndex << " component "
1736 << uMsCompIdx << "\n"
1737 << "If valid this index has to be added in the TOF "
1738 "parameter file in the RocIdArray field";
1739 continue;
1740 } // if( it == fGdpbIdIndexMap.end() )
1741 else
1743
1744 // Prepare variables for the loop on contents
1745 const uint64_t* pInBuff = reinterpret_cast<const uint64_t*>(msContent);
1746 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
1747 // Fill message
1748 uint64_t ulData = static_cast<uint64_t>(pInBuff[uIdx]);
1749
1751 if (0 == uIdx && kFALSE == fbOldFwData) {
1752 ProcessEpochCycle(ulData);
1753 continue;
1754 } // if( 0 == uIdx && kFALSE == fbOldFwData )
1755
1756 gdpbv100::Message mess(ulData);
1757
1758 if (fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging(fair::Severity::debug2)) {
1759 mess.printDataCout();
1761 } // if( fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging( fair::Severity::debug2 ) )
1762
1763 // Increment counter for different message types
1764 // and fill the corresponding histogram
1765 messageType = mess.getMessageType();
1766 fviMsgCounter[messageType]++;
1767 fhMessType->Fill(messageType);
1768 fhGdpbMessType->Fill(messageType, fuGdpbNr);
1769
1775
1777 LOG(warning) << "Message with Get4 ID too high: " << fuGet4Id << " VS " << fuNrOfGet4PerGdpb
1778 << " set in parameters.";
1779
1780 switch (messageType) {
1781 case gdpbv100::MSG_HIT: {
1782 if (mess.getGdpbHitIs24b()) {
1783 fhGet4MessType->Fill(fuGet4Nr, 4);
1785 PrintGenInfo(mess);
1786 } // if( getGdpbHitIs24b() )
1787 else {
1788 fhGet4MessType->Fill(fuGet4Nr, 0);
1790 fvmEpSupprBuffer[fuGet4Nr].push_back(mess);
1791 } // else of if( getGdpbHitIs24b() )
1792 break;
1793 } // case gdpbv100::MSG_HIT:
1794 case gdpbv100::MSG_EPOCH: {
1796 if (1 == mess.getGdpbEpSync()) {
1797 fhGdpbEpochFlags->Fill(fuGdpbNr, 0);
1799 } // if (1 == mess.getGdpbEpSync())
1800
1801 if (1 == mess.getGdpbEpDataLoss()) fhGdpbEpochFlags->Fill(fuGdpbNr, 1);
1802
1803 if (1 == mess.getGdpbEpEpochLoss()) fhGdpbEpochFlags->Fill(fuGdpbNr, 2);
1804
1805 if (1 == mess.getGdpbEpMissmatch()) {
1806 fhGdpbEpochFlags->Fill(fuGdpbNr, 3);
1808 } // if (1 == mess.getGdpbEpMissmatch())
1809
1810 for (uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGet4Index++) {
1811 fuGet4Id = uGet4Index;
1813 gdpbv100::Message tmpMess(mess);
1814 tmpMess.setGdpbGenChipId(uGet4Index);
1815
1816 fhGet4MessType->Fill(fuGet4Nr, 1);
1818 FillEpochInfo(tmpMess);
1819 } // for( uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGetIndex ++ )
1820
1821 if (kTRUE == fbPrintAllEpochsEnable) {
1822 LOG(info) << "Epoch: " << Form("0x%08x ", fuGdpbId) << ", Merg"
1823 << ", Link " << std::setw(1) << mess.getGdpbEpLinkId() << ", epoch " << std::setw(8)
1824 << mess.getGdpbEpEpochNb() << ", Sync " << std::setw(1) << mess.getGdpbEpSync()
1825 << ", Data loss " << std::setw(1) << mess.getGdpbEpDataLoss() << ", Epoch loss "
1826 << std::setw(1) << mess.getGdpbEpEpochLoss() << ", Epoch miss " << std::setw(1)
1827 << mess.getGdpbEpMissmatch();
1828 } // if( kTRUE == fbPrintAllEpochsEnable )
1829 } // if this epoch message is a merged one valid for all chips
1830 else {
1831 fhGet4MessType->Fill(fuGet4Nr, 1);
1833 FillEpochInfo(mess);
1834
1835 if (kTRUE == fbPrintAllEpochsEnable) {
1836 LOG(info) << "Epoch: " << Form("0x%08x ", fuGdpbId) << ", " << std::setw(4) << fuGet4Nr << ", Link "
1837 << std::setw(1) << mess.getGdpbEpLinkId() << ", epoch " << std::setw(8)
1838 << mess.getGdpbEpEpochNb() << ", Sync " << std::setw(1) << mess.getGdpbEpSync()
1839 << ", Data loss " << std::setw(1) << mess.getGdpbEpDataLoss() << ", Epoch loss "
1840 << std::setw(1) << mess.getGdpbEpEpochLoss() << ", Epoch miss " << std::setw(1)
1841 << mess.getGdpbEpMissmatch();
1842 } // if( kTRUE == fbPrintAllEpochsEnable )
1843 } // if single chip epoch message
1844 break;
1845 } // case gdpbv100::MSG_EPOCH:
1846 case gdpbv100::MSG_SLOWC: {
1847 fhGet4MessType->Fill(fuGet4Nr, 2);
1849 PrintSlcInfo(mess);
1850 break;
1851 } // case gdpbv100::MSG_SLOWC:
1852 case gdpbv100::MSG_SYST: {
1853 fhSysMessType->Fill(mess.getGdpbSysSubType());
1856 fhGet4MessType->Fill(fuGet4Nr, 3);
1858
1859 UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
1860 if (0 <= fdStartTime) {
1864 1e-9 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTime), 1, 1);
1865
1866 // UInt_t uGbtxNr = (uFeeNr / kuNbFeePerGbtx);
1867 // UInt_t uGbtxNrInSys = fuGdpbNr * kuNbGbtxPerGdpb + uGbtxNr;
1868 /*
1869 fvhModErrorRate[ fviModuleId[ uGbtxNrInSys ] ]->Fill(
1870 1e-9 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTime));
1871 fvhModErrorRatio[ fviModuleId[ uGbtxNrInSys ] ]->Fill(
1872 1e-9 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTime), 1, 1);
1873*/
1874 } // if (0 <= fdStartTime)
1875 if (0 <= fdStartTimeLong) {
1877 1e-9 / 60.0 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTimeLong), 1 / 60.0);
1879 1e-9 / 60.0 * (mess.getMsgFullTimeD(fvulCurrentEpoch[fuGet4Nr]) - fdStartTimeLong), 1, 1 / 60.0);
1880 } // if (0 <= fdStartTime)
1881
1884 switch (mess.getGdpbSysErrData()) {
1886 fhGet4ChanErrors->Fill(dFullChId, 0);
1887 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 0);
1888 break;
1890 fhGet4ChanErrors->Fill(dFullChId, 1);
1891 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 1);
1892 break;
1894 fhGet4ChanErrors->Fill(dFullChId, 2);
1895 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 2);
1896 break;
1898 fhGet4ChanErrors->Fill(dFullChId, 3);
1899 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 3);
1900 break;
1902 fhGet4ChanErrors->Fill(dFullChId, 4);
1903 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 4);
1904 break;
1906 fhGet4ChanErrors->Fill(dFullChId, 5);
1907 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 5);
1908 break;
1910 fhGet4ChanErrors->Fill(dFullChId, 6);
1911 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 6);
1912 break;
1914 fhGet4ChanErrors->Fill(dFullChId, 7);
1915 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 7);
1916 break;
1918 fhGet4ChanErrors->Fill(dFullChId, 8);
1919 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 8);
1920 break;
1922 fhGet4ChanErrors->Fill(dFullChId, 9);
1923 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 9);
1924 break;
1926 fhGet4ChanErrors->Fill(dFullChId, 10);
1927 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 10);
1928 break;
1930 fhGet4ChanErrors->Fill(dFullChId, 11);
1931 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 11);
1932 break;
1934 fhGet4ChanErrors->Fill(dFullChId, 12);
1935 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 12);
1936 break;
1938 fhGet4ChanErrors->Fill(dFullChId, 13);
1939 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 13);
1940 break;
1942 fhGet4ChanErrors->Fill(dFullChId, 14);
1943 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 14);
1944 break;
1946 fhGet4ChanErrors->Fill(dFullChId, 15);
1947 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 15);
1948 break;
1950 fhGet4ChanErrors->Fill(dFullChId, 16);
1951 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 16);
1952 break;
1954 fhGet4ChanErrors->Fill(dFullChId, 17);
1955 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 17);
1956 break;
1958 fhGet4ChanErrors->Fill(dFullChId, 18);
1959 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 18);
1960 break;
1962 fhGet4ChanErrors->Fill(dFullChId, 19);
1963 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 19);
1964 break;
1966 fhGet4ChanErrors->Fill(dFullChId, 20);
1967 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 20);
1968 break;
1969 default: // Corrupt error or not yet supported error
1970 fhGet4ChanErrors->Fill(dFullChId, 21);
1971 fvhGdpbGet4ChanErrors[fuGdpbNr]->Fill(dGdpbChId, 21);
1972 break;
1973 } // Switch( mess.getGdpbSysErrData() )
1974 } // if( gdpbv100::SYSMSG_GET4_EVENT == mess.getGdpbSysSubType() )
1977 FillPattInfo(mess);
1978 } // if( gdpbv100::SYS_PATTERN == mess.getGdpbSysSubType() )
1979 PrintSysInfo(mess);
1980 break;
1981 } // case gdpbv100::MSG_SYST:
1986 // fhGet4MessType->Fill(fuGet4Nr, 5);
1987 FillStarTrigInfo(mess);
1988 break;
1989 default:
1990 LOG(error) << "Message type " << std::hex << std::setw(2) << static_cast<uint16_t>(messageType)
1991 << " not included in Get4 unpacker.";
1992 } // switch( mess.getMessageType() )
1993 } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
1994 } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
1995
1997 if (kTRUE == fbPulserModeEnable) {
1999 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFeeA) {
2000 if (1 != fvuFeeNbHitsLastMs[uFeeA]) {
2002 fvuFeeNbHitsLastMs[uFeeA] = 0;
2003 continue;
2004 } // if( 1 != fvuFeeNbHitsLastMs[ uFeeA ] )
2005
2006 UInt_t uGdpbNr = uFeeA / fuNrOfFeePerGdpb;
2007 UInt_t uGbtxNr = uFeeA / kuNbFeePerGbtx;
2009 for (UInt_t uFeeB = uFeeA + 1; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFeeB) {
2010 if (1 != fvuFeeNbHitsLastMs[uFeeB]) continue;
2011
2012 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) {
2013 Double_t dTimeDiff = 1e3 * (fdTsLastPulserHit[uFeeB] - fdTsLastPulserHit[uFeeA]);
2014 if (TMath::Abs(dTimeDiff) < kdMaxDtPulserPs) {
2015 fvhTimeDiffPulser[uFeeA][uFeeB]->Fill(dTimeDiff);
2016
2018 if (0 == uFeeA % kuNbFeePerGbtx && 0 == uFeeB % kuNbFeePerGbtx) {
2020 if (uGdpbNr == uFeeB / fuNrOfFeePerGdpb) {
2021 if (0 == uGbtxNr) {
2022 UInt_t uPlotIdx =
2023 uGdpbNr * (kuNbGbtxPerGdpb - 1) + (uFeeB - uGdpbNr * fuNrOfFeePerGdpb) / kuNbFeePerGbtx - 1;
2024 fvhPulserTimeDiffEvoGbtxGbtx[uPlotIdx]->Fill(1e-9 / 60.0 * (fdTsLastPulserHit[uFeeA] - fdStartTime),
2025 dTimeDiff);
2026 } // if( 0 == uGbtxNr )
2027 } // if( uGdpbNr == uFeeB / fuNrOfFeePerGdpb )
2028 else // if( NULL != fvvhPulserTimeDiffEvoGdpbGdpb[ uFeeB / fuNrOfFeePerGdpb ][ uGdpbNr ] )
2029 {
2031 if (0 == uGbtxNr && 0 == uFeeB / kuNbFeePerGbtx)
2032 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpbNr][uFeeB / fuNrOfFeePerGdpb]->Fill(
2033 1e-9 / 60.0 * (fdTsLastPulserHit[uFeeA] - fdStartTime), dTimeDiff);
2034 } // else of if( uGdpbNr == uFeeB / fuNrOfFeePerGdpb )
2035 } // if( 0 == uFeeA % kuNbFeePerGbtx && 0 == uFeeB % kuNbFeePerGbtx )
2036 } // if( TMath::Abs( dTimeDiff ) < kdMaxDtPulserPs )
2037 // else if( 10 == uFeeA && 20 == uFeeB )
2038 // LOG(info) << "new in 10 " << dTimeDiff;
2039 } // if( NULL != fvhTimeDiffPulser[uFeeA][uFeeB] )
2040 } // for( UInt_t uFeeB = uFeeA + 1; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFeeB)
2041
2043 fvuFeeNbHitsLastMs[uFeeA] = 0;
2044 } // for( UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; ++uFeeA)
2045 } // if( kTRUE == fbPulserModeEnable )
2046
2047 if (kTRUE == fbCoincMapsEnable) {
2048 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
2049 for (UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerGdpb; ++uChanA) {
2050 if (0 == fvuCoincNbHitsLastMs[uGdpb][uChanA]) {
2052 continue;
2053 } // if( 0 == fvuCoincNbHitsLastMs[ uGdpb ][ uChanA ] )
2054
2055 for (UInt_t uChanB = uChanA + 1; uChanB < fuNrOfChannelsPerGdpb; ++uChanB) {
2056 if (0 == fvuCoincNbHitsLastMs[uGdpb][uChanB]) {
2058 continue;
2059 } // if( 0 == fvuCoincNbHitsLastMs[ uGdpb ][ uChanB ] )
2060
2061 Double_t dTimeDiff = 1e3 * (fvdCoincTsLastHit[uGdpb][uChanB] - fvdCoincTsLastHit[uGdpb][uChanA]);
2062
2063 fvhCoincMeanAllChanGdpb[uGdpb]->Fill(uChanA, uChanB, dTimeDiff);
2064
2065 if (TMath::Abs(dTimeDiff) < kdMaxDtPulserPs) {
2066 fvhCoincMapAllChanGdpb[uGdpb]->Fill(uChanA, uChanB);
2067 } // if( TMath::Abs( dTimeDiff ) < kdMaxDtPulserPs )
2068 } // for( UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerGdpb; ++uChan A )
2069
2071 fvuCoincNbHitsLastMs[uGdpb][uChanA] = 0;
2072 } // for( UInt_t uChanA = 0; uChanA < fuNrOfChannelsPerGdpb; ++uChan A )
2073 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
2074 } // if( kTRUE == fbCoincMapsEnable )
2075
2076 // UInt_t uTsIndexHeader = ts.index();
2077 UInt_t uTsIndexHeader = fulCurrentTsIndex;
2078 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
2079 fhHitsPerMsFirstChan_gDPB[uGdpb]->Fill(uTsIndexHeader, fvvuChanNbHitsPerMs[uGdpb][0]);
2080 for (UInt_t uChan = 0; uChan < fuNrOfChannelsPerGdpb; ++uChan) {
2081 fvhChannelRatePerMs_gDPB[uGdpb]->Fill(uTsIndexHeader, uChan, 1.0 * fvvuChanNbHitsPerMs[uGdpb][uChan]);
2082 fvvuChanNbHitsPerMs[uGdpb][uChan] = 0;
2083 } // for( UInt_t uChan = 0; uChan < fuNrOfChannelsPerGdpb; ++uChan )
2084 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
2085 } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
2086
2088 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb)
2089 for (UInt_t uAsic = 0; uAsic < fuNrOfGet4PerGdpb; ++uAsic) {
2090 if (fvvbGdpbLastMissmatchPattern[uGdpb][uAsic]) {
2091 fvhGdpbMissmatchEvoPerTs[uGdpb]->Fill(fulCurrentTsIndex, uAsic);
2092 } // if( fvvbGdpbLastMissmatchPattern[ uGdpb ][ uAsic ] )
2093
2094 if (fvvbGdpbLastEnablePattern[uGdpb][uAsic]) {
2095 fvhGdpbEnableEvoPerTs[uGdpb]->Fill(fulCurrentTsIndex, uAsic);
2096
2097 if (fvvbGdpbLastMissmatchPattern[uGdpb][uAsic]) {
2099 } // if( fvvbGdpbLastMissmatchPattern[ uGdpb ][ uAsic ] )
2100
2101 if (fvvbGdpbLastResyncPattern[uGdpb][uAsic]) {
2102 fvhGdpbResyncEnaEvoPerTs[uGdpb]->Fill(fulCurrentTsIndex, uAsic);
2103 } // if( fvvbGdpbLastResyncPattern[ uGdpb ][ uAsic ] )
2104
2106 if (fvvbGdpbLastMissmatchPattern[uGdpb][uAsic]) {
2107 if (fvvbGdpbLastResyncPattern[uGdpb][uAsic]) {
2108 fvhGdpbStateEvoPerTs[uGdpb]->Fill(fulCurrentTsIndex, uAsic, 4);
2109 } // if( fvvbGdpbLastResyncPattern[ uGdpb ][ uAsic ] )
2110 else
2111 fvhGdpbStateEvoPerTs[uGdpb]->Fill(fulCurrentTsIndex, uAsic, 2);
2112 } // if( fvvbGdpbLastMissmatchPattern[ uGdpb ][ uAsic ] )
2113 else if (fvvbGdpbLastResyncPattern[uGdpb][uAsic]) {
2114 fvhGdpbStateEvoPerTs[uGdpb]->Fill(fulCurrentTsIndex, uAsic, 3);
2115 } // else if( fvvbGdpbLastResyncPattern[ uGdpb ][ uAsic ] )
2116 else
2117 fvhGdpbStateEvoPerTs[uGdpb]->Fill(fulCurrentTsIndex, uAsic, 1);
2118 } // if( fvvbGdpbLastEnablePattern[ uGdpb ][ uAsic ] )
2119 else
2120 fvhGdpbStateEvoPerTs[uGdpb]->Fill(fulCurrentTsIndex, uAsic, 0);
2121
2122 if (fvvbGdpbLastResyncPattern[uGdpb][uAsic]) {
2123 fvhGdpbResyncEvoPerTs[uGdpb]->Fill(fulCurrentTsIndex, uAsic);
2124 } // if( fvvbGdpbLastResyncPattern[ uGdpb ][ uAsic ] )
2125 } // Loop on gDPB and ASICs
2126
2127 // Update RMS plots only every 10s in data
2128 if (kTRUE == fbPulserModeEnable) {
2129 if (10.0 < dTsStartTime - fdLastRmsUpdateTime) {
2130 // Reset summary histograms for safety
2131 fhTimeMeanPulser->Reset();
2132 fhTimeRmsPulser->Reset();
2133
2134 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
2135 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
2136 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) {
2137 fhTimeMeanPulser->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetMean());
2138 fhTimeRmsPulser->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetRMS());
2139 } // for( UInt_t uChan = 0; uChan < kuNbChanTest - 1; uChan++)
2141 } // if( 10.0 < dTsStartTime - fdLastRmsUpdateTime )
2142 } // if( kTRUE == fbPulserModeEnable )
2143
2145
2146 return kTRUE;
2147}
2148
2150{
2151 uint64_t ulEpochCycleVal = ulCycleData & gdpbv100::kulEpochCycleFieldSz;
2152
2153 if (fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging(fair::Severity::debug2)) {
2154 LOG(info) << "CbmMcbm2018MonitorTof::ProcessEpochCyle => "
2155 // << Form( " TS %5llu MS %3lu In data 0x%016llX Cycle 0x%016llX",
2156 // fulCurrentTsIndex, fuCurrentMs, ulCycleData, ulEpochCycleVal );
2157 << " TS " << FormatDecPrintout(fulCurrentTsIndex, 5) << " MS " << FormatDecPrintout(fuCurrentMs, 3)
2158 << " In data 0x" << FormatHexPrintout(ulCycleData, 16, '0', true) << " Cycle 0x"
2159 << FormatHexPrintout(ulEpochCycleVal, 16, '0', true);
2161 } // if( fuRawDataPrintMsgIdx < fuRawDataPrintMsgNb || fair::Logger::Logging( fair::Severity::debug2 ) )
2162
2163 for (uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGet4Index++) {
2164 fuGet4Id = uGet4Index;
2166 /*
2167 if( !( ulEpochCycleVal == fvulCurrentEpochCycle[fuGet4Nr] ||
2168 ulEpochCycleVal == fvulCurrentEpochCycle[fuGet4Nr] + 1 ) )
2169 LOG(error) << "CbmMcbm2018MonitorTof::ProcessEpochCyle => "
2170 << " Missmatch in epoch cycles detected, probably fake cycles due to epoch index corruption! "
2171 << Form( " Current cycle 0x%09X New cycle 0x%09X", fvulCurrentEpochCycle[fuGet4Nr], ulEpochCycleVal );
2172*/
2173 fvulCurrentEpochCycle[fuGet4Nr] = ulEpochCycleVal;
2174 } // for( uint32_t uGet4Index = 0; uGet4Index < fuNrOfGet4PerGdpb; uGet4Index ++ )
2175 return;
2176}
2177
2179{
2180 UInt_t uChannel = mess.getGdpbHitChanId();
2181 UInt_t uTot = mess.getGdpbHit32Tot();
2182 UInt_t uFts = mess.getGdpbHitFineTs();
2183
2184 ULong64_t ulCurEpochGdpbGet4 = fvulCurrentEpoch[fuGet4Nr];
2185
2186 // In Ep. Suppr. Mode, receive following epoch instead of previous
2187 if (0 < ulCurEpochGdpbGet4) ulCurEpochGdpbGet4--;
2188 else
2189 ulCurEpochGdpbGet4 = gdpbv100::kuEpochCounterSz; // Catch epoch cycle!
2190
2191 UInt_t uChannelNr = fuGet4Id * fuNrOfChannelsPerGet4 + uChannel;
2192 UInt_t uChannelNrInFee = (fuGet4Id % fuNrOfGet4PerFee) * fuNrOfChannelsPerGet4 + uChannel;
2193 UInt_t uFeeNr = (fuGet4Id / fuNrOfGet4PerFee);
2194 UInt_t uFeeNrInSys = fuGdpbNr * fuNrOfFeePerGdpb + uFeeNr;
2195 UInt_t uRemappedChannelNr = uFeeNr * fuNrOfChannelsPerFee + fvuGet4ToPadi[uChannelNrInFee];
2197 if (fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId) uRemappedChannelNr = uChannelNr;
2198 // UInt_t uGbtxNr = (uFeeNr / kuNbFeePerGbtx);
2199 // UInt_t uFeeInGbtx = (uFeeNr % kuNbFeePerGbtx);
2200 // UInt_t uGbtxNrInSys = fuGdpbNr * kuNbGbtxPerGdpb + uGbtxNr;
2201
2202 ULong_t ulHitTime = mess.getMsgFullTime(ulCurEpochGdpbGet4);
2203 Double_t dHitTime = mess.getMsgFullTimeD(ulCurEpochGdpbGet4);
2204
2205 // In 32b mode the coarse counter is already computed back to 112 FTS bins
2206 // => need to hide its contribution from the Finetime
2207 // => FTS = Fullt TS modulo 112
2208 uFts = mess.getGdpbHitFullTs() % 112;
2209
2210 fvvuChanNbHitsPerMs[fuGdpbNr][uChannelNr]++;
2211 fvhChCount_gDPB[fuGdpbNr]->Fill(uChannelNr);
2212 fvhRawFt_gDPB[fuGdpbNr]->Fill(uChannelNr, uFts);
2213 fvhRawTot_gDPB[fuGdpbNr]->Fill(uChannelNr, uTot);
2214
2216 fvhRemapChCount_gDPB[fuGdpbNr]->Fill(uRemappedChannelNr);
2217 fvhRemapTot_gDPB[fuGdpbNr]->Fill(uRemappedChannelNr, uTot);
2218 /*
2219 if( uGbtxNrInSys < fuNrOfGbtx )
2220 {
2221 UInt_t uOffset = uGbtxNrInSys * kuNbFeeSide * fuNrOfChannelsPerFee;
2222 if( fviRpcSide[ uGbtxNrInSys ] )
2223 fvhRemapTotSideB_mod[ fviModuleId[ uGbtxNrInSys ] ]->Fill( uRemappedChannelNr - uOffset, uTot);
2224 else fvhRemapTotSideA_mod[ fviModuleId[ uGbtxNrInSys ] ]->Fill( uRemappedChannelNr - uOffset, uTot);
2225 } // if( uGbtxNrInSys < fuNrOfGbtx )
2226*/
2227 /*
2228 switch( ( uRemappedChannelNr / fuNrOfChannelsPerFee ) / kuNbFeeSide )
2229 {
2230 case 0: // Module 1 Side A
2231 fvhRemapTotSideA_mod[ fuGdpbNr ]->Fill( uRemappedChannelNr , uTot);
2232 case 1: // Module 1 Side B
2233 fvhRemapTotSideB_mod[ fuGdpbNr ]->Fill( uRemappedChannelNr - 160 , uTot);
2234 case 2: // Module 2 Side A
2235 fvhRemapTotSideA_mod[ fuGdpbNr ]->Fill( uRemappedChannelNr - 160 , uTot);
2236 case 3: // Module 2 Side B
2237 fvhRemapTotSideB_mod[ fuGdpbNr ]->Fill( uRemappedChannelNr - 320, uTot);
2238 } // switch( ( uRemappedChannelNr / fuNrOfChannelsPerFee ) % kuNbFeeSide )
2239*/
2240 // In Run rate evolution
2241 if (fdStartTime < 0) fdStartTime = dHitTime;
2242
2243 // Reset the evolution Histogram and the start time when we reach the end of the range
2244 if (fuHistoryHistoSize < 1e-9 * (dHitTime - fdStartTime)) {
2246 fdStartTime = dHitTime;
2247 } // if( fuHistoryHistoSize < 1e-9 * (dHitTime - fdStartTime) )
2248
2249 // In Run rate evolution
2250 if (fdStartTimeLong < 0) fdStartTimeLong = dHitTime;
2251
2252 // Reset the evolution Histogram and the start time when we reach the end of the range
2253 if (fuHistoryHistoSizeLong < 1e-9 * (dHitTime - fdStartTimeLong) / 60.0) {
2255 fdStartTimeLong = dHitTime;
2256 } // if( fuHistoryHistoSize < 1e-9 * (dHitTime - fdStartTime) / 60.0 )
2257
2259 if (kTRUE == fbPulserModeEnable) {
2262 if (gdpbv100::kuFeePulserChannel == uChannelNrInFee && fuGdpbNr != fuDiamondDpbIdx) {
2263 fdTsLastPulserHit[uFeeNrInSys] = dHitTime;
2264 fvuFeeNbHitsLastMs[uFeeNrInSys]++;
2265 /*
2267 for( UInt_t uFeeB = 0; uFeeB < uFeeNrInSys; uFeeB++)
2268 if( NULL != fvhTimeDiffPulser[uFeeB][uFeeNrInSys] )
2269 {
2270 Double_t dTimeDiff = 1e3 * ( fdTsLastPulserHit[ uFeeNrInSys ] - fdTsLastPulserHit[ uFeeB ] );
2271 if( TMath::Abs( dTimeDiff ) < kdMaxDtPulserPs )
2272 {
2273 fvhTimeDiffPulser[uFeeB][uFeeNrInSys]->Fill( dTimeDiff );
2274
2276 if( 0 == uFeeInGbtx && 0 == uFeeB % kuNbFeePerGbtx )
2277 {
2279 if( fuGdpbNr == uFeeB / fuNrOfFeePerGdpb )
2280 {
2281 if( 0 == uFeeB / kuNbFeePerGbtx )
2282 {
2283 UInt_t uPlotIdx = fuGdpbNr * ( kuNbGbtxPerGdpb - 1) + uGbtxNr - 1;
2284 fvhPulserTimeDiffEvoGbtxGbtx[ uPlotIdx ]->Fill( 1e-9 / 60.0 * (dHitTime - fdStartTime), dTimeDiff );
2285 }
2286 } // if( fuGdpbNr == uFeeB / fuNrOfFeePerGdpb )
2287 else // if( NULL != fvvhPulserTimeDiffEvoGdpbGdpb[ uFeeB / fuNrOfFeePerGdpb ][ fuGdpbNr ] )
2288 {
2290 if( 0 == uGbtxNr && 0 == uFeeB / kuNbFeePerGbtx )
2291 fvvhPulserTimeDiffEvoGdpbGdpb[ uFeeB / fuNrOfFeePerGdpb ][ fuGdpbNr ]->Fill(
2292 1e-9 / 60.0 * (dHitTime - fdStartTime), dTimeDiff );
2293 } // else of if( fuGdpbNr == uFeeB / fuNrOfFeePerGdpb )
2294 } // if( 0 == uFeeInGbtx && 0 == uFeeB % kuNbFeePerGbtx )
2295 } // if( TMath::Abs( dTimeDiff ) < kdMaxDtPulserPs )
2296 // else if( 10 == uFeeB && 20 == uFeeNrInSys )
2297 // LOG(info) << "new in 20 " << dTimeDiff;
2298 } // if( NULL != fvhTimeDiffPulser[uFeeB][uFeeB] )
2299
2301 for( UInt_t uFeeB = uFeeNrInSys + 1; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
2302 if( NULL != fvhTimeDiffPulser[uFeeNrInSys][uFeeB] )
2303 {
2304 Double_t dTimeDiff = 1e3 * ( fdTsLastPulserHit[ uFeeB ] - fdTsLastPulserHit[ uFeeNrInSys ] );
2305 if( TMath::Abs( dTimeDiff ) < kdMaxDtPulserPs )
2306 {
2307 fvhTimeDiffPulser[uFeeNrInSys][uFeeB]->Fill( dTimeDiff );
2308
2310 if( 0 == uFeeInGbtx && 0 == uFeeB % kuNbFeePerGbtx )
2311 {
2313 if( fuGdpbNr == uFeeB / fuNrOfFeePerGdpb )
2314 {
2315 if( 0 == uGbtxNr )
2316 {
2317 UInt_t uPlotIdx = fuGdpbNr * ( kuNbGbtxPerGdpb - 1)
2318 + ( uFeeB - fuGdpbNr * fuNrOfFeePerGdpb) / kuNbFeePerGbtx - 1;
2319 fvhPulserTimeDiffEvoGbtxGbtx[ uPlotIdx ]->Fill( 1e-9 / 60.0 * (dHitTime - fdStartTime), dTimeDiff );
2320 } // if( 0 == uGbtxNr )
2321 } // if( fuGdpbNr == uFeeB / fuNrOfFeePerGdpb )
2322 else // if( NULL != fvvhPulserTimeDiffEvoGdpbGdpb[ uFeeB / fuNrOfFeePerGdpb ][ fuGdpbNr ] )
2323 {
2325 if( 0 == uGbtxNr && 0 == uFeeB / kuNbFeePerGbtx )
2326 fvvhPulserTimeDiffEvoGdpbGdpb[ fuGdpbNr ][ uFeeB / fuNrOfFeePerGdpb ]->Fill(
2327 1e-9 / 60.0 * (dHitTime - fdStartTime), dTimeDiff );
2328 } // else of if( fuGdpbNr == uFeeB / fuNrOfFeePerGdpb )
2329 } // if( 0 == uFeeInGbtx && 0 == uFeeB % kuNbFeePerGbtx )
2330 } // if( TMath::Abs( dTimeDiff ) < kdMaxDtPulserPs )
2331 // else if( 10 == uFeeNrInSys && 20 == uFeeB )
2332 // LOG(info) << "new in 10 " << dTimeDiff;
2333 } // if( NULL != fvhTimeDiffPulser[uFeeNrInSys][uFeeB] )
2334*/
2335 } // if( gdpbv100::kuFeePulserChannel == uChannelNrInFee )
2337 else if ((fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId) && 0 == uChannelNrInFee) {
2338 fdTsLastPulserHit[uFeeNrInSys] = dHitTime;
2339 fvuFeeNbHitsLastMs[uFeeNrInSys]++;
2340 } // if( fuGdpbNr == fuDiamondDpbIdx && 0 == uChannelNrInFee )
2341 } // if( kTRUE == fbPulserModeEnable )
2342
2344 if (kTRUE == fbCoincMapsEnable) {
2345 fvdCoincTsLastHit[fuGdpbNr][uRemappedChannelNr] = dHitTime;
2346 fvuCoincNbHitsLastMs[fuGdpbNr][uRemappedChannelNr]++;
2347 } // if( kTRUE == fbCoincMapsEnable )
2348
2349 if (0 <= fdStartTime) {
2350 fvhChannelRate_gDPB[fuGdpbNr]->Fill(1e-9 * (dHitTime - fdStartTime), uChannelNr);
2351 fvhRemapChRate_gDPB[fuGdpbNr]->Fill(1e-9 * (dHitTime - fdStartTime), uRemappedChannelNr);
2352 fvhFeeRate_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(1e-9 * (dHitTime - fdStartTime));
2353 fvhFeeErrorRatio_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(1e-9 * (dHitTime - fdStartTime), 0, 1);
2354
2355 /*
2356 fvhModRate[ fviModuleId[ uGbtxNrInSys ] ]->Fill( 1e-9 * (dHitTime - fdStartTime));
2357 fvhModErrorRatio[ fviModuleId[ uGbtxNrInSys ] ]->Fill( 1e-9 * (dHitTime - fdStartTime), 0, 1);
2358*/
2359 } // if (0 <= fdStartTime)
2360
2361 if (0 <= fdStartTimeLong) {
2362 fvhFeeRateLong_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(1e-9 / 60.0 * (dHitTime - fdStartTimeLong),
2363 1 / 60.0);
2364 fvhFeeErrorRatioLong_gDPB[(fuGdpbNr * fuNrOfFeePerGdpb) + uFeeNr]->Fill(1e-9 / 60.0 * (dHitTime - fdStartTimeLong),
2365 0, 1 / 60.0);
2366 } // if (0 <= fdStartTimeLong)
2367
2368 if (kTRUE == fbPrintAllHitsEnable) {
2369 LOG(info) << "Hit: " << Form("0x%08x ", fuGdpbId) << ", " << std::setw(2) << fuGet4Nr << ", " << std::setw(3)
2370 << uChannel << ", " << std::setw(3) << uTot << ", epoch " << std::setw(3) << ulCurEpochGdpbGet4
2371 << ", FullTime Clk " << Form("%12lu ", ulHitTime) << ", FullTime s " << Form("%12.9f ", dHitTime / 1e9)
2372 << ", FineTime " << uFts;
2373 } // if( kTRUE == fbPrintAllHitsEnable )
2374}
2375
2377{
2378 ULong64_t ulEpochNr = mess.getGdpbEpEpochNb();
2379 /*
2380 if( fvulCurrentEpoch[fuGet4Nr] < ulEpochNr )
2381 fvulCurrentEpochCycle[fuGet4Nr]++;
2382*/
2383 fvulCurrentEpoch[fuGet4Nr] = ulEpochNr;
2385
2386 if (1 == mess.getGdpbEpSync()) fhGet4EpochFlags->Fill(fuGet4Nr, 0);
2387 if (1 == mess.getGdpbEpDataLoss()) fhGet4EpochFlags->Fill(fuGet4Nr, 1);
2388 if (1 == mess.getGdpbEpEpochLoss()) fhGet4EpochFlags->Fill(fuGet4Nr, 2);
2389 if (1 == mess.getGdpbEpMissmatch()) fhGet4EpochFlags->Fill(fuGet4Nr, 3);
2390
2391 fulCurrentEpochTime = mess.getMsgFullTime(ulEpochNr);
2392
2395 if (0 < ulEpochNr) mess.setGdpbEpEpochNb(ulEpochNr - 1);
2396 else
2398
2399 Int_t iBufferSize = fvmEpSupprBuffer[fuGet4Nr].size();
2400 if (0 < iBufferSize) {
2401 LOG(debug) << "Now processing stored messages for for get4 " << fuGet4Nr << " with epoch number "
2402 << (fvulCurrentEpoch[fuGet4Nr] - 1);
2403
2406 std::stable_sort(fvmEpSupprBuffer[fuGet4Nr].begin(), fvmEpSupprBuffer[fuGet4Nr].begin());
2407
2408 for (Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++) {
2410 } // for( Int_t iMsgIdx = 0; iMsgIdx < iBufferSize; iMsgIdx++ )
2411
2412 fvmEpSupprBuffer[fuGet4Nr].clear();
2413 } // if( 0 < fvmEpSupprBuffer[fuGet4Nr] )
2414}
2415
2417{
2418 if (fGdpbIdIndexMap.end() != fGdpbIdIndexMap.find(fuGdpbId)) {
2419 // UInt_t uChip = mess.getGdpbGenChipId();
2420 // UInt_t uChan = mess.getGdpbSlcChan();
2421 // UInt_t uEdge = mess.getGdpbSlcEdge();
2422 UInt_t uData = mess.getGdpbSlcData();
2423 UInt_t uType = mess.getGdpbSlcType();
2424 Double_t dGdpbChId = fuGet4Id * fuNrOfChannelsPerGet4 + mess.getGdpbSlcChan() + 0.5 * mess.getGdpbSlcEdge();
2425 Double_t dFullChId = fuGet4Nr * fuNrOfChannelsPerGet4 + mess.getGdpbSlcChan() + 0.5 * mess.getGdpbSlcEdge();
2426 Double_t dMessTime = static_cast<Double_t>(fulCurrentEpochTime) * 1.e-9;
2427
2428 switch (uType) {
2429 case 0: // Scaler counter
2430 {
2431 fhGet4ChanScm->Fill(dFullChId, uType);
2432 fvhGdpbGet4ChanScm[fuGdpbNr]->Fill(dGdpbChId, uType);
2433 fhScmScalerCounters->Fill(uData, dFullChId);
2434 break;
2435 }
2436 case 1: // Deadtime counter
2437 {
2438 fhGet4ChanScm->Fill(dFullChId, uType);
2439 fvhGdpbGet4ChanScm[fuGdpbNr]->Fill(dGdpbChId, uType);
2440 fhScmDeadtimeCounters->Fill(uData, dFullChId);
2441 break;
2442 }
2443 case 2: // SPI message
2444 {
2445 /*
2446 LOG(info) << "GET4 Slow Control message, epoch "
2447 << static_cast<Int_t>(fvulCurrentEpoch[fuGet4Nr]) << ", time " << std::setprecision(9)
2448 << std::fixed << dMessTime << " s "
2449 << " for board ID " << std::hex << std::setw(4) << fuGdpbId
2450 << std::dec << "\n"
2451 << " +++++++ > Chip = "
2452 << std::setw(2) << uChip << ", Chan = "
2453 << std::setw(1) << uChan << ", Edge = "
2454 << std::setw(1) << uEdge << ", Type = "
2455 << std::setw(1) << mess.getGdpbSlcType() << ", Data = 0x"
2456// << std::hex << std::setw(6) << mess.getGdpbSlcData()
2457 << Form( "%06x", uData )
2458 << std::dec << ", CRC = " << uCRC
2459// << " RAW: " << Form( "%08x", mess.getGdpbSlcMess() );
2460*/
2461 fhGet4ChanScm->Fill(dFullChId, uType);
2462 fvhGdpbGet4ChanScm[fuGdpbNr]->Fill(dGdpbChId, uType);
2463 break;
2464 }
2465 case 3: // Start message or SEU counter
2466 {
2467 if (0 == mess.getGdpbSlcChan() && 0 == mess.getGdpbSlcEdge()) // START message
2468 {
2469 /*
2470 LOG(info) << std::setprecision(9)
2471 << std::fixed << dMessTime << " s ";
2472 LOG(info) << "GET4 Slow Control message, epoch "
2473 << static_cast<Int_t>(fvulCurrentEpoch[fuGet4Nr]) << ", time " << std::setprecision(9)
2474 << std::fixed << dMessTime << " s "
2475 << " for board ID " << std::hex << std::setw(4) << fuGdpbId
2476 << std::dec << "\n"
2477 << " +++++++ > Chip = "
2478 << std::setw(2) << mess.getGdpbGenChipId() << ", Chan = "
2479 << std::setw(1) << mess.getGdpbSlcChan() << ", Edge = "
2480 << std::setw(1) << mess.getGdpbSlcEdge() << ", Type = "
2481 << std::setw(1) << mess.getGdpbSlcType() << ", Data = 0x"
2482 // << std::hex << std::setw(6) << mess.getGdpbSlcData()
2483 << Form( "%06x", mess.getGdpbSlcData() )
2484 << std::dec << ", CRC = " << mess.getGdpbSlcCrc();
2485*/
2486 fhGet4ChanScm->Fill(dFullChId, uType + 1);
2487 fvhGdpbGet4ChanScm[fuGdpbNr]->Fill(dGdpbChId, uType + 1);
2488 } // if( 0 == mess.getGdpbSlcChan() && 0 == mess.getGdpbSlcEdge() )
2489 else if (0 == mess.getGdpbSlcChan() && 1 == mess.getGdpbSlcEdge()) // SEU counter message
2490 {
2491 /*
2492 LOG(info) << "GET4 Slow Control message, epoch "
2493 << static_cast<Int_t>(fvulCurrentEpoch[fuGet4Nr]) << ", time " << std::setprecision(9)
2494 << std::fixed << dMessTime << " s "
2495 << " for board ID " << std::hex << std::setw(4) << fuGdpbId
2496 << std::dec << "\n"
2497 << " +++++++ > Chip = "
2498 << std::setw(2) << mess.getGdpbGenChipId() << ", Chan = "
2499 << std::setw(1) << mess.getGdpbSlcChan() << ", Edge = "
2500 << std::setw(1) << mess.getGdpbSlcEdge() << ", Type = "
2501 << std::setw(1) << mess.getGdpbSlcType() << ", Data = 0x"
2502// << std::hex << std::setw(6) << mess.getGdpbSlcData()
2503 << Form( "%06x", mess.getGdpbSlcData() )
2504 << std::dec << ", CRC = " << mess.getGdpbSlcCrc();
2505*/
2506 fhGet4ChanScm->Fill(dFullChId, uType);
2507 fvhGdpbGet4ChanScm[fuGdpbNr]->Fill(dGdpbChId, uType);
2508 fhScmSeuCounters->Fill(uData, dFullChId);
2509 fhScmSeuCountersEvo->Fill(dMessTime - fdStartTime * 1.e-9, uData, dFullChId);
2510 } // else if( 0 == mess.getGdpbSlcChan() && 1 == mess.getGdpbSlcEdge() )
2511 break;
2512 }
2513 default: // Should never happen
2514 break;
2515 } // switch( mess.getGdpbSlcType() )
2516 }
2517}
2518
2520{
2521 Int_t mType = mess.getMessageType();
2522 Int_t channel = mess.getGdpbHitChanId();
2523 uint64_t uData = mess.getData();
2524
2525 LOG(debug) << "Get4 MSG type " << mType << " from gdpbId " << fuGdpbId << ", getId " << fuGet4Id << ", (hit channel) "
2526 << channel << " data " << std::hex << uData;
2527}
2528
2530{
2531 if (fGdpbIdIndexMap.end() != fGdpbIdIndexMap.find(fuGdpbId))
2532 LOG(debug) << "GET4 System message, epoch " << static_cast<Int_t>(fvulCurrentEpoch[fuGet4Nr]) << ", time "
2533 << std::setprecision(9) << std::fixed << Double_t(fulCurrentEpochTime) * 1.e-9 << " s "
2534 << " for board ID " << std::hex << std::setw(4) << fuGdpbId << std::dec;
2535
2536 switch (mess.getGdpbSysSubType()) {
2538 uint32_t uData = mess.getGdpbSysErrData();
2542 LOG(debug) << " +++++++ > gDPB: " << std::hex << std::setw(4) << fuGdpbId << std::dec
2543 << ", Chip = " << std::setw(2) << mess.getGdpbGenChipId() << ", Chan = " << std::setw(1)
2544 << mess.getGdpbSysErrChanId() << ", Edge = " << std::setw(1) << mess.getGdpbSysErrEdge()
2545 << ", Empt = " << std::setw(1) << mess.getGdpbSysErrUnused() << ", Data = " << std::hex
2546 << std::setw(2) << uData << std::dec << " -- GET4 V1 Error Event";
2547 else
2548 LOG(debug) << " +++++++ >gDPB: " << std::hex << std::setw(4) << fuGdpbId << std::dec
2549 << ", Chip = " << std::setw(2) << mess.getGdpbGenChipId() << ", Chan = " << std::setw(1)
2550 << mess.getGdpbSysErrChanId() << ", Edge = " << std::setw(1) << mess.getGdpbSysErrEdge()
2551 << ", Empt = " << std::setw(1) << mess.getGdpbSysErrUnused() << ", Data = " << std::hex
2552 << std::setw(2) << uData << std::dec << " -- GET4 V1 Error Event ";
2553 break;
2554 } // case gdpbv100::SYSMSG_GET4_EVENT
2556 LOG(debug) << "Unknown GET4 message, data: " << std::hex << std::setw(8) << mess.getGdpbSysUnkwData() << std::dec
2557 << " Full message: " << std::hex << std::setw(16) << mess.getData() << std::dec;
2558 break;
2559 } // case gdpbv100::SYS_GDPB_UNKWN:
2561 if (mess.getGdpbSysFwErrResync())
2562 LOG(info) << Form("GET4 Resynchronization: Get4:0x%04x ", mess.getGdpbGenChipId()) << std::hex << std::setw(4)
2563 << fuGdpbId << std::dec;
2564 else
2565 LOG(info) << "GET4 synchronization pulse missing in gDPB " << std::hex << std::setw(4) << fuGdpbId << std::dec;
2566 break;
2567 } // case gdpbv100::SYS_GET4_SYNC_MISS:
2568 case gdpbv100::SYS_PATTERN: {
2569 LOG(debug) << "ASIC pattern for missmatch, disable or resync";
2570 break;
2571 } // case gdpbv100::SYS_PATTERN:
2572 default: {
2573 LOG(debug) << "Crazy system message, subtype " << mess.getGdpbSysSubType();
2574 break;
2575 } // default
2576
2577 } // switch( getGdpbSysSubType() )
2578}
2579
2581{
2582 uint16_t usType = mess.getGdpbSysPattType();
2583 uint16_t usIndex = mess.getGdpbSysPattIndex();
2584 uint32_t uPattern = mess.getGdpbSysPattPattern();
2585
2586 switch (usType) {
2588 LOG(debug) << Form("Missmatch pattern message => Type %d, Index %2d, Pattern 0x%08X", usType, usIndex, uPattern);
2589 for (UInt_t uBit = 0; uBit < 32; ++uBit) {
2590 UInt_t uBadAsic = ConvertElinkToGet4(32 * usIndex + uBit);
2592 if (fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId) uBadAsic = 32 * usIndex + uBit;
2593
2594 if ((uPattern >> uBit) & 0x1) {
2595 fhPatternMissmatch->Fill(uBadAsic, fuGdpbNr);
2597 fvvbGdpbLastMissmatchPattern[fuGdpbNr][uBadAsic] = kTRUE;
2598 } // if( ( uPattern >> uBit ) & 0x1 )
2599 else
2600 fvvbGdpbLastMissmatchPattern[fuGdpbNr][uBadAsic] = kFALSE;
2601
2602 } // for( UInt_t uBit = 0; uBit < 32; ++uBit )
2603 break;
2604 } // case gdpbv100::PATT_MISSMATCH:
2605 case gdpbv100::PATT_ENABLE: {
2606 for (UInt_t uBit = 0; uBit < 32; ++uBit) {
2607 UInt_t uAsic = ConvertElinkToGet4(32 * usIndex + uBit);
2609 if (fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId) uAsic = 32 * usIndex + uBit;
2610
2611 if ((uPattern >> uBit) & 0x1) {
2612 fhPatternEnable->Fill(uAsic, fuGdpbNr);
2614 fvvbGdpbLastEnablePattern[fuGdpbNr][uAsic] = kFALSE;
2615 } // if( ( uPattern >> uBit ) & 0x1 )
2616 else
2617 fvvbGdpbLastEnablePattern[fuGdpbNr][uAsic] = kTRUE;
2618
2619 } // for( UInt_t uBit = 0; uBit < 32; ++uBit )
2620 break;
2621 } // case gdpbv100::PATT_ENABLE:
2622 case gdpbv100::PATT_RESYNC: {
2623 LOG(debug) << Form("RESYNC pattern message => Type %d, Index %2d, Pattern 0x%08X", usType, usIndex, uPattern);
2624
2625 for (UInt_t uBit = 0; uBit < 32; ++uBit) {
2626 UInt_t uBadAsic = ConvertElinkToGet4(32 * usIndex + uBit);
2628 if (fuGdpbNr == fuDiamondDpbIdx || 0x90 == fuCurrentMsSysId) uBadAsic = 32 * usIndex + uBit;
2629
2630 if ((uPattern >> uBit) & 0x1) {
2631 fhPatternResync->Fill(uBadAsic, fuGdpbNr);
2633 fvvbGdpbLastResyncPattern[fuGdpbNr][uBadAsic] = kTRUE;
2634 } // if( ( uPattern >> uBit ) & 0x1 )
2635 else
2636 fvvbGdpbLastResyncPattern[fuGdpbNr][uBadAsic] = kFALSE;
2637
2638 } // for( UInt_t uBit = 0; uBit < 32; ++uBit )
2639 break;
2640 } // case gdpbv100::PATT_RESYNC:
2641 default: {
2642 LOG(debug) << "Crazy pattern message, subtype " << usType;
2643 break;
2644 } // default
2645 } // switch( usType )
2646
2647 return;
2648}
2649
2651{
2652 Int_t iMsgIndex = mess.getStarTrigMsgIndex();
2653
2654 switch (iMsgIndex) {
2655 case 0:
2656 fvhTokenMsgType[fuGdpbNr]->Fill(0);
2658 break;
2659 case 1:
2660 fvhTokenMsgType[fuGdpbNr]->Fill(1);
2663 break;
2664 case 2:
2665 fvhTokenMsgType[fuGdpbNr]->Fill(2);
2667 break;
2668 case 3: {
2669 fvhTokenMsgType[fuGdpbNr]->Fill(3);
2670
2671 ULong64_t ulNewGdpbTsFull = (fvulGdpbTsMsb[fuGdpbNr] << 24) + (fvulGdpbTsLsb[fuGdpbNr]);
2672 ULong64_t ulNewStarTsFull =
2674 UInt_t uNewToken = mess.getStarTokenStarD();
2675 UInt_t uNewDaqCmd = mess.getStarDaqCmdStarD();
2676 UInt_t uNewTrigCmd = mess.getStarTrigCmdStarD();
2677
2678 if ((uNewToken == fvuStarTokenLast[fuGdpbNr]) && (ulNewGdpbTsFull == fvulGdpbTsFullLast[fuGdpbNr])
2679 && (ulNewStarTsFull == fvulStarTsFullLast[fuGdpbNr]) && (uNewDaqCmd == fvuStarDaqCmdLast[fuGdpbNr])
2680 && (uNewTrigCmd == fvuStarTrigCmdLast[fuGdpbNr])) {
2681 UInt_t uTrigWord = ((fvuStarTrigCmdLast[fuGdpbNr] & 0x00F) << 16)
2682 + ((fvuStarDaqCmdLast[fuGdpbNr] & 0x00F) << 12) + ((fvuStarTokenLast[fuGdpbNr] & 0xFFF));
2683 LOG(warning) << "Possible error: identical STAR tokens found twice in "
2684 "a row => ignore 2nd! "
2685 << " TS " << fulCurrentTsIndex << " gDBB #" << fuGdpbNr << " "
2686 << Form("token = %5u ", fvuStarTokenLast[fuGdpbNr])
2687 << Form("gDPB ts = %12llu ", fvulGdpbTsFullLast[fuGdpbNr])
2688 << Form("STAR ts = %12llu ", fvulStarTsFullLast[fuGdpbNr])
2689 << Form("DAQ cmd = %2u ", fvuStarDaqCmdLast[fuGdpbNr])
2690 << Form("TRG cmd = %2u ", fvuStarTrigCmdLast[fuGdpbNr]) << Form("TRG Wrd = %5x ", uTrigWord);
2691 return;
2692 } // if exactly same message repeated
2693 /*
2694 if( (uNewToken != fuStarTokenLast[fuGdpbNr] + 1) &&
2695 0 < fvulGdpbTsFullLast[fuGdpbNr] && 0 < fvulStarTsFullLast[fuGdpbNr] &&
2696 ( 4095 != fvuStarTokenLast[fuGdpbNr] || 1 != uNewToken) )
2697 LOG(warning) << "Possible error: STAR token did not increase by exactly 1! "
2698 << " gDBB #" << fuGdpbNr << " "
2699 << Form("old = %5u vs new = %5u ", fvuStarTokenLast[fuGdpbNr], uNewToken)
2700 << Form("old = %12llu vs new = %12llu ", fvulGdpbTsFullLast[fuGdpbNr], ulNewGdpbTsFull)
2701 << Form("old = %12llu vs new = %12llu ", fvulStarTsFullLast[fuGdpbNr], ulNewStarTsFull)
2702 << Form("old = %2u vs new = %2u ", fvuStarDaqCmdLast[fuGdpbNr], uNewDaqCmd)
2703 << Form("old = %2u vs new = %2u ", fvuStarTrigCmdLast[fuGdpbNr], uNewTrigCmd);
2704*/
2705 // STAR TS counter reset detection
2706 if (ulNewStarTsFull < fvulStarTsFullLast[fuGdpbNr])
2707 LOG(debug) << "Probable reset of the STAR TS: old = " << Form("%16llu", fvulStarTsFullLast[fuGdpbNr])
2708 << " new = " << Form("%16llu", ulNewStarTsFull) << " Diff = -"
2709 << Form("%8llu", fvulStarTsFullLast[fuGdpbNr] - ulNewStarTsFull);
2710
2711 /*
2712 LOG(info) << "Updating trigger token for " << fuGdpbNr
2713 << " " << fuStarTokenLast[fuGdpbNr] << " " << uNewToken;
2714*/
2715 // ULong64_t ulGdpbTsDiff = ulNewGdpbTsFull - fvulGdpbTsFullLast[fuGdpbNr];
2716 fvulGdpbTsFullLast[fuGdpbNr] = ulNewGdpbTsFull;
2717 fvulStarTsFullLast[fuGdpbNr] = ulNewStarTsFull;
2718 fvuStarTokenLast[fuGdpbNr] = uNewToken;
2719 fvuStarDaqCmdLast[fuGdpbNr] = uNewDaqCmd;
2720 fvuStarTrigCmdLast[fuGdpbNr] = uNewTrigCmd;
2721
2723 if (fuCurrentMs < fuCoreMs) {
2725 if (0 <= fdStartTime) {
2730 } // if( fuHistoryHistoSize < 1e-9 * (fulGdpbTsFullLast * gdpbv100::kdClockCycleSizeNs - fdStartTime) )
2731
2732 fvhTriggerRate[fuGdpbNr]->Fill(1e-9
2743 } // if( 0 < fdStartTime )
2744 else
2747 } // if( fuCurrentMs < fuCoreMs )
2748
2749 break;
2750 } // case 3
2751 default: LOG(error) << "Unknown Star Trigger messageindex: " << iMsgIndex;
2752 } // switch( iMsgIndex )
2753}
2754
2756
2758{
2759 // Printout some stats on what was unpacked
2760 TString message_type;
2761 for (unsigned int i = 0; i < fviMsgCounter.size(); ++i) {
2762 switch (i) {
2763 case 0: message_type = "NOP"; break;
2764 case 1: message_type = "HIT"; break;
2765 case 2: message_type = "EPOCH"; break;
2766 case 3: message_type = "SYNC"; break;
2767 case 4: message_type = "AUX"; break;
2768 case 5: message_type = "EPOCH2"; break;
2769 case 6: message_type = "GET4"; break;
2770 case 7: message_type = "SYS"; break;
2771 case 8: message_type = "GET4_SLC"; break;
2772 case 9: message_type = "GET4_32B"; break;
2773 case 10: message_type = "GET4_SYS"; break;
2774 default: message_type = "UNKNOWN"; break;
2775 } // switch(i)
2776 LOG(info) << message_type << " messages: " << fviMsgCounter[i];
2777 } // for (unsigned int i=0; i< fviMsgCounter.size(); ++i)
2778
2779 LOG(info) << "-------------------------------------";
2780 for (UInt_t i = 0; i < fuNrOfGdpbs; ++i) {
2781 for (UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j) {
2782 LOG(info) << "Last epoch for gDPB: " << std::hex << std::setw(4) << i << std::dec << " , GET4 " << std::setw(4)
2783 << j << " => " << fvulCurrentEpoch[GetArrayIndex(i, j)];
2784 } // for (UInt_t j = 0; j < fuNrOfGet4PerGdpb; ++j)
2785 } // for (UInt_t i = 0; i < fuNrOfGdpbs; ++i)
2786 LOG(info) << "-------------------------------------";
2787
2788
2790 if (kTRUE == fbPulserModeEnable) {
2792 fhTimeMeanPulser->Reset();
2793 fhTimeRmsPulser->Reset();
2794
2795 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
2796 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
2797 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) {
2798 fhTimeMeanPulser->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetMean());
2799 fhTimeRmsPulser->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetRMS());
2800 } // for( UInt_t uChan = 0; uChan < kuNbChanTest - 1; uChan++)
2801
2804 } // if( kTRUE == fbPulserModeEnable )
2805
2807}
2808
2810{
2812 TFile* oldFile = gFile;
2813 TDirectory* oldDir = gDirectory;
2814
2815 TFile* histoFile = NULL;
2816 if ("" != sFileName) {
2817 // open separate histo file in recreate mode
2818 histoFile = new TFile(sFileName, "RECREATE");
2819 histoFile->cd();
2820 } // if( "" != sFileName )
2821
2822 gDirectory->mkdir("Tof_Raw_gDPB");
2823 gDirectory->cd("Tof_Raw_gDPB");
2824
2825 fhMessType->Write();
2826 fhSysMessType->Write();
2827 fhGet4MessType->Write();
2828 fhGet4ChanScm->Write();
2829 fhGet4ChanErrors->Write();
2830 fhGet4EpochFlags->Write();
2831
2832 fhGdpbMessType->Write();
2833 fhGdpbSysMessType->Write();
2834 fhGdpbSysMessPattType->Write();
2835 fhGdpbEpochFlags->Write();
2836 fhGdpbEpochSyncEvo->Write();
2837 fhGdpbEpochMissEvo->Write();
2838
2839 fhScmScalerCounters->Write();
2840 fhScmDeadtimeCounters->Write();
2841 fhScmSeuCounters->Write();
2842 fhScmSeuCountersEvo->Write();
2843
2844 fhPatternMissmatch->Write();
2845 fhPatternEnable->Write();
2846 fhPatternResync->Write();
2847
2848 for (UInt_t uTotPlot = 0; uTotPlot < fvhRawTot_gDPB.size(); ++uTotPlot)
2849 fvhRawTot_gDPB[uTotPlot]->Write();
2850
2851 for (UInt_t uTotPlot = 0; uTotPlot < fvhRemapTot_gDPB.size(); ++uTotPlot)
2852 fvhRemapTot_gDPB[uTotPlot]->Write();
2853 /*
2854 for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
2855 {
2856 fvhRemapTotSideA_mod[ uMod ]->Write();
2857 fvhRemapTotSideB_mod[ uMod ]->Write();
2858
2859 fvhModRate[ uMod ]->Write();
2860 fvhModErrorRate[ uMod ]->Write();
2861 fvhModErrorRatio[ uMod ]->Write();
2862 } // for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
2863*/
2864 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
2865 fvhGdpbGet4MessType[uGdpb]->Write();
2866 fvhGdpbGet4ChanScm[uGdpb]->Write();
2867 fvhGdpbGet4ChanErrors[uGdpb]->Write();
2868
2869 fvhGdpbPatternMissmatchEvo[uGdpb]->Write();
2870 fvhGdpbPatternEnableEvo[uGdpb]->Write();
2871 fvhGdpbPatternResyncEvo[uGdpb]->Write();
2872
2873 fvhRawFt_gDPB[uGdpb]->Write();
2874 fvhChCount_gDPB[uGdpb]->Write();
2875 fvhChannelRate_gDPB[uGdpb]->Write();
2876 fvhRemapChCount_gDPB[uGdpb]->Write();
2877 fvhRemapChRate_gDPB[uGdpb]->Write();
2878
2879 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee) {
2880 fvhFeeRate_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Write();
2881 fvhFeeErrorRate_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Write();
2882 fvhFeeErrorRatio_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Write();
2883 fvhFeeRateLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Write();
2884 fvhFeeErrorRateLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Write();
2885 fvhFeeErrorRatioLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Write();
2886 } // for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++ uFee)
2887
2888 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
2889 if (kTRUE == fbPulserModeEnable) {
2890 fhTimeMeanPulser->Write();
2891 fhTimeRmsPulser->Write();
2892 fhTimeRmsZoomFitPuls->Write();
2893 fhTimeResFitPuls->Write();
2894 } // if( kTRUE == fbPulserModeEnable )
2895 gDirectory->cd("..");
2896
2897 gDirectory->mkdir("Tof_Chan_FineCount");
2898 gDirectory->cd("Tof_Chan_FineCount");
2899 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
2900 fhHitsPerMsFirstChan_gDPB[uGdpb]->Write();
2901 fvhChannelRatePerMs_gDPB[uGdpb]->Write();
2902 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
2903 gDirectory->cd("..");
2904
2905 gDirectory->mkdir("Tof_Ena");
2906 gDirectory->cd("Tof_Ena");
2907 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
2908 fvhGdpbMissmatchEvoPerTs[uGdpb]->Write();
2909 fvhGdpbMissmatchEnaEvoPerTs[uGdpb]->Write();
2910 fvhGdpbEnableEvoPerTs[uGdpb]->Write();
2911 fvhGdpbResyncEvoPerTs[uGdpb]->Write();
2912 fvhGdpbResyncEnaEvoPerTs[uGdpb]->Write();
2913 fvhGdpbStateEvoPerTs[uGdpb]->Write();
2914 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
2915 gDirectory->cd("..");
2916
2918 gDirectory->mkdir("Star_Raw");
2919 gDirectory->cd("Star_Raw");
2920 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
2921 fvhTokenMsgType[uGdpb]->Write();
2922 fvhTriggerRate[uGdpb]->Write();
2923 fvhCmdDaqVsTrig[uGdpb]->Write();
2924 fvhStarTokenEvo[uGdpb]->Write();
2925 fvhStarTrigGdpbTsEvo[uGdpb]->Write();
2926 fvhStarTrigStarTsEvo[uGdpb]->Write();
2927 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
2928 gDirectory->cd("..");
2929
2931 if (kTRUE == fbPulserModeEnable) {
2932 gDirectory->mkdir("TofDt");
2933 gDirectory->cd("TofDt");
2934 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
2935 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
2936 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) fvhTimeDiffPulser[uFeeA][uFeeB]->Write();
2937 gDirectory->cd("..");
2938
2940 gDirectory->mkdir("TofDtEvo");
2941 gDirectory->cd("TofDtEvo");
2942 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
2943 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx)
2944 fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx]->Write();
2945
2946 for (UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB)
2947 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB]->Write();
2948 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
2949 gDirectory->cd("..");
2950 } // if( kTRUE == fbPulserModeEnable )
2951
2953 if (kTRUE == fbCoincMapsEnable) {
2954 gDirectory->mkdir("TofCoinc");
2955 gDirectory->cd("TofCoinc");
2956 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
2957 fvhCoincMapAllChanGdpb[uGdpb]->Write();
2958 fvhCoincMeanAllChanGdpb[uGdpb]->Write();
2959 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
2960 gDirectory->cd("..");
2961 } // if( kTRUE == fbCoincMapsEnable )
2962
2963 gDirectory->mkdir("Flib_Raw");
2964 gDirectory->cd("Flib_Raw");
2965 for (UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++) {
2966 if (NULL == fvhMsSzPerLink[uLinks]) continue;
2967
2968 fvhMsSzPerLink[uLinks]->Write();
2969 fvhMsSzTimePerLink[uLinks]->Write();
2970 } // for( UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++ )
2971
2972 TH1* pMissedTsH1 = dynamic_cast<TH1*>(gROOT->FindObjectAny("Missed_TS"));
2973 if (NULL != pMissedTsH1) pMissedTsH1->Write();
2974
2975 TProfile* pMissedTsEvoP = dynamic_cast<TProfile*>(gROOT->FindObjectAny("Missed_TS_Evo"));
2976 if (NULL != pMissedTsEvoP) pMissedTsEvoP->Write();
2977
2978 gDirectory->cd("..");
2979
2980 gDirectory->mkdir("canvases");
2981 gDirectory->cd("canvases");
2982 fcSummary->Write();
2983 fcSummaryGdpb->Write();
2984 fcGdpbChannelCount->Write();
2985 fcGdpbRemapChCount->Write();
2986 fcGdpbChannelRate->Write();
2987 fcGdpbRemapChRate->Write();
2988 gDirectory->cd("..");
2989
2990
2991 if ("" != sFileName) {
2992 // Restore original directory position
2993 histoFile->Close();
2994 } // if( "" != sFileName )
2995
2997 gFile = oldFile;
2998 gDirectory = oldDir;
2999}
3000
3002{
3003 LOG(info) << "Reseting all TOF histograms.";
3004
3005 fhMessType->Reset();
3006 fhSysMessType->Reset();
3007 fhGet4MessType->Reset();
3008 fhGet4ChanScm->Reset();
3009 fhGet4ChanErrors->Reset();
3010 fhGet4EpochFlags->Reset();
3011
3012 fhGdpbMessType->Reset();
3013 fhGdpbSysMessType->Reset();
3014 fhGdpbSysMessPattType->Reset();
3015 fhGdpbEpochFlags->Reset();
3016 fhGdpbEpochSyncEvo->Reset();
3017 fhGdpbEpochMissEvo->Reset();
3018
3019 fhScmScalerCounters->Reset();
3020 fhScmDeadtimeCounters->Reset();
3021 fhScmSeuCounters->Reset();
3022 fhScmSeuCountersEvo->Reset();
3023
3024 fhPatternMissmatch->Reset();
3025 fhPatternEnable->Reset();
3026 fhPatternResync->Reset();
3027
3028 for (UInt_t uTotPlot = 0; uTotPlot < fvhRawTot_gDPB.size(); ++uTotPlot)
3029 fvhRawTot_gDPB[uTotPlot]->Reset();
3030
3031 for (UInt_t uTotPlot = 0; uTotPlot < fvhRemapTot_gDPB.size(); ++uTotPlot)
3032 fvhRemapTot_gDPB[uTotPlot]->Reset();
3033 /*
3034 for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
3035 {
3036 fvhRemapTotSideA_mod[ uMod ]->Reset();
3037 fvhRemapTotSideB_mod[ uMod ]->Reset();
3038
3039 fvhModRate[ uMod ]->Reset();
3040 fvhModErrorRate[ uMod ]->Reset();
3041 fvhModErrorRatio[ uMod ]->Reset();
3042 } // for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
3043*/
3044 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
3045 fvhGdpbGet4MessType[uGdpb]->Reset();
3046 fvhGdpbGet4ChanScm[uGdpb]->Reset();
3047 fvhGdpbGet4ChanErrors[uGdpb]->Reset();
3048
3049 fvhGdpbPatternMissmatchEvo[uGdpb]->Reset();
3050 fvhGdpbPatternEnableEvo[uGdpb]->Reset();
3051 fvhGdpbPatternResyncEvo[uGdpb]->Reset();
3052
3053 fvhRawFt_gDPB[uGdpb]->Reset();
3054 fvhChCount_gDPB[uGdpb]->Reset();
3055 fvhChannelRate_gDPB[uGdpb]->Reset();
3056 fvhRemapChCount_gDPB[uGdpb]->Reset();
3057 fvhRemapChRate_gDPB[uGdpb]->Reset();
3058
3059 for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++uFee) {
3060 fvhFeeRate_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Reset();
3061 fvhFeeErrorRate_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Reset();
3062 fvhFeeErrorRatio_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Reset();
3063 fvhFeeRateLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Reset();
3064 fvhFeeErrorRateLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Reset();
3065 fvhFeeErrorRatioLong_gDPB[uGdpb * fuNrOfFeePerGdpb + uFee]->Reset();
3066 } // for (UInt_t uFee = 0; uFee < fuNrOfFeePerGdpb; ++ uFee)
3067
3068 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
3069
3070 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
3071 fhHitsPerMsFirstChan_gDPB[uGdpb]->Reset();
3072 fvhChannelRatePerMs_gDPB[uGdpb]->Reset();
3073 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
3074
3076 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
3077 fvhTokenMsgType[uGdpb]->Reset();
3078 fvhTriggerRate[uGdpb]->Reset();
3079 fvhCmdDaqVsTrig[uGdpb]->Reset();
3080 fvhStarTokenEvo[uGdpb]->Reset();
3081 fvhStarTrigGdpbTsEvo[uGdpb]->Reset();
3082 fvhStarTrigStarTsEvo[uGdpb]->Reset();
3083 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
3084
3086 if (kTRUE == fbPulserModeEnable) {
3087 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
3088 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
3089 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) fvhTimeDiffPulser[uFeeA][uFeeB]->Reset();
3090
3091 fhTimeMeanPulser->Reset();
3092 fhTimeRmsPulser->Reset();
3093 fhTimeRmsZoomFitPuls->Reset();
3094 fhTimeResFitPuls->Reset();
3095
3096 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
3097 for (UInt_t uGbtx = 0; uGbtx < kuNbGbtxPerGdpb - 1; ++uGbtx)
3098 fvhPulserTimeDiffEvoGbtxGbtx[uGdpb * (kuNbGbtxPerGdpb - 1) + uGbtx]->Reset();
3099
3100 for (UInt_t uGdpbB = uGdpb + 1; uGdpbB < fuNrOfGdpbs; ++uGdpbB)
3101 fvvhPulserTimeDiffEvoGdpbGdpb[uGdpb][uGdpbB]->Reset();
3102 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
3103 } // if( kTRUE == fbPulserModeEnable )
3104
3106 if (kTRUE == fbCoincMapsEnable) {
3107 for (UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb) {
3108 fvhCoincMapAllChanGdpb[uGdpb]->Reset();
3109 fvhCoincMeanAllChanGdpb[uGdpb]->Reset();
3110 } // for( UInt_t uGdpb = 0; uGdpb < fuNrOfGdpbs; ++uGdpb )
3111 } // if( kTRUE == fbCoincMapsEnable )
3112
3113 for (UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++) {
3114 if (NULL == fvhMsSzPerLink[uLinks]) continue;
3115
3116 fvhMsSzPerLink[uLinks]->Reset();
3117 fvhMsSzTimePerLink[uLinks]->Reset();
3118 } // for( UInt_t uLinks = 0; uLinks < fvhMsSzPerLink.size(); uLinks++ )
3119
3120 fdStartTime = -1;
3121 fdStartTimeLong = -1;
3122 fdStartTimeMsSz = -1;
3123}
3125{
3126 for (UInt_t uGdpbLoop = 0; uGdpbLoop < fuNrOfGdpbs; ++uGdpbLoop) {
3127 fvhChannelRate_gDPB[uGdpbLoop]->Reset();
3128 fvhRemapChRate_gDPB[uGdpbLoop]->Reset();
3129 for (UInt_t uFeeLoop = 0; uFeeLoop < fuNrOfFeePerGdpb; ++uFeeLoop) {
3130 fvhFeeRate_gDPB[(uGdpbLoop * fuNrOfFeePerGdpb) + uFeeLoop]->Reset();
3131 fvhFeeErrorRate_gDPB[(uGdpbLoop * fuNrOfFeePerGdpb) + uFeeLoop]->Reset();
3132 fvhFeeErrorRatio_gDPB[(uGdpbLoop * fuNrOfFeePerGdpb) + uFeeLoop]->Reset();
3133 } // for( UInt_t uFeeLoop = 0; uFeeLoop < fuNrOfFeePerGdpb; ++uFeeLoop )
3134 fvhTriggerRate[uGdpbLoop]->Reset();
3135 fvhStarTokenEvo[uGdpbLoop]->Reset();
3136 fvhStarTrigGdpbTsEvo[uGdpbLoop]->Reset();
3137 fvhStarTrigStarTsEvo[uGdpbLoop]->Reset();
3138 } // for( UInt_t uGdpbLoop = 0; uGdpbLoop < fuNrOfGdpbs; ++uGdpbLoop )
3139 /*
3140 for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
3141 {
3142 fvhModRate[ uMod ]->Reset();
3143 fvhModErrorRate[ uMod ]->Reset();
3144 fvhModErrorRatio[ uMod ]->Reset();
3145 } // for( UInt_t uMod = 0; uMod < fuNrOfModules; uMod ++ )
3146*/
3147 fdStartTime = -1;
3148}
3150{
3151 for (UInt_t uGdpbLoop = 0; uGdpbLoop < fuNrOfGdpbs; uGdpbLoop++) {
3152 for (UInt_t uFeeLoop = 0; uFeeLoop < fuNrOfFeePerGdpb; uFeeLoop++) {
3153 fvhFeeRateLong_gDPB[(uGdpbLoop * fuNrOfFeePerGdpb) + uFeeLoop]->Reset();
3154 fvhFeeErrorRateLong_gDPB[(uGdpbLoop * fuNrOfFeePerGdpb) + uFeeLoop]->Reset();
3155 fvhFeeErrorRatioLong_gDPB[(uGdpbLoop * fuNrOfFeePerGdpb) + uFeeLoop]->Reset();
3156 } // for (UInt_t uFeeLoop = 0; uFeeLoop < fuNrOfFeePerGdpb; uFeeLoop++)
3157 } // for (UInt_t uFeeLoop = 0; uFeeLoop < fuNrOfFeePerGdpb; uFeeLoop++)
3158
3159 fdStartTimeLong = -1;
3160}
3161
3163{
3164 if (kFALSE == fbPulserModeEnable) {
3165 LOG(error) << "CbmMcbm2018MonitorTof::UpdateZoomedFit => "
3166 << "Pulser mode not enabled in root macro, doinb nothing !!! ";
3167 return;
3168 } // if( kFALSE == fbPulserModeEnable )
3169
3170 // Only do something is the user defined the width he want for the zoom
3171 if (0.0 < fdFitZoomWidthPs) {
3172 // Reset summary histograms for safety
3173 fhTimeRmsZoomFitPuls->Reset();
3174 fhTimeResFitPuls->Reset();
3175
3176 Double_t dRes = 0;
3178
3179 for (UInt_t uFeeA = 0; uFeeA < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeA++)
3180 for (UInt_t uFeeB = 0; uFeeB < fuNrOfFeePerGdpb * fuNrOfGdpbs; uFeeB++)
3181 if (NULL != fvhTimeDiffPulser[uFeeA][uFeeB]) {
3182 // Check that we have at least 1 entry
3183 if (0 == fvhTimeDiffPulser[uFeeA][uFeeB]->GetEntries()) {
3184 fhTimeRmsZoomFitPuls->Fill(uFeeA, uFeeB, 0.0);
3185 fhTimeResFitPuls->Fill(uFeeA, uFeeB, 0.0);
3186 LOG(info) << "CbmMcbm2018MonitorTof::UpdateZoomedFit => Empty input "
3187 << "for FEE pair " << uFeeA << " and " << uFeeB << " !!! ";
3188 continue;
3189 } // if( 0 == fvhTimeDiffPulser[uFeeA][uFeeB]->GetEntries() )
3190
3191 // Read the peak position (bin with max counts) + total nb of entries
3192 Int_t iBinWithMax = fvhTimeDiffPulser[uFeeA][uFeeB]->GetMaximumBin();
3193 Double_t dNbCounts = fvhTimeDiffPulser[uFeeA][uFeeB]->Integral();
3194
3195 // Zoom the X axis to +/- ZoomWidth around the peak position
3196 Double_t dPeakPos = fvhTimeDiffPulser[uFeeA][uFeeB]->GetXaxis()->GetBinCenter(iBinWithMax);
3197 fvhTimeDiffPulser[uFeeA][uFeeB]->GetXaxis()->SetRangeUser(dPeakPos - fdFitZoomWidthPs,
3198 dPeakPos + fdFitZoomWidthPs);
3199
3200 // Read integral and check how much we lost due to the zoom (% loss allowed)
3201 Double_t dZoomCounts = fvhTimeDiffPulser[uFeeA][uFeeB]->Integral();
3202 if ((dZoomCounts / dNbCounts) < 0.99) {
3203 fhTimeRmsZoomFitPuls->Fill(uFeeA, uFeeB, 0.0);
3204 fhTimeResFitPuls->Fill(uFeeA, uFeeB, 0.0);
3205 LOG(warning) << "CbmMcbm2018MonitorTof::UpdateZoomedFit => Zoom too strong, "
3206 << "more than 1% loss for FEE pair " << uFeeA << " and " << uFeeB << " !!! ";
3207 continue;
3208 } // if( ( dZoomCounts / dNbCounts ) < 0.99 )
3209
3210 // Fill new RMS after zoom into summary histo
3211 fhTimeRmsZoomFitPuls->Fill(uFeeA, uFeeB, fvhTimeDiffPulser[uFeeA][uFeeB]->GetRMS());
3212
3213
3214 // Fit using zoomed boundaries + starting gaussian width, store into summary histo
3215 dRes = 0;
3216 fitFuncPairs[uFeeA][uFeeB] = new TF1(Form("fPair_%02d_%02d", uFeeA, uFeeB), "gaus",
3217 dPeakPos - fdFitZoomWidthPs, dPeakPos + fdFitZoomWidthPs);
3218 // Fix the Mean fit value around the Histogram Mean
3219 fitFuncPairs[uFeeA][uFeeB]->SetParameter(0, dZoomCounts);
3220 fitFuncPairs[uFeeA][uFeeB]->SetParameter(1, dPeakPos);
3221 fitFuncPairs[uFeeA][uFeeB]->SetParameter(2, 200.0); // Hardcode start with ~4*BinWidth, do better later
3222 // Using integral instead of bin center seems to lead to unrealistic values => no "I"
3223 fvhTimeDiffPulser[uFeeA][uFeeB]->Fit(Form("fPair_%02d_%02d", uFeeA, uFeeB), "QRM0");
3224 // Get Sigma
3225 dRes = fitFuncPairs[uFeeA][uFeeB]->GetParameter(2);
3226 // Cleanup memory
3227 delete fitFuncPairs[uFeeA][uFeeB];
3228 // Fill summary
3229 fhTimeResFitPuls->Fill(uFeeA, uFeeB, dRes / TMath::Sqrt2());
3230
3231
3232 LOG(info) << "CbmMcbm2018MonitorTof::UpdateZoomedFit => "
3233 << "For FEE pair " << uFeeA << " and " << uFeeB
3234 << " we have zoomed RMS = " << fvhTimeDiffPulser[uFeeA][uFeeB]->GetRMS() << " and a resolution of "
3235 << dRes / TMath::Sqrt2();
3236
3237 // Restore original axis state?
3238 fvhTimeDiffPulser[uFeeA][uFeeB]->GetXaxis()->UnZoom();
3239 } // loop on uFeeA and uFeeB + check if corresponding fvhTimeDiffPulser exists
3240 } // if( 0.0 < fdFitZoomWidthPs )
3241 else {
3242 LOG(error) << "CbmMcbm2018MonitorTof::UpdateZoomedFit => Zoom width not defined, "
3243 << "please use SetFitZoomWidthPs, e.g. in macro, before trying this "
3244 "update !!!";
3245 } // else of if( 0.0 < fdFitZoomWidthPs )
3246}
3247
ClassImp(CbmConverterManager)
std::string FormatDecPrintout(uint64_t ulVal, char cFill, uint uWidth)
std::string FormatHexPrintout(uint64_t ulVal, char cFill, uint uWidth, bool bUppercase)
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Histogram manager.
Bool_t bMcbmMoniTofPrintAllEpochsEna
Bool_t bMcbmMoniTofSaveHistos
Bool_t bMcbmMoniTofResetHistos
Bool_t bMcbmMoniTofUpdateZoomedFit
Bool_t bMcbmMoniTofRawDataPrint
Bool_t bMcbmMoniTofPrintAllHitsEna
static double dTsStartTime
static constexpr size_t size()
Definition KfSimdPseudo.h:2
int Int_t
bool Bool_t
void FillStarTrigInfo(gdpbv100::Message)
std::vector< ULong64_t > fvulStarTsMsb
std::vector< TH2 * > fvhRemapTot_gDPB
std::vector< TProfile2D * > fvhChannelRatePerMs_gDPB
std::vector< TH1 * > fvhRemapChCount_gDPB
std::vector< TH2 * > fvhCmdDaqVsTrig
std::vector< TH2 * > fvhGdpbResyncEnaEvoPerTs
std::vector< UInt_t > fvuPadiToGet4
TH2 * fhGet4MessType
Per GET4 in system.
void SaveAllHistos(TString sFileName="")
std::vector< TProfile * > fvhPulserTimeDiffEvoGbtxGbtx
std::vector< TProfile2D * > fvhCoincMeanAllChanGdpb
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::vector< TH1 * > fvhMsSzPerLink
std::vector< TH2 * > fvhGdpbResyncEvoPerTs
const UInt_t kuNbBinsDt
[ fuNrOfGdpbs ][ fuNrOfChannelsPerGdpb ]
std::vector< int > fviMsgCounter
std::vector< TH2 * > fvhGdpbGet4MessType
Per GET4 in gDPB.
std::vector< Int_t > fviNrOfRpc
std::vector< Bool_t > fvbFirstEpochSeen
std::vector< UInt_t > fvuStarDaqCmdLast
CbmMcbm2018TofPar * fUnpackPar
std::vector< Double_t > fdTsLastPulserHit
[ fuFeeNr ]
size_t fuMsAcceptsPercent
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
std::vector< size_t > fvMsComponentsList
FLES containers.
std::vector< TH2 * > fvhGdpbPatternResyncEvo
Int_t GetArrayIndex(Int_t gdpbId, Int_t get4Id)
std::vector< TH2 * > fvhStarTokenEvo
std::vector< ULong64_t > fvulStarTsFullLast
std::vector< TH2 * > fhHitsPerMsFirstChan_gDPB
UInt_t ConvertElinkToGet4(UInt_t uElinkIdx)
std::vector< std::vector< gdpbv100::Message > > fvmEpSupprBuffer
Buffer for suppressed epoch processing.
std::vector< ULong64_t > fvulCurrentEpochFull
Epoch cycle from the Ms Start message and Epoch counter flip.
std::vector< ULong64_t > fvulGdpbTsMsb
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
std::vector< UInt_t > fvuGet4ToElink
std::chrono::time_point< std::chrono::system_clock > fTimeLastHistoSaving
std::vector< std::vector< bool > > fvvbGdpbLastMissmatchPattern
void PrintGenInfo(gdpbv100::Message)
std::vector< TProfile * > fvhStarTrigStarTsEvo
std::vector< UInt_t > fvuElinkToGet4
5 FEE with 8 GET4 each
std::vector< UInt_t > fvuStarTrigCmdLast
std::vector< TH2 * > fvhRemapChRate_gDPB
std::vector< TH1 * > fvhFeeRateLong_gDPB
void PrintSlcInfo(gdpbv100::Message)
void PrintSysInfo(gdpbv100::Message)
ULong64_t fulCurrentEpochTime
Epoch + Epoch Cycle.
std::vector< TH2 * > fvhChannelRate_gDPB
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
std::vector< ULong64_t > fvulGdpbTsLsb
void FillPattInfo(gdpbv100::Message)
std::vector< std::vector< bool > > fvvbGdpbLastEnablePattern
Exclude from dictionnary.
std::vector< std::vector< bool > > fvvbGdpbLastResyncPattern
Exclude from dictionnary.
std::vector< TH2 * > fvhRawFt_gDPB
TODO: Channel rate plots!
std::vector< TH1 * > fvhFeeRate_gDPB
std::vector< Int_t > fviRpcSide
void ProcessEpochCycle(uint64_t ulCycleData)
std::vector< Int_t > fviRpcType
std::vector< TH2 * > fvhGdpbEnableEvoPerTs
std::vector< TH2 * > fvhGdpbMissmatchEnaEvoPerTs
std::vector< Int_t > fviModuleId
std::vector< ULong64_t > fvulCurrentEpoch
std::vector< TH1 * > fvhTriggerRate
std::vector< std::vector< TH1 * > > fvhTimeDiffPulser
std::vector< TH2 * > fvhGdpbStateEvoPerTs
std::vector< std::vector< UInt_t > > fvuCoincNbHitsLastMs
[ fuFeeNr ]
std::vector< TH1 * > fvhFeeErrorRateLong_gDPB
void FillHitInfo(gdpbv100::Message)
std::vector< std::vector< UInt_t > > fvvuChanNbHitsPerMs
std::vector< UInt_t > fvuStarTokenLast
std::vector< TH1 * > fvhTokenMsgType
std::vector< TH2 * > fvhRawTot_gDPB
std::vector< TProfile * > fvhFeeErrorRatio_gDPB
std::vector< TH2 * > fvhGdpbPatternEnableEvo
std::vector< TH2 * > fvhGdpbMissmatchEvoPerTs
Exclude from dictionnary.
std::vector< TH1 * > fvhChCount_gDPB
std::vector< TProfile * > fvhFeeErrorRatioLong_gDPB
static const UInt_t kuNbGet4PerGbtx
std::vector< UInt_t > fvuGet4ToPadi
std::vector< TH2 * > fvhGdpbPatternMissmatchEvo
Per MS in gDPB.
TH2 * fhScmScalerCounters
Slow control messages.
std::vector< std::vector< Double_t > > fvdCoincTsLastHit
[ fuNrOfGdpbs ][ fuNrOfChannelsPerGdpb ]
std::vector< TProfile * > fvhMsSzTimePerLink
std::vector< TH1 * > fvhFeeErrorRate_gDPB
std::map< UInt_t, UInt_t > fGdpbIdIndexMap
Map of ID to index for the gDPBs.
std::vector< TH2 * > fvhGdpbGet4ChanErrors
TH2 * fhPatternMissmatch
Pattern messages per gDPB.
std::vector< UInt_t > fvuFeeNbHitsLastMs
Buffer for pulser channels.
std::vector< ULong64_t > fvulStarTsMid
std::vector< TH2 * > fvhCoincMapAllChanGdpb
std::vector< TProfile * > fvhStarTrigGdpbTsEvo
std::vector< TH2 * > fvhGdpbGet4ChanScm
std::vector< std::vector< TProfile * > > fvvhPulserTimeDiffEvoGdpbGdpb
std::vector< ULong64_t > fvulGdpbTsFullLast
std::vector< ULong64_t > fvulCurrentEpochCycle
void FillEpochInfo(gdpbv100::Message)
Data class with information on a STS local track.
uint16_t getGdpbHitIs24b() const
uint16_t getStarTrigMsgIndex() const
uint32_t getGdpbEpEpochNb() const
uint16_t getGdpbHit32Tot() const
uint16_t getGdpbSysPattType() const
uint64_t getStarTsMidStarC() const
uint16_t getGdpbSysSubType() const
uint64_t getGdpbTsLsbStarB() const
uint32_t getGdpbSlcChan() const
bool getGdpbEpMissmatch() const
double getMsgFullTimeD(uint64_t epoch) const
Returns expanded and adjusted time of message in double (in ns)
uint16_t getGdpbSysPattIndex() const
void setGdpbGenChipId(uint32_t v)
uint16_t getGdpbHitFineTs() const
uint32_t getGdpbSlcData() const
void setGdpbEpEpochNb(uint32_t v)
bool getGdpbEpSync() const
uint32_t getGdpbSysFwErrResync() const
uint64_t getStarTsMsbStarB() const
uint32_t getGdpbHitFullTs() const
uint32_t getStarTrigCmdStarD() const
uint32_t getGdpbSysPattPattern() const
uint32_t getGdpbSlcType() const
bool isStarTrigger() const
Returns true is message type is MSG_STAR_TRI_A, _B, _C, _D (STAR Trigger message)
bool getGdpbEpEpochLoss() const
uint32_t getStarDaqCmdStarD() const
uint64_t getGdpbTsMsbStarA() const
uint16_t getGdpbGenChipId() const
uint16_t getGdpbSysErrUnused() const
void printDataCout(unsigned kind=msg_print_Prefix|msg_print_Data, uint32_t epoch=0) const
Print message in human readable format to cout.
bool getGdpbEpDataLoss() const
uint32_t getStarTokenStarD() const
bool getGdpbEpLinkId() const
uint32_t getGdpbSlcEdge() const
uint64_t getStarTsLsbStarD() const
uint8_t getMessageType() const
Returns the message type. Valid for all message types. 4 bit.
uint32_t getGdpbSysUnkwData() const
uint64_t getData() const
uint16_t getGdpbSysErrData() const
bool getGdpbSysErrEdge() const
uint16_t getGdpbSysErrChanId() const
uint64_t getMsgFullTime(uint64_t epoch) const
Returns expanded and adjusted time of message (in ns)
uint16_t getGdpbHitChanId() const
const double kdClockCycleSizeNs
const uint64_t kulEpochCycleBins
@ GET4_V2X_ERR_LOST_EVT
@ GET4_V2X_ERR_TOT_RANGE
@ GET4_V2X_ERR_FIFO_WRITE
@ GET4_V2X_ERR_DLL_LOCK
@ GET4_V2X_ERR_EPOCH_OVERF
@ GET4_V2X_ERR_EP_CNT_SYNC
@ GET4_V2X_ERR_UNKNOWN
@ GET4_V2X_ERR_READ_INIT
@ GET4_V2X_ERR_DLL_RESET
@ GET4_V2X_ERR_ADD_RIS_EDG
@ GET4_V2X_ERR_TOK_RING_ST
@ GET4_V2X_ERR_TOKEN
@ GET4_V2X_ERR_TOT_OVERWRT
@ GET4_V2X_ERR_READOUT_ERR
@ GET4_V2X_ERR_EVT_DISCARD
@ GET4_V2X_ERR_UNPAIR_FALL
@ GET4_V2X_ERR_CHAN_STATE
@ GET4_V2X_ERR_SYNC
@ GET4_V2X_ERR_SEQUENCE_ER
const uint32_t kuChipIdMergedEpoch
const uint32_t kuFeePulserChannel
const uint32_t kuEpochCounterSz
const uint64_t kulEpochCycleFieldSz
@ SYS_GET4_SYNC_MISS