29 virtual ~Task() =
default;
31 virtual void Init() = 0;
32 virtual void Exec() = 0;
33 virtual void Finish() = 0;
37 void SetInConfiguration(
const Configuration* config) { config_ = config; }
38 void SetDataHeader(
const DataHeader* data_header) { data_header_ = data_header; }
40 void SetInputBranchNames(
const std::set<std::string>& br) { in_branches_ = br; }
42 ANALYSISTREE_ATTR_NODISCARD
const std::set<std::string>& GetInputBranchNames()
const {
return in_branches_; }
44 ANALYSISTREE_ATTR_NODISCARD
bool IsGoodEvent(
const EventHeader& event_header)
const {
45 return event_cuts_ ==
nullptr || event_cuts_->
Apply(event_header);
48 ANALYSISTREE_ATTR_NODISCARD
bool IsGoodEvent(
const Chain& t)
const;
50 void SetEventCuts(
Cuts* cuts) {
51 if (cuts->GetBranches().size() != 1) {
52 throw std::runtime_error(
"Event cuts on only 1 branch are allowed at the moment!");
57 void AddInputBranch(
const std::string& name) { in_branches_.emplace(name); }
63 Cuts* event_cuts_{
nullptr};
65 std::set<std::string> in_branches_{};