diff --git a/analysis/base/EventAna.h b/analysis/base/EventAna.h index 4c6b538..4d38bd9 100644 --- a/analysis/base/EventAna.h +++ b/analysis/base/EventAna.h @@ -234,7 +234,7 @@ namespace Hal { /** * basic constructor */ - EventAna() : EventAna(ECutUpdate::kEvent) {}; + EventAna() : EventAna(ECutUpdate::kEvent) { SetFormatOption(EFormatOption::kReaderAccess); }; /** * copy constructor * @param ana diff --git a/data/io/AnalysisManager.cxx b/data/io/AnalysisManager.cxx index 4555ef5..f2ad0a0 100644 --- a/data/io/AnalysisManager.cxx +++ b/data/io/AnalysisManager.cxx @@ -16,6 +16,7 @@ #include "Cout.h" #include "Package.h" #include "Parameter.h" +#include "Reader.h" #include "Source.h" #include "Std.h" #include "Task.h" @@ -179,6 +180,19 @@ namespace Hal { fManager->CloseManager(); } + void AnalysisManager::AddTask(Task* ana) { + if (auto trig = dynamic_cast(ana)) { + fTriggers.push_back(trig); + } else if (auto reader = dynamic_cast(ana)) { + if (fTasks.size() != 0) + Hal::Cout::PrintInfo("You are adding reader as not a first task, this might lead to undefined behaviour", + EInfo::kWarning); + fTasks.push_back(ana); + } else { + fTasks.push_back(ana); + } + } + AnalysisManager::~AnalysisManager() { delete fSource; delete fManager; @@ -191,10 +205,6 @@ namespace Hal { if (fField) delete fField; } - void AnalysisManager::AddReader(Reader* /*reader*/) {} - - void AnalysisManager::AddTrigger(TriggerTask* /*trigger*/) {} - void AnalysisManager::DoStep(Int_t entry) { if (fTriggersEnabled) { fManager->GetEntry(entry, 0); diff --git a/data/io/AnalysisManager.h b/data/io/AnalysisManager.h index 895611f..ad2fdb4 100644 --- a/data/io/AnalysisManager.h +++ b/data/io/AnalysisManager.h @@ -47,21 +47,11 @@ namespace Hal { * enables progress bar */ void EnableProgressBar() { fProgressBar = kTRUE; } - /** - * add reader task - it's guaranteed that reader will be set as a first task after the triggers - * @param reader - */ - void AddReader(Reader* reader); - /** - * add trigger task, it's guaranteed that will be set before other tasks - * @param trigger - */ - void AddTrigger(TriggerTask* trigger); /** * add task to analysis * @param ana */ - void AddTask(Task* ana) { fTasks.push_back(ana); }; + void AddTask(Task* ana); /** * initalize run */