// created: 25 March 2014 // last modif: 25 March 2014 // Author: Creusot Alexandre #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; void comparisonHits2() { gROOT->Reset(); gROOT->SetStyle("Plain"); gStyle->SetPalette(1); gStyle->SetNumberContours(99); gStyle->SetOptFit(0000); TStopwatch watch; string line1; string line2; //ifstream in3("../../../../../data/run915-rdatv1-hits.dat"); ifstream in1("test-v1.dat"); ifstream in2("test-v2.dat"); while (getline(in1, line1)) { getline(in2, line2); istringstream iss1; istringstream iss2; iss1.clear(); iss2.clear(); iss1.str(line1); iss2.str(line2); int temp1[3]; iss1 >> temp1[0] >> temp1[1] >> temp1[2]; //cout << temp1[0] << ' ' << temp1[1] << ' ' << temp1[2] << endl; int temp2[3]; iss2 >> temp2[0] >> temp2[1] >> temp2[2]; //cout << temp2[0] << ' ' << temp2[1] << ' ' << temp2[2] << endl; if (temp1[0] != temp2[0]) { //cout << "******************************" << endl; cout << temp1[0] << ' ' << temp1[1] << ' ' << temp1[2] << endl; getline(in1, line1); iss1.clear(); iss1.str(line1); iss1 >> temp1[0] >> temp1[1] >> temp1[2]; if (temp1[0] != temp2[0]) { //cout << "******************************" << endl; cout << temp1[0] << ' ' << temp1[1] << ' ' << temp1[2] << endl; getline(in1, line1); iss1.clear(); iss1.str(line1); iss1 >> temp1[0] >> temp1[1] >> temp1[2]; //cout << temp1[0] << ' ' << temp1[1] << ' ' << temp1[2] << endl; if (temp1[0] != temp2[0]) { //cout << "******************************" << endl; cout << temp1[0] << ' ' << temp1[1] << ' ' << temp1[2] << endl; getline(in1, line1); iss1.clear(); iss1.str(line1); iss1 >> temp1[0] >> temp1[1] >> temp1[2]; //cout << temp1[0] << ' ' << temp1[1] << ' ' << temp1[2] << endl; } } //cout << temp1[0] << ' ' << temp1[1] << ' ' << temp1[2] << endl; } //cout << endl; } in1.close(); in2.close(); cout << "time: " << watch.CpuTime() << " s" << endl; }