1 #include "art/Utilities/ToolMacros.h"
2 #include "art/Utilities/ToolConfigTable.h"
7 #include "fhiclcpp/ParameterSet.h"
8 #include "fhiclcpp/types/Sequence.h"
9 #include "fhiclcpp/types/OptionalSequence.h"
10 #include "fhiclcpp/types/OptionalDelegatedParameter.h"
11 #include "fhiclcpp/types/Comment.h"
12 #include "fhiclcpp/types/Table.h"
14 #include "WireCellApps/Main.h"
15 #include "WireCellUtil/String.h"
16 #include "WireCellUtil/Logging.h"
18 #include "WireCellUtil/NamedFactory.h"
43 fhicl::Comment(
"List of one or more WCT configuration files."
44 "\nThey are located w.r.t. the WCT load path.") };
46 fhicl::Comment(
"List of one or more WCT application objects to execute.")};
48 fhicl::Comment(
"List of WCT component plugin libraries to load.\n"
49 "They are located w.r.t. the OS library load path")};
52 fhicl::Comment(
"Optional list of file system paths to add to the WCT "
53 "configuration file load path."
54 "\nThis augments the WIRECELL_PATH environment variable.")};
56 fhicl::Comment(
"Optional table giving external variables to inject into WCT configuration.")};
58 fhicl::Comment(
"Optional table giving external Jsonnet code to inject into WCT configuration.")};
62 fhicl::Comment(
"List of WCT components which act as WCT sources.\n"
63 "They are called before WCT executes on each Art Event object") };
65 fhicl::Comment(
"List of WCT components which act as WCT sinks.\n"
66 "They are called after WCT executes on each Art Event object.") };
69 fhicl::Comment(
"List of WCT log sinks.\n"
70 "Eg the strings 'stdout', 'stderr' or a file name.\n"
71 "An optional log level may be appended with ':<level>'.") };
73 fhicl::Comment(
"List of minimum WCT logger levels.\n"
74 "Specify as '<logger>:<level>' or as just '<level>' for default.") };
81 using Parameters = art::ToolConfigTable<WCLSConfig, WCLSKeysToIgnore>;
86 void produces(art::ProducesCollector& collector) {
88 iaev->produces(collector);
91 void process(art::Event& event);
106 const auto& wclscfg = params();
107 WCLSConfig::optional_string_list_t::value_type slist;
109 if (wclscfg.logsinks(slist)) {
110 for (
auto logsink : slist) {
112 auto ls = WireCell::String::split(logsink,
":");
113 if (
ls.size() == 2) {
122 if (wclscfg.loglevels(slist)) {
123 for (
auto loglevel : slist) {
125 auto ll = WireCell::String::split(loglevel,
":");
126 if (ll.size() == 2) {
127 m_wcmain.set_loglevel(ll[0], ll[1]);
135 WireCell::Log::set_pattern(
"[%H:%M:%S.%03e] %L [%^%=8n%$] %v");
141 for (
auto cfg : wclscfg.configs()) {
145 for (
auto app : wclscfg.apps()) {
149 for (
auto plugin : wclscfg.plugins()) {
155 if (wclscfg.paths(slist)) {
156 for (
auto path : slist) {
164 fhicl::ParameterSet wcps;
165 if (wclscfg.params.get_if_present(wcps)) {
166 for (
auto key : wcps.get_names()) {
167 auto value = wcps.get<std::string>(key);
173 fhicl::ParameterSet wcps;
174 if (wclscfg.structs.get_if_present(wcps)) {
175 for (
auto key : wcps.get_names()) {
176 auto value = wcps.get<std::string>(key);
186 catch (WireCell::Exception&
e) {
187 std::cerr <<
"Wire Cell Toolkit threw an exception\n";
188 auto msg = errstr(e);
190 throw cet::exception(
"WireCellLArSoft") <<
msg;
195 if (wclscfg.inputers(slist)) {
196 for (
auto inputer : slist) {
197 auto iaev = WireCell::Factory::find_tn<IArtEventVisitor>(inputer);
199 std::cerr <<
"Inputer: \"" << inputer <<
"\"\n";
203 if (wclscfg.outputers(slist)) {
204 for (
auto outputer : slist) {
205 auto iaev = WireCell::Factory::find_tn<IArtEventVisitor>(outputer);
207 std::cerr <<
"Outputer: \"" << outputer <<
"\"\n";
215 for (
auto iaev : m_inputers) {
224 for (
auto iaev : m_outputers) {
wcls::IArtEventVisitor::vector m_outputers
fhicl::OptionalSequence< std::string > optional_string_list_t
BEGIN_PROLOG could also be cerr
std::set< std::string > operator()()
fhicl::Sequence< std::string > string_list_t
then echo Invalid dCache scratch not copying back else ifdh ls
void produces(art::ProducesCollector &collector)
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics path
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
art::ToolConfigTable< WCLSConfig, WCLSKeysToIgnore > Parameters
BEGIN_PROLOG vertical distance to the surface Name
fhicl::OptionalDelegatedParameter generic_pset_t
optional_string_list_t loglevels
void process(art::Event &event)
Accept an event to process.
wcls::IArtEventVisitor::vector m_inputers
optional_string_list_t logsinks
WCLS(Parameters const &ps)
optional_string_list_t inputers
optional_string_list_t outputers
optional_string_list_t paths