Belle II Software  release-05-01-25
b2display.cc
1 #include <framework/utilities/FileSystem.h>
2 
3 #include <iostream>
4 #include <cstdlib>
5 
10 int main(int argc, char* argv[])
11 {
12  if (argc != 2 or std::string(argv[1]) == "--help") {
13  std::cerr << "Usage: " << argv[0] << " input_file.root\n\n"
14  " Show data in given input file using the event display.\n\n"
15 
16  " You can also open multiple files using wildcards, though you have to\n"
17  " pass the string with wildcards to b2display to prevent expansion by the shell, e.g.\n"
18  " b2display \"my/files/mdst_*.root\".\n\n"
19 
20  " Using .sroot files, http:// or root:// URLs is also possible.\n\n"
21 
22  " Configuration of the display can be changed from the defaults by\n"
23  " editing display/examples/display.py.\n"
24  " See output of 'basf2 -m Display' for available options.\n";
25  return 1;
26  }
27  std::string fullPath = Belle2::FileSystem::findFile("/display/examples/display.py");
28  std::string s = "basf2 " + fullPath + " -i \"" + std::string(argv[1]) + "\"";
29  return system(s.c_str());
30 }
main
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:77
Belle2::FileSystem::findFile
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
Definition: FileSystem.cc:147