int main() { std::string file = "cpu_default_M1000.txt"; // std::string file = "TimingInfoDefaultM200.txt"; std::map<std::string,double> timingPerModule, timingPerLabel; std::map<unsigned,double> timingPerEvent; std::ifstream myTimingFile(file.c_str(),std::ifstream::in); std::string dummy1, label, module; double timing; unsigned idummy1,evt; // If the machine is busy, the factor is not 100%. // double factor = 0.975; // Muon 200 GeV double factor = 0.985; //Muon 1000GeV if ( myTimingFile ) { while ( !myTimingFile.eof() ) { myTimingFile >> dummy1 >> evt >> idummy1 >> label >> module >> timing ; // std::cout << evt << " " << module << " " << timing << std::endl; timingPerEvent[evt] += timing * factor * 1000.; if ( evt != 1 ) { timingPerModule[module] += timing * factor * 1000.; timingPerLabel[module+":"+label] += timing * factor * 1000.; } } } else {
int main(int argc, char **argv) { //std::string file = "TimingInfo.txt"; std::string file; file.assign(argv[1]); std::map<std::string,double> timingPerModule, timingPerLabel; std::map<unsigned,double> timingPerEvent; std::ifstream myTimingFile(file.c_str(),std::ifstream::in); std::string dummy1, label, module; double timing; unsigned idummy1,evt; int nbofevts = 0; // If the machine is busy, the factor is not 100%. double factor = 0.995; if ( myTimingFile ) { while ( !myTimingFile.eof() ) { myTimingFile >> dummy1 >> evt >> idummy1 >> label >> module >> timing ; // std::cout << evt << " " << module << " " << timing << std::endl; timingPerEvent[evt] += timing * factor * 1000.; timingPerModule[module] += timing * factor * 1000.; timingPerLabel[module+":"+label] += timing * factor * 1000.; } nbofevts = (int) timingPerEvent.size(); } else {