18#include "FairParGenericSet.h"
19#include "FairRootManager.h"
21#include "FairRunOnline.h"
22#include "FairRuntimeDb.h"
25#include "TClonesArray.h"
27#include "THttpServer.h"
43 , fbMonitorMode(kFALSE)
44 , fbDebugMonitorMode(kFALSE)
45 , fbWriteOutput(kTRUE)
46 , fbDebugWriteOutput(kFALSE)
48 , fPsdDigiVector(nullptr)
49 , fPsdDspVector(nullptr)
50 , fUnpackerAlgo(nullptr)
52 LOG(info) <<
"CbmMcbm2018UnpackerTaskPsd::Allocate";
60 LOG(info) <<
"CbmMcbm2018UnpackerTaskPsd::Init";
61 LOG(info) <<
"Initializing mCBM PSD 2018 Unpacker";
62 Bool_t initOK = kTRUE;
64 FairRootManager* ioman = FairRootManager::Instance();
65 if (NULL == ioman) { LOG(fatal) <<
"No FairRootManager instance"; }
74 LOG(fatal) <<
"fPsdDigiVector could not be registered at FairRootManager";
85 LOG(fatal) <<
"fPsdDspVector could not be registered at FairRootManager";
94 LOG(info) <<
"Setting parameter containers for " << GetName();
98 for (Int_t iparC = 0; iparC < fParCList->GetEntries(); ++iparC) {
99 FairParGenericSet* tempObj = (FairParGenericSet*) (fParCList->At(iparC));
100 fParCList->Remove(tempObj);
102 std::string sParamName {tempObj->GetName()};
103 FairParGenericSet* newObj =
104 dynamic_cast<FairParGenericSet*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
106 if (
nullptr == newObj) {
107 LOG(error) <<
"Failed to obtain parameter container " << sParamName <<
", for parameter index " << iparC;
111 fParCList->AddAt(newObj, iparC);
118 LOG(info) <<
"Init parameter containers for " << GetName();
122 dynamic_cast<CbmMcbm2018PsdPar*
>(FairRun::Instance()->GetRuntimeDb()->getContainer(
"CbmMcbm2018PsdPar"));
123 if (
nullptr == pUnpackPar) {
124 LOG(error) <<
"Failed to obtain parameter container CbmMcbm2018PsdPar";
135 LOG(info) <<
"ReInit parameter containers for " << GetName();
150 LOG(info) <<
"Reset PSD unpacker histos ";
164 => Done in the algo!!!
165 sort(fPsdDigiVector->begin(), fPsdDigiVector->end(),
166 [](const CbmPsdDigi & a, const CbmPsdDigi & b) -> bool
168 return a.GetTime() < b.GetTime();
189 LOG(info) <<
"Finish of CbmMcbm2018UnpackerTaskPsd";
ClassImp(CbmConverterManager)
Bool_t bMcbm2018UnpackerTaskPsdResetHistos
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Bool_t SetDigiOutputPointer(std::vector< CbmPsdDigi > *const pVector)
void SetDspWriteMode(Bool_t bFlagIn=kTRUE)
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
std::pair< std::vector< CbmPsdDigi > *, std::vector< CbmPsdDsp > * > unpack(const fles::Timeslice *ts, std::uint16_t icomp)
Bool_t ReInitContainers()
Bool_t SetDspOutputPointer(std::vector< CbmPsdDsp > *const pVector)
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
virtual ~CbmMcbm2018UnpackerTaskPsd()
Bool_t fbWriteOutput
Switch ON the filling of a additional set of histograms.
uint64_t fulTsCounter
If ON the output vector of dsp debug information is written to disk.
CbmMcbm2018UnpackerTaskPsd(UInt_t uNbSdpb=1)
std::vector< CbmPsdDigi > * fPsdDigiVector
Output Digi vector.
Bool_t ReInitContainers()
Bool_t fbDebugWriteOutput
If ON the output vector of digi is written to disk.
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Temp until we change from CbmMcbmUnpack to something else.
CbmMcbm2018UnpackerAlgoPsd * fUnpackerAlgo
Processing algo.
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
Bool_t fbMonitorMode
Control flags.
std::vector< CbmPsdDsp > * fPsdDspVector
Output Dsp vector – preprocessed info for debugging.
void SetDspWriteMode(Bool_t bFlagIn=kTRUE)
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
Control flags.