File indexing completed on 2026-04-09 07:49:12
0001 #include <algorithm>
0002 #include <iostream>
0003 #include <string>
0004
0005 #include "sysrap/OPTICKS_LOG.hh"
0006
0007 #include <argparse/argparse.hpp>
0008
0009 #include "g4cx/G4CXOpticks.hh"
0010
0011 using namespace std;
0012
0013 int main(int argc, char **argv)
0014 {
0015 OPTICKS_LOG(argc, argv);
0016
0017 argparse::ArgumentParser program("consgeo", "0.0.0");
0018
0019 string gdml_file;
0020 string out_prefix;
0021
0022 program.add_argument("-g", "--gdml")
0023 .help("path to GDML file")
0024 .default_value(string("geom.gdml"))
0025 .nargs(1)
0026 .store_into(gdml_file);
0027
0028 program.add_argument("-o", "--out-prefix")
0029 .help("where to save CSG")
0030 .default_value(string("csg"))
0031 .nargs(1)
0032 .store_into(out_prefix);
0033
0034 try
0035 {
0036 program.parse_args(argc, argv);
0037 }
0038 catch (const exception &err)
0039 {
0040 cerr << err.what() << endl;
0041 cerr << program;
0042 exit(EXIT_FAILURE);
0043 }
0044
0045 LOG_INFO << "gdml_file: " << gdml_file << endl;
0046
0047 from_gdml(gdml_file, out_prefix);
0048
0049 return EXIT_SUCCESS;
0050 }