CbmRoot
Loading...
Searching...
No Matches
CbmConverterManager.h
Go to the documentation of this file.
1/* Copyright (C) 2020-2021 Physikalisches Institut, Eberhard Karls Universitaet Tuebingen, Tuebingen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Viktor Klochkov [committer] */
4
5#ifndef ANALYSIS_TREE_CONVERTERMANAGER_H_
6#define ANALYSIS_TREE_CONVERTERMANAGER_H_
7
8#include "FairTask.h"
9#include <FairRootManager.h>
10
11#include <utility>
12
13#include "AnalysisTree/TaskManager.hpp"
14
15namespace AnalysisTree
16{
17 class Configuration;
18 class DataHeader;
19} // namespace AnalysisTree
20
22class CbmEvent;
23
24class CbmConverterManager : public FairTask {
25
26public:
29
30 InitStatus Init() override;
31 void Exec(Option_t* opt) override;
32 void Finish() override;
33
34 void AddTask(CbmConverterTask* task);
35
36 void SetSystem(const std::string& system) { system_ = system; }
37 void SetBeamMomentum(float beam_mom) { beam_mom_ = beam_mom; }
38 void SetTimeSliceLength(float ts_length) { ts_length_ = ts_length; }
39
40 void SetOutputName(std::string file, std::string tree = "rTree")
41 {
42 task_manager_->SetOutputName(std::move(file), std::move(tree));
43 }
44
45 void InitEvent()
46 {
47 auto* ioman = FairRootManager::Instance();
48 events_ = (TClonesArray*) ioman->GetObject("CbmEvent");
49 }
50
51
52private:
53 void FillDataHeader();
54 void ProcessData(CbmEvent* event);
55
56 AnalysisTree::TaskManager* task_manager_ {AnalysisTree::TaskManager::GetInstance()};
57
58 std::string system_;
59 float beam_mom_ {0.};
60 float ts_length_ {0.};
61
62 std::vector<CbmConverterTask*> tasks_ {};
63
64 std::map<std::string, std::map<int, int>> index_map_ {};
65 TClonesArray* events_ {nullptr};
66
67 ClassDefOverride(CbmConverterManager, 1)
68};
69
70#endif // ANALYSIS_TREE_CONVERTERMANAGER_H_
void Exec(Option_t *opt) override
void AddTask(CbmConverterTask *task)
std::map< std::string, std::map< int, int > > index_map_
map CbmRoot to AT of indexes for a given branch
AnalysisTree::TaskManager * task_manager_
InitStatus Init() override
~CbmConverterManager() override
void SetBeamMomentum(float beam_mom)
void SetSystem(const std::string &system)
std::vector< CbmConverterTask * > tasks_
void SetOutputName(std::string file, std::string tree="rTree")
void SetTimeSliceLength(float ts_length)
CbmConverterManager()=default
void ProcessData(CbmEvent *event)
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34