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