31int main(
int argc,
char **argv)
36 JMultipleFileScanner<JEvt> inputFile;
37 JLimit_t& numberOfEvents = inputFile.getLimit();
43 JParser<> zap(
"Example program to compare acoustic fit results.");
45 zap[
'f'] = make_field(inputFile,
"input file (output of JKatoomba[.sh])");
46 zap[
'n'] = make_field(numberOfEvents) = JLimit::max();
47 zap[
'o'] = make_field(outputFile) =
"comparison.root";
48 zap[
'd'] = make_field(debug) = 2;
52 catch(
const exception &error) {
53 FATAL(error.what() << endl);
57 if (inputFile.size() != 2u) {
58 FATAL(
"Invalid number of input files; need 2 files for comparison." << endl);
61 JManager<int, TH2D> H2(
new TH2D(
"string[%]", NULL, 500, -50.0, +50.0, 500, -50.0, +50.0));
63 JTreeScanner<JEvt, JEvt::JEvaluator> inA(inputFile[0]);
64 JTreeScanner<JEvt, JEvt::JEvaluator> inB(inputFile[1]);
66 while (inA.hasNext() && inB.hasNext()) {
68 STATUS(
"event: " << setw(10) << inA.getCounter() <<
'\r'); DEBUG(endl);
70 JEvt* pA = inA.next();
71 JEvt* pB = inB.next();
81 for (JEvt::const_iterator iA = pA->begin(); iA != pA->end(); ++iA) {
82 for (JEvt::const_iterator iB = pB->begin(); iB != pB->end(); ++iB) {
84 if (iA->id == iB->id) {
86 const double tx = (iA->tx - iB->tx) * 1.0e3;
87 const double ty = (iA->ty - iB->ty) * 1.0e3;
90 H2[iA->id]->Fill(tx, ty);
100 TFile out(outputFile.c_str(),
"recreate");