34 if (fabs(first.
getToA() - second.
getToA()) <= waveform_s)
54 int main(
int argc,
char **argv)
66 JParser<> zap(
"Example program to monitor acoustic events.");
68 zap[
'f'] =
make_field(inputFile,
"output of JAcousticEventBuilder[.sh]");
69 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
70 zap[
'p'] =
make_field(compare.waveform_s,
"wavefrom duration [s]") = 5.0e-3;
71 zap[
'D'] =
make_field(Tmax_s,
"time difference between events [s]") = 20.0e-3;
76 catch(
const exception &error) {
77 FATAL(error.what() << endl);
93 for (JTreeScanner_t::iterator
p1 = in.begin();
p1 != in.end() && events != inputFile.getLimit(); ++
p1, ++events) {
95 STATUS(
"event " << setw(8) << events <<
'\r');
DEBUG(endl);
97 if (!
p1->empty() && !p0->empty()) {
99 if (
p1->begin()->getToE() < p0->rbegin()->getToE() + Tmax_s) {
105 cout << p0->getOID() << endl
106 <<
FIXED(20,6) << p0-> begin()->getToE() <<
' '
107 <<
FIXED(20,6) << p0->rbegin()->getToE() << endl
108 <<
FIXED(20,6) <<
p1-> begin()->getToE() <<
' '
109 <<
FIXED(20,6) <<
p1->rbegin()->getToE() << endl;
114 for (
int i = 0; i != 2; ++i) {
115 sort(evt[i].begin(), evt[i].end(), compare);
120 for (JEvent::const_iterator
122 i1 = evt[1].begin(); i0 != evt[0].end() && i1 != evt[1].end(); ) {
124 if (compare(*i0, *i1))
126 else if (compare(*i1, *i0))
135 cout << setw(2) << p0->getID() <<
' '
136 << setw(10) << i0->getID() <<
' '
137 <<
FIXED(20,6) << i0->getToA() <<
' '
138 <<
FIXED( 8,0) << i0->getQ() <<
' ';
140 cout << setw(2) <<
p1->getID() <<
' '
141 << setw(10) << i1->getID() <<
' '
142 <<
FIXED(20,6) << i1->getToA() <<
' '
143 <<
FIXED( 8,0) << i1->getQ() <<
' ';
145 cout <<
FIXED( 9,6) << (i1->getToA() - i0->getToA()) << endl;
148 if (i0->getToA() < i1->getToA())
150 else if (i1->getToA() < i0->getToA())
172 cout <<
"Number of errors / events: " <<
Q.getCount() <<
" / " << events << endl;
Utility class to parse command line options.
Q(UTCMax_s-UTCMin_s)-livetime_s
int main(int argc, char *argv[])
ROOT TTree parameter settings.
Long64_t counter_type
Type definition for counter.
Auxiliary data structure for floating point format specification.
Template definition for direct access of elements in ROOT TChain.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Auxiliary class for defining the range of iterations of objects.
I/O formatting auxiliaries.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Base class for JTreeScanner.
Utility class to parse command line options.
double getToA() const
Get calibrated time of arrival.
int getID() const
Get identifier.
const JLimit & getLimit() const
Get limit.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
#define DEBUG(A)
Message macros.