|
DAS
3.0
Das Analysis System
|
Go to the documentation of this file.
11 #include <boost/exception/all.hpp>
20 typedef std::pair<unsigned, unsigned>
Slice;
26 Stream << slice.second <<
'/' << slice.first;
43 const std::chrono::time_point<std::chrono::system_clock>
start_t;
53 start_t(std::chrono::system_clock::now())
58 BOOST_THROW_EXCEPTION(invalid_argument(
"The number of slices " + to_string(
slice.first)
59 +
" must be larger than the index of the current slice " + to_string(
slice.second)));
62 BOOST_THROW_EXCEPTION(invalid_argument(
"The number of events cannot be " + to_string(
nEvSlice)));
73 template<
typename TTreePtr>
74 [[deprecated(
"Pass the slice to GetChain instead")]]
77 ) :
Looper(&*t, t->GetEntries(), s)
83 if (root_log.find(
"Error") != string::npos)
84 BOOST_THROW_EXCEPTION(runtime_error(
"Error while loading a TTree entry:\n" + root_log));
89 template<
typename TTreePtr>
91 ) :
Looper(&*t, t->GetEntries(), {1, 0})
97 if (root_log.find(
"Error") != string::npos)
98 BOOST_THROW_EXCEPTION(runtime_error(
"Error while loading a TTree entry:\n" + root_log));
105 ) :
Looper(
nullptr, nEvents, s)
112 std::cerr <<
red <<
"Warning: the event loop has stopped at entry "
136 auto now_t = chrono::system_clock::now();
137 auto elapsed_time {now_t -
start_t};
138 auto secs = chrono::duration_cast<chrono::seconds>(elapsed_time);
139 cout <<
'\t' << secs.count() <<
's';
142 time_t now = chrono::system_clock::to_time_t(now_t);
143 cout <<
'\t' << put_time(localtime(&now),
"%Y-%m-%d %H:%M:%S %Z");
147 cout <<
'\t' <<
percent <<
'%' << endl;
163 using Darwin::Tools::operator<<;
cerr
Definition: Ntupliser_cfg.py:93
static const char * def
Definition: Step.h:36
Handling of exceptions.
Definition: darwin.h:35
static const char * red
Definition: Step.h:34
std::string intercept_printf(std::function< void()> const lambda=[]() { printf(__func__);})
Definition: exceptions.h:25