8 #include <fhiclcpp/ParameterSet.h>
25 int main(
int argc,
char* argv[]) {
27 std::vector<char*> config_names;
30 while ((c=getopt(argc, argv,
"c:")) != -1) {
33 config_names.push_back(optarg);
37 fprintf(stderr,
"Option -%c requires an argument.\n", optopt);
38 else if (isprint(optopt))
39 fprintf(stderr,
"Unknown option `-%c'.\n", optopt);
41 fprintf(stderr,
"Unknown option character `\\x%x'.\n", optopt);
48 if (argc - optind < 1) {
49 std::cout <<
"Usage: " << argv[0] <<
" [-c [Config]] "
50 <<
"INPUTDEF [...]" << std::endl;
55 std::vector<std::string> filenames;
56 for (
int i=optind; i<argc; i++) {
57 filenames.push_back(argv[i]);
59 assert(!filenames.empty());
62 int n_processors = config_names.empty() ? 1 : config_names.size();
63 std::vector<fhicl::ParameterSet*>
configs(n_processors);
64 std::vector<core::ProcessorBase*> procs(n_processors);
66 std::cout <<
"Configuring... " << std::endl;
67 for (
size_t i=0; i<n_processors; i++) {
69 configs[i] = config_names.empty() ? NULL :
core::LoadConfig(config_names[i]);
73 for (
int i=0; i<procs.size(); i++) {
Struct containing (macro defined) creation/deletion operations.
process_name WireCellLarsoft configs
ProcessorBase *(* create)(void)
struct core::export_table exports
virtual void DeleteProcessors()
A generic tree-writing event-by-event processor.
core::export_table * LoadProcessor()
void DestroyProcessorObject(core::ProcessorBase *proc)
fhicl::ParameterSet * LoadConfig(char *configfile)
virtual void ProcessFiles(std::vector< std::string > filenames)
virtual void AddProcessor(ProcessorBase *processor, fhicl::ParameterSet *config)
core::ProcessorBase * CreateProcessorObject()
int main(int argc, char **argv)
BEGIN_PROLOG could also be cout