CbmRoot
Loading...
Searching...
No Matches
reco/offline/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: Volker Friese [committer] */
4
10#ifndef CBM_RECO_OFFLINE_STEER_RUN_H
11#define CBM_RECO_OFFLINE_STEER_RUN_H 1
12
13#include "CbmDefs.h"
14#include "Config.h"
15
16#include <FairRunAna.h>
17
18#include <TNamed.h>
19
20#include <string>
21
22class TGeoManager;
23class CbmSetup;
24class FairTask;
25class FairFileSource;
26class TTree;
27
28namespace cbm::reco::offline
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 SetRawFile(const char* fileName) { fRaw = fileName; }
90
91
95 void SetNumTs(int32_t num) { fNumTs = num; }
96
97
101 void SetOutput(const char* fileName) { fOutput = fileName; }
102
103
107 void SetParFile(const char* fileName) { fPar = fileName; }
108
109
110 private:
112 Run(const Run&) = delete;
113
114
116 Run operator=(const Run&) = delete;
117
118
123 void CheckDigiBranch(TTree* tree, ECbmModuleId detector);
124
125
130 bool CheckFile(const char* fileName);
131
132
134 void CheckInputBranches(FairFileSource* source);
135
136
138 void CreateTopology();
139
140
141 private:
142 FairRunAna fRun{};
143 TString fOutput = "";
144 TString fRaw = "";
145 TString fPar = "";
146 TString fSetupTag = "";
147 CbmSetup* fSetup = nullptr;
148 size_t fNumTs = 0;
149 bool fOverwrite = false;
150
152 std::set<ECbmModuleId> fDataPresent = {};
153
154
156 };
157
158} // namespace cbm::reco::offline
159
160#endif /* CBM_RECO_OFFLINE_STEER_RUN_H */
ECbmModuleId
Definition CbmDefs.h:39
void SetConfig(const Config &config)
Set configuration.
void SetGeoSetupTag(const char *tag)
Set geometry setup tag.
void LoadConfig(const char *fileName)
Set configuration file name.
bool CheckFile(const char *fileName)
Check existence of a file.
ClassDef(cbm::reco::offline::Run, 1)
void AddTask(FairTask *task)
Add a task to the run.
std::set< ECbmModuleId > fDataPresent
bool IsDataPresent(ECbmModuleId detector) const
Presence of input digi data.
void AllowOverwrite()
Allow overwriting if output file already exists.
const Config & GetConfig() const
Settings object.
void CheckDigiBranch(TTree *tree, ECbmModuleId detector)
Check and mark presence of a digi branch.
void CheckInputBranches(FairFileSource *source)
Check the presence of digi input branches.
void SetRawFile(const char *fileName)
Set digitization (raw) file name.
void SetParFile(const char *fileName)
Set parameter file name.
void SetNumTs(int32_t num)
Set number of timeslices to process.
void Exec()
Run reconstruction.
Run(const Run &)=delete
Copy constructor forbidden.
void CreateTopology()
Create the reconstruction task topology (chain)
Run operator=(const Run &)=delete
Assignment operator forbidden.
void SetOutput(const char *fileName)
Set output file name.