Go to the documentation of this file.
13 #include "FairLogger.h"
14 #include "FairParGenericSet.h"
15 #include "FairRootManager.h"
17 #include "FairRunOnline.h"
18 #include "FairRuntimeDb.h"
20 #include "TClonesArray.h"
21 #include "THttpServer.h"
36 , fbMonitorMode(kFALSE)
37 , fbWriteOutput(kTRUE)
40 , fUnpackerAlgo(nullptr) {
49 LOG(info) <<
"CbmMcbm2018UnpackerTaskMuch::Init";
50 LOG(info) <<
"Initializing mCBM MUCH 2018 Unpacker";
52 FairRootManager* ioman = FairRootManager::Instance();
53 if (NULL == ioman) { LOG(fatal) <<
"No FairRootManager instance"; }
67 LOG(info) <<
"Setting parameter containers for " << GetName();
71 for (Int_t iparC = 0; iparC < fParCList->GetEntries(); ++iparC) {
72 FairParGenericSet* tempObj = (FairParGenericSet*) (fParCList->At(iparC));
73 fParCList->Remove(tempObj);
75 std::string sParamName {tempObj->GetName()};
76 FairParGenericSet* newObj =
dynamic_cast<FairParGenericSet*
>(
77 FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
79 if (
nullptr == newObj) {
80 LOG(error) <<
"Failed to obtain parameter container " << sParamName
81 <<
", for parameter index " << iparC;
85 fParCList->AddAt(newObj, iparC);
91 LOG(info) <<
"Init parameter containers for " << GetName();
95 FairRun::Instance()->GetRuntimeDb()->getContainer(
"CbmMcbm2018MuchPar"));
96 if (
nullptr == pUnpackPar) {
97 LOG(error) <<
"Failed to obtain parameter container CbmMcbm2018MuchPar";
117 std::vector<std::pair<TNamed*, std::string>> vHistos =
121 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
122 if (
nullptr != server) {
123 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
124 server->Register(Form(
"/%s", vHistos[uHisto].second.data()),
125 vHistos[uHisto].first);
128 server->RegisterCommand(
"/Reset_UnpMuch_Hist",
129 "bMcbm2018UnpackerTaskMuchResetHistos=kTRUE");
130 server->Restrict(
"/Reset_UnpMuch_Hist",
"allow=admin");
137 for (std::vector<MuchFebChanMask>::iterator it =
fvChanMasks.begin();
146 LOG(info) <<
"ReInit parameter containers for " << GetName();
153 UShort_t usDetectorId) {
160 LOG(info) <<
"Reset MUCH unpacker histos ";
166 LOG(error) <<
"Failed processing TS " << ts.index()
167 <<
" in unpacker algorithm class";
197 std::vector<std::pair<TNamed*, std::string>> vHistos =
201 TDirectory* oldDir = NULL;
202 TFile* histoFile = NULL;
206 histoFile =
new TFile(
"data/HistosUnpackerMuch.root",
"RECREATE");
210 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
212 TString sFolder = vHistos[uHisto].second.data();
213 if (
nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
214 gDirectory->cd(sFolder);
217 vHistos[uHisto].first->Write();
237 Double_t dOffsetIn) {
void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked=kTRUE)
std::vector< CbmErrorMessage > * fpvErrorMuch
Bool_t CreateHistograms()
std::vector< std::pair< TNamed *, std::string > > GetHistoVector()
std::vector< CbmErrorMessage > & GetErrorVector()
std::vector< T > & GetVector()
void SetAdcCut(UInt_t uAdc)
ADC cut.
void EnableAsicType(Int_t flag=0)
Bool_t ProcessTs(const fles::Timeslice &ts)
CbmMcbm2018UnpackerTaskMuch(UInt_t uNbSdpb=1)
void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn=0.0)
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Temp until we change from CbmMcbmUnpack to something else.
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn=0.0)
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
Bool_t fbMonitorMode
Control flags.
void SetAdcCut(UInt_t uAdc)
Bool_t ReInitContainers()
std::vector< MuchFebChanMask > fvChanMasks
If ON the output TClonesArray of digi is written to disk.
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
Bool_t ReInitContainers()
CbmMcbm2018UnpackerAlgoMuch * fUnpackerAlgo
Processing algo.
void SetBinningFwFlag(Bool_t bEnable=kTRUE)
=> Quick and dirty hack for binning FW!!!
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
Bool_t bMcbm2018UnpackerTaskMuchResetHistos
uint64_t fulTsCounter
Statistics & first TS rejection.
Bool_t fbWriteOutput
Switch ON the filling of a additional set of histograms.
virtual ~CbmMcbm2018UnpackerTaskMuch()
void EnableAsicType(Int_t fiFlag=0)
void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked=kTRUE)
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
void ClearVector()
For unpacker algos.
std::vector< CbmMuchBeamTimeDigi > * fpvDigiMuch
Output vectors.
void SetBinningFwFlag(Bool_t bEnable=kTRUE)
=> Quick and dirty hack for binning FW!!!
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
Control flags.