37 int main(
int argc,
char **argv)
45 JLimit_t& numberOfEvents = inputFile.getLimit();
47 double Tmax_s = 300.0;
58 JParser<> zap(
"Example program to process DAQ and acoustic events.");
63 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
69 catch(
const exception &error) {
70 FATAL(error.what() << endl);
74 TH1D h1(
"h1", NULL, 101, -0.5, +100.5);
75 TH1D hn(
"hn", NULL, 101, -0.5, +100.5);
76 TH1D ht(
"ht", NULL, 100, -1.0e3, +1.0e3);
85 for (JTreeScanner_t::iterator p = in.begin(), q; p != in.end(); p = q) {
87 STATUS(
"event " <<
FIXED(20,6) << p->begin()->getToE() <<
'\r');
DEBUG(endl);
89 for (q = p; ++q != in.end() && q->begin()->getToE() <= p->rbegin()->getToE() + Tmax_s; ) {}
98 for (JTreeScanner_t::iterator i = p; i != q; ++i) {
99 if (i->rbegin()->getToE() - p->begin()->getToE() > range) {
100 range = i->rbegin()->getToE() - p->begin()->getToE();
104 data[p->begin()->getToE()] = range;
119 double t1 = (p !=
data.end() ? p->first : 0.0);
121 if (p !=
data.begin()) {
125 if (fabs(t1 - t0) > fabs(p->first - t0)) { t1 = p->first; }
126 if (fabs(t1 - t0) > fabs(p->first + p->second - t0)) { t1 = p->first + p->second; }
136 out << h1 << hn << ht;
int main(int argc, char **argv)
ROOT TTree parameter settings.
General purpose messaging.
#define DEBUG(A)
Message macros.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
Utility class to parse parameter values.
#define gmake_property(A)
macros to convert (template) parameter to JPropertiesElement object
ROOT TTree parameter settings of various packages.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Utility class to parse parameter values.
Utility class to parse command line options.
General purpose class for object reading from a list of file names.
virtual bool hasNext() override
Check availability of next element.
virtual const pointer_type & next() override
Get next element.
Base class for JTreeScanner.
Template definition for direct access of elements in ROOT TChain.
double getUNIXTime(const KM3NETDAQ::JDAQChronometer &chronometer)
Get UNIX time of given DAQ object.
size_t getNumberOfEmitters(T __begin, T __end)
Get number of emitters.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Auxiliary data structure for floating point format specification.
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Auxiliary class for defining the range of iterations of objects.