Skip to content

Commit 243414f

Browse files
lubynetsOleksii Lubynets
andauthored
add printing event # during task running (#108)
Co-authored-by: Oleksii Lubynets <lubynets@lxbuild07.gsi.de>
1 parent c8e232f commit 243414f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

infra/TaskManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ void TaskManager::Run(long long nEvents) {
9797
}
9898

9999
for (long long iEvent = 0; iEvent < nEvents; ++iEvent) {
100+
if(verbosity_period_ > 0 && iEvent%verbosity_period_ == 0) {
101+
std::cout << "Event no " << iEvent << "\n";
102+
}
100103
if (read_in_tree_) {
101104
chain_->GetEntry(iEvent);
102105
}

infra/TaskManager.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ class TaskManager {
164164

165165
void SetWriteMode(eBranchWriteMode mode) { write_mode_ = mode; }
166166
void SetBranchesExclude(std::vector<std::string> brex) { branches_exclude_ = std::move(brex); }
167+
void SetVerbosityPeriod(int value) { verbosity_period_ = value; }
167168

168169
void ClearTasks() { tasks_.clear(); }
169170

@@ -187,6 +188,8 @@ class TaskManager {
187188
std::string out_file_name_{"analysis_tree.root"};
188189
std::vector<std::string> branches_exclude_{};
189190

191+
int verbosity_period_{-1};
192+
190193
// configuration parameters
191194
eBranchWriteMode write_mode_{eBranchWriteMode::kCreateNewTree};
192195
bool is_init_{false};

0 commit comments

Comments
 (0)