|
DAS
3.0
Das Analysis System
|
Go to the documentation of this file.
11 #include <boost/exception/all.hpp>
29 std::chrono::time_point<std::chrono::system_clock>
start_t;
37 ,
start_t(std::chrono::system_clock::now())
42 BOOST_THROW_EXCEPTION(
43 invalid_argument(
"The number of events must be nonnegative"));
52 template<
typename TTreePtr>
54 ) :
Looper(&*t, t->GetEntries())
59 printf(
"loading first entry");
62 if (root_log.find(
"Error") != string::npos)
63 BOOST_THROW_EXCEPTION(runtime_error(
"Error while loading a TTree entry:\n" + root_log));
69 ) :
Looper(nullptr, nEvents)
76 std::cerr <<
red <<
"Warning: the event loop has stopped at entry "
93 long long test_percent = (100ll*
iEv)/
nEv;
98 auto now_t = chrono::system_clock::now();
99 auto elapsed_time {now_t -
start_t};
100 auto secs = chrono::duration_cast<chrono::seconds>(elapsed_time);
101 cout << secs.count() <<
's';
104 time_t now = chrono::system_clock::to_time_t(now_t);
105 cout <<
'\t' << put_time(localtime(&now),
"%Y-%m-%d %H:%M:%S %Z");
109 cout <<
'\t' <<
percent <<
'%' << endl;
cerr
Definition: Ntupliser_cfg.py:93
static const char * def
Definition: Step.h:36
Handling of exceptions.
Definition: darwin.h:36
static const char * red
Definition: Step.h:34
std::string intercept_printf(std::function< void()> const lambda=[]() { printf(__func__);})
Definition: exceptions.h:33