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) <<
"CbmMcbm2018UnpackerTaskSts::Init";
50 LOG(info) <<
"Initializing mCBM STS 2018 Unpacker";
52 FairRootManager* ioman = FairRootManager::Instance();
53 if (NULL == ioman) { LOG(fatal) <<
"No FairRootManager instance"; }
56 if (
nullptr != ioman->InitObjectAs<std::vector<CbmStsDigi>
const*>(
"StsDigi"))
58 <<
"CbmMcbm2018UnpackerTaskSts::Init => output vector already registered,"
59 <<
" probably by CbmMcbm2018UnpackerTaskHodo" << std::endl
60 <<
" THESE TWO CLASSES ARE INCOMPATIBLE!";
74 LOG(info) <<
"Setting parameter containers for " << GetName();
78 for (Int_t iparC = 0; iparC < fParCList->GetEntries(); ++iparC) {
79 FairParGenericSet* tempObj = (FairParGenericSet*) (fParCList->At(iparC));
80 fParCList->Remove(tempObj);
82 std::string sParamName {tempObj->GetName()};
83 FairParGenericSet* newObj =
dynamic_cast<FairParGenericSet*
>(
84 FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
86 if (
nullptr == newObj) {
87 LOG(error) <<
"Failed to obtain parameter container " << sParamName
88 <<
", for parameter index " << iparC;
92 fParCList->AddAt(newObj, iparC);
98 LOG(info) <<
"Init parameter containers for " << GetName();
102 FairRun::Instance()->GetRuntimeDb()->getContainer(
"CbmMcbm2018StsPar"));
103 if (
nullptr == pUnpackPar) {
104 LOG(error) <<
"Failed to obtain parameter container CbmMcbm2018StsPar";
124 std::vector<std::pair<TNamed*, std::string>> vHistos =
128 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
129 if (
nullptr != server) {
130 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
131 server->Register(Form(
"/%s", vHistos[uHisto].second.data()),
132 vHistos[uHisto].first);
135 server->RegisterCommand(
"/Reset_UnpSts_Hist",
136 "bMcbm2018UnpackerTaskStsResetHistos=kTRUE");
137 server->Restrict(
"/Reset_UnpSts_Hist",
"allow=admin");
143 for (std::vector<FebChanMask>::iterator it =
fvChanMasks.begin();
152 LOG(info) <<
"ReInit parameter containers for " << GetName();
159 UShort_t usDetectorId) {
166 LOG(info) <<
"Reset STS unpacker histos ";
172 LOG(error) <<
"Failed processing TS " << ts.index()
173 <<
" in unpacker algorithm class";
203 std::vector<std::pair<TNamed*, std::string>> vHistos =
207 TDirectory* oldDir = NULL;
208 TFile* histoFile = NULL;
212 histoFile =
new TFile(
"data/HistosUnpackerSts.root",
"RECREATE");
216 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
218 TString sFolder = vHistos[uHisto].second.data();
219 if (
nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
220 gDirectory->cd(sFolder);
223 vHistos[uHisto].first->Write();
243 Double_t dOffsetIn) {
Bool_t CreateHistograms()
std::vector< CbmStsDigi > * fpvDigiSts
Output vectors.
void SetAdcCut(UInt_t uAdc)
std::vector< std::pair< TNamed *, std::string > > GetHistoVector()
virtual ~CbmMcbm2018UnpackerTaskSts()
std::vector< CbmErrorMessage > & GetErrorVector()
std::vector< T > & GetVector()
void SetBinningFwFlag(Bool_t bEnable=kTRUE)
=> Quick and dirty hack for binning FW!!!
Bool_t fbMonitorMode
Control flags.
Bool_t ReInitContainers()
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Bool_t bMcbm2018UnpackerTaskStsResetHistos
CbmMcbm2018UnpackerTaskSts(UInt_t uNbSdpb=1)
CbmMcbm2018UnpackerAlgoSts * fUnpackerAlgo
Processing algo.
void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn=0.0)
void SetTimeOffsetNsAsic(UInt_t uAsicIdx, Double_t dOffsetIn=0.0)
ClassImp(CbmConverterManager) InitStatus CbmConverterManager
void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked=kTRUE)
void AddMsComponentToList(size_t component, UShort_t usDetectorId)
Temp until we change from CbmMcbmUnpack to something else.
Bool_t fbWriteOutput
Switch ON the filling of a additional set of histograms.
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
void SetTimeOffsetNs(Double_t dOffsetIn=0.0)
void MaskNoisyChannel(UInt_t uFeb, UInt_t uChan, Bool_t bMasked=kTRUE)
uint64_t fulTsCounter
Statistics & first TS rejection.
Bool_t ReInitContainers()
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
void SetMonitorMode(Bool_t bFlagIn=kTRUE)
std::vector< CbmErrorMessage > * fpvErrorSts
void SetAdcCut(UInt_t uAdc)
virtual Bool_t DoUnpack(const fles::Timeslice &ts, size_t component)
void ClearVector()
For unpacker algos.
std::vector< FebChanMask > fvChanMasks
If ON the output TClonesArray of digi is written to disk.
Bool_t ProcessTs(const fles::Timeslice &ts)
void SetIgnoreOverlapMs(Bool_t bFlagIn=kTRUE)
Control flags.
void SetBinningFwFlag(Bool_t bEnable=kTRUE)
=> Quick and dirty hack for binning FW!!!