35 inline bool operator()(
const JFit& first,
const JFit& second)
const
37 if (first.
id == second.
id) {
39 if (first.
tx == second.
tx) {
41 return first.
ty < second.
ty;
45 return first.
tx < second.
tx;
50 return first.
id < second.
id;
62 inline bool operator()(
const JEvt& first,
const JEvt& second)
const
74 if (first.size() == second.size()) {
76 for (JEvt::const_iterator
78 p1 = second.begin(); p0 != first.end() &&
p1 != second.end(); ++p0, ++
p1) {
80 if ((*
this)(*p0, *
p1)) {
89 return first.size() < second.size();
139 std::ostream& operator()(std::ostream& out,
const std::string& filename,
const int index,
const JEvt& evt,
const std::string& prefix,
const std::string& postfix)
const
145 out << prefix << (prefix ==
"" ?
"" :
" ")
146 << setw(width) << left << filename << right <<
' '
147 <<
"[" <<
FILL(6,
'0') << index <<
"]" <<
FILL() <<
' '
151 << (postfix ==
"" ?
"" :
" ") << postfix << endl;
167 std::ostream& operator()(std::ostream& out,
const JFit&
object,
const std::string& prefix,
const std::string& postfix)
const
173 out << prefix << (prefix ==
"" ?
"" :
" ")
174 <<
FILL(4,
'0') <<
object.id <<
FILL() <<
' '
175 <<
FIXED(9,6) <<
object.tx <<
' '
176 <<
FIXED(9,6) <<
object.ty <<
' '
177 << (postfix ==
"" ?
"" :
" ") << postfix << endl;
191 int main(
int argc,
char **argv)
202 JParser<> zap(
"Program to compare acoustics fit data.");
204 zap[
'f'] =
make_field(inputFile,
"two outputs of JKatoomba[.sh]");
205 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
210 catch(
const exception &error) {
211 FATAL(error.what() << endl);
214 if (inputFile.size() != 2u) {
215 FATAL(
"Wrong number of input files " << inputFile.size() << endl);
218 const size_t width = max(inputFile[0].size(), inputFile[1].size());
223 for (
int i = 0; i != 2; ++i) {
226 buffer[i].push_back(*in.next());
229 sort(buffer[i].begin(), buffer[i].end());
233 for (
int i = 0; i != 2; ++i) {
240 int count[] = { 0, 0 };
243 p0 = buffer[0].begin(),
244 p1 = buffer[1].begin(); p0 != buffer[0].end() &&
p1 != buffer[1].end(); ) {
246 for ( ; p0 != buffer[0].end() &&
p1 != buffer[1].end() && compare(*p0,*
p1); ++p0, ++count[1]) {
247 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
">>",
"");
250 for ( ; p0 != buffer[0].end() &&
p1 != buffer[1].end() && compare(*
p1,*p0); ++
p1, ++count[1]) {
254 if (p0 != buffer[0].end() &&
p1 != buffer[1].end()) {
256 if (!compare(*p0,*
p1) && !compare(*
p1,*p0)) {
260 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
"",
"\\");
267 if (p0->detid ==
p1->detid &&
268 p0->UNIXTimeStart ==
p1->UNIXTimeStart &&
269 p0->UNIXTimeStop ==
p1->UNIXTimeStop) {
271 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
"",
"");
274 JEvt::const_iterator i0 = p0->begin();
275 JEvt::const_iterator i1 =
p1->begin();
277 for ( ; i0 != p0->end() && i1 !=
p1->end(); ++i0, ++i1) {
278 if (compare(*i0, *i1) || compare(*i1,*i0)) {
279 print(cout, *i0,
">>",
"");
280 print(cout, *i1,
"<<",
"");
284 for ( ; i0 != p0->end(); ++i0) {
285 print(cout, *i0,
">>",
"");
288 for ( ; i1 !=
p1->end(); ++i1) {
289 print(cout, *i1,
"<<",
"");
294 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
">>",
"");
299 if (compare(*p0,*
p1) || compare(*
p1,*p0)) {
309 STATUS(
"Number of differences / events: " << count[1] <<
" / " << count[0] << endl);
311 if (buffer[0].size() != buffer[1].size()) {
312 FATAL(
"Different size " << buffer[0].size() <<
' ' << buffer[1].size() << endl);
316 FATAL(
"Number of differences " << count[1] << endl);
ROOT TTree parameter settings.
int main(int argc, char **argv)
General purpose messaging.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Scanning of objects from a single file according a format that follows from the extension of each fil...
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 command line options.
Object reading from a list of files.
virtual bool hasNext() override
Check availability of next element.
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter=' ', const bool useColors=true)
Print test summary.
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for sequence of same character.
Auxiliary data structure for floating point format specification.
double UNIXTimeStop
stop time
int detid
detector identifier
int npar
number of fit parameters
double UNIXTimeStart
start time
Auxiliary class for defining the range of iterations of objects.