CbmRoot
Loading...
Searching...
No Matches
CbmMcbm2018MonitorMuchLite.cxx
Go to the documentation of this file.
1/* Copyright (C) 2018-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: David Emschermann [committer], Pierre-Alain Loizeau */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmMcbm2018MonitorMuchLite -----
8// ----- Created 11/05/18 by P.-A. Loizeau -----
9// ----- Modified 11/05/18 by Ajit kumar -----
10// ----- Modified 05/03/19 by Vikas Singhal -----
11// ----- -----
12// -----------------------------------------------------------------------------
13
15
16// Data
17
18// CbmRoot
20#include "CbmHistManager.h"
21#include "CbmMcbm2018MuchPar.h"
22
23// FairRoot
24#include "FairRootManager.h"
25#include "FairRun.h"
26#include "FairRunOnline.h"
27#include "FairRuntimeDb.h"
28#include <Logger.h>
29
30// Root
31#include "TClonesArray.h"
32#include "THttpServer.h"
33#include "TMath.h"
34#include "TROOT.h"
35#include "TRandom.h"
36#include "TString.h"
37#include "TStyle.h"
38#include <TFile.h>
39
40// C++11
41#include <bitset>
42
43// C/C++
44#include <iomanip>
45#include <iostream>
46
47#include <stdint.h>
48
52
53
56 , fbMuchMode(kFALSE)
57 , fvbMaskedComponents()
58 , fvMsComponentsList()
59 , fuNbCoreMsPerTs(0)
60 , fuNbOverMsPerTs(0)
61 ,
62 //uTimeBin(1e-9),
63 fbIgnoreOverlapMs(kFALSE)
64 , fUnpackParMuch(NULL)
65 , fuNrOfDpbs(0)
66 , fDpbIdIndexMap()
67 , fvbCrobActiveFlag()
68 , fuNbFebs(0)
69 , fuNbStsXyters(0)
70 ,
71 //fvdFebAdcGain(),
72 //fvdFebAdcOffs(),
73 /*
74 fuNrOfDpbs(0),
75 fDpbIdIndexMap(),
76 fuNbStsXyters(0),
77 fUnpackParMuch->GetNbChanPerAsic()(0),
78 fuNbFebs(0),
79 */
80 fsHistoFileFullname("data/HistosMonitorMuch.root")
81 , fbPrintMessages(kFALSE)
82 , fPrintMessCtrl(stsxyter::MessagePrintMask::msg_print_Human)
83 , fulCurrentTsIdx(0)
84 , fulCurrentMsIdx(0)
85 , fmMsgCounter()
86 , fuCurrentEquipmentId(0)
87 , fuCurrDpbId(0)
88 , fuCurrDpbIdx(0)
89 , fiRunStartDateTimeSec(-1)
90 , fiBinSizeDatePlots(-1)
91 , fvulCurrentTsMsb()
92 , fvuCurrentTsMsbCycle()
93 , fvuInitialHeaderDone()
94 , fvuInitialTsMsbCycleHeader()
95 , fvuElinkLastTsHit()
96 , fvulChanLastHitTime()
97 , fvdChanLastHitTime()
98 , fvdPrevMsTime()
99 , fvdMsTime()
100 , fvuChanNbHitsInMs()
101 , fvdChanLastHitTimeInMs()
102 , fvusChanLastHitAdcInMs()
103 ,
104 // fvmChanHitsInTs(),
105 prevtime_new(0.0)
106 , prevTime(0.0)
107 , prevAsic(0.0)
108 , prevChan(0.0)
109 , fdStartTime(-1.0)
110 , fdStartTimeMsSz(-1.0)
111 , ftStartTimeUnix(std::chrono::steady_clock::now())
112 , fvmHitsInMs()
113 , fvmAsicHitsInMs()
114 , fvmFebHitsInMs()
115 , fuMaxNbMicroslices(100)
116 , fiTimeIntervalRateUpdate(10)
117 , fviFebTimeSecLastRateUpdate()
118 , fviFebCountsSinceLastRateUpdate()
119 , fvdFebChanCountsSinceLastRateUpdate()
120 ,
121 /*fbLongHistoEnable( kFALSE ),
122 fuLongHistoNbSeconds( 0 ),
123 fuLongHistoBinSizeSec( 0 ),
124 fuLongHistoBinNb( 0 ),*/
125 Counter(0)
126 , Counter1(0)
127 , fHM(new CbmHistManager())
128 , fhMuchMessType(NULL)
129 , fhMuchSysMessType(NULL)
130 , fhMuchFebChanAdcRaw_combined(NULL)
131 , fhMuchMessTypePerDpb(NULL)
132 , fhMuchSysMessTypePerDpb(NULL)
133 , fhStatusMessType(NULL)
134 , fhMsStatusFieldType(NULL)
135 , fhMuchHitsElinkPerDpb(NULL)
136 , fhRate(NULL)
137 , fhRateAdcCut(NULL)
138 , fHistPadDistr()
139 , fRealHistPadDistr()
140 , fhMuchFebChanCntRaw()
141 ,
142 //fhMuchFebChanCntRawGood(),
143 fhMuchFebChanAdcRaw()
144 , fhMuchFebChanAdcRawProf()
145 , fhMuchFebChanRawTs()
146 , fhMuchFebChanHitRateEvo()
147 , fhMuchFebChanHitRateProf()
148 ,
149 //fhMuchFebAsicHitRateEvo(),
150 fhMuchFebHitRateEvo()
151 , fhMuchFebHitRateEvo_mskch()
152 , fhMuchFebHitRateEvo_mskch_adccut()
153 , fhMuchFebHitRateEvo_WithoutDupli()
154 , fdMuchFebChanLastTimeForDist()
155 , fhMuchFebChanDistT()
156 , fhMuchFebDuplicateHitProf()
157 , fcMsSizeAll(NULL)
158{
159}
160
161
163
164
166{
167 LOG(info) << "Initializing flib StsXyter unpacker for MUCH";
168
169 FairRootManager* ioman = FairRootManager::Instance();
170 if (ioman == NULL) { LOG(fatal) << "No FairRootManager instance"; }
171
172 return kTRUE;
173}
174
176{
177 LOG(info) << "Setting parameter containers for " << GetName();
178 fUnpackParMuch = (CbmMcbm2018MuchPar*) (FairRun::Instance()->GetRuntimeDb()->getContainer("CbmMcbm2018MuchPar"));
179}
180
182{
183 LOG(info) << "Init parameter containers for " << GetName();
184
185 Bool_t bInit = InitMuchParameters();
186 if (kTRUE == bInit) CreateHistograms();
187
188 return bInit;
189}
190
192{
193 LOG(info) << "ReInit parameter containers for " << GetName();
194
195 return InitMuchParameters();
196}
197
198
200{
201
203 LOG(info) << "Nr. of MUCH DPBs: " << fuNrOfDpbs;
204
205 fDpbIdIndexMap.clear();
206 for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
208 LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = 0x" << std::setw(4) << std::hex
209 << fUnpackParMuch->GetDpbId(uDpb) << std::dec << " => " << fDpbIdIndexMap[fUnpackParMuch->GetDpbId(uDpb)];
210 } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
211
213 LOG(info) << "Nr. of FEBs: " << fuNbFebs;
214
216 LOG(info) << "Nr. of StsXyter ASICs: " << fuNbStsXyters;
217
219 //fvdFebAdcGain.resize( fuNrOfDpbs );
220 //fvdFebAdcOffs.resize( fuNrOfDpbs );
221 for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
223 //fvdFebAdcGain[ uDpb ].resize( fUnpackParMuch->GetNbCrobsPerDpb() );
224 //fvdFebAdcOffs[ uDpb ].resize( fUnpackParMuch->GetNbCrobsPerDpb() );
225 for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParMuch->GetNbCrobsPerDpb(); ++uCrobIdx) {
226 fvbCrobActiveFlag[uDpb][uCrobIdx] = fUnpackParMuch->IsCrobActive(uDpb, uCrobIdx);
227 // fvdFebAdcGain[ uDpb ][ uCrobIdx ].resize( fUnpackParMuch->GetNbFebsPerCrob(), 0.0 );
228 //fvdFebAdcOffs[ uDpb ][ uCrobIdx ].resize( fUnpackParMuch->GetNbFebsPerCrob(), 0.0 );
229 } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParMuch->GetNbCrobsPerDpb(); ++uCrobIdx )
230 } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
231
232 for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
233 for (UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParMuch->GetNbCrobsPerDpb(); ++uCrobIdx) {
234 LOG(info) << Form("DPB #%02u CROB #%02u Active: ", uDpb, uCrobIdx) << fvbCrobActiveFlag[uDpb][uCrobIdx];
235 } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackParMuch->GetNbCrobsPerDpb(); ++uCrobIdx )
236 } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
237
238 if (fbBinningFw) LOG(info) << "Unpacking data in bin sorter FW mode";
239 else
240 LOG(info) << "Unpacking data in full time sorter FW mode (legacy)";
241
242 // Internal status initialization
248 for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
249 fvulCurrentTsMsb[uDpb] = 0;
250 fvuCurrentTsMsbCycle[uDpb] = 0;
251 fvuInitialHeaderDone[uDpb] = kFALSE;
253 } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
254
263
264 //fvdMsTime.resize( fuMaxNbMicroslices );
265 //fvuChanNbHitsInMs.resize( fuNbStsXyters );
266 //fvdChanLastHitTimeInMs.resize( fuNbStsXyters );
267 //fvusChanLastHitAdcInMs.resize( fuNbStsXyters );
268 //fvmAsicHitsInMs.resize( fuNbStsXyters );
269
270 for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbFebs; ++uXyterIdx) {
276 fvmAsicHitsInMs[uXyterIdx].clear();
277
278 for (UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerAsic(); ++uChan) {
279 fvulChanLastHitTime[uXyterIdx][uChan] = 0;
280 fvdChanLastHitTime[uXyterIdx][uChan] = -1.0;
281
282 fvuChanNbHitsInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
283 fvdChanLastHitTimeInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
284 fvusChanLastHitAdcInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
285 for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
286 fvuChanNbHitsInMs[uXyterIdx][uChan][uMsIdx] = 0;
287 fvdChanLastHitTimeInMs[uXyterIdx][uChan][uMsIdx] = -1.0;
288 fvusChanLastHitAdcInMs[uXyterIdx][uChan][uMsIdx] = 0;
289 } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
290 } // for( UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerAsic(); ++uChan )
291 } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
292
293 LOG(info) << "CbmMcbm2018MonitorMuchLite::ReInitContainers => Changed "
294 "fvuChanNbHitsInMs size "
295 << fvuChanNbHitsInMs.size() << " VS " << fuNbFebs;
296 LOG(info) << "CbmMcbm2018MonitorMuchLite::ReInitContainers => Changed "
297 "fvuChanNbHitsInMs size "
298 << fvuChanNbHitsInMs[0].size() << " VS " << fUnpackParMuch->GetNbChanPerAsic();
299 LOG(info) << "CbmMcbm2018MonitorMuchLite::ReInitContainers => Changed "
300 "fvuChanNbHitsInMs size "
301 << fvuChanNbHitsInMs[0][0].size() << " VS " << fuMaxNbMicroslices;
302
303 fvmFebHitsInMs.resize(fuNbFebs);
308 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
309 fvmFebHitsInMs[uFebIdx].clear();
312 } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
313
315 // SmxErrInitializeVariables();
317
318 return kTRUE;
319}
320
321void CbmMcbm2018MonitorMuchLite::AddMsComponentToList(size_t component, UShort_t /*usDetectorId*/)
322{
324 for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
325 if (component == fvMsComponentsList[uCompIdx]) return;
326
328 if (kiMaxNbFlibLinks <= component) {
329 LOG(error) << "CbmMcbm2018MonitorMuchLite::AddMsComponentToList => "
330 << "Ignored the addition of component " << component << " as it is above the hadcoded limit of "
331 << static_cast<Int_t>(kiMaxNbFlibLinks) << " !!!!!!!!! "
332 << "\n"
333 << " To change this behavior check kiMaxNbFlibLinks in "
334 "CbmMcbm2018MonitorMuchLite.cxx";
335 return;
336 } // if( kiMaxNbFlibLinks <= component )
337
338
340 fvMsComponentsList.push_back(component);
341 LOG(info) << "CbmMcbm2018MonitorMuchLite::AddMsComponentToList => Added component: " << component;
342
344 if (NULL == fhMsSz[component]) {
345 TString sMsSzName = Form("MsSz_link_%02lu", component);
346 TString sMsSzTitle = Form("Size of MS for nDPB of link %02lu; Ms Size [bytes]", component);
347 fhMsSz[component] = new TH1F(sMsSzName.Data(), sMsSzTitle.Data(), 160000, 0., 20000.);
348 fHM->Add(sMsSzName.Data(), fhMsSz[component]);
349
350 sMsSzName = Form("MsSzTime_link_%02lu", component);
351 sMsSzTitle = Form("Size of MS vs time for gDPB of link %02lu; Time[s] ; Ms Size [bytes]", component);
352 fhMsSzTime[component] = new TProfile(sMsSzName.Data(), sMsSzTitle.Data(), 15000, 0., 300.);
353 fHM->Add(sMsSzName.Data(), fhMsSzTime[component]);
354
355 if (NULL != fcMsSizeAll) {
356 fcMsSizeAll->cd(1 + component);
357 gPad->SetLogy();
358 fhMsSzTime[component]->Draw("hist le0");
359 } // if( NULL != fcMsSizeAll )
360 LOG(info) << "Added MS size histo for component: " << component << " (DPB)";
361
362 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
363 if (server) {
364 server->Register("/FlibRaw", fhMsSz[component]);
365 server->Register("/FlibRaw", fhMsSzTime[component]);
366 } // if( server )
367 } // if( NULL == fhMsSz[ component ] )
368}
369
370void CbmMcbm2018MonitorMuchLite::SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
371{
372 fuNbCoreMsPerTs = uCoreMsNb;
373 fuNbOverMsPerTs = uOverlapMsNb;
374 //LOG(info) <<" fuNbCoreMsPerTs "<<fuNbCoreMsPerTs<<" fuNbOverMsPerTs "<<fuNbOverMsPerTs;
375 UInt_t uNbMsTotal = fuNbCoreMsPerTs + fuNbOverMsPerTs;
376
377 if (fuMaxNbMicroslices < uNbMsTotal) {
378 fuMaxNbMicroslices = uNbMsTotal;
379
384 for (UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx) {
388 for (UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerAsic(); ++uChan) {
389 fvuChanNbHitsInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
390 fvdChanLastHitTimeInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
391 fvusChanLastHitAdcInMs[uXyterIdx][uChan].resize(fuMaxNbMicroslices);
392 for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
393 fvuChanNbHitsInMs[uXyterIdx][uChan][uMsIdx] = 0;
394 fvdChanLastHitTimeInMs[uXyterIdx][uChan][uMsIdx] = -1.0;
395 fvusChanLastHitAdcInMs[uXyterIdx][uChan][uMsIdx] = 0;
396 } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
397 } // for( UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerAsic(); ++uChan )
398 } // for( UInt_t uXyterIdx = 0; uXyterIdx < fuNbStsXyters; ++uXyterIdx )
399 LOG(info) << "CbmMcbm2018MonitorMuchLite::DoUnpack => Changed "
400 "fvuChanNbHitsInMs size "
401 << fvuChanNbHitsInMs.size() << " VS " << fuNbStsXyters;
402 LOG(info) << "CbmMcbm2018MonitorMuchLite::DoUnpack => Changed "
403 "fvuChanNbHitsInMs size "
404 << fvuChanNbHitsInMs[0].size() << " VS " << fUnpackParMuch->GetNbChanPerAsic();
405 LOG(info) << "CbmMcbm2018MonitorMuchLite::DoUnpack => Changed "
406 "fvuChanNbHitsInMs size "
407 << fvuChanNbHitsInMs[0][0].size() << " VS " << fuMaxNbMicroslices;
408 } // if( fuMaxNbMicroslices < uNbMsTotal )
409}
410
412{
413 TString sHistName {""};
414 TString title {""};
415
416 sHistName = "hMessageType";
417 title = "Nb of message for each type; Type";
418 fhMuchMessType = new TH1I(sHistName, title, 6, 0., 6.);
419 fhMuchMessType->GetXaxis()->SetBinLabel(1, "Dummy");
420 fhMuchMessType->GetXaxis()->SetBinLabel(2, "Hit");
421 fhMuchMessType->GetXaxis()->SetBinLabel(3, "TsMsb");
422 fhMuchMessType->GetXaxis()->SetBinLabel(4, "Epoch");
423 fhMuchMessType->GetXaxis()->SetBinLabel(5, "Status");
424 fhMuchMessType->GetXaxis()->SetBinLabel(6, "Empty");
425
426
427 sHistName = "hSysMessType";
428 title = "Nb of system message for each type; System Type";
429 fhMuchSysMessType = new TH1I(sHistName, title, 17, 0., 17.);
430
431 sHistName = "hMuchFebChanAdcRaw_combined";
432 title = "ADC hist combined";
434 new TH1I(sHistName, title, stsxyter::kuHitNbAdcBins, -0.5, stsxyter::kuHitNbAdcBins - 0.5);
435
436 LOG(debug) << "Initialized 1st Histo";
437 sHistName = "hMessageTypePerDpb";
438 title = "Nb of message of each type for each DPB; DPB; Type";
439 fhMuchMessTypePerDpb = new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 6, 0., 6.);
440 fhMuchMessTypePerDpb->GetYaxis()->SetBinLabel(1, "Dummy");
441 fhMuchMessTypePerDpb->GetYaxis()->SetBinLabel(2, "Hit");
442 fhMuchMessTypePerDpb->GetYaxis()->SetBinLabel(3, "TsMsb");
443 fhMuchMessTypePerDpb->GetYaxis()->SetBinLabel(4, "Epoch");
444 fhMuchMessTypePerDpb->GetYaxis()->SetBinLabel(5, "Status");
445 fhMuchMessTypePerDpb->GetYaxis()->SetBinLabel(6, "Empty");
446
447 for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
449 sHistName = Form("HistPadDistr_Module_%01u", uModuleId);
450 title = Form("Pad distribution for, Module #%01u; ", uModuleId);
451
452 //Below for Rectangular Module shape VS
453 fHistPadDistr.push_back(new TH2I(sHistName, title, 23, -0.5, 22.5, 97, -0.5, 96.5));
454
455 sHistName = Form("RealHistPadDistr_Module_%01u", uModuleId);
456 title = Form("Progressive Pad distribution for, Module #%01u; ", uModuleId);
457 //Below for Progressive Geometry Module shape VS
458 fRealHistPadDistr.push_back(new TH2D(sHistName, title, 500, -0.5, 499.5, 1000, -0.5, 999.5));
459
460
462 sHistName = Form("hMuchFebDuplicateHitProf_%01u", uModuleId);
463 title = Form("FEB wise Duplicate Hit for Module #%01u; FEB []; Hit []", uModuleId);
464 if (uModuleId == 0)
465 //fhMuchFebDuplicateHitProf.push_back( new TProfile(sHistName, title,fUnpackParMuch->GetNrOfFebsInGemA(), -0.5, fUnpackParMuch->GetNrOfFebsInGemA() - 0.5 ) );
466 fhMuchFebDuplicateHitProf.push_back(new TProfile(sHistName, title, 18, -0.5, 18 - 0.5));
467 if (uModuleId == 1)
468 //fhMuchFebDuplicateHitProf.push_back( new TProfile(sHistName, title,fUnpackParMuch->GetNrOfFebsInGemB(), -0.5, fUnpackParMuch->GetNrOfFebsInGemB() - 0.5 ) );
469 fhMuchFebDuplicateHitProf.push_back(new TProfile(sHistName, title, 18, -0.5, 18 - 0.5));
470 }
471
472 sHistName = "hRate";
473 title = "Rate in kHz";
474 fhRate = new TH1I(sHistName, title, 10000, -0.5, 9999.5);
475
476 sHistName = "hRateAdcCut";
477 title = "Rate in kHz with Adc cut";
478 fhRateAdcCut = new TH1I(sHistName, title, 10000, -0.5, 9999.5);
479
480
481 sHistName = "hFEBcount";
482 title = "Count vs FEB number; FEB Number; Count";
483 fhFEBcount = new TH1I(sHistName, title, 40, -0.5, 39.5);
484
485
486 sHistName = "hSysMessTypePerDpb";
487 title = "Nb of system message of each type for each DPB; DPB; System Type";
488 fhMuchSysMessTypePerDpb = new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 17, 0., 17.);
489
490 sHistName = "hStatusMessType";
491 title = "Nb of status message of each type for each DPB; ASIC; Status Type";
492 fhStatusMessType = new TH2I(sHistName, title, fuNbStsXyters, 0, fuNbStsXyters, 16, 0., 16.);
493
494
495 sHistName = "hMsStatusFieldType";
496 title = "For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []";
497 fhMsStatusFieldType = new TH2I(sHistName, title, 16, -0.5, 15.5, 2, -0.5, 1.5);
498
499 //For mCBM March 2019 data taking we will have only one eLink enable for each FEB
500 sHistName = "hMuchHitsElinkPerDpb";
501 title = "Nb of hit messages per eLink for each DPB; DPB; eLink; Hits nb []";
502 fhMuchHitsElinkPerDpb = new TH2I(sHistName, title, fuNrOfDpbs, 0, fuNrOfDpbs, 42, 0., 42.);
503
504 LOG(debug) << "Initialized 2nd Histo";
505 /*
506 // Number of rate bins =
507 // 9 for the sub-unit decade
508 // + 9 for each unit of each decade * 10 for the subdecade range
509 // + 1 for the closing bin top edge
510 const Int_t iNbDecadesRate = 9;
511 const Int_t iNbStepsDecade = 9;
512 const Int_t iNbSubStepsInStep = 10;
513 const Int_t iNbBinsRate = iNbStepsDecade
514 + iNbStepsDecade * iNbSubStepsInStep * iNbDecadesRate
515 + 1;
516 Double_t dBinsRate[iNbBinsRate];
517 // First fill sub-unit decade
518 for( Int_t iSubU = 0; iSubU < iNbStepsDecade; iSubU ++ )
519 dBinsRate[ iSubU ] = 0.1 * ( 1 + iSubU );
520 std::cout << std::endl;
521 // Then fill the main decades
522 Double_t dSubstepSize = 1.0 / iNbSubStepsInStep;
523 for( Int_t iDecade = 0; iDecade < iNbDecadesRate; iDecade ++)
524 {
525 Double_t dBase = std::pow( 10, iDecade );
526 Int_t iDecadeIdx = iNbStepsDecade
527 + iDecade * iNbStepsDecade * iNbSubStepsInStep;
528 for( Int_t iStep = 0; iStep < iNbStepsDecade; iStep++ )
529 {
530 Int_t iStepIdx = iDecadeIdx + iStep * iNbSubStepsInStep;
531 for( Int_t iSubStep = 0; iSubStep < iNbSubStepsInStep; iSubStep++ )
532 {
533 dBinsRate[ iStepIdx + iSubStep ] = dBase * (1 + iStep)
534 + dBase * dSubstepSize * iSubStep;
535 } // for( Int_t iSubStep = 0; iSubStep < iNbSubStepsInStep; iSubStep++ )
536 } // for( Int_t iStep = 0; iStep < iNbStepsDecade; iStep++ )
537 } // for( Int_t iDecade = 0; iDecade < iNbDecadesRate; iDecade ++)
538 dBinsRate[ iNbBinsRate - 1 ] = std::pow( 10, iNbDecadesRate );
539*/
540 LOG(debug) << "Initialized 3rd Histo";
542 //UInt_t uAlignedLimit = fuLongHistoNbSeconds - (fuLongHistoNbSeconds % fuLongHistoBinSizeSec);
543 // UInt_t uAlignedLimit = 0;
544
545 // UInt_t uNbBinEvo = (32768 + 1) * 2;
546 // Double_t dMaxEdgeEvo = stsxyter::kdClockCycleNs
547 // * static_cast< Double_t >( uNbBinEvo ) / 2.0;
548 // Double_t dMinEdgeEvo = dMaxEdgeEvo * -1.0;
549
550 //UInt_t uNbBinDt = static_cast<UInt_t>( (fdCoincMax - fdCoincMin )/stsxyter::kdClockCycleNs );
551
552 // Miscroslice properties histos
553 for (Int_t component = 0; component < kiMaxNbFlibLinks; component++) {
554 fhMsSz[component] = NULL;
555 fhMsSzTime[component] = NULL;
556 } // for( Int_t component = 0; component < kiMaxNbFlibLinks; component ++ )
557
559 // fhMuchFebChanDtCoinc.resize( fuNbFebs );
560 // fhMuchFebChanCoinc.resize( fuNbFebs );
561 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
563 sHistName = Form("hMuchFebChanCntRaw_%03u", uFebIdx);
564 title = Form("Hits Count per channel, FEB #%03u; Channel; Hits []", uFebIdx);
565 fhMuchFebChanCntRaw.push_back(
566 new TH1I(sHistName, title, fUnpackParMuch->GetNbChanPerFeb(), -0.5, fUnpackParMuch->GetNbChanPerFeb() - 0.5));
567
568 //sHistName = Form( "hMuchFebChanCntRawGood_%03u", uFebIdx );
569 //title = Form( "Hits Count per channel in good MS (SX2 bug flag off), FEB #%03u; Channel; Hits []", uFebIdx );
570 //fhMuchFebChanCntRawGood.push_back( new TH1I(sHistName, title,
571 // fUnpackParMuch->GetNbChanPerFeb(), -0.5, fUnpackParMuch->GetNbChanPerFeb() - 0.5 ) );
572
573 sHistName = Form("fhMuchFebSpill_%03u", uFebIdx);
574 title = Form("Time distribution of hits, FEB #%03u; Time ; Counts ", uFebIdx);
575 fhMuchFebSpill.push_back(new TH1I(sHistName, title, 1000, 0, 1000));
576
577
578 sHistName = Form("hMuchChannelTime_FEB%03u", uFebIdx);
579 title = Form("Time vs Channel, FEB #%03u; TIME(s) ; CHANNEL ", uFebIdx);
580 fhMuchChannelTime.push_back(new TH2I(sHistName, title, 1000, 0, 1000, 129, -0.5, 128.5));
581
582
583 sHistName = Form("hMuchFebADC_%03u", uFebIdx);
584 title = Form("CHANNEL vs ADC, FEB #%03u; CHANNEL ; ADC ", uFebIdx);
585 fhMuchFebADC.push_back(new TH2I(sHistName, title, 129, -0.5, 128.5, 34, -0.5, 33.5));
586
587
589 sHistName = Form("hMuchFebChanAdcRaw_%03u", uFebIdx);
590 title = Form("Raw Adc distribution per channel, FEB #%03u; Channel []; Adc "
591 "[]; Hits []",
592 uFebIdx);
593 fhMuchFebChanAdcRaw.push_back(new TH2I(sHistName, title, fUnpackParMuch->GetNbChanPerFeb(), -0.5,
596
598 sHistName = Form("hMuchFebChanAdcRawProfc_%03u", uFebIdx);
599 title = Form("Raw Adc prodile per channel, FEB #%03u; Channel []; Adc []", uFebIdx);
600 fhMuchFebChanAdcRawProf.push_back(
601 new TProfile(sHistName, title, fUnpackParMuch->GetNbChanPerFeb(), -0.5, fUnpackParMuch->GetNbChanPerFeb() - 0.5));
602
604 //sHistName = Form( "hMuchFebChanAdcCal_%03u", uFebIdx );
605 //title = Form( "Cal. Adc distribution per channel, FEB #%03u; Channel []; Adc [e-]; Hits []", uFebIdx );
606 //fhMuchFebChanAdcCal.push_back( new TH2I(sHistName, title,
607 // fUnpackParMuch->GetNbChanPerFeb(), -0.5, fUnpackParMuch->GetNbChanPerFeb() - 0.5,
608 // 50, 0., 100000. ) );
609
611 //sHistName = Form( "hMuchFebChanAdcCalProfc_%03u", uFebIdx );
612 //title = Form( "Cal. Adc prodile per channel, FEB #%03u; Channel []; Adc [e-]", uFebIdx );
613 //fhMuchFebChanAdcCalProf.push_back( new TProfile(sHistName, title,
614 // fUnpackParMuch->GetNbChanPerFeb(), -0.5, fUnpackParMuch->GetNbChanPerFeb() - 0.5 ) );
615
617 sHistName = Form("hMuchFebChanRawTs_%03u", uFebIdx);
618 title = Form("Raw Timestamp distribution per channel, FEB #%03u; Channel "
619 "[]; Ts []; Hits []",
620 uFebIdx);
621 fhMuchFebChanRawTs.push_back(new TH2I(sHistName, title, fUnpackParMuch->GetNbChanPerFeb(), -0.5,
624
626 sHistName = Form("hMuchFebChanRateEvo_%03u", uFebIdx);
627 title = Form("Hits per second & channel in FEB #%03u; Time [s]; Channel []; Hits []", uFebIdx);
628 fhMuchFebChanHitRateEvo.push_back(new TH2I(sHistName, title, 1800, 0, 1800, fUnpackParMuch->GetNbChanPerFeb(), -0.5,
630
632 sHistName = Form("hMuchFebChanRateProf_%03u", uFebIdx);
633 title = Form("Hits per second for each channel in FEB #%03u; Channel []; Hits/s []", uFebIdx);
634 fhMuchFebChanHitRateProf.push_back(
635 new TProfile(sHistName, title, fUnpackParMuch->GetNbChanPerFeb(), -0.5, fUnpackParMuch->GetNbChanPerFeb() - 0.5));
636
638 // sHistName = Form( "hMuchFebAsicRateEvo_%03u", uFebIdx );
639 // title = Form( "Hits per second & StsXyter in FEB #%03u; Time [s]; Asic []; Hits []", uFebIdx );
640 // fhMuchFebAsicHitRateEvo.push_back( new TH2I( sHistName, title, 1800, 0, 1800,
641 // fUnpackParMuch->GetNbAsicsPerFeb(), -0.5, fUnpackParMuch->GetNbAsicsPerFeb() - 0.5 ) );
642
644 sHistName = Form("hMuchFebRateEvo_%03u", uFebIdx);
645 title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
646 fhMuchFebHitRateEvo.push_back(new TH1I(sHistName, title, 1800, 0, 1800));
647
648
650 sHistName = Form("hMuchFebRateEvo_mskch_%03u", uFebIdx);
651 title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
652 fhMuchFebHitRateEvo_mskch.push_back(new TH1I(sHistName, title, 1800, 0, 1800));
653
655 sHistName = Form("hMuchFebRateEvo_mskch_adcut_%03u", uFebIdx);
656 title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
657 fhMuchFebHitRateEvo_mskch_adccut.push_back(new TH1I(sHistName, title, 1800, 0, 1800));
658
660 sHistName = Form("hMuchFebRateEvo_WithoutDupli_%03u", uFebIdx);
661 title = Form("Hits per second in FEB #%03u; Time [s]; Hits []", uFebIdx);
662 fhMuchFebHitRateEvo_WithoutDupli.push_back(new TH1I(sHistName, title, 50000, 0, 5000));
663
665 //sHistName = Form( "hMuchFebChanRateEvoLong_%03u", uFebIdx );
666 //title = Form( "Hits per second & channel in FEB #%03u; Time [min]; Channel []; Hits []", uFebIdx );
667 //fhMuchFebChanHitRateEvoLong.push_back( new TH2D( sHistName, title,
668 // fuLongHistoBinNb, -0.5, uAlignedLimit - 0.5,
669 // fUnpackParMuch->GetNbChanPerFeb(), -0.5, fUnpackParMuch->GetNbChanPerFeb() - 0.5 ) );
670
672 //sHistName = Form( "hMuchFebAsicRateEvoLong_%03u", uFebIdx );
673 //title = Form( "Hits per second & StsXyter in FEB #%03u; Time [min]; Asic []; Hits []", uFebIdx );
674 //fhMuchFebAsicHitRateEvoLong.push_back( new TH2D( sHistName, title,
675 // fuLongHistoBinNb, -0.5, uAlignedLimit - 0.5,
676 // fUnpackParMuch->GetNbAsicsPerFeb(), -0.5, fUnpackParMuch->GetNbAsicsPerFeb() - 0.5 ) );
677
679 //sHistName = Form( "hMuchFebRateEvoLong_%03u", uFebIdx );
680 //title = Form( "Hits per second in FEB #%03u; Time [min]; Hits []", uFebIdx );
681 //fhMuchFebHitRateEvoLong.push_back( new TH1D(sHistName, title,
682 // fuLongHistoBinNb, -0.5, uAlignedLimit - 0.5 ) );
683
685 sHistName = Form("hMuchFebChanDistT_%03u", uFebIdx);
686 title = Form("Time distance between hits on same channel in between FEB "
687 "#%03u; Time difference [ns]; Channel []; ",
688 uFebIdx);
689 fhMuchFebChanDistT.push_back(new TH2I(sHistName, title, 1000, -0.5, 6250.0 - 0.5, fUnpackParMuch->GetNbChanPerFeb(),
690 -0.5, fUnpackParMuch->GetNbChanPerFeb() - 0.5));
691
692 } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
693
696 new TH2I("fhDpbMsErrors", "; DPB []; Error type []; Counts []", fuNrOfDpbs, 0, fuNrOfDpbs, 4, -0.5, 3.5);
698
699 // Miscroslice properties histos
700 for (Int_t component = 0; component < kiMaxNbFlibLinks; component++) {
701 fhMsSz[component] = NULL;
702 fhMsSzTime[component] = NULL;
703 } // for( Int_t component = 0; component < kiMaxNbFlibLinks; component ++ )
704
705 LOG(debug) << "Initialized 6th Histo before FairRunOnlne Instance";
706 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
707 if (server) {
708 for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
709 // server->Register("/MuchRaw", fHistPadDistr[uModuleId] );
710 // server->Register("/MuchRaw", fRealHistPadDistr[uModuleId] );
711 // server->Register("/MuchFeb", fhMuchFebDuplicateHitProf[uModuleId] );
712 }
713
714 // server->Register("/MuchRaw", fhRate );
715 // server->Register("/MuchRaw", fhRateAdcCut );
716 server->Register("/MuchRaw", fhFEBcount);
717 server->Register("/MuchRaw", fhMuchMessType);
718 // server->Register("/MuchRaw", fhMuchSysMessType );
719 server->Register("/MuchRaw", fhMuchMessTypePerDpb);
720 server->Register("/MuchRaw", fhMuchSysMessTypePerDpb);
721 // server->Register("/MuchRaw", fhStatusMessType );
722 server->Register("/MuchRaw", fhMsStatusFieldType);
723 server->Register("/MuchRaw", fhMuchHitsElinkPerDpb);
724 server->Register("/MuchRaw", fhMuchFebChanAdcRaw_combined);
725 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
726 if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
727 server->Register("/MuchFeb", fhMuchFebChanCntRaw[uFebIdx]);
728 server->Register("/MuchFeb", fhMuchFebSpill[uFebIdx]);
729 server->Register("/MuchFeb", fhMuchFebADC[uFebIdx]);
730 server->Register("/MuchFeb", fhMuchChannelTime[uFebIdx]);
731
732 //server->Register("/MuchFeb", fhMuchFebChanCntRawGood[ uFebIdx ] );
734 // server->Register("/MuchFeb", fhMuchFebChanAdcRawProf[ uFebIdx ] );
735 //server->Register("/MuchFeb", fhMuchFebChanAdcCal[ uFebIdx ] );
736 //server->Register("/MuchFeb", fhMuchFebChanAdcCalProf[ uFebIdx ] );
738 //server->Register("/MuchFeb", fhMuchFebChanHitRateEvo[ uFebIdx ] );
739 // server->Register("/MuchFeb", fhMuchFebChanHitRateProf[ uFebIdx ] );
740 //server->Register("/MuchFeb", fhMuchFebAsicHitRateEvo[ uFebIdx ] );
741 // server->Register("/MuchFeb", fhMuchFebHitRateEvo[ uFebIdx ] );
743 // server->Register("/MuchFeb", fhMuchFebHitRateEvo_mskch_adccut[ uFebIdx ] );
744 // server->Register("/MuchFeb", fhMuchFebHitRateEvo_WithoutDupli[ uFebIdx ] );
745 LOG(debug) << "Initialized fhMuchFebHitRateEvo_WithoutDupli number " << uFebIdx;
746 /*server->Register("/MuchFeb", fhMuchFebChanHitRateEvoLong[ uFebIdx ] );
747 server->Register("/MuchFeb", fhMuchFebAsicHitRateEvoLong[ uFebIdx ] );
748 server->Register("/MuchFeb", fhMuchFebHitRateEvoLong[ uFebIdx ] );
749 server->Register("/MuchFeb", fhMuchFebChanDistT[ uFebIdx ] );*/
750
751 } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
752 server->Register("/MuchRaw", fhDpbMsErrors);
753 } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
754
755 LOG(debug) << "Initialized FEB 8th Histo";
756 server->RegisterCommand("/Reset_All", "bMcbm2018ResetMuchLite=kTRUE");
757 server->RegisterCommand("/Write_All", "bMcbm2018WriteMuchLite=kTRUE");
758 server->RegisterCommand("/ScanNoisyCh", "bMcbm2018ScanNoisyMuchLite=kTRUE");
759 server->Restrict("/Reset_All", "allow=admin");
760 server->Restrict("/Write_All", "allow=admin");
761 server->Restrict("/ScanNoisyCh", "allow=admin");
762 } // if( server )
763
764 LOG(debug) << "Initialized All Histos 8th Histo";
766 Double_t w = 10;
767 Double_t h = 10;
768 LOG(debug) << "Initialized 7th Histo before Summary per FEB";
769
770 TCanvas* cChannel = new TCanvas(Form("CHANNELS"),
771 Form("CHANNELS")); //,
772 // w, h);
773 cChannel->Divide(4, 9);
774 // Summary per FEB
775 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
776 if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
777 cChannel->cd(uFebIdx + 1);
779 // gPad->SetGridy();
780 gPad->SetLogy();
781 fhMuchFebChanCntRaw[uFebIdx]->Draw();
782
783 } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
784 } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
785
786 server->Register("/canvases", cChannel);
787 //All Feb hit rate together on one Canvas
788
789 TCanvas* cspill = new TCanvas(Form("SPILLS"), Form("SPILLS")); //,w, h);
790 cspill->Divide(4, 9);
791
792 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
793 if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
794 UInt_t flPad = 1 + uFebIdx;
795 cspill->cd(flPad);
796 //gPad->SetGridx();
797 //gPad->SetGridy();
798 // gPad->SetLogy();
799 fhMuchFebSpill[uFebIdx]->Draw();
800 }
801 // server->Register("/canvases", cspill);
802 }
803 server->Register("/canvases", cspill);
804
805 TCanvas* cadc = new TCanvas(Form("ADC"), Form("ADC"), w, h);
806 cadc->Divide(4, 9);
807
808 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
809 if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
810 UInt_t flPad = 1 + uFebIdx;
811 cadc->cd(flPad);
812 //gPad->SetGridx();
813 //gPad->SetGridy();
814 //gPad->SetLogy();
815 fhMuchFebADC[uFebIdx]->Draw("colz");
816 }
817 }
818 server->Register("/canvases", cadc);
819
820 TCanvas* cChanneltime = new TCanvas(Form("ChannelvsTime"), Form("ChannelvsTime"), w, h);
821 cChanneltime->Divide(4, 9);
822
823 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
824 if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
825 UInt_t flPad = 1 + uFebIdx;
826 cChanneltime->cd(flPad);
827 //gPad->SetGridx();
828 //gPad->SetGridy();
829 //gPad->SetLogy();
830 fhMuchChannelTime[uFebIdx]->Draw("colz");
831 }
832 }
833 server->Register("/canvases", cChanneltime);
834 //====================================================================//
835 LOG(debug) << "Initialized Last Histo before exiting CreateHistograms";
836 //====================================================================//
838 // Try to recover canvas in case it was created already by another monitor
839 // If not existing, create it
840 fcMsSizeAll = dynamic_cast<TCanvas*>(gROOT->FindObject("cMsSizeAll"));
841 if (NULL == fcMsSizeAll) {
842 fcMsSizeAll = new TCanvas("cMsSizeAll",
843 "Evolution of MS size in last 300 s"); //, w, h);
844 fcMsSizeAll->Divide(1, 8);
845 LOG(info) << "Created MS size canvas in Much monitor";
846 server->Register("/canvases", fcMsSizeAll);
847 } // if( NULL == fcMsSizeAll )
848 else
849 LOG(info) << "Recovered MS size canvas in Much monitor";
850 //====================================================================//
851
852 /*****************************/
853}
854
855Bool_t CbmMcbm2018MonitorMuchLite::DoUnpack(const fles::Timeslice& ts, size_t component)
856{
859 bMcbm2018ResetMuchLite = kFALSE;
860 } // if( bMcbm2018ResetMuchLite )
863 bMcbm2018WriteMuchLite = kFALSE;
864 } // if( bMcbm2018WriteMuchLite )
868 } // if( bMcbm2018WriteMuchLite )
869
870 LOG(debug) << "Timeslice contains " << ts.num_microslices(component) << " microslices.";
871 fulCurrentTsIdx = ts.index();
872
873 // Ignore overlap ms if flag set by user
874 UInt_t uNbMsLoop = fuNbCoreMsPerTs;
875 if (kFALSE == fbIgnoreOverlapMs) uNbMsLoop += fuNbOverMsPerTs;
876
877 //LOG(info) <<" uNbMsLoop "<<uNbMsLoop;
878 // Loop over core microslices (and overlap ones if chosen)
879 for (UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx++) {
880 // Double_t dMsTime = (1e-9) * static_cast<double>( ts.descriptor( fvMsComponentsList[ 0 ], uMsIdx ).idx );
881
882 if (0 == fulCurrentTsIdx && 0 == uMsIdx) {
883 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
884 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
885 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
886 /*
887 LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
888 LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
889 static_cast<unsigned int>(msDescriptor.hdr_id),
890 static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
891 static_cast<unsigned int>(msDescriptor.sys_id),
892 static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
893 msDescriptor.size, msDescriptor.offset );
894*/
895 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
896 uint32_t uEqId = static_cast<uint32_t>(msDescriptor.eq_id & 0xFFFF);
897 auto it = fDpbIdIndexMap.find(uEqId);
898 if (fDpbIdIndexMap.end() == it) {
899 LOG(warning) << "Could not find the sDPB index for AFCK id 0x" << std::hex << uEqId << std::dec
900 << " component " << uMsCompIdx << "\n"
901 << "If valid this index has to be added in the TOF parameter file "
902 "in the RocIdArray field"
903 << "\n"
904 << "For now we remove it from the list of components analyzed";
905 } // if( fDpbIdIndexMap.end() == it )
906 } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
907 } // if( 0 == fulCurrentTsIndex && 0 == uMsIdx )
908
909
910 // Loop over registered components
911 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
912 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
913
914 if (kFALSE == ProcessMuchMs(ts, uMsComp, uMsIdx)) return kFALSE;
915
916 } // for( UInt_t uMsComp = 0; uMsComp < fvMsComponentsList.size(); ++uMsComp )
917
919 // Sort the buffer of hits
920 std::sort(fvmHitsInMs.begin(), fvmHitsInMs.end());
921
922 // Time differences plotting using the fully time sorted hits
923 if (0 < fvmHitsInMs.size()) {
924 // ULong64_t ulLastHitTime = ( *( fvmHitsInMs.rbegin() ) ).GetTs();
925 std::vector<stsxyter::FinalHit>::iterator itA;
926 // comment unused variable, FU, 18.01.21 std::vector<stsxyter::FinalHit>::iterator itB;
927
928 // std::chrono::steady_clock::time_point tNow = std::chrono::steady_clock::now();
929 // Double_t dUnixTimeInRun = std::chrono::duration_cast< std::chrono::seconds >(tNow - ftStartTimeUnix).count();
930 //LOG(info) <<" ulLastHitTime "<<ulLastHitTime<<" dUnixTimeInRun "<<dUnixTimeInRun;
931 for (itA = fvmHitsInMs.begin(); itA != fvmHitsInMs.end();
932 // itA != fvmHitsInMs.end() && (*itA).GetTs() < ulLastHitTime - 320; // 320 * 3.125 ns = 1000 ns
933 ++itA) {
934 UShort_t usAsicIdx = (*itA).GetAsic();
935 // UShort_t usChanIdx = (*itA).GetChan();
936 // ULong64_t ulHitTs = (*itA).GetTs();
937 // UShort_t usHitAdc = (*itA).GetAdc();
938 UShort_t usFebIdx = usAsicIdx / fUnpackParMuch->GetNbAsicsPerFeb();
939 // UShort_t usAsicInFeb = usAsicIdx % fUnpackParMuch->GetNbAsicsPerFeb();
940 //LOG(info) <<" usAsicIdx "<<usAsicIdx<<" usChanIdx "<<usChanIdx<<" ulHitTs "<<ulHitTs<<" usHitAdc "<<usHitAdc<<" usFebIdx "<<usFebIdx<<" usAsicInFeb "<<usAsicInFeb;
941 // Double_t dTimeSinceStartSec = (ulHitTs * stsxyter::kdClockCycleNs - fdStartTime)* 1e-9;
942 //LOG(info) <<" dTimeSinceStartSec "<<dTimeSinceStartSec;
943 fvmAsicHitsInMs[usAsicIdx].push_back((*itA));
944 fvmFebHitsInMs[usFebIdx].push_back((*itA));
945 } // loop on time sorted hits and split per asic/feb
946
947 // Remove all hits which were already used
948 fvmHitsInMs.erase(fvmHitsInMs.begin(), itA);
950 // fvmFebHitsInMs[ uFebIdx ].clear();
951 //} // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
952 } // if( 0 < fvmHitsInMs.size() )
953 } // for( UInt_t uMsIdx = 0; uMsIdx < uNbMsLoop; uMsIdx ++ )
954
955 for (UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx) {
956 fvdMsTime[uMsIdx] = 0.0;
957 } // for( UInt_t uMsIdx = 0; uMsIdx < fuMaxNbMicroslices; ++uMsIdx )
958
959 if (0 == ts.index() % 1000) {
960 for (UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb) {
961 Double_t dTsMsbTime =
962 static_cast<ULong64_t>(stsxyter::kuHitNbTsBins) * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
963 + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins)
964 * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
965
967 if (kTRUE == fbBinningFw)
968 dTsMsbTime = static_cast<ULong64_t>(stsxyter::kuHitNbTsBinsBinning)
969 * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
970 + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBinsBinning)
971 * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
972 dTsMsbTime *= stsxyter::kdClockCycleNs * 1e-9;
973
974 LOG(info) << "End of TS " << std::setw(7) << ts.index() << " eDPB " << std::setw(2) << uDpb
975 << " current TS MSB counter is " << std::setw(12) << fvulCurrentTsMsb[uDpb]
976 << " current TS MSB cycle counter is " << std::setw(12) << fvuCurrentTsMsbCycle[uDpb]
977 << " current TS MSB time is " << std::setw(12) << dTsMsbTime << " s";
978 }
979 } // if( 0 == ts.index() % 1000 )
980 //If Needed store Histos after 10000 TS.
981 //if( 0 == ts.index() % 10000 )
982 //SaveAllHistos( "data/PeriodicHistosSave.root");
983
984 return kTRUE;
985}
986
987Bool_t CbmMcbm2018MonitorMuchLite::ProcessMuchMs(const fles::Timeslice& ts, size_t uMsComp, UInt_t uMsIdx)
988{
989 auto msDescriptor = ts.descriptor(uMsComp, uMsIdx);
990 fuCurrentEquipmentId = msDescriptor.eq_id;
991 const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsComp, uMsIdx));
992
993 fulCurrentTsIdx = ts.index();
994 if (0 == fvbMaskedComponents.size()) fvbMaskedComponents.resize(ts.num_components(), kFALSE);
995
996 if (0 == fulCurrentTsIdx && 0 == uMsIdx) {
997 /*
998 LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
999 LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
1000 static_cast<unsigned int>(msDescriptor.hdr_id),
1001 static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
1002 static_cast<unsigned int>(msDescriptor.sys_id),
1003 static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
1004 msDescriptor.size, msDescriptor.offset );
1005*/
1006 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
1007 } // if( 0 == fulCurrentTsIndex && 0 == uMsIdx )
1008 if (kFALSE == fvbMaskedComponents[uMsComp] && 0 == uMsIdx) {
1009 auto it = fDpbIdIndexMap.find(fuCurrentEquipmentId);
1010 if (fDpbIdIndexMap.end() == it) {
1011 LOG(warning) << "Could not find the sDPB index for AFCK id 0x" << std::hex << fuCurrentEquipmentId << std::dec
1012 << " component " << uMsComp << "\n"
1013 << "If valid this index has to be added in the TOF parameter file in "
1014 "the RocIdArray field"
1015 << "\n"
1016 << "For now we remove it from the list of components analyzed";
1017 fvbMaskedComponents[uMsComp] = kTRUE;
1018 } // if( fDpbIdIndexMap.end() == it )
1019
1020 } // if( kFALSE == fvbMaskedComponents[ uMsComp ] && 0 == uMsIdx )
1021
1022 if (kTRUE == fvbMaskedComponents[uMsComp]) return kTRUE;
1023
1024 uint32_t uSize = msDescriptor.size;
1025 fulCurrentMsIdx = msDescriptor.idx;
1026 Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
1027 LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec
1028 << " has size: " << uSize;
1029
1030 fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
1032 //LOG(info) <<" fuCurrDpbIdx "<<fuCurrDpbIdx<<" fuCurrDpbId "<<fuCurrDpbId;
1033
1034 if (uMsComp < kiMaxNbFlibLinks) {
1035 if (fdStartTimeMsSz < 0) fdStartTimeMsSz = dMsTime;
1036 fhMsSz[uMsComp]->Fill(uSize);
1037 fhMsSzTime[uMsComp]->Fill(dMsTime - fdStartTimeMsSz, uSize);
1038 } // if( uMsComp < kiMaxNbFlibLinks )
1039
1041 if (static_cast<Int_t>(fvdPrevMsTime[uMsComp]) < static_cast<Int_t>(dMsTime)) {
1043 UInt_t uFebIdxOffset = fUnpackParMuch->GetNbFebsPerDpb() * fuCurrDpbIdx;
1044 for (UInt_t uFebIdx = 0; uFebIdx < fUnpackParMuch->GetNbFebsPerDpb(); ++uFebIdx) {
1045 UInt_t uFebIdxInSyst = uFebIdxOffset + uFebIdx;
1046
1048 if (0 == fviFebTimeSecLastRateUpdate[uFebIdxInSyst]) {
1049 fviFebTimeSecLastRateUpdate[uFebIdxInSyst] = static_cast<Int_t>(dMsTime);
1050 fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] = 0;
1051 for (UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerFeb(); ++uChan)
1052 fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan] = 0.0;
1053 continue;
1054 } // if( 0 == fviFebTimeSecLastRateUpdate[uFebIdxInSyst] )
1055
1056 Int_t iTimeInt = static_cast<Int_t>(dMsTime) - fviFebTimeSecLastRateUpdate[uFebIdxInSyst];
1057 if (fiTimeIntervalRateUpdate <= iTimeInt) {
1059 if (0 == fviFebCountsSinceLastRateUpdate[uFebIdxInSyst]) {
1060 fviFebTimeSecLastRateUpdate[uFebIdxInSyst] = static_cast<Int_t>(dMsTime);
1061 continue;
1062 } // if( 0 == fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] )
1063
1064 for (UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerFeb(); ++uChan) {
1065 fhMuchFebChanHitRateProf[uFebIdxInSyst]->Fill(uChan, fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan]
1066 / iTimeInt);
1067 fvdFebChanCountsSinceLastRateUpdate[uFebIdxInSyst][uChan] = 0.0;
1068 } // for( UInt_t uChan = 0; uChan < fUnpackParMuch->GetNbChanPerFeb(); ++uChan )
1069
1070 fviFebTimeSecLastRateUpdate[uFebIdxInSyst] = static_cast<Int_t>(dMsTime);
1071 fviFebCountsSinceLastRateUpdate[uFebIdxInSyst] = 0;
1072 } // if( fiTimeIntervalRateUpdate <= iTimeInt )
1073 } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackParMuch->GetNbFebsPerDpb(); ++uFebIdx )
1074 } // if( static_cast<Int_t>( fvdMsTime[ uMsCompIdx ] ) < static_cast<Int_t>( dMsTime ) )
1075
1076 // Store MS time for coincidence plots
1077 fvdPrevMsTime[uMsComp] = dMsTime;
1078
1080 uint16_t uMsHeaderFlags = msDescriptor.flags;
1081 for (UInt_t uBit = 0; uBit < 16; ++uBit)
1082 fhMsStatusFieldType->Fill(uBit, (uMsHeaderFlags >> uBit) & 0x1);
1083
1085 UInt_t uTsMsbCycleHeader = std::floor(fulCurrentMsIdx / (stsxyter::kulTsCycleNbBins * stsxyter::kdClockCycleNs))
1087
1089 if (kTRUE == fbBinningFw)
1092
1093 if (kFALSE == fvuInitialHeaderDone[fuCurrDpbIdx]) {
1094 fvuInitialTsMsbCycleHeader[fuCurrDpbIdx] = uTsMsbCycleHeader;
1096 } // if( kFALSE == fvuInitialHeaderDone[ fuCurrDpbIdx ] )
1097 else if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle[fuCurrDpbIdx] && 4194303 != fvulCurrentTsMsb[fuCurrDpbIdx]) {
1098 /*
1099 LOG(warning) << "TS MSB cycle from MS header does not match current cycle from data "
1100 << "for TS " << std::setw( 12 ) << fulCurrentTsIdx
1101 << " MS " << std::setw( 12 ) << fulCurrentMsIdx
1102 << " MsInTs " << std::setw( 3 ) << uMsIdx
1103 << " ====> " << fvuCurrentTsMsbCycle[ fuCurrDpbIdx ]
1104 << " VS " << uTsMsbCycleHeader;
1105*/
1106 fvuCurrentTsMsbCycle[fuCurrDpbIdx] = uTsMsbCycleHeader;
1107 }
1108
1109 // If not integer number of message in input buffer, print warning/error
1110 if (0 != (uSize % kuBytesPerMessage))
1111 LOG(error) << "The input microslice buffer does NOT "
1112 << "contain only complete nDPB messages!";
1113
1114 // Compute the number of complete messages in the input microslice buffer
1115 uint32_t uNbMessages = (uSize - (uSize % kuBytesPerMessage)) / kuBytesPerMessage;
1116
1117 // Prepare variables for the loop on contents
1118 const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>(msContent);
1119
1120 for (uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx) {
1121 // Fill message
1122 uint32_t ulData = static_cast<uint32_t>(pInBuff[uIdx]);
1123
1124 stsxyter::Message mess(static_cast<uint32_t>(ulData & 0xFFFFFFFF));
1125
1126 // Print message if requested
1127 if (fbPrintMessages) mess.PrintMess(std::cout, fPrintMessCtrl);
1128 /*
1129 if( 1000 == fulCurrentTsIdx )
1130 {
1131 mess.PrintMess( std::cout, fPrintMessCtrl );
1132 } // if( 0 == fulCurrentTsIdx )
1133*/
1134 stsxyter::MessType typeMess = mess.GetMessType();
1135 fmMsgCounter[typeMess]++;
1136 // fhMuchMessType->Fill( static_cast< uint16_t > (typeMess) );
1137 // fhMuchMessTypePerDpb->Fill( fuCurrDpbIdx, static_cast< uint16_t > (typeMess) );
1138
1139 switch (typeMess) {
1141 // Extract the eLink and Asic indices => Should GO IN the fill method now that obly hits are link/asic specific!
1142 UShort_t usElinkIdx = mess.GetLinkIndex();
1144 if (kTRUE == fbBinningFw) usElinkIdx = mess.GetLinkIndexHitBinning();
1145
1146 UInt_t uCrobIdx = usElinkIdx / fUnpackParMuch->GetNbElinkPerCrob();
1147 Int_t uFebIdx = fUnpackParMuch->ElinkIdxToFebIdx(usElinkIdx);
1148 // if(usElinkIdx!=0)
1149 //LOG(info) <<" usElinkIdx "<<usElinkIdx<<" uCrobIdx "<<uCrobIdx<<" uFebIdx "<<uFebIdx;
1150 if (kTRUE == fbMuchMode) uFebIdx = usElinkIdx;
1151 fhMuchHitsElinkPerDpb->Fill(fuCurrDpbIdx, usElinkIdx);
1152 if (-1 == uFebIdx) {
1153 LOG(warning) << "CbmMcbm2018MonitorMuchLite::DoUnpack => "
1154 << "Wrong elink Idx! Elink raw " << Form("%d remap %d", usElinkIdx, uFebIdx);
1155 continue;
1156 } // if( -1 == uFebIdx )
1157 //LOG(info) << " uCrobIdx "<<uCrobIdx<<" fUnpackParMuch->ElinkIdxToAsicIdx( usElinkIdx ) "<<fUnpackParMuch->ElinkIdxToAsicIdx( usElinkIdx )<<" usElinkIdx "<<usElinkIdx;
1158 UInt_t uAsicIdx =
1160 + fUnpackParMuch->ElinkIdxToAsicIdx(usElinkIdx);
1161
1162 FillHitInfo(mess, usElinkIdx, uAsicIdx, uMsIdx);
1163 break;
1164 } // case stsxyter::MessType::Hit :
1166 FillTsMsbInfo(mess, uIdx, uMsIdx);
1167 break;
1168 } // case stsxyter::MessType::TsMsb :
1170 // The first message in the TS is a special ones: EPOCH
1171 FillEpochInfo(mess);
1172
1173 if (0 < uIdx)
1174 LOG(info) << "CbmMcbm2018MonitorMuchLite::DoUnpack => "
1175 << "EPOCH message at unexpected position in MS: message " << uIdx << " VS message 0 expected!";
1176 break;
1177 } // case stsxyter::MessType::TsMsb :
1179 // UShort_t usElinkIdx = mess.GetStatusLink(); // commented 03.07.20 FU unused
1180 // UInt_t uCrobIdx = usElinkIdx / fUnpackParMuch->GetNbElinkPerCrob(); // commented 03.07.20 FU unused
1181 // Int_t uFebIdx = fUnpackParMuch->ElinkIdxToFebIdx( usElinkIdx );
1182 // UInt_t uAsicIdx = ( fuCurrDpbIdx * fUnpackParMuch->GetNbCrobsPerDpb() + uCrobIdx // commented 03.07.20 FU unused
1183 // ) * fUnpackParMuch->GetNbAsicsPerCrob()
1184 // + fUnpackParMuch->ElinkIdxToAsicIdx( usElinkIdx );
1185
1186 // UShort_t usStatusField = mess.GetStatusStatus(); // commented 03.07.20 FU unused
1187
1188 // fhStatusMessType->Fill( uAsicIdx, usStatusField );
1190 if (fbPrintMessages) {
1191 std::cout << Form("DPB %2u TS %12llu MS %12llu mess %5u ", fuCurrDpbIdx, fulCurrentTsIdx, fulCurrentMsIdx,
1192 uIdx);
1193 mess.PrintMess(std::cout, fPrintMessCtrl);
1194 } // if( fbPrintMessages )
1195 // FillTsMsbInfo( mess );
1196 break;
1197 } // case stsxyter::MessType::Status
1199 // FillTsMsbInfo( mess );
1200 break;
1201 } // case stsxyter::MessType::Empty :
1203 if (mess.IsMsErrorFlagOn()) {
1205 } // if( pMess[uIdx].IsMsErrorFlagOn() )
1206 break;
1207 } // case stsxyter::MessType::EndOfMs :
1209 break;
1210 } // case stsxyter::MessType::Dummy / ReadDataAck / Ack :
1211 default: {
1212 LOG(fatal) << "CbmMcbm2018MonitorMuchLite::DoUnpack => "
1213 << "Unknown message type, should never happen, stopping "
1214 "here! Type found was: "
1215 << static_cast<int>(typeMess);
1216 }
1217 } // switch( mess.GetMessType() )
1218 } // for( uint32_t uIdx = 0; uIdx < uNbMessages; ++uIdx )
1219
1220 return kTRUE;
1221}
1222
1223
1224void CbmMcbm2018MonitorMuchLite::FillHitInfo(stsxyter::Message mess, const UShort_t& /*usElinkIdx*/,
1225 const UInt_t& uAsicIdx, const UInt_t& uMsIdx)
1226{
1227 UShort_t usChan = mess.GetHitChannel();
1228 UShort_t usRawAdc = mess.GetHitAdc();
1229 // UShort_t usFullTs = mess.GetHitTimeFull();
1230 // UShort_t usTsOver = mess.GetHitTimeOver();
1231 UShort_t usRawTs = mess.GetHitTime();
1232 //Below FebID is according to FEB Position in Module GEM A or Module GEM B (Carefully write MUCH Par file)
1233 Int_t FebId = fUnpackParMuch->GetFebId(uAsicIdx);
1234
1236 if (kTRUE == fbBinningFw) usRawTs = mess.GetHitTimeBinning();
1237
1238 // UInt_t uFebIdx = uAsicIdx / fUnpackParMuch->GetNbAsicsPerFeb();
1239 //For MUCH each FEB has one StsXyter
1240 UInt_t uFebIdx = uAsicIdx;
1241 // UInt_t uCrobIdx = usElinkIdx / fUnpackParMuch->GetNbElinkPerCrob();
1242 // UInt_t uAsicInFeb = uAsicIdx % fUnpackParMuch->GetNbAsicsPerFeb();
1243 UInt_t uChanInFeb = usChan + fUnpackParMuch->GetNbChanPerAsic() * (uAsicIdx % fUnpackParMuch->GetNbAsicsPerFeb());
1244 Int_t ModuleNr = fUnpackParMuch->GetModule(uAsicIdx);
1245 Int_t sector = fUnpackParMuch->GetPadXA(FebId, usChan);
1246 Int_t channel = fUnpackParMuch->GetPadYA(FebId, usChan);
1247
1248 //Convert into Real X Y Position
1249 // Double_t ActualX = fUnpackParMuch->GetRealX(channel+97*sector);
1250 // Double_t ActualY = fUnpackParMuch->GetRealPadSize(channel+97*sector);
1251 Double_t ActualX = fUnpackParMuch->GetRealX(channel, sector);
1252 Double_t ActualY = fUnpackParMuch->GetRealPadSize(channel, sector);
1253
1254 //Converting Module (Small side up)
1255 ActualX = 1000 - ActualX;
1256 channel = 96 - channel;
1257
1258 LOG(debug) << "Module Nr " << ModuleNr << " Sector Nr " << sector << " Channel Nr " << channel << "Actual X "
1259 << ActualX << "Actual Y " << ActualY << "uAsicIdx " << uAsicIdx;
1260
1261
1262 // fHistPadDistr[ModuleNr]->Fill(sector, channel);
1263 // fRealHistPadDistr[ModuleNr]->Fill(ActualY, ActualX);
1264
1265 //Double_t dCalAdc = fvdFebAdcOffs[ fuCurrDpbIdx ][ uCrobIdx ][ uFebIdx ]
1266 // + (usRawAdc - 1)* fvdFebAdcGain[ fuCurrDpbIdx ][ uCrobIdx ][ uFebIdx ];
1267 fhFEBcount->Fill(uFebIdx);
1268 // fhMuchFebSpill[uFebIdx] ->Fill(usRawTs);
1269 fhMuchFebChanCntRaw[uFebIdx]->Fill(uChanInFeb);
1270 // fhMuchFebChanAdcRaw[ uFebIdx ]->Fill( uChanInFeb, usRawAdc );
1271 // fhMuchFebChanAdcRawProf[ uFebIdx ]->Fill( uChanInFeb, usRawAdc );
1272 //fhMuchFebChanAdcCal[ uFebIdx ]->Fill( uChanInFeb, dCalAdc );
1273 //fhMuchFebChanAdcCalProf[ uFebIdx ]->Fill( uChanInFeb, dCalAdc );
1274 // fhMuchFebChanRawTs[ uFebIdx ]->Fill( usChan, usRawTs );
1275 //fhMuchFebChanMissEvt[ uFebIdx ]->Fill( usChan, mess.IsHitMissedEvts() );
1276 // fhMuchFebChanAdcRaw_combined->Fill(usRawAdc);
1277
1278
1279 fhMuchFebADC[uFebIdx]->Fill(usChan, usRawAdc);
1280 // Compute the Full time stamp
1281 // ULong64_t ulOldHitTime = fvulChanLastHitTime[ uAsicIdx ][ usChan ]; // commented 03.07.20 FU unused
1282 // Long64_t dOldHitTime = fvdChanLastHitTime[ uAsicIdx ][ usChan ];
1283
1284 // Use TS w/o overlap bits as they will anyway come from the TS_MSB
1285 fvulChanLastHitTime[uAsicIdx][usChan] = usRawTs;
1286
1287 fvulChanLastHitTime[uAsicIdx][usChan] +=
1288 static_cast<ULong64_t>(stsxyter::kuHitNbTsBins) * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
1289 + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins) * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
1290
1292 if (kTRUE == fbBinningFw)
1293 fvulChanLastHitTime[uAsicIdx][usChan] =
1294 usRawTs
1295 + static_cast<ULong64_t>(stsxyter::kuHitNbTsBinsBinning) * static_cast<ULong64_t>(fvulCurrentTsMsb[fuCurrDpbIdx])
1296 + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBinsBinning)
1297 * static_cast<ULong64_t>(fvuCurrentTsMsbCycle[fuCurrDpbIdx]);
1298
1299
1300 // Convert the Hit time in bins to Hit time in ns
1301 Long64_t dHitTimeNs = fvulChanLastHitTime[uAsicIdx][usChan] * stsxyter::kdClockCycleNs;
1302
1303 // Store new value of Hit time in ns
1304 fvdChanLastHitTime[uAsicIdx][usChan] = fvulChanLastHitTime[uAsicIdx][usChan] * stsxyter::kdClockCycleNs;
1305 // For StsXyter2.0 Duplicate Hit Error
1306 //Int_t ModuleNr = fUnpackParMuch->GetModule(uAsicIdx);
1307 /*
1308 fhMuchFebDuplicateHitProf[ModuleNr]->Fill(FebId,0);
1309 if( ulOldHitTime == fvulChanLastHitTime[uAsicIdx][usChan] )
1310 fhMuchFebDuplicateHitProf[ModuleNr]->Fill(FebId,1);
1311*/
1312
1313 /*
1314 LOG(info) << " Asic " << std::setw( 2 ) << uAsicIdx
1315 << " Channel " << std::setw( 3 ) << usChan
1316 << " Diff to last hit " << std::setw( 12 ) << ( fvulChanLastHitTime[ uAsicIdx ][ usChan ] - ulOldHitTime)
1317 << " in s " << std::setw( 12 ) << ( fvdChanLastHitTime[ uAsicIdx ][ usChan ] - dOldHitTime) * 1e-9;
1318*/
1319 // Pulser and MS
1320 fvuChanNbHitsInMs[uAsicIdx][usChan][uMsIdx]++;
1321 fvdChanLastHitTimeInMs[uAsicIdx][usChan][uMsIdx] = dHitTimeNs;
1322 fvusChanLastHitAdcInMs[uAsicIdx][usChan][uMsIdx] = usRawAdc;
1323 /*
1324 fvmChanHitsInTs[ uAsicIdx ][ usChan ].insert( stsxyter::FinalHit( fvulChanLastHitTime[ uAsicIdx ][ usChan ],
1325 usRawAdc, uAsicIdx, usChan ) );
1326*/
1327 fvmHitsInMs.push_back(stsxyter::FinalHit(fvulChanLastHitTime[uAsicIdx][usChan], usRawAdc, uAsicIdx, usChan));
1328
1329 // Check Starting point of histos with time as X axis
1330 if (-1 == fdStartTime) fdStartTime = fvdChanLastHitTime[uAsicIdx][usChan];
1331
1332 Int_t constime = (fvdChanLastHitTime[uAsicIdx][usChan] - prevtime_new);
1333
1334 if (constime < 10000000) {
1335 if (usRawAdc > 1) { Counter1++; }
1336 Counter++;
1337 }
1338 else {
1339 //fhRate->Fill(Counter);
1340 // fhRateAdcCut->Fill(Counter1);
1341 Counter = 0;
1342 Counter1 = 0;
1343 prevtime_new = fvdChanLastHitTime[uAsicIdx][usChan];
1344 }
1345
1346
1347 // Fill histos with time as X axis
1348 Double_t dTimeSinceStartSec = (fvdChanLastHitTime[uAsicIdx][usChan] - fdStartTime) * 1e-9; //uTimeBin
1349 // Double_t dTimeSinceStartMin = dTimeSinceStartSec / 60.0;
1350
1352 fvdFebChanCountsSinceLastRateUpdate[uFebIdx][uChanInFeb] += 1;
1353
1354 // fhMuchFebChanHitRateEvo[ uFebIdx ]->Fill( dTimeSinceStartSec, uChanInFeb );
1355 //fhMuchFebAsicHitRateEvo[ uFebIdx ]->Fill( dTimeSinceStartSec, uAsicInFeb );
1356 // fhMuchFebHitRateEvo[ uFebIdx ]->Fill( dTimeSinceStartSec );
1357 // fhMuchFebHitRateEvo_mskch[ uFebIdx ]->Fill( dTimeSinceStartSec );
1358 // if(usRawAdc>1)fhMuchFebHitRateEvo_mskch_adccut[ uFebIdx ]->Fill( dTimeSinceStartSec );
1359 //fhMuchFebChanHitRateEvoLong[ uFebIdx ]->Fill( dTimeSinceStartMin, uChanInFeb, 1.0/60.0 );
1360 //fhMuchFebAsicHitRateEvoLong[ uFebIdx ]->Fill( dTimeSinceStartMin, uAsicInFeb, 1.0/60.0 );
1361 //fhMuchFebHitRateEvoLong[ uFebIdx ]->Fill( dTimeSinceStartMin, 1.0/60.0 );
1362
1363 fhMuchFebSpill[uFebIdx]->Fill(dTimeSinceStartSec);
1364 fhMuchFebChanCntRaw[uFebIdx]->Fill(usChan);
1365 fhMuchChannelTime[uFebIdx]->Fill(dTimeSinceStartSec, usChan);
1366
1367 /*
1368 if( mess.IsHitMissedEvts() )
1369 {
1370 fhMuchFebChanMissEvtEvo[ uFebIdx ]->Fill( dTimeSinceStartSec, uChanInFeb );
1371 fhMuchFebAsicMissEvtEvo[ uFebIdx ]->Fill( dTimeSinceStartSec, uAsicInFeb );
1372 fhMuchFebMissEvtEvo[ uFebIdx ]->Fill( dTimeSinceStartSec );
1373 } // if( mess.IsHitMissedEvts() )
1374 //if(fvdChanLastHitTime[ uAsicIdx ][ usChan ] == prevTime && uAsicIdx == prevAsic && usChan == prevChan)
1375 */
1376 if (fvdChanLastHitTime[uAsicIdx][usChan] == prevTime && usChan == prevChan) {
1377 //fDupliCount++;
1378 }
1379 else {
1380 // fhMuchFebHitRateEvo_WithoutDupli[ uFebIdx ]->Fill( dTimeSinceStartSec );
1381 }
1382 prevTime = fvdChanLastHitTime[uAsicIdx][usChan];
1383 prevChan = usChan;
1384 prevAsic = uAsicIdx;
1385}
1386
1387void CbmMcbm2018MonitorMuchLite::FillTsMsbInfo(stsxyter::Message mess, UInt_t /*uMessIdx*/, UInt_t /*uMsIdx*/)
1388{
1389 UInt_t uVal = mess.GetTsMsbVal();
1391 if (kTRUE == fbBinningFw) uVal = mess.GetTsMsbValBinning();
1392
1393 // Update Status counters
1394 if (uVal < fvulCurrentTsMsb[fuCurrDpbIdx]) {
1395
1397 } // if( uVal < fvulCurrentTsMsb[fuCurrDpbIdx] )
1399 /*
1400 ULong64_t ulNewTsMsbTime = static_cast< ULong64_t >( stsxyter::kuHitNbTsBins )
1401 * static_cast< ULong64_t >( fvulCurrentTsMsb[fuCurrDpbIdx])
1402 + static_cast< ULong64_t >( stsxyter::kulTsCycleNbBins )
1403 * static_cast< ULong64_t >( fvuCurrentTsMsbCycle[fuCurrDpbIdx] );
1404*/
1405}
1406
1408{
1409 // UInt_t uVal = mess.GetEpochVal();
1410 // UInt_t uCurrentCycle = uVal % stsxyter::kulTsCycleNbBins;
1411}
1412
1414
1416{
1417
1418 LOG(info) << "-------------------------------------";
1419 LOG(info) << "CbmMcbm2018MonitorMuchLite statistics are ";
1420 LOG(info) << " Hit messages: " << fmMsgCounter[stsxyter::MessType::Hit] << "\n"
1421 << " Ts MSB messages: " << fmMsgCounter[stsxyter::MessType::TsMsb] << "\n"
1422 << " Dummy messages: " << fmMsgCounter[stsxyter::MessType::Dummy] << "\n"
1423 << " Epoch messages: " << fmMsgCounter[stsxyter::MessType::Epoch] << "\n"
1424 << " Empty messages: " << fmMsgCounter[stsxyter::MessType::Empty];
1425
1426 LOG(info) << "-------------------------------------";
1427
1429 //SaveAllHistos();
1430}
1431
1432
1434{
1436 TFile* oldFile = gFile;
1437 TDirectory* oldDir = gDirectory;
1438
1439 TFile* histoFile = NULL;
1440 if ("" != sFileName) {
1441 // open separate histo file in recreate mode
1442 histoFile = new TFile(sFileName, "RECREATE");
1443 histoFile->cd();
1444 } // if( "" != sFileName )
1445
1446 /***************************/
1447 gDirectory->mkdir("Much_Raw");
1448 gDirectory->cd("Much_Raw");
1449
1450 for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
1451 // fHistPadDistr[uModuleId]->Write();
1452 // fRealHistPadDistr[uModuleId]->Write();
1453 // fhMuchFebDuplicateHitProf[uModuleId]->Write();
1454 }
1455 // fhRate->Write();
1456 // fhRateAdcCut->Write();
1457 fhFEBcount->Write();
1458 // fhMuchMessType->Write();
1459 // fhMuchSysMessType->Write();
1460 // fhMuchMessTypePerDpb->Write();
1461 // fhMuchSysMessTypePerDpb->Write();
1462 // fhStatusMessType->Write();
1463 fhMsStatusFieldType->Write();
1464 fhMuchHitsElinkPerDpb->Write();
1465 // fhMuchFebChanAdcRaw_combined->Write();
1466 fhDpbMsErrors->Write();
1467 gDirectory->cd("..");
1468 /***************************/
1469
1470 /***************************/
1471 gDirectory->mkdir("Much_Feb");
1472 gDirectory->cd("Much_Feb");
1473 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1474 if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
1475 fhMuchFebChanCntRaw[uFebIdx]->Write();
1476 fhMuchFebSpill[uFebIdx]->Write();
1477 fhMuchChannelTime[uFebIdx]->Write();
1478 fhMuchFebADC[uFebIdx]->Write();
1479 //fhMuchFebChanCntRawGood[ uFebIdx ]->Write();
1480 // fhMuchFebChanAdcRaw[ uFebIdx ]->Write();
1481 // fhMuchFebChanAdcRawProf[ uFebIdx ]->Write();
1482 //fhMuchFebChanAdcCal[ uFebIdx ]->Write();
1483 //fhMuchFebChanAdcCalProf[ uFebIdx ]->Write();
1484 // fhMuchFebChanRawTs[ uFebIdx ]->Write();
1485 // fhMuchFebChanHitRateProf[ uFebIdx ]->Write();
1486 //fhMuchFebAsicHitRateEvo[ uFebIdx ]->Write();
1487 // fhMuchFebHitRateEvo[ uFebIdx ]->Write();
1488 // fhMuchFebHitRateEvo_mskch[ uFebIdx ]->Write();
1489 // fhMuchFebHitRateEvo_mskch_adccut[ uFebIdx ]->Write();
1490 // fhMuchFebHitRateEvo_WithoutDupli[ uFebIdx ]->Write();
1491 /*fhMuchFebChanHitRateEvoLong[ uFebIdx ]->Write();
1492 fhMuchFebAsicHitRateEvoLong[ uFebIdx ]->Write();
1493 fhMuchFebHitRateEvoLong[ uFebIdx ]->Write();
1494 fhMuchFebChanDistT[ uFebIdx ]->Write();
1495 for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
1496 {
1497 fhMuchFebChanDtCoinc[ uFebIdx ][ uFebIdxB ]->Write();
1498 fhMuchFebChanCoinc[ uFebIdx ][ uFebIdxB ]->Write();
1499 } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )*/
1500 } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
1501 } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1502 gDirectory->cd("..");
1503 /***************************/
1504
1505 /***************************/
1506 // Flib Histos
1507 gDirectory->mkdir("Flib_Raw");
1508 gDirectory->cd("Flib_Raw");
1509 for (UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; uLinks++) {
1510 TString sMsSzName = Form("MsSz_link_%02u", uLinks);
1511 if (fHM->Exists(sMsSzName.Data())) fHM->H1(sMsSzName.Data())->Write();
1512
1513 sMsSzName = Form("MsSzTime_link_%02u", uLinks);
1514 if (fHM->Exists(sMsSzName.Data())) fHM->P1(sMsSzName.Data())->Write();
1515 } // for( UInt_t uLinks = 0; uLinks < 16; uLinks ++)
1516
1517 /***************************/
1518
1519 if ("" != sFileName) {
1520 // Restore original directory position
1521 histoFile->Close();
1522 } // if( "" != sFileName )
1523
1525 gFile = oldFile;
1526 gDirectory = oldDir;
1527}
1528
1530{
1531 LOG(info) << "Reseting all Much histograms.";
1532
1533 for (UInt_t uModuleId = 0; uModuleId < 2; ++uModuleId) {
1534 //fHistPadDistr[uModuleId]->Reset();
1535 //fRealHistPadDistr[uModuleId]->Reset();
1536 fhMuchFebDuplicateHitProf[uModuleId]->Reset();
1537 }
1538 // fhRate->Reset();
1539 // fhRateAdcCut->Reset();
1540 fhFEBcount->Reset();
1541 // fhMuchMessType->Reset();
1542 // fhMuchSysMessType->Reset();
1543 // fhMuchMessTypePerDpb->Reset();
1544 // fhMuchSysMessTypePerDpb->Reset();
1545 // fhStatusMessType->Reset();
1546 fhMsStatusFieldType->Reset();
1547 fhMuchHitsElinkPerDpb->Reset();
1548 // fhMuchFebChanAdcRaw_combined->Reset();
1549 fhDpbMsErrors->Reset();
1550
1551 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1552 if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
1553 fhMuchFebChanCntRaw[uFebIdx]->Reset();
1554 fhMuchFebSpill[uFebIdx]->Reset();
1555 fhMuchChannelTime[uFebIdx]->Reset();
1556 fhMuchFebADC[uFebIdx]->Reset();
1557 //fhMuchFebChanCntRawGood[ uFebIdx ]->Reset();
1559 //fhMuchFebChanAdcRawProf[ uFebIdx ]->Reset();
1560 //fhMuchFebChanAdcCal[ uFebIdx ]->Reset();
1561 //fhMuchFebChanAdcCalProf[ uFebIdx ]->Reset();
1563 // fhMuchFebChanHitRateEvo[ uFebIdx ]->Reset();
1564 // fhMuchFebChanHitRateProf[ uFebIdx ]->Reset();
1565 //fhMuchFebAsicHitRateEvo[ uFebIdx ]->Reset();
1567 // fhMuchFebHitRateEvo_mskch[ uFebIdx ]->Reset();
1568 // fhMuchFebHitRateEvo_mskch_adccut[ uFebIdx ]->Reset();
1569 // fhMuchFebHitRateEvo_WithoutDupli[ uFebIdx ]->Reset();
1570 /*fhMuchFebChanHitRateEvoLong[ uFebIdx ]->Reset();
1571 fhMuchFebAsicHitRateEvoLong[ uFebIdx ]->Reset();
1572 fhMuchFebHitRateEvoLong[ uFebIdx ]->Reset();
1573 fhMuchFebChanDistT[ uFebIdx ]->Reset();
1574 for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )
1575 {
1576 fhMuchFebChanDtCoinc[ uFebIdx ][ uFebIdxB ]->Reset();
1577 fhMuchFebChanCoinc[ uFebIdx ][ uFebIdxB ]->Reset();
1578 } // for( UInt_t uFebIdxB = uFebIdx; uFebIdxB < fuNbFebs; ++uFebIdxB )*/
1579 } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
1580 } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1581
1582 for (UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; ++uLinks) {
1583 TString sMsSzName = Form("MsSz_link_%02u", uLinks);
1584 if (fHM->Exists(sMsSzName.Data())) fHM->H1(sMsSzName.Data())->Reset();
1585
1586 sMsSzName = Form("MsSzTime_link_%02u", uLinks);
1587 if (fHM->Exists(sMsSzName.Data())) fHM->P1(sMsSzName.Data())->Reset();
1588 } // for( UInt_t uLinks = 0; uLinks < kiMaxNbFlibLinks; ++uLinks )
1589
1590 fdStartTime = -1;
1591 fdStartTimeMsSz = -1;
1592}
1593
1595{
1596 TDatime* fRunStartDateTime = new TDatime(dateIn, timeIn);
1597 fiRunStartDateTimeSec = fRunStartDateTime->Convert();
1598 fiBinSizeDatePlots = iBinSize;
1599
1600 LOG(info) << "Assigned new MUCH Run Start Date-Time: " << fRunStartDateTime->AsString();
1601}
1602
1605{
1606 for (UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx) {
1607 if (kTRUE == fUnpackParMuch->IsFebActive(uFebIdx)) {
1608 LOG(info) << Form(" ------------------ Noisy channels scan for FEB %2d ------------", uFebIdx);
1609 for (UInt_t uAsicIdx = 0; uAsicIdx < fUnpackParMuch->GetNbAsicsPerFeb(); ++uAsicIdx)
1610 for (UInt_t uChanIdx = 0; uChanIdx < fUnpackParMuch->GetNbChanPerAsic(); ++uChanIdx) {
1611 UInt_t uChanInFeb = uAsicIdx * fUnpackParMuch->GetNbChanPerAsic() + uChanIdx;
1612 if (dNoiseThreshold < fhMuchFebChanHitRateProf[uFebIdx]->GetBinContent(1 + uChanInFeb))
1613 LOG(info) << Form("Noisy Channel ASIC %d channel %3d (%4d) level %6.0f", uAsicIdx, uChanIdx, uChanInFeb,
1614 fhMuchFebChanHitRateProf[uFebIdx]->GetBinContent(1 + uChanInFeb));
1615
1616 } // for( UInt_t uChanIdx = 0; uChanIdx < fUnpackParMuch->GetNbChanPerAsic(); ++uChanIdx )
1617
1618 LOG(info) << " ---------------------------------------------------------------";
1619 } // if( kTRUE == fUnpackParMuch->IsFebActive( uFebIdx ) )
1620 } // for( UInt_t uFebIdx = 0; uFebIdx < fuNbFebs; ++uFebIdx )
1621 return kTRUE;
1622}
1624
ClassImp(CbmConverterManager)
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
Histogram manager.
Bool_t bMcbm2018ScanNoisyMuchLite
Bool_t bMcbm2018ResetMuchLite
Bool_t bMcbm2018WriteMuchLite
int Int_t
bool Bool_t
Histogram manager.
TProfile * P1(const std::string &name) const
Return pointer to TProfile.
Bool_t Exists(const std::string &name) const
Check existence of object in manager.
void Add(const std::string &name, TNamed *object)
Add new named object to manager.
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
std::vector< TH1 * > fhMuchFebHitRateEvo_mskch_adccut
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
std::vector< std::vector< std::vector< UShort_t > > > fvusChanLastHitAdcInMs
Last hit time in bins in each MS for each Channel.
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
void SetRunStart(Int_t dateIn, Int_t timeIn, Int_t iBinSize=5)
std::vector< TProfile * > fhMuchFebDuplicateHitProf
CbmHistManager * fHM
Coincidences in sorted hits.
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of STS DPBs in system.
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
std::vector< std::vector< ULong64_t > > fvulChanLastHitTime
stsxyter::MessagePrintMask fPrintMessCtrl
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Current data properties.
std::vector< UInt_t > fvuInitialTsMsbCycleHeader
Flag set after seeing MS header in 1st MS for DPB.
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
std::vector< TH2 * > fHistPadDistr
Plots per FEB-8.
void FillEpochInfo(stsxyter::Message mess)
std::vector< UInt_t > fvuInitialHeaderDone
Current TS MSB cycle for DPB.
Int_t fiTimeIntervalRateUpdate
Mean Rate per channel plots.
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
std::vector< Double_t > fvdMsTime
Header time of previous MS per link.
std::vector< std::vector< std::vector< Double_t > > > fvdChanLastHitTimeInMs
Number of hits in each MS for each Channel.
std::vector< std::vector< Bool_t > > fvbCrobActiveFlag
Map of DPB Identifier to DPB index.
void SaveAllHistos(TString sFileName="")
std::vector< TProfile * > fhMuchFebChanAdcRawProf
std::vector< UInt_t > fvuElinkLastTsHit
TS MSB cycle from MS header in 1st MS for DPB.
void FillTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
UInt_t Counter
Rate evolution histos.
std::vector< std::vector< std::vector< UInt_t > > > fvuChanNbHitsInMs
Header time of each MS.
std::vector< TH1 * > fhMuchFebHitRateEvo_mskch
std::vector< Bool_t > fvbMaskedComponents
TProfile * fhMsSzTime[kiMaxNbFlibLinks]
std::vector< std::vector< stsxyter::FinalHit > > fvmFebHitsInMs
All hits (time in bins, ADC in bins, asic, channel) in last TS, per ASIC, sorted with "<" operator.
Bool_t ScanForNoisyChannels(Double_t dNoiseThreshold=1e3)
---------------------------------------------------------------—///
Bool_t fbBinningFw
=> Quick and dirty hack for binning FW!!!
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
std::vector< TH1 * > fhMuchFebHitRateEvo_WithoutDupli
std::vector< Double_t > fvdPrevMsTime
Last hit time in ns for each Channel.
std::vector< std::vector< Double_t > > fdMuchFebChanLastTimeForDist
std::vector< Int_t > fviFebTimeSecLastRateUpdate
UInt_t fuNbStsXyters
Number of StsXyter ASICs.
std::vector< ULong64_t > fvulCurrentTsMsb
Bin size in s for the plots with date as X axis.
std::vector< std::vector< stsxyter::FinalHit > > fvmAsicHitsInMs
All hits (time in bins, ADC in bins, asic, channel) in last TS, sorted with "<" operator.
std::vector< std::vector< Double_t > > fvdFebChanCountsSinceLastRateUpdate
static const Int_t kiMaxNbFlibLinks
Number of StsXyter ASICs.
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
std::vector< Int_t > fviFebCountsSinceLastRateUpdate
TH2 * fhDpbMsErrors
Binning FW error flag.
std::vector< std::vector< Double_t > > fvdChanLastHitTime
Last hit time in bins for each Channel.
std::vector< TProfile * > fhMuchFebChanHitRateProf
Long64_t prevtime_new
Last hit ADC in bins in each MS for each Channel.
Bool_t ProcessMuchMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
CbmMcbm2018MuchPar * fUnpackParMuch
/‍** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **‍/
Bool_t fbPrintMessages
Task configuration values.
UInt_t fuNbFebs
Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ].
void FillHitInfo(stsxyter::Message mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
Int_t ElinkIdxToFebIdx(UInt_t uElink)
static constexpr UInt_t GetNbElinkPerCrob()
Double_t GetRealPadSize(Int_t)
Short_t GetPadXA(UShort_t febid, UShort_t channelid)
static constexpr UInt_t GetNbChanPerAsic()
static constexpr UInt_t GetNbAsicsPerCrob()
static constexpr UInt_t GetNbChanPerFeb()
UInt_t GetDpbId(UInt_t uDpbIdx)
UInt_t ElinkIdxToAsicIdx(UInt_t uElink)
Short_t GetPadYA(UShort_t febid, UShort_t channelid)
Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx)
Bool_t IsFebActive(UInt_t uFebInSystIdx)
static constexpr UInt_t GetNbFebsPerDpb()
static constexpr UInt_t GetNbCrobsPerDpb()
static constexpr UInt_t GetNbAsicsPerFeb()
Data class with information on a STS local track.
XPU_D uint32_t GetTsMsbValBinning() const
For TS MSB data: Returns the TS MSB 29 bit field)
XPU_D uint16_t GetHitAdc() const
For Hit data: Returns ADC value (5 bit field)
XPU_D uint16_t GetHitChannel() const
For Hit data: Returns StsXYTER channel number (7 bit field)
bool PrintMess(std::ostream &os, MessagePrintMask ctrl=MessagePrintMask::msg_print_Human, bool bBinning=true) const
XPU_D uint16_t GetLinkIndex() const
For all data: Returns the (global) index of the eLink on which the message was received (n bit field)
XPU_D MessType GetMessType() const
Returns the message type, see enum MessType.
XPU_D uint16_t GetLinkIndexHitBinning() const
XPU_D uint16_t GetHitTime() const
For Hit data: Returns timestamp (8 bit field, 2 MSB bits overlap removed)
XPU_D uint32_t GetTsMsbVal() const
For TS MSB data: Returns the TS MSB 22 bit field)
XPU_D uint16_t GetHitTimeBinning() const
XPU_D uint16_t GetMsErrorType() const
For End of MS data: Returns the MS error type field (2 bit field)
XPU_D bool IsMsErrorFlagOn() const
For End of MS data: Returns the MS error flag (1 bit field)
Hash for CbmL1LinkKey.
static constexpr uint32_t kuHitNbTsBinsBinning
static constexpr uint64_t kulTsCycleNbBins
static constexpr uint64_t kulTsCycleNbBinsBinning
static constexpr uint32_t kuHitNbTsBins
static constexpr uint32_t kuHitNbAdcBins
Status/properties constants.
static constexpr double kdClockCycleNs
MessType
Message types.