13 #include <TClonesArray.h>
15 #include <THttpServer.h>
19 #include <FairLogger.h>
20 #include <FairParGenericSet.h>
21 #include <FairRootManager.h>
23 #include <FairRunOnline.h>
24 #include <FairRuntimeDb.h>
38 , fbMonitorMode(kFALSE)
39 , fbDebugMonitorMode(kFALSE)
40 , fbWriteOutput(kTRUE)
51 LOG(info) <<
"CbmMcbm2018UnpackerTaskRich::Init";
52 LOG(info) <<
"Initializing mCBM RICH 2018 Unpacker";
54 FairRootManager* ioman = FairRootManager::Instance();
55 if (ioman == NULL) { LOG(fatal) <<
"No FairRootManager instance"; }
68 LOG(info) <<
"Reset RICH unpacker histos ";
74 LOG(error) <<
"Failed processing TS " << ts.index()
75 <<
" in mRICH unpacker algorithm class";
105 std::vector<std::pair<TNamed*, std::string>> vHistos =
109 TDirectory* oldDir = NULL;
110 TFile* histoFile = NULL;
114 histoFile =
new TFile(
"data/HistosUnpackerRich.root",
"RECREATE");
118 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
120 TString sFolder = vHistos[uHisto].second.data();
121 if (
nullptr == gDirectory->Get(sFolder)) gDirectory->mkdir(sFolder);
122 gDirectory->cd(sFolder);
125 vHistos[uHisto].first->Write();
140 LOG(info) <<
"Setting parameter containers for " << GetName();
144 for (Int_t iparC = 0; iparC < fParCList->GetEntries(); ++iparC) {
145 FairParGenericSet* tempObj = (FairParGenericSet*) (fParCList->At(iparC));
146 fParCList->Remove(tempObj);
148 std::string sParamName {tempObj->GetName()};
149 FairParGenericSet* newObj =
dynamic_cast<FairParGenericSet*
>(
150 FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
152 if (
nullptr == newObj) {
153 LOG(error) <<
"Failed to obtain parameter container " << sParamName
154 <<
", for parameter index " << iparC;
158 fParCList->AddAt(newObj, iparC);
167 LOG(info) <<
"Init parameter containers for " << GetName();
171 FairRun::Instance()->GetRuntimeDb()->getContainer(
"CbmMcbm2018RichPar"));
172 if (
nullptr == pUnpackPar) {
173 LOG(error) <<
"Failed to obtain parameter container CbmMcbm2018RichPar";
193 std::vector<std::pair<TNamed*, std::string>> vHistos =
196 std::vector<std::pair<TCanvas*, std::string>> vCanvases =
200 THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
201 if (
nullptr != server) {
202 for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
203 server->Register(Form(
"/rich/%s", vHistos[uHisto].second.data()),
204 vHistos[uHisto].first);
206 for (UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv) {
208 Form(
"/rich/%s", vCanvases[uCanv].second.data()),
209 gROOT->FindObject((vCanvases[uCanv].first)->GetName()));
213 server->RegisterCommand(
"/Reset_UnpRich_Hist",
214 "bMcbm2018UnpackerTaskRichResetHistos=kTRUE");
215 server->Restrict(
"/Reset_UnpRich_Hist",
"allow=admin");
229 LOG(info) <<
"ReInit parameter containers for " << GetName();
239 UShort_t usDetectorId) {