CbmRoot
Loading...
Searching...
No Matches
CbmCosy2019MonitorAlgoHodo.cxx
Go to the documentation of this file.
1/* Copyright (C) 2019-2021 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau, Florian Uhlig [committer] */
4
5// -----------------------------------------------------------------------------
6// ----- -----
7// ----- CbmCosy2019MonitorAlgoHodo -----
8// ----- Created 03.07.2019 by P.-A. Loizeau -----
9// ----- -----
10// -----------------------------------------------------------------------------
11
13
15
16//#include "CbmCosy2019HodoPar.h"
17
18#include "FairRootManager.h"
19#include "FairRun.h"
20#include "FairRunOnline.h"
21#include "FairRuntimeDb.h"
22#include <Logger.h>
23
24#include "TCanvas.h"
25#include "TH1.h"
26#include "TH2.h"
27#include "TList.h"
28#include "TProfile.h"
29#include "TROOT.h"
30#include "TString.h"
31
32#include <fstream>
33#include <iomanip>
34#include <iostream>
35
36#include <stdint.h>
37
38// -------------------------------------------------------------------------
41 ,
43 fbMonitorMode(kFALSE)
44 , fbDebugMonitorMode(kFALSE)
45 , fvbMaskedComponents()
46 , fuDpbId(0x5b75)
47 , fvuElinkIdxHodo(kuNbHodos, 0)
48 , fvbHodoSwapXY(kuNbHodos, kFALSE)
49 , fvbHodoInvertX(kuNbHodos, kFALSE)
50 , fvbHodoInvertY(kuNbHodos, kFALSE)
51 , fvuAdcGainHodo(kuNbHodos, 0)
52 , fvuAdcOffsHodo(kuNbHodos, 0)
53 ,
54 /*
55 fUnpackPar( nullptr ),
56 fuNbModules( 0 ),
57 fviModuleType(),
58 fviModAddress(),
59 fuNrOfDpbs( 0 ),
60 fDpbIdIndexMap(),
61 fvbCrobActiveFlag(),
62 fuNbFebs( 0 ),
63 fuNbHodoXyters( 0 ),
64 fviFebModuleIdx(),
65 fviFebModuleSide(),
66 fviFebType(),
67 fvdFebAdcGain(),
68 fvdFebAdcOffs(),
69 fviFebAddress(),
70*/
71 fdTimeOffsetNs(0.0)
72 , fulCurrentTsIdx(0)
73 , fulCurrentMsIdx(0)
74 , fdTsStartTime(-1.0)
75 , fdTsStopTimeCore(-1.0)
76 , fvdPrevMsTime(kiMaxNbFlibLinks, -1.0)
77 , fdMsTime(-1.0)
78 , fuMsIndex(0)
79 , fmMsgCounter()
80 , fuCurrentEquipmentId(0)
81 , fuCurrDpbId(0)
82 , fiRunStartDateTimeSec(-1)
83 , fiBinSizeDatePlots(-1)
84 , fvulCurrentTsMsb()
85 , fdStartTime(-1.0)
86 , fdStartTimeMsSz(-1.0)
87 , ftStartTimeUnix(std::chrono::steady_clock::now())
88 , fvmHitsInMs()
89 , fhHodoMessType(nullptr)
90 , fhHodoStatusMessType(nullptr)
91 , fhHodoMsStatusFieldType(nullptr)
92 , fhHodoMessTypePerElink(nullptr)
93 , fhHodoChanCntRaw(kuNbHodos, nullptr)
94 , fhHodoChanAdcRaw(kuNbHodos, nullptr)
95 , fhHodoChanAdcRawProf(kuNbHodos, nullptr)
96 , fhHodoChanAdcCal(kuNbHodos, nullptr)
97 , fhHodoChanAdcCalProf(kuNbHodos, nullptr)
98 , fhHodoChanRawTs(kuNbHodos, nullptr)
99 , fhHodoChanMissEvt(kuNbHodos, nullptr)
100 , fhHodoChanMissEvtEvo(kuNbHodos, nullptr)
101 , fhHodoChanHitRateEvo(kuNbHodos, nullptr)
102 , fhHodoChanHitRateProf(kuNbHodos, nullptr)
103 , fhHodoChanDistT(kuNbHodos, nullptr)
104 , fhHodoFiberCnt(kuNbHodos, std::vector<TH1*>(kuNbAxis, nullptr))
105 , fhHodoFiberAdc(kuNbHodos, std::vector<TH2*>(kuNbAxis, nullptr))
106 , fhHodoFiberAdcProf(kuNbHodos, std::vector<TProfile*>(kuNbAxis, nullptr))
107 , fhHodoFiberHitRateEvo(kuNbHodos, std::vector<TH2*>(kuNbAxis, nullptr))
108 , fhHodoFiberCoincMapXY(kuNbHodos, nullptr)
109 , fhHodoFiberCoincTimeXY(kuNbHodos, nullptr)
110 , fhHodoFiberCoincWalkXY_X(kuNbHodos, nullptr)
111 , fhHodoFiberCoincWalkXY_Y(kuNbHodos, nullptr)
112 , fhHodoFiberCoincMapSameAB(kuNbAxis, nullptr)
113 , fhHodoFiberCoincTimeSameAB(kuNbAxis, nullptr)
114 , fhHodoFiberCoincMapDiffAB(kuNbAxis, nullptr)
115 , fhHodoFiberCoincTimeDiffAB(kuNbAxis, nullptr)
116 , fhHodoFullCoincPosA(nullptr)
117 , fhHodoFullCoincPosB(nullptr)
118 , fhHodoFullCoincCompX(nullptr)
119 , fhHodoFullCoincCompY(nullptr)
120 , fhHodoFullCoincResidualXY(nullptr)
121 , fhHodoFullCoincTimeDiff(nullptr)
122 , fhHodoFullCoincTimeWalk(kuNbHodos, std::vector<TH2*>(kuNbAxis, nullptr))
123 , fhHodoFullCoincRateEvo(nullptr)
124 , fhHodoFullCoincPosEvo(kuNbHodos, std::vector<TH2*>(kuNbAxis, nullptr))
125 , fhPrevHitDtAllAsics(nullptr)
126 , fhPrevHitDtAsicA(nullptr)
127 , fhPrevHitDtAsicB(nullptr)
128 , fhPrevHitDtAsicsAB(nullptr)
129 , fiTimeIntervalRateUpdate(-1)
130 , fviTimeSecLastRateUpdate(kuNbHodos, 0)
131 , fvdChanCountsSinceLastRateUpdate(kuNbHodos, std::vector<Double_t>(kuNbChanPerAsic, 0.0))
132 , fdHodoChanLastTimeForDist(kuNbHodos, std::vector<Double_t>(kuNbChanPerAsic, 0.0))
133 , fuPreviousHitAsic(0)
134 , fvdPreviousHitTimePerAsic(2, 0.0)
135 , fcSummary(nullptr)
136 , fcHodoSummaryRaw(kuNbHodos, nullptr)
137 , fcHodoSummaryFiber(kuNbHodos, nullptr)
138 , fcHodoFiberCoinc(nullptr)
139 , fcHodoFiberCoincAB(nullptr)
140 , fcHodoFullCoinc(nullptr)
141 , fcHodoFullCoincPos(nullptr)
142 , fcHodoPrevHitDt(nullptr)
143{
144}
150
151// -------------------------------------------------------------------------
153{
154 LOG(info) << "Initializing mCBM HODO 2019 monitor algo";
155
156 return kTRUE;
157}
165
166// -------------------------------------------------------------------------
168{
169 LOG(info) << "Init parameter containers for CbmCosy2019MonitorAlgoHodo";
170 Bool_t initOK = ReInitContainers();
171
172 return initOK;
173}
175{
176 LOG(info) << "**********************************************";
177 LOG(info) << "ReInit parameter containers for CbmCosy2019MonitorAlgoHodo";
178 /*
179 fUnpackPar = (CbmCosy2019HodoPar*)fParCList->FindObject("CbmCosy2019HodoPar");
180 if( nullptr == fUnpackPar )
181 return kFALSE;
182*/
183 Bool_t initOK = InitParameters();
184
185 return initOK;
186}
188{
189 if (nullptr == fParCList) fParCList = new TList();
190 /*
191 fUnpackPar = new CbmCosy2019HodoPar("CbmCosy2019HodoPar");
192 fParCList->Add(fUnpackPar);
193*/
194 return fParCList;
195}
197{
198 /*
199 fuNbModules = fUnpackPar->GetNbOfModules();
200 LOG(info) << "Nr. of STS Modules: " << fuNbModules;
201
202 fviModuleType.resize( fuNbModules );
203 fviModAddress.resize( fuNbModules );
204 for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++uModIdx)
205 {
206 fviModuleType[ uModIdx ] = fUnpackPar->GetModuleType( uModIdx );
207 fviModAddress[ uModIdx ] = fUnpackPar->GetModuleAddress( uModIdx );
208 LOG(info) << "Module #" << std::setw(2) << uModIdx
209 << " Type " << std::setw(4) << fviModuleType[ uModIdx ]
210 << " Address 0x" << std::setw(8) << std::hex <<fviModAddress[ uModIdx ]
211 << std::dec;
212 } // for( UInt_t uModIdx = 0; uModIdx < fuNbModules; ++uModIdx)
213
214 fuNrOfDpbs = fUnpackPar->GetNrOfDpbs();
215 LOG(info) << "Nr. of STS DPBs: " << fuNrOfDpbs;
216
217 fDpbIdIndexMap.clear();
218 for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
219 {
220 fDpbIdIndexMap[ fUnpackPar->GetDpbId( uDpb ) ] = uDpb;
221 LOG(info) << "Eq. ID for DPB #" << std::setw(2) << uDpb << " = 0x"
222 << std::setw(4) << std::hex << fUnpackPar->GetDpbId( uDpb )
223 << std::dec
224 << " => " << fDpbIdIndexMap[ fUnpackPar->GetDpbId( uDpb ) ];
225 } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
226
227 fuNbFebs = fUnpackPar->GetNrOfFebs();
228 LOG(info) << "Nr. of FEBs: " << fuNbFebs;
229
230 fuNbHodoXyters = fUnpackPar->GetNrOfAsics();
231 LOG(info) << "Nr. of HodoXyter ASICs: " << fuNbHodoXyters;
232
233 fvbCrobActiveFlag.resize( fuNrOfDpbs );
234 fviFebModuleIdx.resize( fuNrOfDpbs );
235 fviFebModuleSide.resize( fuNrOfDpbs );
236 fviFebType.resize( fuNrOfDpbs );
237 fvdFebAdcGain.resize( fuNrOfDpbs );
238 fvdFebAdcOffs.resize( fuNrOfDpbs );
239 for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
240 {
241 fvbCrobActiveFlag[ uDpb ].resize( fUnpackPar->GetNbCrobsPerDpb() );
242 fviFebModuleIdx[ uDpb ].resize( fUnpackPar->GetNbCrobsPerDpb() );
243 fviFebModuleSide[ uDpb ].resize( fUnpackPar->GetNbCrobsPerDpb() );
244 fviFebType[ uDpb ].resize( fUnpackPar->GetNbCrobsPerDpb() );
245 fvdFebAdcGain[ uDpb ].resize( fUnpackPar->GetNbCrobsPerDpb() );
246 fvdFebAdcOffs[ uDpb ].resize( fUnpackPar->GetNbCrobsPerDpb() );
247 for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx )
248 {
249 fvbCrobActiveFlag[ uDpb ][ uCrobIdx ] = fUnpackPar->IsCrobActive( uDpb, uCrobIdx );
250
251 fviFebModuleIdx[ uDpb ][ uCrobIdx ].resize( fUnpackPar->GetNbFebsPerCrob() );
252 fviFebModuleSide[ uDpb ][ uCrobIdx ].resize( fUnpackPar->GetNbFebsPerCrob() );
253 fviFebType[ uDpb ][ uCrobIdx ].resize( fUnpackPar->GetNbFebsPerCrob(), -1 );
254 fvdFebAdcGain[ uDpb ][ uCrobIdx ].resize( fUnpackPar->GetNbFebsPerCrob(), 0.0 );
255 fvdFebAdcOffs[ uDpb ][ uCrobIdx ].resize( fUnpackPar->GetNbFebsPerCrob(), 0.0 );
256 for( UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++ uFebIdx )
257 {
258 fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] = fUnpackPar->GetFebModuleIdx( uDpb, uCrobIdx, uFebIdx );
259 fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ] = fUnpackPar->GetFebModuleSide( uDpb, uCrobIdx, uFebIdx );
260 fvdFebAdcGain[ uDpb ][ uCrobIdx ][ uFebIdx ] = fUnpackPar->GetFebAdcGain( uDpb, uCrobIdx, uFebIdx );
261 fvdFebAdcOffs[ uDpb ][ uCrobIdx ][ uFebIdx ] = fUnpackPar->GetFebAdcOffset( uDpb, uCrobIdx, uFebIdx );
262
263 if( 0 <= fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] &&
264 fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] < fuNbModules &&
265 0 <= fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ] &&
266 fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ] < 2 )
267 {
268 switch( fviModuleType[ fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] ] )
269 {
270 case 0: // FEB-8-1 with ZIF connector on the right
271 {
272 // P side (0) has type A (0)
273 // N side (1) has type B (1)
274 fviFebType[ uDpb ][ uCrobIdx ][ uFebIdx ] = fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ];
275
280 fviFebAddress.push_back( fviModAddress[ fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] ]
281 + ( fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ] << 25 ) );
282
283 break;
284 } // case 0: // FEB-8-1 with ZIF connector on the right
285 case 1: // FEB-8-1 with ZIF connector on the left
286 {
287 // P side (0) has type B (1)
288 // N side (1) has type A (0)
289 fviFebType[ uDpb ][ uCrobIdx ][ uFebIdx ] = !(fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ]);
290
295 fviFebAddress.push_back( fviModAddress[ fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] ]
296 + ( (!fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ]) << 25 ) );
297 break;
298 } // case 1: // FEB-8-1 with ZIF connector on the left
299 default:
300 LOG(fatal) << Form( "Bad module type for DPB #%02u CROB #%u FEB %02u: %d",
301 uDpb, uCrobIdx, uFebIdx,
302 fviModuleType[ fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] ] );
303 break;
304 } // switch( fviModuleType[ fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] ] )
305 } // FEB active and module index OK
306 else if( -1 == fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] ||
307 -1 == fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ] )
308 {
309 fviFebAddress.push_back( 0 );
310 } // Module index or type is set to inactive
311 else
312 {
313 LOG(fatal) << Form( "Bad module Index and/or Side for DPB #%02u CROB #%u FEB %02u: %d %d",
314 uDpb, uCrobIdx, uFebIdx,
315 fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ],
316 fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ] );
317 } // Bad module index or type for this FEB
318 } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++ uFebIdx )
319 } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx )
320 } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
321
322 for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
323 {
324 TString sPrintoutLine = Form( "DPB #%02u CROB Active ?: ", uDpb);
325 for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx )
326 {
327 sPrintoutLine += Form( "%1u", ( fvbCrobActiveFlag[ uDpb ][ uCrobIdx ] == kTRUE ) );
328 } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx )
329 LOG(info) << sPrintoutLine;
330 } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
331
332 UInt_t uGlobalFebIdx = 0;
333 for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
334 {
335 for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx )
336 {
337 LOG(info) << Form( "DPB #%02u CROB #%u: ", uDpb, uCrobIdx);
338 for( UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++ uFebIdx )
339 {
340 if( 0 <= fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ] )
341 LOG(info) << Form( " FEB #%02u (%02u): Mod. Idx = %03d Side %c (%2d) Type %c (%2d) (Addr. 0x%08x) ADC gain %4.0f e- ADC Offs %5.0f e-",
342 uFebIdx, uGlobalFebIdx,
343 fviFebModuleIdx[ uDpb ][ uCrobIdx ][ uFebIdx ],
344 1 == fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ] ? 'N': 'P',
345 fviFebModuleSide[ uDpb ][ uCrobIdx ][ uFebIdx ],
346 1 == fviFebType[ uDpb ][ uCrobIdx ][ uFebIdx ] ? 'B' : 'A',
347 fviFebType[ uDpb ][ uCrobIdx ][ uFebIdx ],
348 fviFebAddress[ uGlobalFebIdx ],
349 fvdFebAdcGain[ uDpb ][ uCrobIdx ][ uFebIdx ],
350 fvdFebAdcOffs[ uDpb ][ uCrobIdx ][ uFebIdx ]
351 );
352 uGlobalFebIdx ++;
353 } // for( UInt_t uFebIdx = 0; uFebIdx < fUnpackPar->GetNbFebsPerCrob(); ++ uFebIdx )
354 } // for( UInt_t uCrobIdx = 0; uCrobIdx < fUnpackPar->GetNbCrobsPerDpb(); ++uCrobIdx )
355 } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
356
357 // Internal status initialization
358 fvulCurrentTsMsb.resize( fuNrOfDpbs );
359 fvuCurrentTsMsbCycle.resize( fuNrOfDpbs );
360 for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
361 {
362 fvulCurrentTsMsb[uDpb] = 0;
363 fvuCurrentTsMsbCycle[uDpb] = 0;
364 } // for( UInt_t uDpb = 0; uDpb < fuNrOfDpbs; ++uDpb )
365*/
366
368 /*
369 for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx )
370 {
371 fhHodoFiberCnt[ uHodoIdx ].resize( kuNbAxis, nullptr );
372 fhHodoFiberAdc[ uHodoIdx ].resize( kuNbAxis, nullptr );
373 fhHodoFiberAdcProf[ uHodoIdx ].resize( kuNbAxis, nullptr );
374 fhHodoFiberHitRateEvo[ uHodoIdx ].resize( kuNbAxis, nullptr );
375 fvdChanCountsSinceLastRateUpdate[ uHodoIdx ].resize( kuNbChanPerAsic, 0.0 );
376 fdHodoChanLastTimeForDist[ uHodoIdx ].resize( kuNbChanPerAsic, 0.0 );
377 } // for( uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx )
378*/
379 return kTRUE;
380}
381// -------------------------------------------------------------------------
382
383void CbmCosy2019MonitorAlgoHodo::AddMsComponentToList(size_t component, UShort_t usDetectorId)
384{
386 for (UInt_t uCompIdx = 0; uCompIdx < fvMsComponentsList.size(); ++uCompIdx)
387 if (component == fvMsComponentsList[uCompIdx]) return;
388
390 fvMsComponentsList.push_back(component);
391
392 LOG(info) << "CbmCosy2019MonitorAlgoHodo::AddMsComponentToList => Component " << component << " with detector ID 0x"
393 << std::hex << usDetectorId << std::dec << " added to list";
394}
395// -------------------------------------------------------------------------
396
397Bool_t CbmCosy2019MonitorAlgoHodo::ProcessTs(const fles::Timeslice& ts)
398{
399 fulCurrentTsIdx = ts.index();
400 fdTsStartTime = static_cast<Double_t>(ts.descriptor(0, 0).idx);
401
403 if (0 == fulCurrentTsIdx) { return kTRUE; } // if( 0 == fulCurrentTsIdx )
404
406 if (-1.0 == fdTsCoreSizeInNs) {
407 fuNbCoreMsPerTs = ts.num_core_microslices();
408 fuNbOverMsPerTs = ts.num_microslices(0) - ts.num_core_microslices();
411 LOG(info) << "Timeslice parameters: each TS has " << fuNbCoreMsPerTs << " Core MS and " << fuNbOverMsPerTs
412 << " Overlap MS, for a core duration of " << fdTsCoreSizeInNs << " ns and a full duration of "
413 << fdTsFullSizeInNs << " ns";
414
418 LOG(info) << "In each TS " << fuNbMsLoop << " MS will be looped over";
419 } // if( -1.0 == fdTsCoreSizeInNs )
420
423 // LOG(info) << Form( "TS %5d Start %12f Stop %12f", fulCurrentTsIdx, fdTsStartTime, fdTsStopTimeCore );
424
426 for (fuMsIndex = 0; fuMsIndex < fuNbMsLoop; fuMsIndex++) {
428 for (UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx) {
429 UInt_t uMsComp = fvMsComponentsList[uMsCompIdx];
430
431 if (kFALSE == ProcessMs(ts, uMsComp, fuMsIndex)) {
432 LOG(error) << "Failed to process ts " << fulCurrentTsIdx << " MS " << fuMsIndex << " for component " << uMsComp;
433 return kFALSE;
434 } // if( kFALSE == ProcessMs( ts, uMsCompIdx, fuMsIndex ) )
435 } // for( UInt_t uMsCompIdx = 0; uMsCompIdx < fvMsComponentsList.size(); ++uMsCompIdx )
436
438 std::sort(fvmHitsInMs.begin(), fvmHitsInMs.end());
439 /*
441 for( auto itHitIn = fvmHitsInMs.begin(); itHitIn < fvmHitsInMs.end(); ++itHitIn )
442 {
443 UInt_t uFebIdx = itHitIn->GetAsic() / fUnpackPar->GetNbAsicsPerFeb();
444 UInt_t uChanInFeb = itHitIn->GetChan()
445 + fUnpackPar->GetNbChanPerAsic() * (itHitIn->GetAsic() % fUnpackPar->GetNbAsicsPerFeb());
446
447 ULong64_t ulTimeInNs = static_cast< ULong64_t >( itHitIn->GetTs() * stsxyter::kdClockCycleNs - fdTimeOffsetNs );
448
449 fDigiVect.push_back( CbmHodoDigi( fviFebAddress[ uFebIdx ], uChanInFeb, ulTimeInNs, itHitIn->GetAdc() ) );
450 } // for( auto itHitIn = fvmHitsInMs.begin(); itHitIn < fvmHitsInMs.end(); ++itHitIn )
451*/
452
453 if (kFALSE == FillHistograms()) {
454 LOG(error) << "Failed to fill histos in ts " << fulCurrentTsIdx << " MS " << fuMsIndex;
455 return kFALSE;
456 } // if( kFALSE == FillHistograms() )
457
459 fvmHitsInMs.clear();
460 } // for( fuMsIndex = 0; fuMsIndex < uNbMsLoop; fuMsIndex ++ )
461
463 fvmHitsInMs.clear();
464
465
466 return kTRUE;
467}
468
469Bool_t CbmCosy2019MonitorAlgoHodo::ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx)
470{
471 auto msDescriptor = ts.descriptor(uMsCompIdx, uMsIdx);
472 fuCurrentEquipmentId = msDescriptor.eq_id;
473 const uint8_t* msContent = reinterpret_cast<const uint8_t*>(ts.content(uMsCompIdx, uMsIdx));
474
475 uint32_t uSize = msDescriptor.size;
476 fulCurrentMsIdx = msDescriptor.idx;
477
478 Double_t dMsTime = (1e-9) * static_cast<double>(fulCurrentMsIdx);
479 LOG(debug) << "Microslice: " << fulCurrentMsIdx << " from EqId " << std::hex << fuCurrentEquipmentId << std::dec
480 << " has size: " << uSize;
481
482 if (0 == fvbMaskedComponents.size()) fvbMaskedComponents.resize(ts.num_components(), kFALSE);
483
484 fuCurrDpbId = static_cast<uint32_t>(fuCurrentEquipmentId & 0xFFFF);
485
487 if (fuDpbId != fuCurrDpbId) {
488 if (kFALSE == fvbMaskedComponents[uMsCompIdx]) {
489 LOG(info) << "---------------------------------------------------------------";
490 /*
491 LOG(info) << "hi hv eqid flag si sv idx/start crc size offset";
492 LOG(info) << Form( "%02x %02x %04x %04x %02x %02x %016llx %08x %08x %016llx",
493 static_cast<unsigned int>(msDescriptor.hdr_id),
494 static_cast<unsigned int>(msDescriptor.hdr_ver), msDescriptor.eq_id, msDescriptor.flags,
495 static_cast<unsigned int>(msDescriptor.sys_id),
496 static_cast<unsigned int>(msDescriptor.sys_ver), msDescriptor.idx, msDescriptor.crc,
497 msDescriptor.size, msDescriptor.offset );
498*/
499 LOG(info) << FormatMsHeaderPrintout(msDescriptor);
500 LOG(warning) << "Could not find the sDPB index for AFCK id 0x" << std::hex << fuCurrDpbId << std::dec
501 << " in timeslice " << fulCurrentTsIdx << " in microslice " << uMsIdx << " component " << uMsCompIdx
502 << "\n"
503 << "If valid this index has to be added in the STS "
504 "parameter file in the DbpIdArray field";
505 fvbMaskedComponents[uMsCompIdx] = kTRUE;
506
509 if (1 == fulCurrentTsIdx) return kTRUE;
510 } // if( kFALSE == fvbMaskedComponents[ uMsComp ] )
511 else
512 return kTRUE;
513
514 return kFALSE;
515 } // if( fuDpbId != fuCurrDpbId )
516
518 if (static_cast<Int_t>(fvdPrevMsTime[uMsCompIdx]) < static_cast<Int_t>(dMsTime)) {
520 for (UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx) {
522 if (0 == fviTimeSecLastRateUpdate[uHodoIdx]) {
523 fviTimeSecLastRateUpdate[uHodoIdx] = static_cast<Int_t>(dMsTime);
524 for (UInt_t uChan = 0; uChan < kuNbChanPerAsic; ++uChan) {
525 fvdChanCountsSinceLastRateUpdate[uHodoIdx][uChan] = 0.0;
526 } // for( UInt_t uChan = 0; uChan < kuNbChanPerAsic; ++uChan )
527 continue;
528 } // if( 0 == fviTimeSecLastRateUpdate[ uHodoIdx ] )
529
530 Int_t iTimeInt = static_cast<Int_t>(dMsTime) - fviTimeSecLastRateUpdate[uHodoIdx];
531 if (fiTimeIntervalRateUpdate <= iTimeInt) {
532 for (UInt_t uChan = 0; uChan < kuNbChanPerAsic; ++uChan) {
533 fhHodoChanHitRateProf[uHodoIdx]->Fill(uChan, fvdChanCountsSinceLastRateUpdate[uHodoIdx][uChan] / iTimeInt);
534 fvdChanCountsSinceLastRateUpdate[uHodoIdx][uChan] = 0.0;
535 } // for( UInt_t uChan = 0; uChan < kuNbChanPerAsic; ++uChan )
536
537 fviTimeSecLastRateUpdate[uHodoIdx] = static_cast<Int_t>(dMsTime);
538 } // if( fiTimeIntervalRateUpdate <= iTimeInt )
539 } // for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx )
540 } // if( static_cast<Int_t>( fvdPrevMsTime[ uMsCompIdx ] ) < static_cast<Int_t>( dMsTime ) )
541 fvdPrevMsTime[uMsCompIdx] = dMsTime;
542
544 uint16_t uMsHeaderFlags = msDescriptor.flags;
545 for (UInt_t uBit = 0; uBit < 16; ++uBit)
546 fhHodoMsStatusFieldType->Fill(uBit, (uMsHeaderFlags >> uBit) & 0x1);
547
549 UInt_t uTsMsbCycleHeader = std::floor(fulCurrentMsIdx / (stsxyter::kulTsCycleNbBins * stsxyter::kdClockCycleNs));
550
551 if (0 == uMsIdx) {
552 fvuCurrentTsMsbCycle = uTsMsbCycleHeader;
554 } // if( 0 == uMsIdx )
555 else if (uTsMsbCycleHeader != fvuCurrentTsMsbCycle && 4194303 != fvulCurrentTsMsb) {
556 LOG(warning) << "TS MSB cycle from MS header does not match current cycle from data "
557 << "for TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx
558 << " MsInTs " << std::setw(3) << uMsIdx << " ====> " << fvuCurrentTsMsbCycle << " VS "
559 << uTsMsbCycleHeader;
560 fvuCurrentTsMsbCycle = uTsMsbCycleHeader;
561 }
562
563 // If not integer number of message in input buffer, print warning/error
564 if (0 != (uSize % kuBytesPerMessage))
565 LOG(error) << "The input microslice buffer does NOT "
566 << "contain only complete nDPB messages!";
567
568 // Compute the number of complete messages in the input microslice buffer
569 uint32_t uNbMessages = (uSize - (uSize % kuBytesPerMessage)) / kuBytesPerMessage;
570
571 // Prepare variables for the loop on contents
572 const uint32_t* pInBuff = reinterpret_cast<const uint32_t*>(msContent);
573 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
574 // Fill message
575 uint32_t ulData = static_cast<uint32_t>(pInBuff[uIdx]);
576
577 stsxyter::Message mess(static_cast<uint32_t>(ulData & 0xFFFFFFFF));
578
580 stsxyter::MessType typeMess = mess.GetMessType();
581 fmMsgCounter[typeMess]++;
582 fhHodoMessType->Fill(static_cast<uint16_t>(typeMess));
583
584 switch (typeMess) {
586 // Extract the eLink and Asic indices => Should GO IN the fill method now that obly hits are link/asic specific!
587 UShort_t usElinkIdx = mess.GetLinkIndex();
588 fhHodoMessTypePerElink->Fill(usElinkIdx, static_cast<uint16_t>(typeMess));
589
591 UInt_t uHodoIdx = 0;
592 Bool_t bBadElink = kTRUE;
593 for (uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx)
594 if (fvuElinkIdxHodo[uHodoIdx] == usElinkIdx) {
595 bBadElink = kFALSE;
596 break;
597 } // if( fuElinkIdxHodo[ uHodo ] == usElinkIdx )
598
599 if (bBadElink) {
600 LOG(warning) << "CbmCosy2019MonitorAlgoHodo::DoUnpack => "
601 << "Wrong elink Idx! Elink raw " << Form("%2d", usElinkIdx);
602 continue;
603 } // if( bBadElink )
604
605 ProcessHitInfo(mess, uHodoIdx, uMsIdx);
606 break;
607 } // case stsxyter::MessType::Hit :
609 fhHodoMessTypePerElink->Fill(0., static_cast<uint16_t>(typeMess));
610
611 ProcessTsMsbInfo(mess, uIdx, uMsIdx);
612 break;
613 } // case stsxyter::MessType::TsMsb :
615 fhHodoMessTypePerElink->Fill(0., static_cast<uint16_t>(typeMess));
616
617 // The first message in the TS is a special ones: EPOCH
618 ProcessEpochInfo(mess);
619
620 if (0 < uIdx)
621 LOG(info) << "CbmCosy2019MonitorAlgoHodo::DoUnpack => "
622 << "EPOCH message at unexpected position in MS: message " << uIdx << " VS message 0 expected!";
623 break;
624 } // case stsxyter::MessType::TsMsb :
626 UShort_t usElinkIdx = mess.GetStatusLink();
627 fhHodoMessTypePerElink->Fill(usElinkIdx, static_cast<uint16_t>(typeMess));
628 ProcessStatusInfo(mess);
629 break;
630 } // case stsxyter::MessType::Status
632 fhHodoMessTypePerElink->Fill(0., static_cast<uint16_t>(typeMess));
633 // FillTsMsbInfo( mess );
634 break;
635 } // case stsxyter::MessType::Empty :
637 fhHodoMessTypePerElink->Fill(0., static_cast<uint16_t>(typeMess));
638 break;
639 } // case stsxyter::MessType::Dummy / ReadDataAck / Ack :
640 default: {
641 LOG(fatal) << "CbmCosy2019MonitorAlgoHodo::DoUnpack => "
642 << "Unknown message type, should never happen, stopping "
643 "here! Type found was: "
644 << static_cast<int>(typeMess);
645 }
646 } // switch( typeMess )
647 } // for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx ++)
648
649 return kTRUE;
650}
651
652// -------------------------------------------------------------------------
654 const UInt_t& /*uMsIdx*/)
655{
656 UShort_t usChan = mess.GetHitChannel();
657 UShort_t usRawAdc = mess.GetHitAdc();
658 // UShort_t usTsOver = mess.GetHitTimeOver();
659 UShort_t usRawTs = mess.GetHitTime();
660
661 fhHodoChanCntRaw[uHodoIdx]->Fill(usChan);
662 fhHodoChanAdcRaw[uHodoIdx]->Fill(usChan, usRawAdc);
663 fhHodoChanAdcRawProf[uHodoIdx]->Fill(usChan, usRawAdc);
664 fhHodoChanRawTs[uHodoIdx]->Fill(usChan, usRawTs);
665 fhHodoChanMissEvt[uHodoIdx]->Fill(usChan, mess.IsHitMissedEvts());
666
667 /*
668 Double_t dCalAdc = fvdFebAdcOffs[ fuCurrDpbIdx ][ uCrobIdx ][ uFebIdx ]
669 + (usRawAdc - 1)* fvdFebAdcGain[ fuCurrDpbIdx ][ uCrobIdx ][ uFebIdx ];
670 fhHodoChanAdcCal[ uHodoIdx ]->Fill( usChan, dCalAdc );
671 fhHodoChanAdcCalProf[ uHodoIdx ]->Fill( usChan, dCalAdc );
672*/
673
675 UInt_t uAxis = kuChannelToPlaneMap[usChan];
676 UInt_t uFiber = kuChannelToFiberMap[usChan];
677
679 fhHodoFiberCnt[uHodoIdx][uAxis]->Fill(uFiber);
680 fhHodoFiberAdc[uHodoIdx][uAxis]->Fill(uFiber, usRawAdc);
681 fhHodoFiberAdcProf[uHodoIdx][uAxis]->Fill(uFiber, usRawAdc);
682
685 Long64_t ulHitTime = usRawTs;
686 ulHitTime += static_cast<ULong64_t>(stsxyter::kuHitNbTsBins) * static_cast<ULong64_t>(fvulCurrentTsMsb)
687 + static_cast<ULong64_t>(stsxyter::kulTsCycleNbBins) * static_cast<ULong64_t>(fvuCurrentTsMsbCycle);
688
690 Double_t dHitTimeNs = ulHitTime * stsxyter::kdClockCycleNs;
691
693 fhHodoChanDistT[uHodoIdx]->Fill(dHitTimeNs - fdHodoChanLastTimeForDist[uHodoIdx][usChan], usChan);
694 fdHodoChanLastTimeForDist[uHodoIdx][usChan] = dHitTimeNs;
695
696 fvmHitsInMs.push_back(stsxyter::FinalHit(ulHitTime, usRawAdc, uHodoIdx, uFiber, uAxis, 0));
697
699 if (-1 == fdStartTime) fdStartTime = dHitTimeNs;
700
701 // Fill histos with time as X axis
702 Double_t dTimeSinceStartSec = (dHitTimeNs - fdStartTime) * 1e-9;
703 // Double_t dTimeSinceStartMin = dTimeSinceStartSec / 60.0;
704
705 fvdChanCountsSinceLastRateUpdate[uHodoIdx][usChan] += 1;
706
707 fhHodoChanHitRateEvo[uHodoIdx]->Fill(dTimeSinceStartSec, usChan);
708 fhHodoFiberHitRateEvo[uHodoIdx][uAxis]->Fill(dTimeSinceStartSec, uFiber);
709 if (mess.IsHitMissedEvts()) {
710 fhHodoChanMissEvtEvo[uHodoIdx]->Fill(dTimeSinceStartSec, usChan);
711 } // if( mess.IsHitMissedEvts() )
712}
713
714void CbmCosy2019MonitorAlgoHodo::ProcessTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx, UInt_t uMsIdx)
715{
716 UInt_t uVal = mess.GetTsMsbVal();
717
718 // Update Status counters
719 if (uVal < fvulCurrentTsMsb) {
720
721 LOG(info) << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx << " MS Idx "
722 << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " Old TsMsb " << std::setw(5)
723 << fvulCurrentTsMsb << " Old MsbCy " << std::setw(5) << fvuCurrentTsMsbCycle << " new TsMsb "
724 << std::setw(5) << uVal;
725
727 } // if( uVal < fvulCurrentTsMsb )
728 if (uVal != fvulCurrentTsMsb + 1 && 0 != uVal && 4194303 != fvulCurrentTsMsb
729 && 1 != uMessIdx) // 1st TS MSB in MS always repat of last in prev MS
730 {
731 LOG(info) << "TS MSb Jump in "
732 << " TS " << std::setw(12) << fulCurrentTsIdx << " MS " << std::setw(12) << fulCurrentMsIdx << " MS Idx "
733 << std::setw(4) << uMsIdx << " Msg Idx " << std::setw(5) << uMessIdx << " => Old TsMsb " << std::setw(5)
734 << fvulCurrentTsMsb << " new TsMsb " << std::setw(5) << uVal;
735 } // if( uVal + 1 != fvulCurrentTsMsb && 4194303 != uVal && 0 != fvulCurrentTsMsb && 1 != uMessIdx )
736 fvulCurrentTsMsb = uVal;
737 /*
738 ULong64_t ulNewTsMsbTime = static_cast< ULong64_t >( stsxyter::kuHitNbTsBins )
739 * static_cast< ULong64_t >( fvulCurrentTsMsb )
740 + static_cast< ULong64_t >( stsxyter::kulTsCycleNbBins )
741 * static_cast< ULong64_t >( fvuCurrentTsMsbCycle );
742*/
743}
744
746{
747 // UInt_t uVal = mess.GetEpochVal();
748 // UInt_t uCurrentCycle = uVal % stsxyter::kulTsCycleNbBins;
749
750 /*
751 // Update Status counters
752 if( usVal < fvulCurrentTsMsb )
753 fvuCurrentTsMsbCycle ++;
754 fvulCurrentTsMsb = usVal;
755*/
756}
757
759{
760 /*
761 UInt_t uCrobIdx = usElinkIdx / XXXX
762 Int_t uFebIdx = XXXX
763 UInt_t uAsicIdx = XXX
764
765 UShort_t usStatusField = mess.GetStatusStatus();
766
767 fhPulserStatusMessType->Fill( uAsicIdx, usStatusField );
769 if( fbPrintMessages )
770 {
771 std::cout << Form("TS %12u MS %12u mess %5u ", fulCurrentTsIdx, fulCurrentMsIdx, uIdx );
772 mess.PrintMess( std::cout, fPrintMessCtrl );
773 } // if( fbPrintMessages )
774*/
775}
776
777// -------------------------------------------------------------------------
778
779// -------------------------------------------------------------------------
780
782{
783 fhHodoMessType = new TH1I("hHodoMessType", "Nb of message for each type; Type", 6, 0., 6.);
784 fhHodoMessType->GetXaxis()->SetBinLabel(1, "Dummy");
785 fhHodoMessType->GetXaxis()->SetBinLabel(2, "Hit");
786 fhHodoMessType->GetXaxis()->SetBinLabel(3, "TsMsb");
787 fhHodoMessType->GetXaxis()->SetBinLabel(4, "Epoch");
788 fhHodoMessType->GetXaxis()->SetBinLabel(5, "Status");
789 fhHodoMessType->GetXaxis()->SetBinLabel(6, "Empty");
790
792 new TH2I("hHodoStatusMessType", "Nb of status message of each type for each DPB; ASIC; Status Type", kuNbHodos, 0,
793 kuNbHodos, 16, 0., 16.);
794 /*
795 fhHodoStatusMessType->GetYaxis()->SetBinLabel( 1, "Dummy");
796 fhHodoStatusMessType->GetYaxis()->SetBinLabel( 2, "Hit");
797 fhHodoStatusMessType->GetYaxis()->SetBinLabel( 3, "TsMsb");
798 fhHodoStatusMessType->GetYaxis()->SetBinLabel( 4, "Epoch");
799*/
800
802 new TH2I("hHodoMsStatusFieldType", "For each flag in the MS header, ON/OFF counts; Flag bit []; ON/OFF; MS []", 16,
803 -0.5, 15.5, 2, -0.5, 1.5);
804 /*
805 fhHodoStatusMessType->GetYaxis()->SetBinLabel( 1, "Dummy");
806 fhHodoStatusMessType->GetYaxis()->SetBinLabel( 2, "Hit");
807 fhHodoStatusMessType->GetYaxis()->SetBinLabel( 3, "TsMsb");
808 fhHodoStatusMessType->GetYaxis()->SetBinLabel( 4, "Epoch");
809*/
810
811 fhHodoMessTypePerElink = new TH2I("hHodoMessTypePerElink", "Nb of message of each type for each eLink; eLink; Type",
812 kuNbElinksDpb, 0, kuNbElinksDpb, 6, 0., 6.);
813 fhHodoMessTypePerElink->GetYaxis()->SetBinLabel(1, "Dummy");
814 fhHodoMessTypePerElink->GetYaxis()->SetBinLabel(2, "Hit");
815 fhHodoMessTypePerElink->GetYaxis()->SetBinLabel(3, "TsMsb");
816 fhHodoMessTypePerElink->GetYaxis()->SetBinLabel(4, "Epoch");
817 fhHodoMessTypePerElink->GetYaxis()->SetBinLabel(5, "Status");
818 fhHodoMessTypePerElink->GetYaxis()->SetBinLabel(6, "Empty");
819
820 AddHistoToVector(fhHodoMessType, "MessTypes");
824
825 for (UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx) {
828 fhHodoChanCntRaw[uHodoIdx] = new TH1I(Form("hHodoChanCntRaw_%u", uHodoIdx),
829 Form("Hits Count per channel, Hodo #%u; Channel; Hits []", uHodoIdx),
830 kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5);
831
833 fhHodoChanAdcRaw[uHodoIdx] = new TH2I(Form("hHodoChanAdcRaw_%u", uHodoIdx),
834 Form("Raw Adc distribution per channel, Hodo #%u; Channel []; "
835 "Adc []; Hits []",
836 uHodoIdx),
839
841 fhHodoChanAdcRawProf[uHodoIdx] =
842 new TProfile(Form("hHodoChanAdcRawProf_%u", uHodoIdx),
843 Form("Raw Adc prodile per channel, Hodo #%u; Channel []; Adc []", uHodoIdx), kuNbChanPerAsic, -0.5,
844 kuNbChanPerAsic - 0.5);
845 /*
847 fhHodoChanAdcCal[ uHodoIdx ] = new TH2I( Form( "hHodoChanAdcCal_%u", uHodoIdx ),
848 Form( "Cal. Adc distribution per channel, Hodo #%u; Channel []; Adc [e-]; Hits []", uHodoIdx ),
849 kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5,
850 50, 0., 100000. );
851
853 fhHodoChanAdcCalProf[ uHodoIdx ] = new TProfile( Form( "hHodoChanAdcCalProf_%u", uHodoIdx ),
854 Form( "Cal. Adc prodile per channel, Hodo #%u; Channel []; Adc [e-]", uHodoIdx ),
855 kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5 );
856*/
858 fhHodoChanRawTs[uHodoIdx] = new TH2I(Form("hHodoChanRawTs_%u", uHodoIdx),
859 Form("Raw Timestamp distribution per channel, FEB #%03u; "
860 "Channel []; Ts []; Hits []",
861 uHodoIdx),
864
866 fhHodoChanMissEvt[uHodoIdx] = new TH2I(Form("hHodoChanMissEvt_%u", uHodoIdx),
867 Form("Missed Event flags per channel, Hodo #%u; Channel []; "
868 "Miss Evt []; Hits []",
869 uHodoIdx),
870 kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5, 2, -0.5, 1.5);
871
873 fhHodoChanMissEvtEvo[uHodoIdx] = new TH2I(Form("hHodoChanMissEvtEvo_%u", uHodoIdx),
874 Form("Missed Evt flags per second & channel in Hodo #%u; Time "
875 "[s]; Channel []; Missed Evt flags []",
876 uHodoIdx),
877 1800, 0, 1800, kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5);
878
880 fhHodoChanHitRateEvo[uHodoIdx] =
881 new TH2I(Form("hHodoChanHitRateEvo_%u", uHodoIdx),
882 Form("Hits per second & channel in Hodo #%u; Time [s]; Channel []; Hits []", uHodoIdx), 1800, 0, 1800,
883 kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5);
884
886 fhHodoChanHitRateProf[uHodoIdx] =
887 new TProfile(Form("hHodoChanHitRateProf_%u", uHodoIdx),
888 Form("Hits per second for each channel in Hodo #%u; Channel []; Hits/s []", uHodoIdx),
889 kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5);
890
892 fhHodoChanDistT[uHodoIdx] = new TH2I(Form("hHodoChanDistT_%u", uHodoIdx),
893 Form("Time distance between hits on same channel in Hodo #%u; "
894 "Time difference [ns]; Channel []; ",
895 uHodoIdx),
896 1000, -0.5, 6250.0 - 0.5, kuNbChanPerAsic, -0.5, kuNbChanPerAsic - 0.5);
897
899 for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) {
900 Char_t cAxisName = (uAxis ? 'Y' : 'X');
902 fhHodoFiberCnt[uHodoIdx][uAxis] =
903 new TH1I(Form("hHodoFiberCnt%c_%u", cAxisName, uHodoIdx),
904 Form("Hits Count per Fiber, Hodo #%u Axis %c; Fiber; Hits []", uHodoIdx, cAxisName),
905 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5);
906
908 fhHodoFiberAdc[uHodoIdx][uAxis] = new TH2I(Form("fhHodoFiberAdc%c_%u", cAxisName, uHodoIdx),
909 Form("Raw Adc distribution per Fiber, Hodo #%u Axis %c; "
910 "Channel []; Adc []; Hits []",
911 uHodoIdx, cAxisName),
912 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5,
914
916 fhHodoFiberAdcProf[uHodoIdx][uAxis] =
917 new TProfile(Form("hHodoFiberAdcProf%c_%u", cAxisName, uHodoIdx),
918 Form("Raw Adc prodile per Fiber, Hodo #%u Axis %c; Channel []; Adc []", uHodoIdx, cAxisName),
919 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5);
920
922 fhHodoFiberHitRateEvo[uHodoIdx][uAxis] =
923 new TH2I(Form("hHodoFiberHitRateEvo%c_%u", cAxisName, uHodoIdx),
924 Form("Hits per second & Fiber in Hodo #%u Axis %c; Time [s]; "
925 "Channel []; Hits []",
926 uHodoIdx, cAxisName),
927 1800, 0, 1800, kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5);
928
929 AddHistoToVector(fhHodoFiberCnt[uHodoIdx][uAxis], "Fibers");
930 AddHistoToVector(fhHodoFiberAdc[uHodoIdx][uAxis], "Fibers");
931 AddHistoToVector(fhHodoFiberAdcProf[uHodoIdx][uAxis], "Fibers");
932 AddHistoToVector(fhHodoFiberHitRateEvo[uHodoIdx][uAxis], "Fibers");
933 } // for( UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis )
934
937
940 fhHodoFiberCoincMapXY[uHodoIdx] = new TH2I(Form("hHodoFiberCoincMapXY_%u", uHodoIdx),
941 Form("Map of coincident (X, Y) pairs in Hodo #%u; X [Fiber]; Y "
942 "[Fiber]; Hits []",
943 uHodoIdx),
944 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5,
945 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5);
947 fhHodoFiberCoincTimeXY[uHodoIdx] = new TH1I(Form("hHodoFiberCoincTimeXY_%u", uHodoIdx),
948 Form("Time difference of coincident (X, Y) pairs in Hodo #%u; "
949 "t_Y - t_X [ns]; Hits []",
950 uHodoIdx),
953 fhHodoFiberCoincWalkXY_X[uHodoIdx] = new TH2I(Form("hHodoFiberCoincWalkXY_X_%u", uHodoIdx),
954 Form("Walk X of coincident (X, Y) pairs in Hodo #%u; ADC X "
955 "[bin]; t_Y - t_X [ns]; Hits []",
956 uHodoIdx),
959 fhHodoFiberCoincWalkXY_Y[uHodoIdx] = new TH2I(Form("hHodoFiberCoincWalkXY_Y_%u", uHodoIdx),
960 Form("Walk X of coincident (X, Y) pairs in Hodo #%u; ADC X "
961 "[bin]; t_Y - t_X [ns]; Hits []",
962 uHodoIdx),
965
966 AddHistoToVector(fhHodoChanCntRaw[uHodoIdx], "Raw");
967 AddHistoToVector(fhHodoChanAdcRaw[uHodoIdx], "Raw");
968 AddHistoToVector(fhHodoChanAdcRawProf[uHodoIdx], "Raw");
969 // AddHistoToVector( fhHodoChanAdcCal[ uHodoIdx ], "Raw" );
970 // AddHistoToVector( fhHodoChanAdcCalProf[ uHodoIdx ], "Raw" );
971 AddHistoToVector(fhHodoChanRawTs[uHodoIdx], "Raw");
972 AddHistoToVector(fhHodoChanMissEvt[uHodoIdx], "Raw");
973 AddHistoToVector(fhHodoChanMissEvtEvo[uHodoIdx], "Raw");
974 AddHistoToVector(fhHodoChanHitRateEvo[uHodoIdx], "Raw");
975 AddHistoToVector(fhHodoChanHitRateProf[uHodoIdx], "Raw");
976 AddHistoToVector(fhHodoChanDistT[uHodoIdx], "Raw");
977 AddHistoToVector(fhHodoFiberCoincMapXY[uHodoIdx], "Coinc");
978 AddHistoToVector(fhHodoFiberCoincTimeXY[uHodoIdx], "Coinc");
979 AddHistoToVector(fhHodoFiberCoincWalkXY_X[uHodoIdx], "Coinc");
980 AddHistoToVector(fhHodoFiberCoincWalkXY_Y[uHodoIdx], "Coinc");
981 } // for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx )
982
983 for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) {
984 Char_t cAxisName = (uAxis ? 'Y' : 'X');
985 Char_t cOtherAxisName = (uAxis ? 'X' : 'Y');
988 fhHodoFiberCoincMapSameAB[uAxis] = new TH2I(Form("hHodoFiberCoincMapSameAB_%c%c", cAxisName, cAxisName),
989 Form("Map of coincident (%c, %c) pairs in Hodo A and B; %c_A "
990 "[Fiber]; %c_B [Fiber]; Hits []",
991 cAxisName, cAxisName, cAxisName, cAxisName),
992 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5,
993 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5);
995 fhHodoFiberCoincTimeSameAB[uAxis] = new TH1I(Form("hHodoFiberCoincTimeSameAB_%c%c", cAxisName, cAxisName),
996 Form("Time difference of coincident (%c, %c) pairs in Hodo A "
997 "and B; t_%c_B - t_%c_A [ns]; Hits []",
998 cAxisName, cAxisName, cAxisName, cAxisName),
1000
1002 fhHodoFiberCoincMapDiffAB[uAxis] = new TH2I(Form("hHodoFiberCoincMapDiffAB_%c%c", cAxisName, cOtherAxisName),
1003 Form("Map of coincident (%c, %c) pairs in Hodo A and B; %c_A "
1004 "[Fiber]; %c_B [Fiber]; Hits []",
1005 cAxisName, cOtherAxisName, cOtherAxisName, cAxisName),
1006 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5,
1007 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5);
1009 fhHodoFiberCoincTimeDiffAB[uAxis] = new TH1I(Form("hHodoFiberCoincTimeDiffAB_%c%c", cAxisName, cOtherAxisName),
1010 Form("Time difference of coincident (%c, %c) pairs in Hodo A and B; "
1011 "t_%c_B - t_%c_A [ns]; Hits []",
1012 cAxisName, cOtherAxisName, cOtherAxisName, cAxisName),
1014
1019 } // for( UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis )
1020
1023 fhHodoFullCoincPosA = new TH2I("fhHodoFullCoincPosA",
1024 "Position on Hodo A for coincident pairs in Hodo A and B; X_A "
1025 "[Fiber]; Y_A [Fiber]; Hits []",
1026 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2, -0.5,
1027 kuNbChanPerAsic / 2 - 0.5);
1029 fhHodoFullCoincPosB = new TH2I("fhHodoFullCoincPosB",
1030 "Position on Hodo B for coincident pairs in Hodo A and B; X_B "
1031 "[Fiber]; Y_B [Fiber]; Hits []",
1032 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2, -0.5,
1033 kuNbChanPerAsic / 2 - 0.5);
1035 fhHodoFullCoincCompX = new TH2I("hHodoFullCoincCompX",
1036 "Comparison of X pos for coincident pairs in Hodo A and B; X_A "
1037 "[Fiber]; X_B [Fiber]; Hits []",
1038 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2, -0.5,
1039 kuNbChanPerAsic / 2 - 0.5);
1041 fhHodoFullCoincCompY = new TH2I("hHodoFullCoincCompY",
1042 "Comparison of Y pos for coincident pairs in Hodo A and B; Y_A "
1043 "[Fiber]; Y_B [Fiber]; Hits []",
1044 kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2, -0.5,
1045 kuNbChanPerAsic / 2 - 0.5);
1046
1049 new TH2I("hHodoFullCoincResidualXY",
1050 "X and Y residuals for coincident pairs in Hodo A and B; X_B - "
1051 "X_A [Fiber]; Y_B - Y_A [Fiber]; Hits []",
1052 kuNbChanPerAsic + 1, -1.0 * kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2 + 0.5, kuNbChanPerAsic + 1,
1053 -1.0 * kuNbChanPerAsic / 2 - 0.5, kuNbChanPerAsic / 2 + 0.5);
1055 fhHodoFullCoincTimeDiff = new TH1I("hHodoFullCoincTimeDiff",
1056 "Time difference of coincident pairs in Hodo A and B; (t_X_B + "
1057 "t_Y_B)/2 - (t_X_A + t_Y_A)/2 [ns]; Hits []",
1059
1060 fhHodoFullCoincRateEvo = new TH1I("fhHodoFullCoincRateEvo",
1061 "Evolution of the full coincidence rate; "
1062 "Time in run [s]; Full coincidences;",
1063 1800, -0.5, 1800 - 0.5);
1064
1072
1073 for (UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx) {
1074 for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) {
1075 Char_t cAxisName = (uAxis ? 'Y' : 'X');
1076 fhHodoFullCoincTimeWalk[uHodoIdx][uAxis] =
1077 new TH2I(Form("hHodoFullCoincTimeWalk_%u%c", uHodoIdx, cAxisName),
1078 Form("Time walk of coincident (A, B) pairs in Hodo #%u Axis "
1079 "%c; ADC %u_%c [bin]; Time Diff <B> - <A> [ns]; Hits []",
1080 uHodoIdx, cAxisName, uHodoIdx, cAxisName),
1083 AddHistoToVector(fhHodoFullCoincTimeWalk[uHodoIdx][uAxis], "Walk");
1084
1085 fhHodoFullCoincPosEvo[uHodoIdx][uAxis] =
1086 new TH2I(Form("hHodoFullCoincPosEvo_%u%c", uHodoIdx, cAxisName),
1087 Form("Time evolution of coincident (A, B) pairs position in Hodo #%u "
1088 "Axis %c; Time in run [s]; Position %u_%c [Fiber]; Hits []",
1089 uHodoIdx, cAxisName, uHodoIdx, cAxisName),
1090 2000, -0.5, 1000 - 0.5, kuNbChanPerAsic / 2, -0.5, kuNbChanPerAsic / 2 - 0.5);
1091 AddHistoToVector(fhHodoFullCoincPosEvo[uHodoIdx][uAxis], "FullCoinc");
1092 } // for( UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis )
1093 } // for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx )
1094
1096 fhPrevHitDtAllAsics = new TH1I("hPrevHitDtAllAsics",
1097 "Time difference between current and previous hits in any ASIC; t "
1098 "- t_prev [ns]; Hit pairs []",
1099 10000, 0.0, 10000 * stsxyter::kdClockCycleNs);
1100 fhPrevHitDtAsicA = new TH1I("hPrevHitDtAsicA",
1101 "Time difference between current and previous "
1102 "hits in ASIC A; t - t_prev [ns]; Hit pairs []",
1103 10000, 0.0, 10000 * stsxyter::kdClockCycleNs);
1104 fhPrevHitDtAsicB = new TH1I("hPrevHitDtAsicB",
1105 "Time difference between current and previous "
1106 "hits in ASIC B; t - t_prev [ns]; Hit pairs []",
1107 10000, 0.0, 10000 * stsxyter::kdClockCycleNs);
1108 fhPrevHitDtAsicsAB = new TH1I("hPrevHitDtAsicsAB",
1109 "Time difference between current in ASIC A and previous hit in "
1110 "ASIC B; t - t_prev [ns]; Hit pairs []",
1111 10000, 0.0, 10000 * stsxyter::kdClockCycleNs);
1112
1113 AddHistoToVector(fhPrevHitDtAllAsics, "SetupDebugging");
1114 AddHistoToVector(fhPrevHitDtAsicA, "SetupDebugging");
1115 AddHistoToVector(fhPrevHitDtAsicB, "SetupDebugging");
1116 AddHistoToVector(fhPrevHitDtAsicsAB, "SetupDebugging");
1117
1119 Double_t w = 860;
1120 Double_t h = 480;
1121
1122 fcSummary = new TCanvas("fcSummary", "Summary for the Hodo sDPB", w, h);
1123 fcSummary->Divide(2, 2);
1124
1125 fcSummary->cd(1);
1126 gPad->SetGridx();
1127 gPad->SetGridy();
1128 gPad->SetLogy();
1129 fhHodoMessType->Draw("hist");
1130
1131 fcSummary->cd(2);
1132 gPad->SetGridx();
1133 gPad->SetGridy();
1134 gPad->SetLogz();
1135 fhHodoStatusMessType->Draw("colz");
1136
1137 fcSummary->cd(3);
1138 gPad->SetGridx();
1139 gPad->SetGridy();
1140 gPad->SetLogz();
1141 fhHodoMsStatusFieldType->Draw("colz");
1142
1143 fcSummary->cd(4);
1144 gPad->SetGridx();
1145 gPad->SetGridy();
1146 gPad->SetLogz();
1147 fhHodoMessTypePerElink->Draw("colz");
1148
1149 AddCanvasToVector(fcSummary, "canvases");
1150
1151
1152 for (UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx) {
1154 fcHodoSummaryRaw[uHodoIdx] =
1155 new TCanvas(Form("cHodoSummaryRaw%u", uHodoIdx), Form("Raw Summary for Hodo %u", uHodoIdx), w, h);
1156 fcHodoSummaryRaw[uHodoIdx]->Divide(4, 2);
1157
1158 fcHodoSummaryRaw[uHodoIdx]->cd(1);
1159 gPad->SetGridx();
1160 gPad->SetGridy();
1161 gPad->SetLogy();
1162 fhHodoChanCntRaw[uHodoIdx]->Draw("hist");
1163
1164 fcHodoSummaryRaw[uHodoIdx]->cd(2);
1165 gPad->SetGridx();
1166 gPad->SetGridy();
1167 gPad->SetLogy();
1168 fhHodoChanHitRateProf[uHodoIdx]->Draw("hist");
1169
1170 fcHodoSummaryRaw[uHodoIdx]->cd(3);
1171 gPad->SetGridx();
1172 gPad->SetGridy();
1173 gPad->SetLogz();
1174 fhHodoChanAdcRaw[uHodoIdx]->Draw("colz");
1175
1176 fcHodoSummaryRaw[uHodoIdx]->cd(4);
1177 gPad->SetGridx();
1178 gPad->SetGridy();
1179 fhHodoChanAdcRawProf[uHodoIdx]->Draw("hist");
1180
1181 fcHodoSummaryRaw[uHodoIdx]->cd(5);
1182 gPad->SetGridx();
1183 gPad->SetGridy();
1184 gPad->SetLogz();
1185 fhHodoChanDistT[uHodoIdx]->Draw("colz");
1186
1187 fcHodoSummaryRaw[uHodoIdx]->cd(6);
1188 gPad->SetGridx();
1189 gPad->SetGridy();
1190 gPad->SetLogz();
1191 fhHodoChanHitRateEvo[uHodoIdx]->Draw("colz");
1192
1193 fcHodoSummaryRaw[uHodoIdx]->cd(7);
1194 gPad->SetGridx();
1195 gPad->SetGridy();
1196 gPad->SetLogz();
1197 fhHodoChanMissEvt[uHodoIdx]->Draw("colz");
1198
1199 fcHodoSummaryRaw[uHodoIdx]->cd(8);
1200 gPad->SetGridx();
1201 gPad->SetGridy();
1202 gPad->SetLogz();
1203 fhHodoChanMissEvtEvo[uHodoIdx]->Draw("colz");
1204
1206 fcHodoSummaryFiber[uHodoIdx] =
1207 new TCanvas(Form("cHodoSummaryFiber%u", uHodoIdx), Form("Fiber Summary for Hodo %u", uHodoIdx), w, h);
1208 fcHodoSummaryFiber[uHodoIdx]->Divide(4, 2);
1209
1210 for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) {
1211 fcHodoSummaryFiber[uHodoIdx]->cd(1 + 4 * uAxis);
1212 gPad->SetGridx();
1213 gPad->SetGridy();
1214 gPad->SetLogy();
1215 fhHodoFiberCnt[uHodoIdx][uAxis]->Draw("hist");
1216
1217 fcHodoSummaryFiber[uHodoIdx]->cd(2 + 4 * uAxis);
1218 gPad->SetGridx();
1219 gPad->SetGridy();
1220 gPad->SetLogz();
1221 fhHodoFiberAdc[uHodoIdx][uAxis]->Draw("colz");
1222
1223 fcHodoSummaryFiber[uHodoIdx]->cd(3 + 4 * uAxis);
1224 gPad->SetGridx();
1225 gPad->SetGridy();
1226 fhHodoFiberAdcProf[uHodoIdx][uAxis]->Draw("hist");
1227
1228 fcHodoSummaryFiber[uHodoIdx]->cd(4 + 4 * uAxis);
1229 gPad->SetGridx();
1230 gPad->SetGridy();
1231 gPad->SetLogz();
1232 fhHodoFiberHitRateEvo[uHodoIdx][uAxis]->Draw("colz");
1233 } // for( UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis )
1234
1235 AddCanvasToVector(fcHodoSummaryRaw[uHodoIdx], "canvases");
1236 AddCanvasToVector(fcHodoSummaryFiber[uHodoIdx], "canvases");
1237 } // for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx )
1238
1239 fcHodoFiberCoinc = new TCanvas("fcHodoFiberCoinc", "X/Y coincidences in same hodoscope", w, h);
1240 fcHodoFiberCoinc->Divide(4, 2);
1241
1242 fcHodoFiberCoinc->cd(1);
1243 gPad->SetGridx();
1244 gPad->SetGridy();
1245 gPad->SetLogz();
1246 fhHodoFiberCoincMapXY[0]->Draw("colz");
1247
1248 fcHodoFiberCoinc->cd(2);
1249 gPad->SetGridx();
1250 gPad->SetGridy();
1251 gPad->SetLogy();
1252 fhHodoFiberCoincTimeXY[0]->Draw("hist");
1253
1254 fcHodoFiberCoinc->cd(3);
1255 gPad->SetGridx();
1256 gPad->SetGridy();
1257 gPad->SetLogz();
1258 fhHodoFiberCoincWalkXY_X[0]->Draw("colz");
1259
1260 fcHodoFiberCoinc->cd(4);
1261 gPad->SetGridx();
1262 gPad->SetGridy();
1263 gPad->SetLogz();
1264 fhHodoFiberCoincWalkXY_Y[0]->Draw("colz");
1265
1266 fcHodoFiberCoinc->cd(5);
1267 gPad->SetGridx();
1268 gPad->SetGridy();
1269 gPad->SetLogz();
1270 fhHodoFiberCoincMapXY[1]->Draw("colz");
1271
1272 fcHodoFiberCoinc->cd(6);
1273 gPad->SetGridx();
1274 gPad->SetGridy();
1275 gPad->SetLogy();
1276 fhHodoFiberCoincTimeXY[1]->Draw("hist");
1277
1278 fcHodoFiberCoinc->cd(7);
1279 gPad->SetGridx();
1280 gPad->SetGridy();
1281 gPad->SetLogz();
1282 fhHodoFiberCoincWalkXY_X[1]->Draw("colz");
1283
1284 fcHodoFiberCoinc->cd(8);
1285 gPad->SetGridx();
1286 gPad->SetGridy();
1287 gPad->SetLogz();
1288 fhHodoFiberCoincWalkXY_Y[1]->Draw("colz");
1289
1290 fcHodoFiberCoincAB = new TCanvas("fcHodoFiberCoincAB", "X/Y coincidences between hodoscopes", w, h);
1291 fcHodoFiberCoincAB->Divide(4, 2);
1292
1293 for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) {
1294 fcHodoFiberCoincAB->cd(1 + 4 * uAxis);
1295 gPad->SetGridx();
1296 gPad->SetGridy();
1297 gPad->SetLogz();
1298 fhHodoFiberCoincMapSameAB[uAxis]->Draw("colz");
1299
1300 fcHodoFiberCoincAB->cd(2 + 4 * uAxis);
1301 gPad->SetGridx();
1302 gPad->SetGridy();
1303 gPad->SetLogy();
1304 fhHodoFiberCoincTimeSameAB[uAxis]->Draw("hist");
1305
1306 fcHodoFiberCoincAB->cd(3 + 4 * uAxis);
1307 gPad->SetGridx();
1308 gPad->SetGridy();
1309 gPad->SetLogz();
1310 fhHodoFiberCoincMapDiffAB[uAxis]->Draw("colz");
1311
1312 fcHodoFiberCoincAB->cd(4 + 4 * uAxis);
1313 gPad->SetGridx();
1314 gPad->SetGridy();
1315 gPad->SetLogy();
1316 fhHodoFiberCoincTimeDiffAB[uAxis]->Draw("hist");
1317 } // for( UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis )
1318
1319 fcHodoFullCoinc = new TCanvas("fcHodoFullCoinc", "Full coincidences between hodoscopes", w, h);
1320 fcHodoFullCoinc->Divide(4, 2);
1321
1322 fcHodoFullCoinc->cd(1);
1323 gPad->SetGridx();
1324 gPad->SetGridy();
1325 gPad->SetLogz();
1326 fhHodoFullCoincCompX->Draw("colz");
1327
1328 fcHodoFullCoinc->cd(2);
1329 gPad->SetGridx();
1330 gPad->SetGridy();
1331 gPad->SetLogz();
1332 fhHodoFullCoincResidualXY->Draw("colz");
1333
1334 fcHodoFullCoinc->cd(3);
1335 gPad->SetGridx();
1336 gPad->SetGridy();
1337 gPad->SetLogz();
1338 fhHodoFullCoincTimeWalk[0][0]->Draw("colz");
1339
1340 fcHodoFullCoinc->cd(4);
1341 gPad->SetGridx();
1342 gPad->SetGridy();
1343 gPad->SetLogz();
1344 fhHodoFullCoincTimeWalk[0][1]->Draw("colz");
1345
1346 fcHodoFullCoinc->cd(5);
1347 gPad->SetGridx();
1348 gPad->SetGridy();
1349 gPad->SetLogz();
1350 fhHodoFullCoincCompY->Draw("colz");
1351
1352
1353 fcHodoFullCoinc->cd(6);
1354 gPad->SetGridx();
1355 gPad->SetGridy();
1356 gPad->SetLogy();
1357 fhHodoFullCoincTimeDiff->Draw("hist");
1358
1359 fcHodoFullCoinc->cd(7);
1360 gPad->SetGridx();
1361 gPad->SetGridy();
1362 gPad->SetLogz();
1363 fhHodoFullCoincTimeWalk[1][0]->Draw("colz");
1364
1365 fcHodoFullCoinc->cd(8);
1366 gPad->SetGridx();
1367 gPad->SetGridy();
1368 gPad->SetLogz();
1369 fhHodoFullCoincTimeWalk[1][1]->Draw("colz");
1370
1372 new TCanvas("fcHodoFullCoincPos", "Hit Positions for Full coincidences between hodoscopes", w, h);
1373 fcHodoFullCoincPos->Divide(2);
1374
1375 fcHodoFullCoincPos->cd(1);
1376 gPad->SetGridx();
1377 gPad->SetGridy();
1378 gPad->SetLogz();
1379 fhHodoFullCoincPosA->Draw("colz");
1380
1381 fcHodoFullCoincPos->cd(2);
1382 gPad->SetGridx();
1383 gPad->SetGridy();
1384 gPad->SetLogz();
1385 fhHodoFullCoincPosB->Draw("colz");
1386
1388 new TCanvas("fcHodoFullCoincPosEvo", "Hit Positions Evo for Full coincidences between hodoscopes", w, h);
1389 fcHodoFullCoincPosEvo->Divide(4);
1390
1391 fcHodoFullCoincPosEvo->cd(1);
1392 gPad->SetGridx();
1393 gPad->SetGridy();
1394 gPad->SetLogz();
1395 fhHodoFullCoincPosEvo[0][0]->Draw("colz");
1396
1397 fcHodoFullCoincPosEvo->cd(2);
1398 gPad->SetGridx();
1399 gPad->SetGridy();
1400 gPad->SetLogz();
1401 fhHodoFullCoincPosEvo[0][1]->Draw("colz");
1402
1403 fcHodoFullCoincPosEvo->cd(3);
1404 gPad->SetGridx();
1405 gPad->SetGridy();
1406 gPad->SetLogz();
1407 fhHodoFullCoincPosEvo[1][0]->Draw("colz");
1408
1409 fcHodoFullCoincPosEvo->cd(4);
1410 gPad->SetGridx();
1411 gPad->SetGridy();
1412 gPad->SetLogz();
1413 fhHodoFullCoincPosEvo[1][1]->Draw("colz");
1414
1415 fcHodoPrevHitDt = new TCanvas("fcHodoPrevHitDt", "Time difference between current and previous hits", w, h);
1416 fcHodoPrevHitDt->Divide(2, 2);
1417
1418 fcHodoPrevHitDt->cd(1);
1419 gPad->SetGridx();
1420 gPad->SetGridy();
1421 gPad->SetLogy();
1422 fhPrevHitDtAllAsics->Draw("hist");
1423
1424 fcHodoPrevHitDt->cd(2);
1425 gPad->SetGridx();
1426 gPad->SetGridy();
1427 gPad->SetLogy();
1428 fhPrevHitDtAsicA->Draw("hist");
1429
1430 fcHodoPrevHitDt->cd(3);
1431 gPad->SetGridx();
1432 gPad->SetGridy();
1433 gPad->SetLogy();
1434 fhPrevHitDtAsicB->Draw("hist");
1435
1436 fcHodoPrevHitDt->cd(4);
1437 gPad->SetGridx();
1438 gPad->SetGridy();
1439 gPad->SetLogy();
1440 fhPrevHitDtAsicsAB->Draw("hist");
1441
1447
1448 return kTRUE;
1449}
1451{
1453 std::vector<std::vector<stsxyter::FinalHit>> lastHitHodoAxis;
1454 std::vector<std::vector<Bool_t>> bHitFoundHodoAxis;
1455 lastHitHodoAxis.resize(kuNbHodos);
1456 bHitFoundHodoAxis.resize(kuNbHodos);
1457 for (UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx) {
1458 lastHitHodoAxis[uHodoIdx].resize(kuNbAxis);
1459 bHitFoundHodoAxis[uHodoIdx].resize(kuNbAxis, kFALSE);
1460 } // for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx )
1461
1463 UInt_t uTotalNbHits = fvmHitsInMs.size();
1464 for (UInt_t uHit = 0; uHit < uTotalNbHits; ++uHit) {
1465 UInt_t uHodo = fvmHitsInMs[uHit].GetAsic();
1466 UInt_t uAxis = fvmHitsInMs[uHit].GetDpb();
1467 // UInt_t uFiber = fvmHitsInMs[ uHit ].GetChan();
1468
1470 Double_t dCurrentHitTime = fvmHitsInMs[uHit].GetTs() * stsxyter::kdClockCycleNs;
1472 if (0 == uHodo) {
1473 fhPrevHitDtAsicA->Fill(dCurrentHitTime - fvdPreviousHitTimePerAsic[0]);
1474 fhPrevHitDtAsicsAB->Fill(dCurrentHitTime - fvdPreviousHitTimePerAsic[1]);
1475 } // if( 0 == uHodo )
1476 else
1477 fhPrevHitDtAsicB->Fill(dCurrentHitTime - fvdPreviousHitTimePerAsic[1]);
1478
1479 fuPreviousHitAsic = uHodo;
1480 fvdPreviousHitTimePerAsic[uHodo] = dCurrentHitTime;
1481
1482 lastHitHodoAxis[uHodo][uAxis] = fvmHitsInMs[uHit];
1483 bHitFoundHodoAxis[uHodo][uAxis] = kTRUE;
1484
1486 if (bHitFoundHodoAxis[uHodo][0] && bHitFoundHodoAxis[uHodo][1]) {
1487 Double_t dTimeDiffAxis = lastHitHodoAxis[uHodo][1].GetTs() * stsxyter::kdClockCycleNs
1488 - lastHitHodoAxis[uHodo][0].GetTs() * stsxyter::kdClockCycleNs;
1489
1490 if (-fdTimeCoincLimitNs < dTimeDiffAxis && dTimeDiffAxis < fdTimeCoincLimitNs) {
1491 fhHodoFiberCoincMapXY[uHodo]->Fill(lastHitHodoAxis[uHodo][0].GetChan(), lastHitHodoAxis[uHodo][1].GetChan());
1492 fhHodoFiberCoincTimeXY[uHodo]->Fill(dTimeDiffAxis);
1493 fhHodoFiberCoincWalkXY_X[uHodo]->Fill(lastHitHodoAxis[uHodo][0].GetAdc(), dTimeDiffAxis);
1494 fhHodoFiberCoincWalkXY_Y[uHodo]->Fill(lastHitHodoAxis[uHodo][1].GetAdc(), dTimeDiffAxis);
1495 } // if( -fdTimeCoincLimitNs < dTimeDiffAxis && dTimeDiffAxis < fdTimeCoincLimitNs )
1496 } // if( bHitFoundHodoAxis[ uHodo ][ 0 ] && bHitFoundHodoAxis[ uHodo ][ 1 ] )
1497
1499 if (bHitFoundHodoAxis[0][uAxis] && bHitFoundHodoAxis[1][uAxis]) {
1500 Double_t dTimeDiffHodoSame = lastHitHodoAxis[1][uAxis].GetTs() * stsxyter::kdClockCycleNs
1501 - lastHitHodoAxis[0][uAxis].GetTs() * stsxyter::kdClockCycleNs;
1502
1503 if (-fdTimeCoincLimitNs < dTimeDiffHodoSame && dTimeDiffHodoSame < fdTimeCoincLimitNs) {
1504 fhHodoFiberCoincMapSameAB[uAxis]->Fill(lastHitHodoAxis[0][uAxis].GetChan(),
1505 lastHitHodoAxis[1][uAxis].GetChan());
1506 fhHodoFiberCoincTimeSameAB[uAxis]->Fill(dTimeDiffHodoSame);
1507 } // if( -fdTimeCoincLimitNs < dTimeDiffAxis && dTimeDiffAxis < fdTimeCoincLimitNs )
1508 } // if( bHitFoundHodoAxis[ 0 ][ uAxis ] && bHitFoundHodoAxis[ 1 ][ uAxis ] )
1509
1510 UInt_t uAxisA = (uHodo ? !uAxis : uAxis);
1511 UInt_t uAxisB = (uHodo ? uAxis : !uAxis);
1512 if (bHitFoundHodoAxis[0][uAxisA] && bHitFoundHodoAxis[1][uAxisB]) {
1513 Double_t dTimeDiffHodoDiff = lastHitHodoAxis[1][uAxisB].GetTs() * stsxyter::kdClockCycleNs
1514 - lastHitHodoAxis[0][uAxisA].GetTs() * stsxyter::kdClockCycleNs;
1515
1516 if (-fdTimeCoincLimitNs < dTimeDiffHodoDiff && dTimeDiffHodoDiff < fdTimeCoincLimitNs) {
1517 fhHodoFiberCoincMapDiffAB[uAxisA]->Fill(lastHitHodoAxis[0][uAxisA].GetChan(),
1518 lastHitHodoAxis[1][uAxisB].GetChan());
1519 fhHodoFiberCoincTimeDiffAB[uAxisA]->Fill(dTimeDiffHodoDiff);
1520 } // if( -fdTimeCoincLimitNs < dTimeDiffAxis && dTimeDiffAxis < fdTimeCoincLimitNs )
1521 }
1522
1524 if (bHitFoundHodoAxis[0][0] && bHitFoundHodoAxis[0][1] && bHitFoundHodoAxis[1][0] && bHitFoundHodoAxis[1][1]) {
1525 Double_t dTimeDiffHodoA = lastHitHodoAxis[0][1].GetTs() * stsxyter::kdClockCycleNs
1526 - lastHitHodoAxis[0][0].GetTs() * stsxyter::kdClockCycleNs;
1527 Double_t dTimeDiffHodoB = lastHitHodoAxis[1][1].GetTs() * stsxyter::kdClockCycleNs
1528 - lastHitHodoAxis[1][0].GetTs() * stsxyter::kdClockCycleNs;
1529 Double_t dTimeDiffHodoAB = (lastHitHodoAxis[1][1].GetTs() * stsxyter::kdClockCycleNs
1530 + lastHitHodoAxis[1][0].GetTs() * stsxyter::kdClockCycleNs)
1531 / 2.0
1532 - (lastHitHodoAxis[0][1].GetTs() * stsxyter::kdClockCycleNs
1533 + lastHitHodoAxis[0][0].GetTs() * stsxyter::kdClockCycleNs)
1534 / 2.0;
1535 Double_t dTimeHitHodoAB = (lastHitHodoAxis[1][1].GetTs() * stsxyter::kdClockCycleNs
1536 + lastHitHodoAxis[1][0].GetTs() * stsxyter::kdClockCycleNs
1537 + lastHitHodoAxis[0][1].GetTs() * stsxyter::kdClockCycleNs
1538 + lastHitHodoAxis[0][0].GetTs() * stsxyter::kdClockCycleNs)
1539 / 4.0;
1540
1541 if (-fdTimeCoincLimitNs < dTimeDiffHodoA && dTimeDiffHodoA < fdTimeCoincLimitNs
1542 && -fdTimeCoincLimitNs < dTimeDiffHodoB && dTimeDiffHodoB < fdTimeCoincLimitNs
1543 && -fdTimeCoincLimitNs < dTimeDiffHodoAB && dTimeDiffHodoAB < fdTimeCoincLimitNs) {
1544 UInt_t uPosXA = fvbHodoSwapXY[0] ? lastHitHodoAxis[0][1].GetChan() : lastHitHodoAxis[0][0].GetChan();
1545 UInt_t uPosYA = fvbHodoSwapXY[0] ? lastHitHodoAxis[0][0].GetChan() : lastHitHodoAxis[0][1].GetChan();
1546 UInt_t uPosXB = fvbHodoSwapXY[1] ? lastHitHodoAxis[1][1].GetChan() : lastHitHodoAxis[1][0].GetChan();
1547 UInt_t uPosYB = fvbHodoSwapXY[1] ? lastHitHodoAxis[1][0].GetChan() : lastHitHodoAxis[1][1].GetChan();
1548
1549 if (fvbHodoInvertX[0]) uPosXA = kuNbChanPerAsic / 2 - 1 - uPosXA;
1550 if (fvbHodoInvertY[0]) uPosYA = kuNbChanPerAsic / 2 - 1 - uPosYA;
1551 if (fvbHodoInvertX[1]) uPosXB = kuNbChanPerAsic / 2 - 1 - uPosXB;
1552 if (fvbHodoInvertY[1]) uPosYB = kuNbChanPerAsic / 2 - 1 - uPosYB;
1553
1554 Double_t dResX = uPosXB;
1555 Double_t dResY = uPosYB;
1556
1557 dResX -= uPosXA;
1558 dResY -= uPosYA;
1559
1560 fhHodoFullCoincPosA->Fill(uPosXA, uPosYA);
1561 fhHodoFullCoincPosB->Fill(uPosXB, uPosYB);
1562
1563 fhHodoFullCoincCompX->Fill(uPosXA, uPosXB);
1564 fhHodoFullCoincCompY->Fill(uPosYA, uPosYB);
1565 fhHodoFullCoincResidualXY->Fill(dResX, dResY);
1566 fhHodoFullCoincTimeDiff->Fill(dTimeDiffHodoAB);
1567
1568 fhHodoFullCoincTimeWalk[0][0]->Fill(lastHitHodoAxis[0][0].GetAdc(), dTimeDiffHodoAB);
1569 fhHodoFullCoincTimeWalk[0][1]->Fill(lastHitHodoAxis[0][1].GetAdc(), dTimeDiffHodoAB);
1570 fhHodoFullCoincTimeWalk[1][0]->Fill(lastHitHodoAxis[1][0].GetAdc(), dTimeDiffHodoAB);
1571 fhHodoFullCoincTimeWalk[1][1]->Fill(lastHitHodoAxis[1][1].GetAdc(), dTimeDiffHodoAB);
1572
1573 Double_t dTimeSinceStart = (dTimeHitHodoAB - fdStartTime) * 1e-9;
1574 fhHodoFullCoincRateEvo->Fill(dTimeSinceStart);
1575
1576 fhHodoFullCoincPosEvo[0][0]->Fill(dTimeSinceStart, uPosXA);
1577 fhHodoFullCoincPosEvo[0][1]->Fill(dTimeSinceStart, uPosYA);
1578 fhHodoFullCoincPosEvo[1][0]->Fill(dTimeSinceStart, uPosXB);
1579 fhHodoFullCoincPosEvo[1][1]->Fill(dTimeSinceStart, uPosYB);
1580 /*
1581 LOG(info) << "Hodoscopes full coincidence found at " << (dTimeHitHodoAB*1e-9)
1582 << " Position A = ( " << uPosXA << ", " << uPosYA << ")"
1583 << " Position B = ( " << uPosXB << ", " << uPosYB << ")"
1584 << " dT = " << dTimeDiffHodoAB;
1585*/
1586 } // if all hodo axis in coinc and hodos in coinc
1587 } // if all ( Hodo, Axis ) pairs have at least 1 hit
1588 /*
1589 for( UInt_t uHodoOther = 0; uHodoOther < kuNbHodos; ++uHodoOther )
1590 {
1591 for( UInt_t uAxisOther = 0; uAxisOther < kuNbAxis; ++uAxisOther )
1592 {
1593 if( uHodoOther == uHodo )
1594 {
1595 if( uAxisOther == uAxis )
1596 continue;
1597
1598 } // if( uHodoOther == uHodo )
1599
1600 } // for( UInt_t uAxisOther = 0; uAxisOther < kuNbAxis; ++uAxisOther )
1601 } // for( UInt_t uHodoOther = 0; uHodoOther < kuNbHodos; ++uHodoOther )
1602*/
1603 } // for( UInt_t uHit = 0; uHit < uTotalNbHits; ++uHit )
1604
1605 return kTRUE;
1606}
1608{
1609 fhHodoMessType->Reset();
1610 fhHodoStatusMessType->Reset();
1611 fhHodoMsStatusFieldType->Reset();
1612 fhHodoMessTypePerElink->Reset();
1613
1614 for (UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx) {
1615 for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) {
1616 fhHodoFiberCnt[uHodoIdx][uAxis]->Reset();
1617 fhHodoFiberAdc[uHodoIdx][uAxis]->Reset();
1618 fhHodoFiberAdcProf[uHodoIdx][uAxis]->Reset();
1619 fhHodoFiberHitRateEvo[uHodoIdx][uAxis]->Reset();
1620
1621 fhHodoFullCoincTimeWalk[uHodoIdx][uAxis]->Reset();
1622 fhHodoFullCoincPosEvo[uHodoIdx][uAxis]->Reset();
1623 } // for( UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis )
1624
1625 fhHodoChanCntRaw[uHodoIdx]->Reset();
1626 fhHodoChanAdcRaw[uHodoIdx]->Reset();
1627 fhHodoChanAdcRawProf[uHodoIdx]->Reset();
1628 fhHodoChanAdcCal[uHodoIdx]->Reset();
1629 fhHodoChanAdcCalProf[uHodoIdx]->Reset();
1630 fhHodoChanRawTs[uHodoIdx]->Reset();
1631 fhHodoChanMissEvt[uHodoIdx]->Reset();
1632 fhHodoChanMissEvtEvo[uHodoIdx]->Reset();
1633 fhHodoChanHitRateEvo[uHodoIdx]->Reset();
1634 fhHodoChanHitRateProf[uHodoIdx]->Reset();
1635 fhHodoChanDistT[uHodoIdx]->Reset();
1636
1637 fhHodoFiberCoincMapXY[uHodoIdx]->Reset();
1638 fhHodoFiberCoincTimeXY[uHodoIdx]->Reset();
1639 fhHodoFiberCoincWalkXY_X[uHodoIdx]->Reset();
1640 fhHodoFiberCoincWalkXY_Y[uHodoIdx]->Reset();
1641
1642 } // for( UInt_t uHodoIdx = 0; uHodoIdx < kuNbHodos; ++uHodoIdx )
1643
1644
1645 for (UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis) {
1646 fhHodoFiberCoincMapSameAB[uAxis]->Reset();
1647 fhHodoFiberCoincTimeSameAB[uAxis]->Reset();
1648 fhHodoFiberCoincMapDiffAB[uAxis]->Reset();
1649 fhHodoFiberCoincTimeDiffAB[uAxis]->Reset();
1650 } // for( UInt_t uAxis = 0; uAxis < kuNbAxis; ++uAxis )
1651
1652 fhHodoFullCoincPosA->Reset();
1653 fhHodoFullCoincPosB->Reset();
1654 fhHodoFullCoincCompX->Reset();
1655 fhHodoFullCoincCompY->Reset();
1657 fhHodoFullCoincTimeDiff->Reset();
1658
1659 fhPrevHitDtAllAsics->Reset();
1660 fhPrevHitDtAsicA->Reset();
1661 fhPrevHitDtAsicB->Reset();
1662 fhPrevHitDtAsicsAB->Reset();
1663
1664 return kTRUE;
1665}
1666// -------------------------------------------------------------------------
std::string FormatMsHeaderPrintout(const fles::MicrosliceDescriptor &msDescriptor)
UInt_t fuDpbId
Settings from parameter file => For now use only accessors!
std::vector< TH2 * > fhHodoFiberCoincMapXY
+/- in clock cycles
std::vector< std::vector< TH2 * > > fhHodoFullCoincTimeWalk
TH1 * fhHodoFullCoincRateEvo
[ Hodo ][ Axis ]
std::vector< std::vector< TH2 * > > fhHodoFiberHitRateEvo
[ Hodo ][ Axis ]
std::vector< Double_t > fvdPrevMsTime
End Time in ns of current TS Core from the index of the first MS first component.
const UInt_t kuChannelToPlaneMap[kuNbChanPerAsic]
Map from channel index to PMT pixel.
std::vector< Double_t > fvdPreviousHitTimePerAsic
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
std::vector< TH2 * > fhHodoChanMissEvtEvo
[ Hodo ]
std::vector< std::vector< TProfile * > > fhHodoFiberAdcProf
[ Hodo ][ Axis ]
std::vector< std::vector< Double_t > > fvdChanCountsSinceLastRateUpdate
[ Hodo ]
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
std::vector< TH1 * > fhHodoFiberCoincTimeSameAB
[ Axis ]
std::vector< TH2 * > fhHodoChanDistT
[ Hodo ]
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
std::vector< Int_t > fviTimeSecLastRateUpdate
std::vector< TH1 * > fhHodoFiberCoincTimeDiffAB
[ Axis ]
std::vector< TH2 * > fhHodoChanRawTs
[ Hodo ]
std::vector< TH2 * > fhHodoFiberCoincMapSameAB
[ Hodo ]
const UInt_t kuChannelToFiberMap[kuNbChanPerAsic]
TH1 * fhHodoMessType
All hits (time in bins, ADC in bins, asic, channel) in last MS, sorted with "<" operator.
static const UInt_t kuNbHodos
Max Nb of eLinks for this sDPB: 2 GBTx with 42 eLinks each.
std::vector< std::vector< Double_t > > fdHodoChanLastTimeForDist
[ Hodo ][ Chan ]
void ProcessEpochInfo(stsxyter::Message mess)
static const UInt_t kuNbChanPerAsic
Per hodoscope = X and Y.
std::vector< TH2 * > fhHodoChanMissEvt
[ Hodo ]
Bool_t ProcessTs(const fles::Timeslice &ts)
std::vector< TCanvas * > fcHodoSummaryRaw
std::vector< Bool_t > fvbMaskedComponents
Switch ON the filling of a additional set of histograms.
std::vector< TProfile * > fhHodoChanAdcRawProf
[ Hodo ]
std::vector< TProfile * > fhHodoChanAdcCalProf
[ Hodo ]
std::vector< TH2 * > fhHodoFiberCoincWalkXY_Y
[ Hodo ]
std::vector< TH1 * > fhHodoChanCntRaw
Raw = ASIC channels.
void ProcessStatusInfo(stsxyter::Message mess)
Double_t fdTimeCoincLimitNs
+/- in clock cycles
std::vector< std::vector< TH2 * > > fhHodoFiberAdc
[ Hodo ][ Axis ]
std::vector< std::vector< TH1 * > > fhHodoFiberCnt
static const UInt_t kuNbAxis
Nb of hodoscopes = Nb FEBs = Nb ASICs.
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
std::vector< TH2 * > fhHodoChanAdcRaw
[ Hodo ]
ULong64_t fulCurrentTsIdx
Map from channel index to Hodoscope Axis (X or Y)
std::vector< TH2 * > fhHodoFiberCoincWalkXY_X
[ Hodo ]
std::vector< TCanvas * > fcHodoSummaryFiber
std::vector< TH2 * > fhHodoChanAdcCal
[ Hodo ]
std::vector< TH2 * > fhHodoFiberCoincMapDiffAB
[ Axis ]
void ProcessTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
std::vector< TH1 * > fhHodoFiberCoincTimeXY
[ Hodo ]
std::vector< std::vector< TH2 * > > fhHodoFullCoincPosEvo
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
void ProcessHitInfo(stsxyter::Message mess, const UInt_t &uHodoIdx, const UInt_t &uMsIdx)
std::vector< TProfile * > fhHodoChanHitRateProf
[ Hodo ]
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
UInt_t fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
std::vector< TH2 * > fhHodoChanHitRateEvo
[ Hodo ]
void AddHistoToVector(TNamed *pointer, std::string sFolder="")
std::vector< size_t > fvMsComponentsList
void AddCanvasToVector(TCanvas *pointer, std::string sFolder="")
Data class with information on a STS local track.
XPU_D bool IsHitMissedEvts() const
For Hit data: Returns Missed event flag (1 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)
XPU_D uint16_t GetLinkIndex() const
For all data: Returns the (global) index of the eLink on which the message was received (n bit field)
XPU_D MessType GetMessType() const
Returns the message type, see enum MessType.
XPU_D uint16_t GetHitTime() const
For Hit data: Returns timestamp (8 bit field, 2 MSB bits overlap removed)
XPU_D uint32_t GetTsMsbVal() const
For TS MSB data: Returns the TS MSB 22 bit field)
XPU_D uint16_t GetStatusLink() const
For Status data: Returns the Link Inedx (9 bit field)
Hash for CbmL1LinkKey.
static constexpr uint64_t kulTsCycleNbBins
static constexpr uint32_t kuHitNbTsBins
static constexpr uint32_t kuHitNbAdcBins
Status/properties constants.
static constexpr double kdClockCycleNs
MessType
Message types.