CbmRoot
Loading...
Searching...
No Matches
analysis/common/analysis_tree_converter/steer/Run.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Frederic Linz [committer], Volker Friese */
4
10#ifndef CBM_ATCONVERTER_STEER_RUN_H
11#define CBM_ATCONVERTER_STEER_RUN_H 1
12
13#include "CbmDefs.h"
14#include "Config.h"
15
16#include <FairRunAna.h>
17
18#include <TNamed.h>
19#include <TString.h>
20
21#include <string>
22
23class CbmSetup;
24class FairTask;
25class FairFileSource;
26class TTree;
27
28namespace cbm::atconverter
29{
30
31 class Run : public TNamed {
32
33 public:
35 Run();
36
37
39 virtual ~Run();
40
41
43 void AddTask(FairTask* task);
44
45
47 void AllowOverwrite() { fOverwrite = true; }
48
49
51 void Exec();
52
53
55 const Config& GetConfig() const { return fConfig; }
56
57
62 bool IsDataPresent(ECbmModuleId detector) const { return (fDataPresent.count(detector) == 0 ? false : true); }
63
64
71 void LoadConfig(const char* fileName);
72
73
77 void SetConfig(const Config& config) { fConfig = config; }
78
79
83 void SetGeoSetupTag(const char* tag) { fSetupTag = tag; }
84
85
89 void SetOutput(const char* fileName) { fOutput = fileName; }
90
91
95 void SetTraFiles(const std::vector<std::string> files);
96
97
101 void SetRawFile(const char* fileName) { fRaw = fileName; }
102
103
107 void SetParFile(const char* fileName) { fPar = fileName; }
108
109
113 void SetRecoFile(const char* fileName) { fReco = fileName; }
114
115
116 private:
118 Run(const Run&) = delete;
119
120
122 Run operator=(const Run&) = delete;
123
124
129 bool CheckFile(const char* fileName);
130
131
136 void CheckRecoBranch(TTree* tree, ECbmModuleId detector);
137
138
140 void CheckInputBranches(FairFileSource* source);
141
142
144 void CreateTopology();
145
146
147 private:
148 FairRunAna fRun {};
149 TString fOutput = "";
150 std::vector<TString> fTra;
151 TString fRaw = "";
152 TString fPar = "";
153 TString fReco = "";
154 TString fSetupTag = "";
155 CbmSetup* fSetup = nullptr;
156 bool fOverwrite = false;
157
158 public:
160 std::set<ECbmModuleId> fDataPresent = {};
161
162
164 };
165
166} // namespace cbm::atconverter
167
168#endif /* CBM_ATCONVERTER_STEER_RUN_H */
ECbmModuleId
Definition CbmDefs.h:39
void CheckInputBranches(FairFileSource *source)
Check the presence of reco input branches.
void SetOutput(const char *fileName)
Set output file name.
bool CheckFile(const char *fileName)
Check existence of a file.
void SetTraFiles(const std::vector< std::string > files)
Set transport input files.
bool IsDataPresent(ECbmModuleId detector) const
Presence of input digi data.
void SetConfig(const Config &config)
Set configuration.
void SetGeoSetupTag(const char *tag)
Set geometry setup tag.
Run(const Run &)=delete
Copy constructor forbidden.
void CheckRecoBranch(TTree *tree, ECbmModuleId detector)
Check and mark presence of reco branches.
ClassDef(cbm::atconverter::Run, 1)
void SetParFile(const char *fileName)
Set parameter file name.
void CreateTopology()
Create the reconstruction task topology (chain)
void SetRecoFile(const char *fileName)
Set reconstruction file name.
const Config & GetConfig() const
Settings object.
void AddTask(FairTask *task)
Add a task to the run.
Run operator=(const Run &)=delete
Assignment operator forbidden.
void LoadConfig(const char *fileName)
Set configuration file name.
void SetRawFile(const char *fileName)
Set digitizazion (raw) file name.
void AllowOverwrite()
Allow overwriting if output file already exists.