12#ifndef CBMMCBM2018MONITORSTS_H
13#define CBMMCBM2018MONITORSTS_H
15#include "Timeslice.hpp"
34class CbmCern2017UnpackParSts;
41 virtual Bool_t
Init();
43 virtual Bool_t
DoUnpack(
const fles::Timeslice& ts,
size_t component);
56 virtual void SetNbMsInTs(
size_t uCoreMsNb,
size_t uOverlapMsNb);
61 void SetRunStart(Int_t dateIn, Int_t timeIn, Int_t iBinSize = 5);
104 std::vector<std::vector<Bool_t>>
108 std::vector<std::vector<std::vector<Int_t>>>
110 std::vector<std::vector<std::vector<Int_t>>>
112 std::vector<std::vector<std::vector<Int_t>>>
114 std::vector<std::vector<std::vector<Double_t>>>
116 std::vector<std::vector<std::vector<Double_t>>>
156 std::vector<std::vector<std::vector<Double_t>>>
158 std::vector<std::vector<std::vector<UShort_t>>>
164 std::chrono::steady_clock::time_point
168 std::vector<stsxyter::FinalHit>
170 std::vector<std::vector<stsxyter::FinalHit>>
172 std::vector<std::vector<stsxyter::FinalHit>>
237 std::vector< TH1* > fhStsModulePNCoincDt;
238 std::vector< TH2* > fhStsModulePNCoincDtAsicP;
239 std::vector< TH2* > fhStsModulePNCoincDtAsicN;
240 std::vector< TH2* > fhStsModulePNCoincChan;
241 std::vector< TH2* > fhStsModulePNCoincAdc;
242 std::vector< TH2* > fhStsModuleCoincAdcChanP;
243 std::vector< TH2* > fhStsModuleCoincAdcChanN;
244 std::vector< TH2* > fhStsModuleCoincMap;
268 std::vector<std::vector<std::vector<Double_t>>>
278 Bool_t
SmxErrCheckCoinc(UInt_t uFebIdx, UInt_t uAsicIdx, Double_t dNewHitTime);
299 Double_t fdStartTs; //! Last hits in each ASIC
300 std::vector< stsxyter::FinalHit > fvmLastHitAsic; //! Last hits in each ASIC
301 std::vector<TH2 *> fhStsTimeDiffPerAsic;
302 std::vector< std::vector<TH1 *> > fhStsTimeDiffPerAsicPair;
303 std::vector< std::vector<TH1 *> > fhStsTimeDiffClkPerAsicPair;
304 std::vector< std::vector<TH2 *> > fhStsTimeDiffEvoPerAsicPair;
305 std::vector< std::vector<TProfile *> > fhStsTimeDiffEvoPerAsicPairProf;
306 std::vector< std::vector<TProfile *> > fhStsRawTimeDiffEvoPerAsicPairProf;
307 std::vector< std::vector<TH2 *> > fhStsTsLsbMatchPerAsicPair;
308 std::vector< std::vector<TH2 *> > fhStsTsMsbMatchPerAsicPair;
309 std::vector<TH1 *> fhStsIntervalAsic;
310 std::vector<TH1 *> fhStsIntervalLongAsic;
312 static const UInt_t kuNbValuesForTimeDiffMean = 100;
313 constexpr static const double kdPulserPeriod = 154000; /// ns
314 constexpr static const double kdTimeDiffToMeanMargin = 50;
315 std::vector< std::vector< std::vector< Double_t > > > fvdLastTimeDiffValuesAsicPair;
316 std::vector< std::vector< UInt_t > > fvuLastTimeDiffSlotAsicPair;
317 std::vector< std::vector< Double_t > > fvdMeanTimeDiffAsicPair;
319 void UpdatePairMeanValue( UInt_t uAsicA, UInt_t uAsicB, Double_t dNewValue );
325 Bool_t
ProcessStsMs(
const fles::Timeslice& ts,
size_t uMsComp, UInt_t uMsIdx);
std::vector< std::vector< std::vector< Int_t > > > fviFebModuleIdx
Number of StsXyter ASICs.
std::vector< TProfile2D * > fhStsFebSmxErrRatioCopySameAdcEvoAsic
Int_t fiTimeIntervalRateUpdate
Mean Rate per channel plots.
std::vector< TH2 * > fhStsFebAsicHitRateEvo
std::vector< std::vector< ULong64_t > > fvulChanLastHitTime
TH2 * fhStsMsStatusFieldType
std::vector< UInt_t > fvuInitialTsMsbCycleHeader
Flag set after seeing MS header in 1st MS for DPB.
std::vector< std::vector< Double_t > > fvdChanLastHitTime
Last hit time in bins for each Channel.
std::vector< std::vector< std::vector< Int_t > > > fviFebModuleSide
Idx of the STS module for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], -1 if inactive.
std::vector< TH2 * > fhStsFebChanDistT
Bool_t InitStsParameters()
std::vector< ULong64_t > fvulCurrentTsMsb
Bin size in s for the plots with date as X axis.
Bool_t ScanForNoisyChannels(Double_t dNoiseThreshold=1e3)
---------------------------------------------------------------—///
std::vector< std::vector< stsxyter::FinalHit > > fvmAsicHitsInMs
All hits (time in bins, ADC in bins, asic, channel) in last TS, sorted with "<" operator.
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Current data properties.
std::vector< TProfile * > fhStsFebChanAdcRawProf
std::vector< TH1 * > fhStsFebChanCntRaw
std::vector< Double_t > fvdFebTimeSecLastRateUpdate
static constexpr const Double_t kdSmxErrCoincWinNoiseM11
TH2 * fhMsErrorsEvo
Binning FW error flag.
std::vector< TCanvas * > fvcStsSumm
Canvases.
Bool_t fbLongHistoEnable
Rate evolution histos.
std::vector< TProfile * > fhStsFebChanCloseHitsRatio
TH1 * fhMsSz[kiMaxNbFlibLinks]
std::vector< TH2 * > fhStsFebChanCloseHitsCounts
void SaveAllHistos(TString sFileName="")
std::vector< std::vector< std::vector< Int_t > > > fviFebType
STS module side for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = P, 1 = N,...
Double_t fdCoincCenter
Coincidences in sorted hits.
void SmxErrInitializeVariables()
Methods.
std::vector< TCanvas * > fvcStsSmxErr
Bool_t fbSmx2ErrorUseNoiseLevels
SXM 2.0 logic error detection and tagging, 1 eLink case.
std::vector< TH1 * > fhStsFebChanCntRawGood
std::vector< UInt_t > fvuInitialHeaderDone
Current TS MSB cycle for DPB.
TH2 * fhStsSysMessTypePerDpb
Bool_t ReInitContainers()
UInt_t fuLongHistoNbSeconds
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of STS DPBs in system.
TString fsHistoFileFullname
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
stsxyter::MessagePrintMask fPrintMessCtrl
Double_t fdSmxErrCoincWinM08
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
virtual ~CbmMcbm2018MonitorSts()
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
std::vector< Int_t > fviFebCountsSinceLastRateUpdate
std::vector< std::vector< UInt_t > > fvuSmxErrIdxLastHit
[ NbFebs ][ NbSmxPerFeb ]
std::vector< std::vector< Bool_t > > fvbCrobActiveFlag
Map of DPB Identifier to DPB index.
Bool_t fbEnableCheckBugSmx20
ULong64_t fulCurrentMsIdx
std::vector< Double_t > fvdPrevMsTime
Last hit time in ns for each Channel.
UInt_t fuNrOfDpbs
STS address for the first strip of each module.
std::vector< TProfile * > fhStsFebSmxErrRatioCopySameAdcEvo
TH2 * fhStsHitsElinkPerDpb
std::vector< TH2 * > fhStsFebAsicHitRateEvoLong
void SetHistoFileName(TString sFileName="data/SetupHistos.root")
void SetFebChanCoincidenceLimitNs(Double_t dLimitIn)
std::vector< std::vector< Double_t > > fdStsFebChanLastTimeForDist
static constexpr const Double_t kdSmxErrCoincWinNoiseM10
std::vector< TProfile2D * > fhStsFebSmxErrRatioCopyEvoAsic
UInt_t fuLongHistoBinSizeSec
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM07
[ NbFebs ][ NbSmxPerFeb ][ kuSmxErrCoincWinNbHits ]
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.
std::vector< TProfile2D * > fhStsFebSmxErrRatioEvoAsic
Double_t fdSmxErrCoincWinM09
void UseNoiseLimitsSmx2LogicError(Bool_t bUseNoise=kTRUE)
static constexpr const Double_t kdSmxErrCoincWinMainM11
std::vector< TH2 * > fhStsFebChanRawTs
Double_t fdStartTime
Last hit ADC in bins in each MS for each Channel.
UInt_t fuCurrentEquipmentId
void UseDaqBuffer(Bool_t)
CbmMcbm2018MonitorSts operator=(const CbmMcbm2018MonitorSts &)
std::vector< UInt_t > fvuElinkLastTsHit
TS MSB cycle from MS header in 1st MS for DPB.
static constexpr const Double_t kdSmxErrCoincWinNoiseM09
static constexpr const Double_t kdSmxErrCoincWinMainM08
static constexpr const Double_t kdSmxErrCoincWinMainM09
std::vector< TH2 * > fhStsFebChanMissEvt
std::vector< TH1 * > fhStsFebHitRateEvo
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
std::vector< Int_t > fviModAddress
Type of each module: 0 for connectors on the right, 1 for connectors on the left.
UInt_t fuMaxNbMicroslices
void SetEnableCheckBugSmx20(Bool_t bEnable=kTRUE)
static constexpr const Double_t kdSmxErrCoincWinMainM10
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM08
[ NbFebs ][ NbSmxPerFeb ]
std::vector< TH2 * > fhStsFebChanHitRateEvo
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
static constexpr const Double_t kdSmxErrCoincWinBeg
std::vector< std::vector< std::vector< Double_t > > > fvdChanLastHitTimeInMs
Number of hits in each MS for each Channel.
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcOffs
ADC gain in e-/b, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
TH2 * fhStsFebAsicHitCounts
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcGain
FEB type, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = A, 1 = B, -1 if inactive.
static constexpr const Double_t kdSmxErrCoincWinNoiseM07
Coincidence windows 99.9% tagging (up to 0.1% of corruption not detected)
TH2 * fhStsMessTypePerElink
static const UInt_t kuBytesPerMessage
TH1 * fhStsMessType
Histogram manager.
std::vector< TProfile * > fhStsFebSmxErrRatioCopyEvo
static constexpr const Double_t kdSmxErrCoincWinNoiseM08
Bool_t ProcessStsMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
UInt_t fuNbFebs
Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ].
std::vector< Int_t > fviModuleType
Total number of STS modules in the setup.
Double_t fdFebChanCoincidenceLimit
Plots per FEB-8.
std::vector< TH2 * > fhStsFebChanMissEvtEvo
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM10
[ NbFebs ][ NbSmxPerFeb ]
std::vector< TH2 * > fhStsFebChanAdcRaw
std::vector< TProfile * > fhStsFebChanHitRateProf
ULong64_t fulCurrentTsIdx
TS/MS info.
Double_t fdSmxErrCoincWinM10
TH2 * fhStsStatusMessType
void SetRunStart(Int_t dateIn, Int_t timeIn, Int_t iBinSize=5)
std::vector< Bool_t > fvbMaskedComponents
Double_t fdSmxErrCoincWinM07
Tagging variables.
std::vector< std::vector< std::vector< Double_t > > > fvdSmxErrTimeLastHits
std::vector< TProfile * > fhStsFebSmxErrRatioEvo
Histograms.
std::vector< std::vector< std::vector< UInt_t > > > fvuChanNbHitsInMs
Header time of each MS.
std::vector< std::vector< Double_t > > fvdFebChanCountsSinceLastRateUpdate
std::vector< TH2 * > fhStsFebChanHitRateEvoLong
TH2 * fhStsMessTypePerDpb
void SetLongDurationLimits(UInt_t uDurationSeconds=3600, UInt_t uBinSize=1)
CbmMcbm2018StsPar * fUnpackParSts
/** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **/
TH2 * fhStsAllAsicsHitRateEvo
std::vector< TH1 * > fhStsFebHitRateEvoLong
void SetPrintMessage(Bool_t bPrintMessOn=kTRUE, stsxyter::MessagePrintMask ctrl=stsxyter::MessagePrintMask::msg_print_Hex|stsxyter::MessagePrintMask::msg_print_Human)
void SetMsOverlap(size_t uOverlapMsNb=1)
void SaveStsHistos(TString sFileName="")
Bool_t fbBinningFw
=> Quick and dirty hack for binning FW!!!
Double_t fdSmxErrCoincWinM11
static constexpr const Double_t kdSmxErrCoincWinMainM07
Coincidence windows for 99.0% tagging (up to 1% of corruption not detected)
Bool_t SmxErrCheckCoinc(UInt_t uFebIdx, UInt_t uAsicIdx, Double_t dNewHitTime)
std::vector< TH1 * > fhStsFebMissEvtEvo
std::vector< std::vector< std::vector< UShort_t > > > fvusChanLastHitAdcInMs
Last hit time in bins in each MS for each Channel.
UInt_t fuNbStsXyters
Number of StsXyter ASICs.
std::chrono::steady_clock::time_point ftStartTimeUnix
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
void SetBinningFwFlag(Bool_t bEnable=kTRUE)
=> Quick and dirty hack for binning FW!!!
std::vector< TH2 * > fhStsFebAsicMissEvtEvo
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
TProfile * fhMsSzTime[kiMaxNbFlibLinks]
std::vector< size_t > fvMsComponentsList
CbmMcbm2018MonitorSts(const CbmMcbm2018MonitorSts &)
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Bool_t fbPrintMessages
Task configuration values.
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM09
[ NbFebs ][ NbSmxPerFeb ]
void SavePulserHistos(TString sFileName="")
void FillHitInfo(stsxyter::Message mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
void FillEpochInfo(stsxyter::Message mess)
static const Int_t kiMaxNbFlibLinks
ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
static const UInt_t kuSmxErrCoincWinNbHits
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM11
[ NbFebs ][ NbSmxPerFeb ]
void FillTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
std::vector< Double_t > fvdMsTime
Header time of previous MS per link.
CbmHistManager * fHM
Histograms.
TH2 * fhStsAllFebsHitRateEvo
MessagePrintMask
Printout control.