12#ifndef CbmCosy2019MonitorAlgoHodo_H
13#define CbmCosy2019MonitorAlgoHodo_H
44 virtual Bool_t
Init();
54 Bool_t
ProcessTs(
const fles::Timeslice& ts);
56 Bool_t
ProcessMs(
const fles::Timeslice& ts,
size_t uMsCompIdx,
size_t uMsIdx);
73 inline void SetHodoSwapXY(Bool_t bSwapHodoA = kFALSE, Bool_t bSwapHodoB = kTRUE)
78 inline void SetHodoInvertX(Bool_t bInvHodoA = kFALSE, Bool_t bInvHodoB = kTRUE)
83 inline void SetHodoInvertY(Bool_t bInvHodoA = kFALSE, Bool_t bInvHodoB = kTRUE)
99 UInt_t fuNbModules; //! Total number of STS modules in the setup
100 std::vector< Int_t > fviModuleType; //! Type of each module: 0 for connectors on the right, 1 for connectors on the left
101 std::vector< Int_t > fviModAddress; //! STS address for the first strip of each module
102 UInt_t fuNrOfDpbs; //! Total number of STS DPBs in system
103 std::map<UInt_t, UInt_t> fDpbIdIndexMap; //! Map of DPB Identifier to DPB index
104 std::vector< std::vector< Bool_t > > fvbCrobActiveFlag; //! Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ]
105 UInt_t fuNbFebs; //! Number of FEBs with HodoXyter ASICs
106 UInt_t fuNbStsXyters; //! Number of StsXyter ASICs
107 std::vector< std::vector< std::vector< Int_t > > > fviFebModuleIdx; //! Idx of the STS module for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], -1 if inactive
108 std::vector< std::vector< std::vector< Int_t > > > fviFebModuleSide; //! STS module side for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = P, 1 = N, -1 if inactive
109 std::vector< std::vector< std::vector< Int_t > > > fviFebType; //! FEB type, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], 0 = A, 1 = B, -1 if inactive
110 std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcGain; //! ADC gain in e-/b, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ]
111 std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcOffs; //! ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ]
112 std::vector< Int_t > fviFebAddress; //! STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ]
144 const UInt_t
kuChannelToFiberMap[
kuNbChanPerAsic] = {32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49, 17, 46, 14, 62,
145 30, 34, 2, 50, 18, 45, 13, 61, 29, 35, 3, 51, 19, 44, 12,
146 60, 28, 36, 4, 52, 20, 43, 11, 59, 27, 37, 5, 53, 21, 42,
147 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, 25, 39, 7, 55, 23,
148 40, 8, 56, 24, 32, 0, 48, 16, 47, 15, 63, 31, 33, 1, 49,
149 17, 46, 14, 62, 30, 34, 2, 50, 18, 45, 13, 61, 29, 35, 3,
150 51, 19, 44, 12, 60, 28, 36, 4, 52, 20, 43, 11, 59, 27, 37,
151 5, 53, 21, 42, 10, 58, 26, 38, 6, 54, 22, 41, 9, 57, 25,
152 39, 7, 55, 23, 40, 8, 56, 24};
153 const UInt_t
kuChannelToPixelMap[
kuNbChanPerAsic] = {1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11, 15, 10, 14, 12,
154 16, 17, 21, 19, 23, 18, 22, 20, 24, 25, 29, 27, 31, 26, 30,
155 28, 32, 33, 37, 35, 39, 34, 38, 36, 40, 41, 45, 43, 47, 42,
156 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, 56, 57, 61, 59, 63,
157 58, 62, 60, 64, 1, 5, 3, 7, 2, 6, 4, 8, 9, 13, 11,
158 15, 10, 14, 12, 16, 17, 21, 19, 23, 18, 22, 20, 24, 25, 29,
159 27, 31, 26, 30, 28, 32, 33, 37, 35, 39, 34, 38, 36, 40, 41,
160 45, 43, 47, 42, 46, 44, 48, 49, 53, 51, 55, 50, 54, 52, 56,
161 57, 61, 59, 63, 58, 62, 60, 64};
163 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
164 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
165 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
166 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
189 std::chrono::steady_clock::time_point
193 std::vector<stsxyter::FinalHit>
UInt_t fuDpbId
Settings from parameter file => For now use only accessors!
std::vector< TH2 * > fhHodoFiberCoincMapXY
+/- in clock cycles
TH2 * fhHodoFullCoincCompY
static const Int_t kiMaxNbFlibLinks
Constants.
CbmCosy2019MonitorAlgoHodo operator=(const CbmCosy2019MonitorAlgoHodo &)
TCanvas * fcHodoFullCoincPos
std::vector< std::vector< TH2 * > > fhHodoFullCoincTimeWalk
TCanvas * fcHodoFiberCoincAB
std::vector< UInt_t > fvuAdcGainHodo
Bool_t CreateHistograms()
TH1 * fhHodoFullCoincTimeDiff
std::vector< Bool_t > fvbHodoSwapXY
TH1 * fhHodoFullCoincRateEvo
[ Hodo ][ Axis ]
CbmCosy2019MonitorAlgoHodo()
TH1 * fhPrevHitDtAllAsics
Setup debugging.
TH2 * fhHodoFullCoincPosB
void SetDpbId(UInt_t uDpbId=0x5b75)
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.
std::chrono::steady_clock::time_point ftStartTimeUnix
Double_t fdMsTime
Header time of previous MS per link.
void SetHodoElinkIdx(UInt_t uElinkHodoA=5, UInt_t uElinkHodoB=10)
const UInt_t kuChannelToPlaneMap[kuNbChanPerAsic]
Map from channel index to PMT pixel.
TCanvas * fcHodoFullCoinc
std::vector< Double_t > fvdPreviousHitTimePerAsic
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
void SetHodoInvertY(Bool_t bInvHodoA=kFALSE, Bool_t bInvHodoB=kTRUE)
Default set closest cosmic setup stack.
static const UInt_t kuBytesPerMessage
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
Int_t fiRunStartDateTimeSec
Temp holder until Current equipment ID is properly filled in MS.
std::vector< TH2 * > fhHodoChanMissEvtEvo
[ Hodo ]
Double_t fdTimeOffsetNs
User settings: Data correction parameters.
std::vector< std::vector< TProfile * > > fhHodoFiberAdcProf
[ Hodo ][ Axis ]
std::vector< std::vector< Double_t > > fvdChanCountsSinceLastRateUpdate
[ Hodo ]
TCanvas * fcHodoFiberCoinc
UInt_t fuCurrentEquipmentId
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Bool_t ReInitContainers()
TCanvas * fcSummary
[ Asic ]
Double_t fdTimeCoincLimit
Bool_t fbDebugMonitorMode
Switch ON the filling of a minimal set of histograms.
TH2 * fhHodoStatusMessType
std::vector< TH1 * > fhHodoFiberCoincTimeSameAB
[ Axis ]
Int_t fiBinSizeDatePlots
Start of run time since "epoch" in s, for the plots with date as X axis.
std::vector< UInt_t > fvuElinkIdxHodo
void SetHodoSwapXY(Bool_t bSwapHodoA=kFALSE, Bool_t bSwapHodoB=kTRUE)
Default set for mMUCH FMC slots 8 and 9.
std::vector< TH2 * > fhHodoChanDistT
[ Hodo ]
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
void SetHodoInvertX(Bool_t bInvHodoA=kFALSE, Bool_t bInvHodoB=kTRUE)
Default set closest cosmic setup stack.
std::vector< UInt_t > fvuAdcOffsHodo
UInt_t fuPreviousHitAsic
[ Hodo ][ Chan ]
std::vector< Int_t > fviTimeSecLastRateUpdate
std::vector< TH1 * > fhHodoFiberCoincTimeDiffAB
[ Axis ]
std::vector< TH2 * > fhHodoChanRawTs
[ Hodo ]
std::vector< TH2 * > fhHodoFiberCoincMapSameAB
[ Hodo ]
TH2 * fhHodoMsStatusFieldType
const UInt_t kuChannelToPixelMap[kuNbChanPerAsic]
Map from channel index to Hodoscope Fiber.
const UInt_t kuChannelToFiberMap[kuNbChanPerAsic]
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
Bool_t fbMonitorMode
Default set closest cosmic setup stack.
TCanvas * fcHodoPrevHitDt
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.
ULong64_t fvulCurrentTsMsb
std::vector< std::vector< Double_t > > fdHodoChanLastTimeForDist
[ Hodo ][ Chan ]
TH2 * fhHodoFullCoincCompX
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)
Int_t fiTimeIntervalRateUpdate
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 ]
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
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< Bool_t > fvbHodoInvertX
TH2 * fhHodoMessTypePerElink
TH2 * fhHodoFullCoincResidualXY
std::vector< TCanvas * > fcHodoSummaryFiber
std::vector< TH2 * > fhHodoChanAdcCal
[ Hodo ]
CbmCosy2019MonitorAlgoHodo(const CbmCosy2019MonitorAlgoHodo &)
std::vector< TH2 * > fhHodoFiberCoincMapDiffAB
[ Axis ]
TH2 * fhHodoFullCoincPosA
[ Axis ]
~CbmCosy2019MonitorAlgoHodo()
void ProcessTsMsbInfo(stsxyter::Message mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
std::vector< TH1 * > fhHodoFiberCoincTimeXY
[ Hodo ]
std::vector< std::vector< TH2 * > > fhHodoFullCoincPosEvo
Bool_t ProcessTs(const fles::Timeslice &ts, size_t)
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 ]
ULong64_t fulCurrentMsIdx
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
static const UInt_t kuNbElinksDpb
UInt_t fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
TCanvas * fcHodoFullCoincPosEvo
std::vector< Bool_t > fvbHodoInvertY
std::vector< TH2 * > fhHodoChanHitRateEvo
[ Hodo ]
static constexpr double kdClockCycleNs