Go to the documentation of this file.
14 #include "FairLogger.h"
15 #include "FairParGenericSet.h"
16 #include "FairRootManager.h"
18 #include "FairRunOnline.h"
19 #include "FairRuntimeDb.h"
29 , fvbMaskedComponents()
30 , fvMsComponentsList()
34 , fbIgnoreOverlapMs(kFALSE)
36 , fdTsCoreSizeInNs(-1.0)
40 , fdTsStopTimeCore(0.0)
43 , fuCurrentEquipmentId(0)
51 LOG(info) <<
"CbmMcbm2018RawConverterGdpb::Init";
52 LOG(info) <<
"Initializing mCBM gDPB 2018 Raw Messages Converter";
58 LOG(info) <<
"Setting parameter containers for " << GetName();
64 for (Int_t iparC = 0; iparC <
fParCList->GetEntries(); ++iparC) {
65 FairParGenericSet* tempObj = (FairParGenericSet*) (
fParCList->At(iparC));
68 std::string sParamName {tempObj->GetName()};
69 FairParGenericSet* newObj =
dynamic_cast<FairParGenericSet*
>(
70 FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
72 if (
nullptr == newObj) {
73 LOG(error) <<
"Failed to obtain parameter container " << sParamName
74 <<
", for parameter index " << iparC;
84 LOG(info) <<
"Init parameter containers for " << GetName();
88 FairRun::Instance()->GetRuntimeDb()->getContainer(
"CbmMcbm2018TofPar"));
90 LOG(error) <<
"Failed to obtain parameter container CbmMcbm2018TofPar";
95 LOG(info) <<
"Nr. of STS DPBs: " <<
fuNrOfDpbs;
98 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
100 LOG(info) <<
"Eq. ID for DPB #" << std::setw(2) << uDpb <<
" = 0x"
102 << std::dec <<
" => "
107 FairRootManager* ioman = FairRootManager::Instance();
108 if (NULL == ioman) { LOG(fatal) <<
"No FairRootManager instance"; }
111 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb) {
114 LOG(fatal) <<
"Failed creating the gDPB messages vector ";
124 LOG(info) <<
"ReInit parameter containers for " << GetName();
130 UShort_t usDetectorId) {
138 LOG(info) <<
"CbmMcbm2018RawConverterGdpb::AddMsComponentToList => Component "
139 << component <<
" with detector ID 0x" << std::hex << usDetectorId
140 << std::dec <<
" added to list";
146 fdTsStartTime =
static_cast<Double_t
>(ts.descriptor(0, 0).idx);
165 LOG(info) <<
"In each TS " <<
fuNbMsLoop <<
" MS will be looped over";
178 auto msDescriptor = ts.descriptor(uMsComp,
fuMsIndex);
180 const uint8_t* msContent =
181 reinterpret_cast<const uint8_t*
>(ts.content(uMsComp,
fuMsIndex));
183 uint32_t uSize = msDescriptor.size;
188 <<
" has size: " << uSize;
199 LOG(info) <<
"-------------------------------------------------------"
211 LOG(warning) <<
"Could not find the gDPB index for AFCK id 0x"
214 <<
" in microslice " <<
fuMsIndex <<
" component "
215 << uMsCompIdx <<
"\n"
216 <<
"If valid this index has to be added in the TOF "
217 "parameter file in the DbpIdArray field";
233 LOG(error) <<
"The input microslice buffer does NOT "
234 <<
"contain only complete gDPB messages!";
237 uint32_t uNbMessages =
241 const uint64_t* pInBuff =
reinterpret_cast<const uint64_t*
>(msContent);
242 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
244 uint64_t ulData =
static_cast<uint64_t
>(pInBuff[uIdx]);
247 if (0 == uIdx) {
continue; }
265 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb)
UInt_t fuCurrDpbId
Current equipment ID, tells from which DPB the current MS is originating.
UInt_t fuCurrentEquipmentId
ULong64_t fulCurrentMsIdx
std::vector< size_t > fvMsComponentsList
Parameters related to FLES containers.
std::vector< Bool_t > fvbMaskedComponents
Control flags.
CbmMcbm2018TofPar * fUnpackPar
Double_t fdMsSizeInNs
/** Ignore Overlap Ms: all fuNbOverMsPerTs MS at the end of timeslice **/
Double_t fdTsStopTimeCore
Time in ns of current TS from the index of the first MS first component.
Bool_t ReInitContainers()
TList * fParCList
Settings from parameter file.
Double_t fdTsFullSizeInNs
Total size of the core MS in a TS, [nanoseconds].
Int_t GetNrOfGdpbs()
FIXME: replace with method returning the correspondign constants! see Star2019 parameter.
std::vector< std::vector< gdpbv100::Message > * > fvGdpbMessages
Index of the DPB from which the MS currently unpacked is coming.
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Temp until we change from CbmMcbmUnpack to something else.
UInt_t fuMsIndex
Start Time in ns of current MS from its index field in header.
UInt_t fuCurrDpbIdx
Temp holder until Current equipment ID is properly filled in MS.
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
virtual ~CbmMcbm2018RawConverterGdpb()
ULong64_t fulCurrentTsIdx
Total size of the core MS in a TS, [nanoseconds].
std::map< UInt_t, UInt_t > fDpbIdIndexMap
Total number of gDPBs to convert.
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
static const UInt_t kuBytesPerMessage
Double_t fdTsCoreSizeInNs
Size of a single MS, [nanoseconds].
CbmMcbm2018RawConverterGdpb(UInt_t uNbGdpb=1)