Skip to content
Snippets Groups Projects
Commit fde5374b authored by leggett's avatar leggett
Browse files

apply formatting artifacts

parent 1e575ddf
No related branches found
No related tags found
1 merge request!784Seedfinder test: specify input file on command line, quiet output
...@@ -67,50 +67,49 @@ std::vector<const SpacePoint*> readFile(std::string filename) { ...@@ -67,50 +67,49 @@ std::vector<const SpacePoint*> readFile(std::string filename) {
} }
int main(int argc, char** argv) { int main(int argc, char** argv) {
std::string file{"sp.txt"};
std::string file {"sp.txt"};
bool help(false); bool help(false);
bool quiet(false); bool quiet(false);
int opt; int opt;
while ((opt = getopt(argc, argv, "hf:q")) != -1) { while ((opt = getopt(argc, argv, "hf:q")) != -1) {
switch (opt) { switch (opt) {
case 'f': case 'f':
file = optarg; file = optarg;
break; break;
case 'q': case 'q':
quiet = true; quiet = true;
break; break;
case 'h': case 'h':
help = true; help = true;
default: /* '?' */ default: /* '?' */
std::cerr << "Usage: " << argv[0] std::cerr << "Usage: " << argv[0] << " [-hq] [-f FILENAME]\n";
<< " [-hq] [-f FILENAME]\n"; if (help) {
if (help) { std::cout << " -h : this help" << std::endl;
std::cout << " -h : this help" << std::endl; std::cout
std::cout << " -f FILE : read spacepoints from FILE. Default is \"" << " -f FILE : read spacepoints from FILE. Default is \""
<< file << "\"" << std::endl; << file << "\"" << std::endl;
std::cout << " -q : don't print out all found seeds" << std::endl; std::cout << " -q : don't print out all found seeds"
} << std::endl;
}
exit(EXIT_FAILURE);
exit(EXIT_FAILURE);
} }
} }
std::ifstream f(file); std::ifstream f(file);
if(!f.good()) { if (!f.good()) {
std::cerr << "input file \"" << file << "\" does not exist\n"; std::cerr << "input file \"" << file << "\" does not exist\n";
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
auto start_read = std::chrono::system_clock::now(); auto start_read = std::chrono::system_clock::now();
std::vector<const SpacePoint*> spVec = readFile(file); std::vector<const SpacePoint*> spVec = readFile(file);
auto end_read = std::chrono::system_clock::now(); auto end_read = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_read = end_read - start_read; std::chrono::duration<double> elapsed_read = end_read - start_read;
std::cout << "read " << spVec.size() << " SP from file " << file std::cout << "read " << spVec.size() << " SP from file " << file << " in "
<< " in " << elapsed_read.count() << "s" << elapsed_read.count() << "s" << std::endl;
<< std::endl;
Acts::SeedfinderConfig<SpacePoint> config; Acts::SeedfinderConfig<SpacePoint> config;
// silicon detector max // silicon detector max
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment