Commit 5f6de5b8 authored by Pierre-Alain Loizeau's avatar Pierre-Alain Loizeau Committed by Pierre-Alain Loizeau
Browse files

[mCBM 2020] Add support for processing of TS ranges based on spills

- Add task finding the spill borders with the T0 + macros
- In CbmMcbm2018Source, add support for selecting TS ranges for a chosen Spill range with 3 spill borders options
- Fix TS metadata calculation against corrupted MS 0 and move it to make sure it is generated even when TS range selected
parent 97862b6e
...@@ -130,6 +130,9 @@ Set(SRCS ...@@ -130,6 +130,9 @@ Set(SRCS
tasks/CbmMcbmCheckTimingAlgo.cxx tasks/CbmMcbmCheckTimingAlgo.cxx
tasks/CbmMcbmCheckTimingTask.cxx tasks/CbmMcbmCheckTimingTask.cxx
tasks/CbmMcbmSpillFindAlgo.cxx
tasks/CbmMcbmSpillFindTask.cxx
) )
If(_UINT8_T_EXIST) If(_UINT8_T_EXIST)
......
...@@ -77,4 +77,7 @@ ...@@ -77,4 +77,7 @@
#pragma link C++ class CbmMcbmCheckTimingAlgo + ; #pragma link C++ class CbmMcbmCheckTimingAlgo + ;
#pragma link C++ class CbmMcbmCheckTimingTask + ; #pragma link C++ class CbmMcbmCheckTimingTask + ;
#pragma link C++ class CbmMcbmSpillFindAlgo + ;
#pragma link C++ class CbmMcbmSpillFindTask + ;
#endif #endif
...@@ -117,6 +117,76 @@ Bool_t CbmMcbm2018Source::Init() { ...@@ -117,6 +117,76 @@ Bool_t CbmMcbm2018Source::Init() {
fTimeSliceMetaDataArray, fTimeSliceMetaDataArray,
fbWriteOutput); fbWriteOutput);
/// Single spill unpacking
if (0 <= fiUnpSpillIdxStart)
{
switch( fuFlagSpillStart )
{
case 0:
{
/// 0 = Break begin
if( fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop )
{
LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakBegTs.size() - 1;
if( fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1 )
{
fiUnpSpillIdxStop = fvuSpillBreakBegTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakBegTs.size() - 1 )
else LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakBegTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakBegTs[ fiUnpSpillIdxStart ]; //!
fuSpillEndTs = fvuSpillBreakBegTs[ fiUnpSpillIdxStop + 1 ]; //!
break;
}
case 1:
{
/// 1 = Break middle
if( fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop )
{
LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakMidTs.size() - 1;
if( fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1 )
{
fiUnpSpillIdxStop = fvuSpillBreakMidTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakMidTs.size() - 1 )
else LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakMidTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakMidTs[ fiUnpSpillIdxStart ]; //!
fuSpillEndTs = fvuSpillBreakMidTs[ fiUnpSpillIdxStop + 1 ]; //!
break;
}
case 2:
{
/// 2 = Break end
if( fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop )
{
LOG(warning) << "Chosen last spill index larger than spills contained in chosen spill start vector: "
<< fiUnpSpillIdxStop << " VS " << fvuSpillBreakEndTs.size() - 1;
if( fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1 )
{
fiUnpSpillIdxStop = fvuSpillBreakEndTs.size() - 2;
LOG(warning) << "Using last possible spill instead as final one";
} // if( fiUnpSpillIdxStart < fvuSpillBreakEndTs.size() - 1 )
else LOG(fatal) << "Start index also too large, exiting";
} // if( fvuSpillBreakEndTs.size() - 1 <= fiUnpSpillIdxStop )
fuSpillBegTs = fvuSpillBreakEndTs[ fiUnpSpillIdxStart ]; //!
fuSpillEndTs = fvuSpillBreakEndTs[ fiUnpSpillIdxStop + 1 ]; //!
break;
}
default:
{
LOG(fatal) << "Unknown spill start point option: " << fuFlagSpillStart;
break;
}
} // switch( fuFlagSpillStart )
} // if (0 <= fiUnpSpillIdxStart)
return kTRUE; return kTRUE;
} }
...@@ -248,26 +318,22 @@ Int_t CbmMcbm2018Source::FillBuffer() { ...@@ -248,26 +318,22 @@ Int_t CbmMcbm2018Source::FillBuffer() {
} // for( auto it = it_list.first; it != it_list.second; ++it ) } // for( auto it = it_list.first; it != it_list.second; ++it )
} // else of if( it == fUnpackers.end() ) } // else of if( it == fUnpackers.end() )
} // for (size_t c {0}; c < ts.num_components(); c++) } // for (size_t c {0}; c < ts.num_components(); c++)
} // if( 1 == fTSCounter )
/// Apply TS throttling as set by user (default = 1 => no throttling) /// Compute and store the timeslice and microslices properties
if (0 == tsIndex % fuTsReduction) {
for (auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end();
++itUnp) {
(*itUnp)->DoUnpack(ts, 0);
} // for( auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end(); ++ itUnp )
} // if( 0 == tsIndex % fuTsReduction )
/// Save the TimeSlice meta-data for access by higher level tasks
if (fTSCounter == 1) {
auto nMsInTs = ts.num_core_microslices(); auto nMsInTs = ts.num_core_microslices();
if (nMsInTs > 1) { if (nMsInTs > 2) {
// This assumes that we have a component 0 and component independent ms/ts settings! // This assumes that we have a component 0 and component independent ms/ts settings!
auto msDescA = ts.descriptor(0, 0); auto msDescA = ts.descriptor(0, 1);
auto msDescB = ts.descriptor(0, 1); auto msDescB = ts.descriptor(0, 2);
auto msLength = msDescB.idx - msDescA.idx; auto msLength = msDescB.idx - msDescA.idx;
fTSLength = msLength * nMsInTs; fTSLength = msLength * nMsInTs;
fTSOverlappLength = msLength * (ts.num_microslices(0) - nMsInTs); fTSOverlappLength = msLength * (ts.num_microslices(0) - nMsInTs);
LOG(info)
<< "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculated "
<< "TimesliceMetaData information from microslices Metadata -> "
<< "MS length found to be " << msLength << " ns, TS length "
<< fTSLength << " ns, and TS overlap length "
<< fTSOverlappLength << " ns";
} else { } else {
LOG(warning) LOG(warning)
<< "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculate " << "CbmMcbm2018Source::FillBuffer() - TS 1 - Calculate "
...@@ -275,7 +341,32 @@ Int_t CbmMcbm2018Source::FillBuffer() { ...@@ -275,7 +341,32 @@ Int_t CbmMcbm2018Source::FillBuffer() {
"TS duration can not be calculated with the given method. Hence, " "TS duration can not be calculated with the given method. Hence, "
"TimesliceMetaData duration values are filled with 0"; "TimesliceMetaData duration values are filled with 0";
} }
} } // if( 1 == fTSCounter )
if (0 <= fiUnpSpillIdxStart )
{
if (tsIndex < fuSpillBegTs)
{
/// Jump all TS until reaching the first TS in the spill we want to unpack
continue;
} // if (tsIndex < fuSpillBegTs)
else if(fuSpillEndTs <= tsIndex)
{
/// Stop when reaching the first TS in the next spill
return 1;
} // else if
} // if (0 <= fiUnpSpillIdxStart)
/// Apply TS throttling as set by user (default = 1 => no throttling)
if (0 == tsIndex % fuTsReduction) {
for (auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end();
++itUnp) {
(*itUnp)->DoUnpack(ts, 0);
} // for( auto itUnp = fUnpackersToRun.begin(); itUnp != fUnpackersToRun.end(); ++ itUnp )
} // if( 0 == tsIndex % fuTsReduction )
/// Save the TimeSlice meta-data for access by higher level tasks
new ((*fTimeSliceMetaDataArray)[fTimeSliceMetaDataArray->GetEntriesFast()]) new ((*fTimeSliceMetaDataArray)[fTimeSliceMetaDataArray->GetEntriesFast()])
TimesliceMetaData( TimesliceMetaData(
ts.descriptor(0, 0).idx, fTSLength, fTSOverlappLength, tsIndex); ts.descriptor(0, 0).idx, fTSLength, fTSOverlappLength, tsIndex);
......
...@@ -77,6 +77,28 @@ public: ...@@ -77,6 +77,28 @@ public:
fuTsReduction = uTsReduction; fuTsReduction = uTsReduction;
} }
void UnpackSingleSpill( Int_t uSpillIdx, UInt_t uSpillStart = 1 ) {
fiUnpSpillIdxStart = uSpillIdx;
fiUnpSpillIdxStop = uSpillIdx;
fuFlagSpillStart = uSpillStart;
}
void UnpackSelectSpills( Int_t uSpillIdxStart, Int_t uSpillIdxStop, UInt_t uSpillStart = 1 ) {
fiUnpSpillIdxStart = uSpillIdxStart;
fiUnpSpillIdxStop = uSpillIdxStop;
fuFlagSpillStart = uSpillStart;
}
void LoadTsListSpillBreakBegin( std::vector< ULong64_t > vTsBeg ) {
fvuSpillBreakBegTs.assign( vTsBeg.begin(), vTsBeg.end() );
}
void LoadTsListSpillBreakEnd( std::vector< ULong64_t > vTsEnd ) {
fvuSpillBreakEndTs.assign( vTsEnd.begin(), vTsEnd.end() );
}
void LoadTsListSpillBreakMiddle( std::vector< ULong64_t > vTsMid ) {
fvuSpillBreakMidTs.assign( vTsMid.begin(), vTsMid.end() );
}
void SetSubscriberHwm(UInt_t val = 1) { fuSubscriberHwm = val; } void SetSubscriberHwm(UInt_t val = 1) { fuSubscriberHwm = val; }
void SetWriteOutputFlag(Bool_t bFlagIn) { fbWriteOutput = bFlagIn; } void SetWriteOutputFlag(Bool_t bFlagIn) { fbWriteOutput = bFlagIn; }
...@@ -105,6 +127,16 @@ private: ...@@ -105,6 +127,16 @@ private:
UInt_t fuTsReduction; UInt_t fuTsReduction;
Int_t fiUnpSpillIdxStart = -1; //! >= 0 means unpack only from this spill
Int_t fiUnpSpillIdxStop = -1; //! >= 0 means unpack only up to this spill (included)
UInt_t fuFlagSpillStart = 0; //! 0 = Break begin, 1 = Break middle, 2 = Break end
UInt_t fuSpillBegTs = 0; //!
UInt_t fuSpillEndTs = 0; //!
std::vector< ULong64_t > fvuSpillBreakBegTs = {}; //!
std::vector< ULong64_t > fvuSpillBreakEndTs = {}; //!
std::vector< ULong64_t > fvuSpillBreakMidTs = {}; //!
std::unique_ptr<fles::TimesliceSource> fSource; //! std::unique_ptr<fles::TimesliceSource> fSource; //!
UInt_t fuSubscriberHwm; UInt_t fuSubscriberHwm;
......
This diff is collapsed.
// -----------------------------------------------------------------------------
// ----- -----
// ----- CbmMcbmSpillFindAlgo -----
// ----- Created 10.02.2019 by P.-A. Loizeau -----
// ----- -----
// -----------------------------------------------------------------------------
#ifndef CbmMcbmSpillFindAlgo_H
#define CbmMcbmSpillFindAlgo_H
#include "CbmStar2019Algo.h"
// Data
#include "CbmTofDigi.h"
#include "gDpbMessv100.h"
// CbmRoot
// C++11
#include <chrono>
// C/C++
#include <map>
#include <vector>
class CbmMcbm2018TofPar;
/*
class TCanvas;
class THttpServer;
*/
class TH1;
class TH2;
class TProfile;
class CbmMcbmSpillFindAlgo : public CbmStar2019Algo<CbmTofDigi> {
public:
CbmMcbmSpillFindAlgo();
~CbmMcbmSpillFindAlgo();
virtual Bool_t Init();
virtual void Reset();
virtual void Finish();
Bool_t InitContainers();
Bool_t ReInitContainers();
TList* GetParList();
Bool_t InitParameters();
Bool_t ProcessTs(const fles::Timeslice& ts);
Bool_t ProcessTs(const fles::Timeslice& ts, size_t /*component*/) { return ProcessTs(ts); }
Bool_t ProcessMs(const fles::Timeslice& ts, size_t uMsCompIdx, size_t uMsIdx);
void AddMsComponentToList(size_t component, UShort_t usDetectorId);
Bool_t CreateHistograms();
Bool_t FillHistograms();
Bool_t ResetHistograms(Bool_t bResetTime = kTRUE);
inline void SetMonitorMode(Bool_t bFlagIn = kTRUE) { fbMonitorMode = bFlagIn; }
inline void SetHistoryHistoSize(UInt_t inHistorySizeSec = 1800) { fuHistoryHistoSize = inHistorySizeSec; }
inline void SetPulserTotLimits(UInt_t uMin, UInt_t uMax)
{
fuMinTotPulser = uMin;
fuMaxTotPulser = uMax;
}
inline void SetSpillThreshold(UInt_t uCntLimit) { fuOffSpillCountLimit = uCntLimit; }
inline void SetSpillCheckIntervalSec(Double_t dInterval) { fdSpillCheckInterval = dInterval; }
private:
/// Control flags
Bool_t fbMonitorMode = kFALSE; //! Switch ON the filling of a minimal set of histograms
Bool_t fbDebugMonitorMode = kFALSE; //! Switch ON the filling of a additional set of histograms
std::vector<Bool_t> fvbMaskedComponents = {};
/// Settings from parameter file
CbmMcbm2018TofPar* fUnpackPar = nullptr; //!
/// Readout chain dimensions and mapping
UInt_t fuNrOfGdpbs = 0; //! Total number of GDPBs in the system
std::map<UInt_t, UInt_t> fGdpbIdIndexMap = {}; //! gDPB ID to index map
UInt_t fuNrOfFeePerGdpb = 0; //! Number of FEBs per GDPB
UInt_t fuNrOfGet4PerFee = 0; //! Number of GET4s per FEE
UInt_t fuNrOfChannelsPerGet4 = 0; //! Number of channels in each GET4
UInt_t fuNrOfChannelsPerFee = 0; //! Number of channels in each FEE
UInt_t fuNrOfGet4 = 0; //! Total number of Get4 chips in the system
UInt_t fuNrOfGet4PerGdpb = 0; //! Number of GET4s per GDPB
UInt_t fuNrOfChannelsPerGdpb = 0; //! Number of channels per GDPB
/// User settings: Data correction parameters
UInt_t fuMinTotPulser = 90;
UInt_t fuMaxTotPulser = 100;
UInt_t fuOffSpillCountLimit = 100;
Double_t fdSpillCheckInterval = 0.5;
/// Constants
static const Int_t kiMaxNbFlibLinks = 32;
static const UInt_t kuBytesPerMessage = 8;
static const UInt_t kuNbChanDiamond = 8;
/// Running indices
/// TS/MS info
ULong64_t fulFirstTsIdx = 9999999999999; //! First TS index, forward point set ~30 years...
ULong64_t fulCurrentTsIdx = 0;
ULong64_t fulCurrentMsIdx = 0;
Double_t fdTsStartTime = -1.0; //! Time in ns of current TS from the index of the first MS first component
Double_t fdTsStopTimeCore =
-1.0; //! End Time in ns of current TS Core from the index of the first MS first component
Double_t fdMsTime = -1.0; //! Start Time in ns of current MS from its index field in header
UInt_t fuMsIndex = 0; //! Index of current MS within the TS
/// Current data properties
std::map<gdpbv100::MessageTypes, UInt_t> fmMsgCounter = {};
UInt_t fuCurrentEquipmentId = 0; //! Current equipment ID, tells from which DPB the current MS is originating
UInt_t fuCurrDpbId = 0; //! Temp holder until Current equipment ID is properly filled in MS
UInt_t fuCurrDpbIdx = 0; //! Index of the DPB from which the MS currently unpacked is coming
Int_t fiRunStartDateTimeSec = -1; //! Start of run time since "epoch" in s, for the plots with date as X axis
Int_t fiBinSizeDatePlots = -1; //! Bin size in s for the plots with date as X axis
UInt_t fuGet4Id = 0; //! running number (0 to fuNrOfGet4PerGdpb) of the Get4 chip of a unique GDPB for current message
UInt_t fuGet4Nr = 0; //! running number (0 to fuNrOfGet4) of the Get4 chip in the system for current message
/// Starting state book-keeping
Double_t fdStartTime = -1.0; //! Time of first valid hit (epoch available), used as reference for evolution plots
Double_t fdStartTimeMsSz = 0.0; //! Time of first microslice, used as reference for evolution plots
std::chrono::steady_clock::time_point ftStartTimeUnix = std::chrono::steady_clock::
now(); //! Time of run Start from UNIX system, used as reference for long evolution plots against reception time
/// Spill detection
Bool_t fbSpillOn = kTRUE;
UInt_t fuCurrentSpillIdx = 0;
Double_t fdStartTimeSpill = -1.0;
Double_t fdLastSecondTime = -1.0;
UInt_t fuCountsLastInterval = 0;
UInt_t fuCountsLastSpill = 0;
std::vector< ULong64_t > fvuSpillBreakBegTs = {};
std::vector< ULong64_t > fvuSpillBreakEndTs = {};
std::vector< ULong64_t > fvuSpillBreakMidTs = {};
/// Histograms related variables
UInt_t fuHistoryHistoSize = 3600; /** Size in seconds of the evolution histograms **/
/// Histograms
TH1* fhHitsEvo = nullptr;
TH1* fhHitsPerSpill = nullptr;
TH1* fhSpillBreakDuration = nullptr;
TH1* fhSpillDuration = nullptr;
/// Canvases
/*
TCanvas* fcSummary = nullptr;
TCanvas* fcHitMaps = nullptr;
TCanvas* fcGenCntsPerMs = nullptr;
TCanvas* fcSpillCounts = nullptr;
TCanvas* fcSpillCountsHori = nullptr;
TCanvas* fcSpillDpbCountsHori = nullptr;
*/
CbmMcbmSpillFindAlgo(const CbmMcbmSpillFindAlgo&);
CbmMcbmSpillFindAlgo operator=(const CbmMcbmSpillFindAlgo&);
ClassDef(CbmMcbmSpillFindAlgo, 1)
};
#endif
// -----------------------------------------------------------------------------
// ----- -----
// ----- CbmMcbmSpillFindTask -----
// ----- Created 10.02.2019 by P.-A. Loizeau -----
// ----- -----
// -----------------------------------------------------------------------------
#include "CbmMcbmSpillFindTask.h"
#include "CbmMcbm2018TofPar.h"
#include "CbmMcbmSpillFindAlgo.h"
#include "FairLogger.h"
#include "FairParGenericSet.h"
#include "FairRootManager.h"
#include "FairRun.h"
#include "FairRunOnline.h"
#include "FairRuntimeDb.h"
#include "TCanvas.h"
#include "THttpServer.h"
#include "TList.h"
#include "TROOT.h"
#include "TString.h"
#include <TFile.h>
#include <chrono>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <stdint.h>
Bool_t bMcbmSpillFindResetHistos = kFALSE;
CbmMcbmSpillFindTask::CbmMcbmSpillFindTask()
: CbmMcbmUnpack()
, fbMonitorMode(kTRUE)
, fbDebugMonitorMode(kFALSE)
, fuHistoryHistoSize(3600)
, fsHistoFileName("data/HistosMonitorT0.root")
, fuMinTotPulser(90)
, fuMaxTotPulser(100)
, fuOffSpillCountLimit(200)
, fulTsCounter(0)
, fMonitorAlgo(nullptr)
{
fMonitorAlgo = new CbmMcbmSpillFindAlgo();
}
CbmMcbmSpillFindTask::~CbmMcbmSpillFindTask() { delete fMonitorAlgo; }
Bool_t CbmMcbmSpillFindTask::Init()
{
LOG(info) << "CbmMcbmSpillFindTask::Init";
LOG(info) << "Initializing mCBM T0 2019 Monitor";
return kTRUE;
}
void CbmMcbmSpillFindTask::SetParContainers()
{
LOG(info) << "Setting parameter containers for " << GetName();
TList* parCList = fMonitorAlgo->GetParList();
for (Int_t iparC = 0; iparC < parCList->GetEntries(); ++iparC) {
FairParGenericSet* tempObj = (FairParGenericSet*) (parCList->At(iparC));
parCList->Remove(tempObj);
std::string sParamName {tempObj->GetName()};
FairParGenericSet* newObj =
dynamic_cast<FairParGenericSet*>(FairRun::Instance()->GetRuntimeDb()->getContainer(sParamName.data()));
if (nullptr == newObj) {
LOG(error) << "Failed to obtain parameter container " << sParamName << ", for parameter index " << iparC;
return;
} // if( nullptr == newObj )
parCList->AddAt(newObj, iparC);
// delete tempObj;
} // for( Int_t iparC = 0; iparC < parCList->GetEntries(); ++iparC )
}
Bool_t CbmMcbmSpillFindTask::InitContainers()
{
LOG(info) << "Init parameter containers for " << GetName();
/// Control flags
CbmMcbm2018TofPar* pUnpackPar =
dynamic_cast<CbmMcbm2018TofPar*>(FairRun::Instance()->GetRuntimeDb()->getContainer("CbmMcbm2018TofPar"));
if (nullptr == pUnpackPar) {
LOG(error) << "Failed to obtain parameter container CbmMcbm2018TofPar";
return kFALSE;
} // if( nullptr == pUnpackPar )
Bool_t initOK = fMonitorAlgo->InitContainers();
/// Transfer parameter values set from calling macro
fMonitorAlgo->SetMonitorMode(fbMonitorMode);
fMonitorAlgo->SetHistoryHistoSize(fuHistoryHistoSize);
fMonitorAlgo->SetPulserTotLimits(fuMinTotPulser, fuMaxTotPulser);
fMonitorAlgo->SetSpillThreshold(fuOffSpillCountLimit);
fMonitorAlgo->SetSpillCheckIntervalSec(fdSpillCheckInterval);
/// Histos creation, obtain pointer on them and add them to the HTTP server
/// Trigger histo creation on all associated algos
initOK &= fMonitorAlgo->CreateHistograms();
/// Obtain vector of pointers on each histo from the algo (+ optionally desired folder)
std::vector<std::pair<TNamed*, std::string>> vHistos = fMonitorAlgo->GetHistoVector();
/// Obtain vector of pointers on each canvas from the algo (+ optionally desired folder)
std::vector<std::pair<TCanvas*, std::string>> vCanvases = fMonitorAlgo->GetCanvasVector();
/// Register the histos in the HTTP server
THttpServer* server = FairRunOnline::Instance()->GetHttpServer();
if (nullptr != server) {
for (UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto) {
// LOG(info) << "Registering " << vHistos[ uHisto ].first->GetName()
// << " in " << vHistos[ uHisto ].second.data();
server->Register(Form("/%s", vHistos[uHisto].second.data()), vHistos[uHisto].first);
} // for( UInt_t uHisto = 0; uHisto < vHistos.size(); ++uHisto )
for (UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv) {
// LOG(info) << "Registering " << vCanvases[ uCanv ].first->GetName()
// << " in " << vCanvases[ uCanv ].second.data();
server->Register(Form("/%s", vCanvases[uCanv].second.data()),
gROOT->FindObject((vCanvases[uCanv].first)->GetName()));
} // for( UInt_t uCanv = 0; uCanv < vCanvases.size(); ++uCanv )
server->RegisterCommand("/Reset_MoniT0_Hist", "bMcbmSpillFindResetHistos=kTRUE");
server->Restrict("/Reset_MoniT0_Hist", "allow=admin");
} // if( nullptr != server )
return initOK;
}
Bool_t CbmMcbmSpillFindTask::ReInitContainers()
{
LOG(info) << "ReInit parameter containers for " << GetName();
Bool_t initOK = fMonitorAlgo->ReInitContainers();
return initOK;
}
void CbmMcbmSpillFindTask::AddMsComponentToList(size_t component, UShort_t usDetectorId)
{
fMonitorAlgo->AddMsComponentToList(component, usDetectorId);
}
Bool_t CbmMcbmSpillFindTask::DoUnpack(const fles::Timeslice& ts, size_t /*component*/)
{
if (fbMonitorMode && bMcbmSpillFindResetHistos) {
LOG(info) << "Reset T0 Monitor histos ";
fMonitorAlgo->ResetHistograms();
bMcbmSpillFindResetHistos = kFALSE;
} // if( fbMonitorMode && bMcbmSpillFindResetHistos )
if (kFALSE == fMonitorAlgo->ProcessTs(ts)) {
LOG(error) << "Failed processing TS " << ts.index() << " in unpacker algorithm class";
return kTRUE;
} // if( kFALSE == fMonitorAlgo->ProcessTs( ts ) )
/// Cleqr the digis vector in case it was filled
std::vector<CbmTofDigi> vDigi = fMonitorAlgo->GetVector();
fMonitorAlgo->ClearVector();
if (0 == fulTsCounter % 1000) LOG(info) << "Processed " << fulTsCounter << "TS";
fulTsCounter++;
return kTRUE;
}
void CbmMcbmSpillFindTask::Reset() {}
void CbmMcbmSpillFindTask::Finish()
{
fMonitorAlgo->Finish();
/// Obtain vector of pointers on each histo from the algo (+ optionally desired folder)
std::vector<std::pair<TNamed*, std::string>> vHistos = fMonitorAlgo->GetHistoVector();
/// Save old global file and folder pointer to avoid messing with FairRoot
TFile* oldFile = gFile;
TDirectory* oldDir = gDirectory;
TFile* histoFile = nullptr;
// open separate histo file in recreate mode