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