CbmRoot
Loading...
Searching...
No Matches
CbmConverterTask.h
Go to the documentation of this file.
1/* Copyright (C) 2020-2021 Physikalisches Institut, Eberhard Karls Universität Tuebingen, Tuebingen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Viktor Klochkov [committer] */
4
5#ifndef ANALYSIS_TREE_CONVERTERTASK_H_
6#define ANALYSIS_TREE_CONVERTERTASK_H_
7
8#include <CbmLink.h>
9
10#include <map>
11#include <string>
12
13#include "AnalysisTree/Task.hpp"
14
15class FairRootManager;
16class CbmEvent;
17
18class CbmConverterTask : public AnalysisTree::Task {
19 using MapType = std::map<int, int>;
20
21public:
22 CbmConverterTask() = default;
23 explicit CbmConverterTask(std::string out_branch_name, std::string match_to = "")
24 {
25 out_branch_ = std::move(out_branch_name);
26 match_to_ = std::move(match_to);
27 };
28
29 ~CbmConverterTask() override = default;
30
31 virtual void ProcessData(CbmEvent* event) = 0;
32
33 void Exec() final { throw std::runtime_error("Should not be used!"); };
34
35 const MapType& GetOutIndexesMap() const { return out_indexes_map_; }
36
37 void SetIndexesMap(std::map<std::string, MapType>* indexes_map) { indexes_map_ = indexes_map; }
38
39 const std::string& GetOutputBranchName() const { return out_branch_; }
40
41
42protected:
44 std::string out_branch_ {};
45 std::map<std::string, MapType>* indexes_map_ {};
47 std::string match_to_ {};
48};
49
50#endif // ANALYSIS_TREE_CONVERTERTASK_H_
MapType out_indexes_map_
CbmRoot to AnalysisTree indexes map for output branch.
void SetIndexesMap(std::map< std::string, MapType > *indexes_map)
std::map< int, int > MapType
const MapType & GetOutIndexesMap() const
std::string match_to_
AT branch to match.
virtual void ProcessData(CbmEvent *event)=0
~CbmConverterTask() override=default
std::string out_branch_
const std::string & GetOutputBranchName() const
std::map< std::string, MapType > * indexes_map_
from other tasks
CbmConverterTask()=default
CbmConverterTask(std::string out_branch_name, std::string match_to="")
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34