75 inline bool operator()(
const JEvent& first,
const JEvent& second)
const
83 if (first.size() == second.size()) {
85 for (JEvent::const_iterator
87 p1 = second.begin(); p0 != first.end() &&
p1 != second.end(); ++p0, ++
p1) {
89 if ((*
this)(*p0, *
p1)) {
98 return first.size() < second.size();
144 out << prefix << (prefix ==
"" ?
"" :
" ")
145 << setw(width) << left << filename << right <<
' '
146 <<
"[" <<
FILL(6,
'0') << index <<
"]" <<
FILL() <<
' '
149 << setw(2) << evt.
getID() <<
' '
150 <<
FIXED(12,6) << evt.begin()->getToE()
151 << (postfix ==
"" ?
"" :
" ") << postfix << endl;
173 out << prefix << (prefix ==
"" ?
"" :
" ")
174 << setw(8) <<
object.
getID() <<
' '
175 << setw(8) <<
object.getRunNumber() <<
' '
176 <<
FIXED(13,7) <<
object.getToA() <<
' '
178 <<
FIXED(8,0) <<
object.getQ()
179 << (postfix ==
"" ?
"" :
" ") << postfix << endl;
193 int main(
int argc,
char **argv)
204 JParser<> zap(
"Program to compare acoustics event data.");
206 zap[
'f'] =
make_field(inputFile,
"two outputs of JAcousticsEventBuilder[.sh]");
207 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
212 catch(
const exception &error) {
213 FATAL(error.what() << endl);
216 if (inputFile.size() != 2
u) {
217 FATAL(
"Wrong number of input files " << inputFile.size() << endl);
220 const size_t width = max(inputFile[0].size(), inputFile[1].size());
225 for (
int i = 0; i != 2; ++i) {
228 buffer[i].push_back(*
in.next());
234 for (
int i = 0; i != 2; ++i) {
236 sort(buffer[i].begin(), buffer[i].end());
244 int count[] = { 0, 0 };
247 p0 = buffer[0].begin(),
248 p1 = buffer[1].begin(); p0 != buffer[0].end() &&
p1 != buffer[1].end(); ) {
250 for ( ; p0 != buffer[0].end() &&
p1 != buffer[1].end() && *p0 < *
p1; ++p0, ++count[1]) {
251 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
">>",
"");
254 for ( ; p0 != buffer[0].end() && p1 != buffer[1].end() && *p1 < *p0; ++
p1, ++count[1]) {
255 print(cout, inputFile[1],
distance(buffer[1].cbegin(),p1), *p1,
"<<",
"");
258 if (p0 != buffer[0].end() && p1 != buffer[1].end()) {
264 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
"",
"\\");
265 print(cout, inputFile[1],
distance(buffer[1].cbegin(),p1), *p1,
"",
"/ ");
271 if (p0->getOID() == p1->getOID() &&
272 p0->getCounter() == p1->getCounter() &&
273 p0->getID() == p1->getID()) {
275 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
"",
"");
276 print(cout, inputFile[1],
distance(buffer[1].cbegin(),p1), *p1,
"",
"");
278 JEvent::const_iterator i0 = p0->begin();
279 JEvent::const_iterator i1 = p1->begin();
281 for ( ; i0 != p0->end() && i1 != p1->end(); ++i0, ++i1) {
283 print(cout, *i0,
">>",
"");
284 print(cout, *i1,
"<<",
"");
288 for ( ; i0 != p0->end(); ++i0) {
289 print(cout, *i0,
">>",
"");
292 for ( ; i1 != p1->end(); ++i1) {
293 print(cout, *i1,
"<<",
"");
298 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
">>",
"");
299 print(cout, inputFile[1],
distance(buffer[1].cbegin(),p1), *p1,
"<<",
"");
303 if (*p0 < *p1 || *p1 < *p0) {
313 STATUS(
"Number of differences / events: " << count[1] <<
" / " << count[0] << endl);
315 if (buffer[0].size() != buffer[1].size()) {
316 FATAL(
"Different size " << buffer[0].size() <<
' ' << buffer[1].size() << endl);
320 FATAL(
"Number of differences " << count[1] << endl);
Utility class to parse command line options.
int main(int argc, char *argv[])
double getQ() const
Get quality.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
int getRunNumber() const
Get run number.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
ROOT TTree parameter settings.
Auxiliary data structure for floating point format specification.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
Scanning of objects from a single file according a format that follows from the extension of each fil...
Auxiliary class for defining the range of iterations of objects.
double getW() const
Get normalisation.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
const std::string & getOID() const
Get detector identifier.
static struct JACOUSTICS::@4 compare
Auxiliary data structure to sort transmissions.
General purpose messaging.
Auxiliary data structure for sequence of same character.
Utility class to parse command line options.
int getCounter() const
Get counter.
double getToA() const
Get calibrated time of arrival.
int getID() const
Get identifier.
Object reading from a list of files.
int getID() const
Get identifier.
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