Go to the documentation of this file.
34 , fbDebugMonitorMode(kFALSE)
35 , fvbMaskedComponents()
50 , fvdTimeOffsetNsAsics()
54 , fdTsStopTimeCore(-1.0)
58 , fuCurrentEquipmentId(0)
61 , fiRunStartDateTimeSec(-1)
62 , fiBinSizeDatePlots(-1)
65 , fdStartTimeMsSz(0.0)
66 , ftStartTimeUnix(std::chrono::steady_clock::now())
68 , fhDigisTimeInRun(nullptr)
89 LOG(info) <<
"Initializing mCBM STS 2019 unpacker algo";
102 LOG(info) <<
"Init parameter containers for CbmMcbm2018UnpackerAlgoHodo";
108 LOG(info) <<
"**********************************************";
109 LOG(info) <<
"ReInit parameter containers for CbmMcbm2018UnpackerAlgoHodo";
128 LOG(info) <<
"Nr. of STS Modules: " <<
fuNbModules;
131 for (UInt_t uModIdx = 0; uModIdx <
fuNbModules; ++uModIdx) {
133 LOG(info) <<
"Module #" << std::setw(2) << uModIdx <<
" Address 0x"
134 << std::setw(8) << std::hex <<
fviModAddress[uModIdx] << std::dec;
138 LOG(info) <<
"Nr. of STS DPBs: " <<
fuNrOfDpbs;
141 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
143 LOG(info) <<
"Eq. ID for DPB #" << std::setw(2) << uDpb <<
" = 0x"
145 << std::dec <<
" => "
150 LOG(info) <<
"Nr. of FEBs: " <<
fuNbFebs;
163 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
205 "Bad module Index for DPB #%02u CROB #%u FEB %02u: %d",
215 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
216 TString sPrintoutLine = Form(
"DPB #%02u CROB Active ?: ", uDpb);
222 LOG(info) << sPrintoutLine;
225 UInt_t uGlobalFebIdx = 0;
226 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
229 LOG(info) << Form(
"DPB #%02u CROB #%u: ", uDpb, uCrobIdx);
233 LOG(info) << Form(
" FEB #%02u (%02u): Mod. Idx = %03d (Addr. "
234 "0x%08x) ADC gain %4.0f e- ADC Offs %5.0f e-",
249 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
259 UShort_t usDetectorId) {
267 LOG(info) <<
"CbmMcbm2018UnpackerAlgoHodo::AddMsComponentToList => Component "
268 << component <<
" with detector ID 0x" << std::hex << usDetectorId
269 << std::dec <<
" added to list";
275 fdTsStartTime =
static_cast<Double_t
>(ts.descriptor(0, 0).idx);
294 LOG(info) <<
"In each TS " <<
fuNbMsLoop <<
" MS will be looped over";
310 <<
fuMsIndex <<
" for component " << uMsComp;
321 UInt_t uAsicIdx = itHitIn->GetAsic();
334 ULong64_t ulTimeInNs =
static_cast<ULong64_t
>(dTimeInNs);
340 fviFebAddress[uFebIdx], uChanInMod, ulTimeInNs, itHitIn->GetAdc());
378 auto msDescriptor = ts.descriptor(uMsCompIdx, uMsIdx);
380 const uint8_t* msContent =
381 reinterpret_cast<const uint8_t*
>(ts.content(uMsCompIdx, uMsIdx));
383 uint32_t uSize = msDescriptor.size;
386 LOG(debug) <<
"Microslice: " <<
fulCurrentMsIdx <<
" from EqId " << std::hex
400 <<
"---------------------------------------------------------------";
412 LOG(warning) <<
"Could not find the sDPB index for AFCK id 0x" << std::hex
415 <<
" component " << uMsCompIdx <<
"\n"
416 <<
"If valid this index has to be added in the HODO "
417 "parameter file in the DbpIdArray field";
433 UInt_t uTsMsbCycleHeader = std::floor(
443 <<
"TS MSB cycle from MS header does not match current cycle from data "
447 << uTsMsbCycleHeader;
453 LOG(error) <<
"The input microslice buffer does NOT "
454 <<
"contain only complete sDPB messages!";
457 uint32_t uNbMessages =
463 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
482 LOG(warning) <<
"CbmMcbm2018UnpackerAlgoHodo::DoUnpack => "
483 <<
"Wrong elink Idx! Elink raw "
484 << Form(
"%d remap %d", usElinkIdx, uFebIdx);
509 LOG(info) <<
"CbmMcbm2018UnpackerAlgoHodo::DoUnpack => "
510 <<
"EPOCH message at unexpected position in MS: message "
511 << uIdx <<
" VS message 0 expected!";
530 LOG(fatal) <<
"CbmMcbm2018UnpackerAlgoHodo::DoUnpack => "
531 <<
"Unknown message type, should never happen, stopping "
532 "here! Type found was: "
533 <<
static_cast<int>(typeMess);
543 const UShort_t& usElinkIdx,
544 const UInt_t& uAsicIdx,
583 Long64_t ulHitTime = usRawTs;
593 ulHitTime, usRawAdc, uAsicIdx, usChan,
fuCurrDpbIdx, uCrobIdx));
656 << uMsIdx <<
" Msg Idx " << std::setw(5) << uMessIdx <<
" DPB "
657 << std::setw(2) <<
fuCurrDpbIdx <<
" Old TsMsb " << std::setw(5)
660 << std::setw(5) << uVal;
666 LOG(info) <<
"TS MSb Jump in "
669 << uMsIdx <<
" Msg Idx " << std::setw(5) << uMessIdx <<
" DPB "
672 << std::setw(5) << uVal;
735 new TH1I(
"hStsDigisTimeInRun",
736 "Digis Nb vs Time in Run; Time in run [s]; Digis Nb []",
743 new TH1I(
"fhVectorSize",
744 "Size of the vector VS TS index; TS index; Size [bytes]",
749 new TH1I(
"fhVectorCapacity",
750 "Size of the vector VS TS index; TS index; Size [bytes]",
1037 Double_t dOffsetIn) {
Double_t fdCapacityIncFactor
Double_t fdTimeOffsetNs
Module for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
Double_t GetFebAdcOffset(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of STS DPBs in system.
Double_t fdMsSizeInNs
/** Ignore Overlap Ms: all fuOverlapMsNb MS at the end of timeslice **/
static constexpr UInt_t GetNbAsicsPerCrob()
std::vector< Double_t > fvdTimeOffsetNsAsics
std::vector< std::vector< std::vector< Int_t > > > fviFebModuleIdx
Number of StsXyter ASICs.
std::vector< Int_t > fviFebAddress
ADC offset in e-, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
ULong64_t fulCurrentTsIdx
std::map< stsxyter::MessType, UInt_t > fmMsgCounter
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
Int_t GetFebModuleIdx(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
std::vector< std::vector< Bool_t > > fvbCrobActiveFlag
Map of DPB Identifier to DPB index.
static constexpr UInt_t GetNbFebsPerCrob()
UInt_t ElinkIdxToAsicIdx(UInt_t uElink)
void AddHistoToVector(TNamed *pointer, std::string sFolder="")
For monitor algos.
uint32_t GetTsMsbVal() const
For TS MSB data: Returns the TS MSB 22 bit field)
uint16_t GetLinkIndex() const
For all data: Returns the (global) index of the eLink on which the message was received (n bit field)
static constexpr UInt_t GetNbElinkPerCrob()
std::vector< Bool_t > fvbMaskedComponents
Switch ON the filling of a additional set of histograms.
void ProcessEpochInfo(const stsxyter::Message &mess)
std::vector< UInt_t > fvuCurrentTsMsbCycle
Current TS MSB for each DPB.
static const uint64_t kulTsCycleNbBins
Int_t ElinkIdxToFebIdx(UInt_t uElink)
std::vector< Int_t > fviModAddress
Total number of STS modules in the setup.
Double_t fdTsFullSizeInNs
Total size of the core MS in a TS, [nanoseconds].
TList * fParCList
Parameter management.
std::vector< size_t > fvMsComponentsList
Parameters related to FLES containers.
uint16_t GetHitAdc() const
For Hit data: Returns ADC value (5 bit field)
void ProcessTsMsbInfo(const stsxyter::Message &mess, UInt_t uMessIdx=0, UInt_t uMsIdx=0)
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcOffs
ADC gain in e-/b, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ].
UInt_t GetModuleAddress(UInt_t uModuleIdx)
static constexpr UInt_t GetNbCrobsPerDpb()
std::vector< ULong64_t > fvulCurrentTsMsb
UInt_t fuNbFebs
Array to hold the active flag for all CROBs, [ NbDpb ][ NbCrobPerDpb ].
UInt_t GetChannelInModule(UInt_t uModuleIdx, UInt_t uChan)
static const uint32_t kuHitNbTsBins
Double_t fdTsCoreSizeInNs
Size of a single MS, [nanoseconds].
std::vector< CbmStsDigi > fDigiVect
Vector of pointers to canvases + optional folder name.
Double_t GetFebAdcGain(UInt_t uDpbIdx, UInt_t uCrobIdx, UInt_t uFebIdx)
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
Bool_t ReInitContainers()
UInt_t fuNbStsXyters
Number of FEBs with StsXyter ASICs.
Bool_t CreateHistograms()
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
static const double kdClockCycleNs
MessType GetMessType() const
Returns the message type, see enum MessType.
void ProcessStatusInfo(const stsxyter::Message &mess)
std::vector< stsxyter::FinalHit > fvmHitsInMs
Hits time-sorting.
Bool_t ProcessTs(const fles::Timeslice &ts)
TH1 * fhDigisTimeInRun
All hits (time in bins, ADC in bins, asic, channel) in last MS, sorted with "<" operator.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn=0.0)
uint16_t GetHitChannel() const
For Hit data: Returns StsXYTER channel number (7 bit field)
Bool_t fbMonitorMode
Control flags.
CbmMcbm2018UnpackerAlgoHodo()
std::vector< Int_t > fviFebModule
STS address for each FEB, [ NbDpb * NbCrobPerDpb * NbFebsPerCrob ].
uint16_t GetHitTime() const
For Hit data: Returns timestamp (8 bit field, 2 MSB bits overlap removed)
static constexpr UInt_t GetNbAsicsPerFeb()
ULong64_t fulCurrentMsIdx
std::vector< std::vector< std::vector< Double_t > > > fvdFebAdcGain
Idx of the STS module for each FEB, [ NbDpb ][ NbCrobPerDpb ][ NbFebsPerCrob ], -1 if inactive.
Bool_t IsCrobActive(UInt_t uDpbIdx, UInt_t uCrobIdx)
~CbmMcbm2018UnpackerAlgoHodo()
UInt_t GetDpbId(UInt_t uDpbIdx)
UInt_t fuCurrentEquipmentId
Bool_t ProcessMs(const fles::Timeslice &ts, size_t uMsCompIdx, size_t uMsIdx)
CbmMcbm2018HodoPar * fUnpackPar
Settings from parameter file.
void ProcessHitInfo(const stsxyter::Message &mess, const UShort_t &usElinkIdx, const UInt_t &uAsicIdx, const UInt_t &uMsIdx)
UInt_t fuNrOfDpbs
STS address for the first strip of each module.