WireSchemaFile.cxx
Go to the documentation of this file.
2 
5 
6 WIRECELL_FACTORY(WireSchemaFile,
9 
10 
11 using namespace WireCell;
12 
14  : m_fname(fname)
15 {
16 }
17 
18 Gen::WireSchemaFile::~WireSchemaFile()
19 {
20 }
21 
22 
24 {
25  m_fname = get(cfg, "filename", m_fname);
26  if (m_fname.empty()) {
27  THROW(ValueError() << errmsg{"must give a wire schema filename"});
28  }
29  m_store = WireSchema::load(m_fname.c_str());
30 }
31 
32 WireCell::Configuration Gen::WireSchemaFile::default_configuration() const
33 {
35  cfg["filename"] = m_fname;
36  return cfg;
37 }
38 
39 
40 const WireSchema::Store& Gen::WireSchemaFile::wire_schema_store() const
41 {
42  return m_store;
43 }
44 
45 
boost::error_info< struct tag_errmsg, std::string > errmsg
Definition: Exceptions.h:54
cfg
Definition: dbjson.py:29
def configure(cfg)
Definition: cuda.py:34
WIRECELL_FACTORY(WireSchemaFile, WireCell::Gen::WireSchemaFile, WireCell::IWireSchema, WireCell::IConfigurable) using namespace WireCell
#define THROW(e)
Definition: Exceptions.h:25
Thrown when a wrong value has been encountered.
Definition: Exceptions.h:37
Definition: Main.h:22
Json::Value Configuration
Definition: Configuration.h:50
def load(filename, jpath="depos")
Definition: depos.py:34