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
64 if (first.
oid == second.
oid) {
70 if (first.
ndf == second.
ndf) {
72 if (first.size() == second.size()) {
74 for (JEvt::const_iterator
76 p1 = second.begin(); p0 != first.end() &&
p1 != second.end(); ++p0, ++
p1) {
78 if ((*
this)(*p0, *
p1)) {
87 return first.size() < second.size();
91 return first.
ndf < second.
ndf;
105 return first.
oid < second.
oid;
130 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
136 out << prefix << (prefix ==
"" ?
"" :
" ")
137 << setw(width) << left << filename << right <<
' '
138 <<
"[" <<
FILL(6,
'0') << index <<
"]" <<
FILL() <<
' '
142 << (postfix ==
"" ?
"" :
" ") << postfix << endl;
158 std::ostream& operator()(std::ostream& out,
const JFit&
object,
const std::string& prefix,
const std::string& postfix)
const
164 out << prefix << (prefix ==
"" ?
"" :
" ")
165 <<
FILL(4,
'0') <<
object.id <<
FILL() <<
' '
166 <<
FIXED(9,6) <<
object.tx <<
' '
167 <<
FIXED(9,6) <<
object.ty <<
' '
168 << (postfix ==
"" ?
"" :
" ") << postfix << endl;
182 int main(
int argc,
char **argv)
193 JParser<> zap(
"Program to compare acoustics fit data.");
195 zap[
'f'] =
make_field(inputFile,
"two outputs of JKatoomba[.sh]");
196 zap[
'n'] =
make_field(numberOfEvents) = JLimit::max();
201 catch(
const exception &error) {
202 FATAL(error.what() << endl);
205 if (inputFile.size() != 2
u) {
206 FATAL(
"Wrong number of input files " << inputFile.size() << endl);
209 const size_t width = max(inputFile[0].size(), inputFile[1].size());
214 for (
int i = 0; i != 2; ++i) {
217 buffer[i].push_back(*
in.next());
220 sort(buffer[i].begin(), buffer[i].end());
224 for (
int i = 0; i != 2; ++i) {
231 int count[] = { 0, 0 };
234 p0 = buffer[0].begin(),
235 p1 = buffer[1].begin(); p0 != buffer[0].end() &&
p1 != buffer[1].end(); ) {
237 for ( ; p0 != buffer[0].end() &&
p1 != buffer[1].end() && compare(*p0,*
p1); ++p0, ++
count[1]) {
238 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
">>",
"");
241 for ( ; p0 != buffer[0].end() &&
p1 != buffer[1].end() && compare(*
p1,*p0); ++
p1, ++
count[1]) {
245 if (p0 != buffer[0].end() &&
p1 != buffer[1].end()) {
247 if (!compare(*p0,*
p1) && !compare(*
p1,*p0)) {
251 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
"",
"\\");
258 if (p0->oid ==
p1->oid &&
259 p0->UNIXTimeStart ==
p1->UNIXTimeStart &&
260 p0->UNIXTimeStop ==
p1->UNIXTimeStop) {
262 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
"",
"");
265 JEvt::const_iterator i0 = p0->begin();
266 JEvt::const_iterator i1 =
p1->begin();
268 for ( ; i0 != p0->end() && i1 !=
p1->end(); ++i0, ++i1) {
269 if (compare(*i0, *i1) || compare(*i1,*i0)) {
270 print(cout, *i0,
">>",
"");
271 print(cout, *i1,
"<<",
"");
275 for ( ; i0 != p0->end(); ++i0) {
276 print(cout, *i0,
">>",
"");
279 for ( ; i1 !=
p1->end(); ++i1) {
280 print(cout, *i1,
"<<",
"");
285 print(cout, inputFile[0],
distance(buffer[0].cbegin(),p0), *p0,
">>",
"");
290 if (compare(*p0,*
p1) || compare(*
p1,*p0)) {
300 STATUS(
"Number of differences / events: " <<
count[1] <<
" / " <<
count[0] << endl);
303 FATAL(
"Number of differences " <<
count[1] << endl);
Utility class to parse command line options.
int main(int argc, char *argv[])
JComparator< JResult_t T::*, JComparison::lt > make_comparator(JResult_t T::*member)
Helper method to create comparator between values of data member.
std::string oid
detector identifier
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.
int ndf
number of degrees of freedom
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...
double UNIXTimeStop
stop time
Auxiliary class for defining the range of iterations of objects.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
General purpose messaging.
Auxiliary data structure for sequence of same character.
double UNIXTimeStart
start time
Utility class to parse command line options.
Object reading from a list of files.
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in