68 inline bool operator()(
const JEvent& first,
const JEvent& second)
const
76 if (first.size() == second.size()) {
78 for (JEvent::const_iterator
80 p1 = second.begin(); p0 != first.end() &&
p1 != second.end(); ++p0, ++
p1) {
82 if ((*
this)(*p0, *
p1)) {
91 return first.size() < second.size();
137 out << prefix << (prefix ==
"" ?
"" :
" ")
138 << setw(width) << left << filename << right <<
' '
139 <<
"[" <<
FILL(6,
'0') << index <<
"]" <<
FILL() <<
' '
142 << setw(2) << evt.
getID() <<
' '
143 <<
FIXED(12,6) << evt.begin()->getToE()
144 << (postfix ==
"" ?
"" :
" ") << postfix << endl;
166 out << prefix << (prefix ==
"" ?
"" :
" ")
167 << setw(8) <<
object.
getID() <<
' '
168 << setw(8) <<
object.getRunNumber() <<
' '
169 <<
FIXED(13,7) <<
object.getToA() <<
' '
171 <<
FIXED(8,0) <<
object.getQ()
172 << (postfix ==
"" ?
"" :
" ") << postfix << endl;
186 int main(
int argc,
char **argv)
197 JParser<> zap(
"Program to compare acoustics event data.");
199 zap[
'f'] =
make_field(inputFile,
"two outputs of JAcousticsEventBuilder[.sh]");
200 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
205 catch(
const exception &error) {
206 FATAL(error.what() << endl);
209 if (inputFile.size() != 2
u) {
210 FATAL(
"Wrong number of input files " << inputFile.size() << endl);
213 const size_t width = max(inputFile[0].size(), inputFile[1].size());
218 for (
int i = 0; i != 2; ++i) {
221 buffer[i].push_back(*
in.next());
227 for (
int i = 0; i != 2; ++i) {
229 sort(buffer[i].begin(), buffer[i].end());
237 int count[] = { 0, 0 };
240 p0 = buffer[0].begin(),
241 p1 = buffer[1].begin(); p0 != buffer[0].end() &&
p1 != buffer[1].end(); ) {
243 for ( ; p0 != buffer[0].end() &&
p1 != buffer[1].end() && *p0 < *
p1; ++p0, ++
count[1]) {
244 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
">>",
"");
247 for ( ; p0 != buffer[0].end() && p1 != buffer[1].end() && *p1 < *p0; ++
p1, ++
count[1]) {
248 print(cout, inputFile[1],
distance(buffer[1].cbegin(),p1), *p1,
"<<",
"");
251 if (p0 != buffer[0].end() && p1 != buffer[1].end()) {
257 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
"",
"\\");
258 print(cout, inputFile[1],
distance(buffer[1].cbegin(),p1), *p1,
"",
"/ ");
264 if (p0->getOID() == p1->getOID() &&
265 p0->getCounter() == p1->getCounter() &&
266 p0->getID() == p1->getID()) {
268 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
"",
"");
269 print(cout, inputFile[1],
distance(buffer[1].cbegin(),p1), *p1,
"",
"");
271 JEvent::const_iterator i0 = p0->begin();
272 JEvent::const_iterator i1 = p1->begin();
274 for ( ; i0 != p0->end() && i1 != p1->end(); ++i0, ++i1) {
276 print(cout, *i0,
">>",
"");
277 print(cout, *i1,
"<<",
"");
281 for ( ; i0 != p0->end(); ++i0) {
282 print(cout, *i0,
">>",
"");
285 for ( ; i1 != p1->end(); ++i1) {
286 print(cout, *i1,
"<<",
"");
291 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
">>",
"");
292 print(cout, inputFile[1],
distance(buffer[1].cbegin(),p1), *p1,
"<<",
"");
296 if (*p0 < *p1 || *p1 < *p0) {
306 STATUS(
"Number of differences / events: " <<
count[1] <<
" / " <<
count[0] << endl);
308 if (buffer[0].size() != buffer[1].size()) {
309 FATAL(
"Different size " << buffer[0].size() <<
' ' << buffer[1].size() << endl);
313 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.
#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