13#ifndef CBMMCBM2018MONITORMUCH_H
14#define CBMMCBM2018MONITORMUCH_H
17#include "Timeslice.hpp"
37class CbmCern2017UnpackParSts;
44 virtual Bool_t
Init();
46 virtual Bool_t
DoUnpack(
const fles::Timeslice& ts,
size_t component);
59 virtual void SetNbMsInTs(
size_t uCoreMsNb,
size_t uOverlapMsNb);
63 void SetRunStart(Int_t dateIn, Int_t timeIn, Int_t iBinSize = 5);
103 std::vector<std::vector<Bool_t>>
107 std::vector<std::vector<std::vector<Double_t>>>
109 std::vector<std::vector<std::vector<Double_t>>>
147 std::vector<std::vector<std::vector<Double_t>>>
149 std::vector<std::vector<std::vector<UShort_t>>>
157 std::chrono::steady_clock::time_point
161 std::vector<stsxyter::FinalHit>
163 std::vector<std::vector<stsxyter::FinalHit>>
165 std::vector<std::vector<stsxyter::FinalHit>>
256 std::vector<std::vector<std::vector<Double_t>>>
266 Bool_t
SmxErrCheckCoinc(UInt_t uFebIdx, UInt_t uAsicIdx, Double_t dNewHitTime);
281 Double_t fdStartTs; //! Last hits in each ASIC
282 std::vector< stsxyter::FinalHit > fvmLastHitAsic; //! Last hits in each ASIC
283 std::vector<TH2 *> fhStsTimeDiffPerAsic;
284 std::vector< std::vector<TH1 *> > fhStsTimeDiffPerAsicPair;
285 std::vector< std::vector<TH1 *> > fhStsTimeDiffClkPerAsicPair;
286 std::vector< std::vector<TH2 *> > fhStsTimeDiffEvoPerAsicPair;
287 std::vector< std::vector<TProfile *> > fhStsTimeDiffEvoPerAsicPairProf;
288 std::vector< std::vector<TProfile *> > fhStsRawTimeDiffEvoPerAsicPairProf;
289 std::vector< std::vector<TH2 *> > fhStsTsLsbMatchPerAsicPair;
290 std::vector< std::vector<TH2 *> > fhStsTsMsbMatchPerAsicPair;
291 std::vector<TH1 *> fhStsIntervalAsic;
292 std::vector<TH1 *> fhStsIntervalLongAsic;
294 static const UInt_t kuNbValuesForTimeDiffMean = 100;
295 constexpr static const double kdPulserPeriod = 154000; /// ns
296 constexpr static const double kdTimeDiffToMeanMargin = 50;
297 std::vector< std::vector< std::vector< Double_t > > > fvdLastTimeDiffValuesAsicPair;
298 std::vector< std::vector< UInt_t > > fvuLastTimeDiffSlotAsicPair;
299 std::vector< std::vector< Double_t > > fvdMeanTimeDiffAsicPair;
301 void UpdatePairMeanValue( UInt_t uAsicA, UInt_t uAsicB, Double_t dNewValue );
307 Bool_t
ProcessStsMs(
const fles::Timeslice& ts,
size_t uMsComp, UInt_t uMsIdx);
Bool_t SmxErrCheckCoinc(UInt_t uFebIdx, UInt_t uAsicIdx, Double_t dNewHitTime)
virtual ~CbmMcbm2018MonitorMuch()
std::vector< TH2 * > fhStsFebChanHitRateEvo
virtual void SetNbMsInTs(size_t uCoreMsNb, size_t uOverlapMsNb)
Bool_t fbEnableCoincidenceMaps
void FillTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
std::vector< TProfile * > fhStsFebSmxErrRatioCopySameAdcEvo
void UseNoiseLimitsSmx2LogicError(Bool_t bUseNoise=kTRUE)
stsxyter::MessagePrintMask fPrintMessCtrl
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
std::vector< TH1 * > fhStsFebChanCntRawGood
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM11
[ NbFebs ][ NbSmxPerFeb ]
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
std::vector< std::vector< UInt_t > > fvuSmxErrIdxLastHit
[ NbFebs ][ NbSmxPerFeb ]
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM10
[ NbFebs ][ NbSmxPerFeb ]
void SavePulserHistos(TString sFileName="")
std::vector< TH2 * > fHistPadDistr
Plots per FEB-8.
std::vector< TH2 * > fhStsFebChanAdcCal
TString fsHistoFileFullname
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcGain
Number of StsXyter ASICs.
std::vector< UInt_t > fvuInitialHeaderDone
Current TS MSB cycle for DPB.
std::vector< TProfile * > fhStsFebSmxErrRatioCopyEvo
std::vector< size_t > fvMsComponentsList
TH2 * fhStsMessTypePerDpb
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM08
[ NbFebs ][ NbSmxPerFeb ]
std::vector< TProfile * > fhStsFebSmxErrRatioEvo
Histograms.
std::vector< TH2 * > fRealHistPadDistr
std::vector< std::vector< Double_t > > fvdChanLastHitTime
Last hit time in bins for each Channel.
void UseDaqBuffer(Bool_t)
std::vector< TH1 * > fhStsFebHitRateEvo
Bool_t fbPrintMessages
Task configuration values.
Int_t fiRunStartDateTimeSec
Index of the DPB from which the MS currently unpacked is coming.
void SetRunStart(Int_t dateIn, Int_t timeIn, Int_t iBinSize=5)
Bool_t ScanForNoisyChannels(Double_t dNoiseThreshold=1e3)
---------------------------------------------------------------—///
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
Bool_t ProcessStsMs(const fles::Timeslice &ts, size_t uMsComp, UInt_t uMsIdx)
static constexpr const Double_t kdSmxErrCoincWinNoiseM10
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM09
[ NbFebs ][ NbSmxPerFeb ]
Int_t fiTimeIntervalRateUpdate
Mean Rate per channel plots.
std::vector< ULong64_t > fvulCurrentTsMsb
Bin size in s for the plots with date as X axis.
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
std::vector< TH2 * > fhStsFebChanDistT
static constexpr const Double_t kdSmxErrCoincWinMainM09
std::vector< TH2 * > fhStsFebChanAdcRaw
UInt_t fuCurrentEquipmentId
std::vector< std::vector< ULong64_t > > fvulChanLastHitTime
TH1 * fhStsMessType
Histogram manager.
UInt_t fuNbStsXyters
Number of StsXyter ASICs.
Bool_t InitStsParameters()
Long64_t fdStartTime
Last hit ADC in bins in each MS for each Channel.
std::vector< TProfile * > fhStsFebChanAdcCalProf
std::vector< std::vector< std::vector< Double_t > > > fvdSmxErrTimeLastHits
std::vector< Double_t > fvdMsTime
Header time of previous MS per link.
std::vector< std::vector< Double_t > > fvdFebChanCountsSinceLastRateUpdate
std::vector< Double_t > fvdPrevMsTime
Last hit time in ns for each Channel.
void SetMsOverlap(size_t uOverlapMsNb=1)
std::vector< TH1 * > fhStsFebMissEvtEvo
void SaveAllHistos(TString sFileName="")
Bool_t fbSmx2ErrorUseNoiseLevels
SXM 2.0 logic error detection and tagging, 1 eLink case.
UInt_t fuNbFebs
Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ].
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of STS DPBs in system.
void SetFebChanCoincidenceLimitNs(Double_t dLimitIn)
TH2 * fhStsSysMessTypePerDpb
static constexpr const Double_t kdSmxErrCoincWinMainM08
std::chrono::steady_clock::time_point ftStartTimeUnix
static constexpr const Double_t kdSmxErrCoincWinNoiseM07
Coincidence windows 99.9% tagging (up to 0.1% of corruption not detected)
static const Int_t kiMaxNbFlibLinks
ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
Bool_t fbLongHistoEnable
Rate evolution histos.
Double_t fdSmxErrCoincWinM07
Tagging variables.
CbmMcbm2018MuchPar * fUnpackParMuch
/** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **/
Bool_t ReInitContainers()
std::vector< TH2 * > fhStsFebChanMissEvt
std::vector< TH2 * > fhStsFebAsicMissEvtEvo
Double_t fdSmxErrCoincWinM08
static constexpr const Double_t kdSmxErrCoincWinBeg
std::vector< std::vector< std::vector< UInt_t > > > fvuChanNbHitsInMs
Header time of each MS.
static constexpr const Double_t kdSmxErrCoincWinMainM11
TProfile * fhMsSzTime[kiMaxNbFlibLinks]
void FillHitInfo(stsxyter::Message mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
std::vector< std::vector< TH1 * > > fhStsFebChanDtCoinc
CbmHistManager * fHM
Histograms.
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
Current data properties.
TH2 * fhPulserStatusMessType
Double_t fdFebChanCoincidenceLimit
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
std::vector< TH2 * > fhStsFebAsicHitRateEvoLong
static constexpr const Double_t kdSmxErrCoincWinNoiseM11
static constexpr const Double_t kdSmxErrCoincWinNoiseM08
void SetEnableCoincidenceMaps(Bool_t bEnableCoincidenceMapsOn=kTRUE)
Double_t fdSmxErrCoincWinM11
void SetHistoFileName(TString sFileName="data/SetupHistos.root")
void SetMuchMode(Bool_t bMuchMode=kTRUE)
Double_t fdSmxErrCoincWinM09
std::vector< TProfile * > fhStsFebChanAdcRawProf
std::vector< TH1 * > fhStsFebHitRateEvo_mskch
ULong64_t fulCurrentMsIdx
std::vector< Int_t > fviFebCountsSinceLastRateUpdate
UInt_t fuMaxNbMicroslices
Double_t fdCoincCenter
Coincidences in sorted hits.
std::vector< std::vector< std::vector< Double_t > > > fvdChanLastHitTimeInMs
Number of hits in each MS for each Channel.
TH2 * fhPulserMsStatusFieldType
static const UInt_t kuSmxErrCoincWinNbHits
std::vector< std::vector< Double_t > > fdStsFebChanLastTimeForDist
TH1 * fhStsFebChanAdcRaw_combined
void FillEpochInfo(stsxyter::Message mess)
std::vector< UInt_t > fvuInitialTsMsbCycleHeader
Flag set after seeing MS header in 1st MS for DPB.
TH1 * fhMsSz[kiMaxNbFlibLinks]
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
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< TH1 * > fhStsFebHitRateEvoLong
void SetLongDurationLimits(UInt_t uDurationSeconds=3600, UInt_t uBinSize=1)
std::vector< std::vector< UInt_t > > fvuSmxErrIdxFirstHitM07
[ NbFebs ][ NbSmxPerFeb ][ kuSmxErrCoincWinNbHits ]
std::vector< Int_t > fviFebTimeSecLastRateUpdate
std::vector< TProfile2D * > fhStsFebSmxErrRatioCopySameAdcEvoAsic
void SetPrintMessage(Bool_t bPrintMessOn=kTRUE, stsxyter::MessagePrintMask ctrl=stsxyter::MessagePrintMask::msg_print_Hex|stsxyter::MessagePrintMask::msg_print_Human)
UInt_t fuLongHistoBinSizeSec
std::vector< TH2 * > fhStsFebChanMissEvtEvo
static const UInt_t kuBytesPerMessage
CbmMcbm2018MonitorMuch operator=(const CbmMcbm2018MonitorMuch &)
std::vector< TH1 * > fhStsFebChanCntRaw
std::vector< TH2 * > fhStsFebChanRawTs
Double_t fdSmxErrCoincWinM10
virtual void AddMsComponentToList(size_t component, UShort_t usDetectorId)
void SetCoincidenceBorder(Double_t dCenterPos, Double_t dBorderVal)
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< Bool_t > > fvbCrobActiveFlag
Map of DPB Identifier to DPB index.
std::vector< TH2 * > fhStsFebAsicHitRateEvo
std::vector< TProfile2D * > fhStsFebSmxErrRatioCopyEvoAsic
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcOffs
ADC gain in e-/b, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
std::vector< TProfile * > fhStsFebChanHitRateProf
std::vector< TH2 * > fhStsFebChanHitRateEvoLong
static constexpr const Double_t kdSmxErrCoincWinMainM10
TH2 * fhStsHitsElinkPerDpb
std::vector< std::vector< std::vector< UShort_t > > > fvusChanLastHitAdcInMs
Last hit time in bins in each MS for each Channel.
std::vector< UInt_t > fvuElinkLastTsHit
TS MSB cycle from MS header in 1st MS for DPB.
static constexpr const Double_t kdSmxErrCoincWinNoiseM09
ULong64_t fulCurrentTsIdx
TS/MS info.
UInt_t fuLongHistoNbSeconds
CbmMcbm2018MonitorMuch(const CbmMcbm2018MonitorMuch &)
std::vector< TH1 * > fhStsFebHitRateEvo_mskch_adccut
void SaveStsHistos(TString sFileName="")
static constexpr const Double_t kdSmxErrCoincWinMainM07
Coincidence windows for 99.0% tagging (up to 1% of corruption not detected)
std::vector< std::vector< TH2 * > > fhStsFebChanCoinc
void SmxErrInitializeVariables()
Methods.
std::vector< TProfile2D * > fhStsFebSmxErrRatioEvoAsic
MessagePrintMask
Printout control.