36 , fbDebugMonitorMode(kFALSE)
37 , fvbMaskedComponents()
42 , fuNrOfChannelsPerFee(0)
43 , fuNrOfChannelsPerGdpb(0)
51 , fdTsStopTimeCore(-1.0)
54 , fuCurrentEquipmentId(0)
57 , fiRunStartDateTimeSec(-1)
58 , fiBinSizeDatePlots(-1)
60 , fvulCurrentEpochCycle()
61 , fvulCurrentEpochFull()
63 , fdStartTimeMsSz(0.0)
64 , ftStartTimeUnix(std::chrono::steady_clock::now()) {}
71 LOG(info) <<
"Initializing mCBM PSD 2019 unpacker algo";
80 LOG(info) <<
"Init parameter containers for CbmMcbm2018UnpackerAlgoPsd";
86 LOG(info) <<
"**********************************************";
87 LOG(info) <<
"ReInit parameter containers for CbmMcbm2018UnpackerAlgoPsd";
119 LOG(info) <<
"GDPB Id of PSD " <<
i <<
" : " << std::hex
127 UInt_t uNrOfModules = 1;
128 UInt_t uNrOfSections = 32;
129 UInt_t uNrOfChannels = uNrOfModules * uNrOfSections;
130 LOG(info) <<
"Nr. of possible Psd channels: " << uNrOfChannels;
134 for (UInt_t iModule = 0; iModule < uNrOfModules; ++iModule) {
135 for (UInt_t iSection = 0; iSection < uNrOfSections; ++iSection) {
136 iCh = iModule * uNrOfSections + iSection;
151 UShort_t usDetectorId) {
159 LOG(info) <<
"CbmMcbm2018UnpackerAlgoPsd::AddMsComponentToList => Component "
160 << component <<
" with detector ID 0x" << std::hex << usDetectorId
161 << std::dec <<
" added to list";
168 fdTsStartTime =
static_cast<Double_t
>(ts.descriptor(0, 0).idx);
187 LOG(info) <<
"In each TS " <<
fuNbMsLoop <<
" MS will be looped over";
203 <<
fuMsIndex <<
" for component " << uMsComp;
213 return a.GetTime() < b.GetTime();
223 auto msDescriptor = ts.descriptor(uMsCompIdx, uMsIdx);
225 const uint8_t* msContent =
226 reinterpret_cast<const uint8_t*
>(ts.content(uMsCompIdx, uMsIdx));
228 uint32_t uSize = msDescriptor.size;
233 LOG(debug) <<
"Microslice: " <<
fulCurrentMsIdx <<
" from EqId " << std::hex
246 <<
"---------------------------------------------------------------";
249 LOG(warning) <<
"Could not find the gDPB index for AFCK id 0x" << std::hex
252 <<
" component " << uMsCompIdx <<
"\n"
253 <<
"If valid this index has to be added in the PSD "
254 "parameter file in the DbpIdArray field";
274 LOG(error) <<
"The input microslice buffer does NOT "
275 <<
"contain only complete nDPB messages!";
282 LOG(error) <<
"negative time! ";
287 uint32_t uNbMessages =
291 const uint64_t* pInBuff =
reinterpret_cast<const uint64_t*
>(msContent);
299 LOG(error) <<
"too many triggered channels! In header: "
305 if (ReadResult == 0) {
309 UInt_t uHitChannel = PsdReader.
VectHitHdr.at(hit_iter).uHitChannel;
310 UInt_t uSignalCharge =
311 PsdReader.
VectHitHdr.at(hit_iter).uSignalCharge;
312 UInt_t uZeroLevel = PsdReader.
VectHitHdr.at(hit_iter).uZeroLevel;
313 std::vector<uint16_t> uWfm = PsdReader.
VectHitData.at(hit_iter).uWfm;
316 LOG(error) <<
"hit channel number out of range! channel index: "
321 UInt_t uChId = uHitChannel;
322 UInt_t uRpdChId = uChId;
325 UInt_t uHitAmlpitude = 0;
326 UInt_t uHitChargeWfm = 0;
327 for (UInt_t wfm_iter = 0; wfm_iter < uWfm.size(); wfm_iter++) {
328 if (uWfm.at(wfm_iter) > uHitAmlpitude)
329 uHitAmlpitude = uWfm.at(wfm_iter);
330 uHitChargeWfm += uWfm.at(wfm_iter) - uZeroLevel;
332 uHitAmlpitude -= uZeroLevel;
340 LOG(debug) << Form(
"Insert 0x%08x digi with charge ", uChanUId)
345 fDigiVect.emplace_back(uChanUId, (
double) uSignalCharge, dAdcTime);
348 fDigiVect.back().SetEdepWfm(uHitChargeWfm);
352 }
else if (ReadResult == 1) {
353 LOG(error) <<
"no event headers in message!";
355 }
else if (ReadResult == 2) {
356 LOG(error) <<
"check number of waveform points! In header: "
359 }
else if (ReadResult == 3) {
360 LOG(error) <<
"wrong amount of hits read! In header: "
362 <<
" in hit vector: " << PsdReader.
VectHitHdr.size();
366 <<
"PsdGbtReader.ReadEventFles() didn't return expected values";
373 LOG(error) <<
"Wrong amount of messages read!"
374 <<
" in microslice " << uNbMessages <<
" by PsdReader "
378 LOG(error) <<
"Wrong MS index!"