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) <<
"CbmMcbm2018RawConverterSdpb::Init";
52 LOG(info) <<
"Initializing mCBM sDPB 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(
"CbmMcbm2018StsPar"));
90 LOG(error) <<
"Failed to obtain parameter container CbmMcbm2018StsPar";
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 sDPB messages vector ";
124 LOG(info) <<
"ReInit parameter containers for " << GetName();
130 UShort_t usDetectorId) {
138 LOG(info) <<
"CbmMcbm2018RawConverterSdpb::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 sDPB index for AFCK id 0x"
214 <<
" in microslice " <<
fuMsIndex <<
" component "
215 << uMsCompIdx <<
"\n"
216 <<
"If valid this index has to be added in the STS "
217 "parameter file in the DbpIdArray field";
234 LOG(error) <<
"The input microslice buffer does NOT "
235 <<
"contain only complete sDPB messages!";
238 uint32_t uNbMessages =
242 const uint32_t* pInBuff =
reinterpret_cast<const uint32_t*
>(msContent);
243 for (uint32_t uIdx = 0; uIdx < uNbMessages; uIdx++) {
245 uint32_t ulData =
static_cast<uint32_t
>(pInBuff[uIdx]);
262 for (UInt_t uDpb = 0; uDpb <
fuNrOfDpbs; ++uDpb)