JsonDepoSource.h
Go to the documentation of this file.
1 /*
2  This component will provide depositions from a JSON file.
3 
4  The JSON file schema is assumed to be a dictionary with a list of
5  depositions found by key "depos" (by default). Each entry in the
6  list is a dictionary with keys:
7 
8  - x,y,z :: the Cartesian spatial coordinates in cm. (fixme: really?)
9  - t : time in seconds (fixme: really?)
10  - q : point energy deposition in MeV
11 or
12  - q,s : energy deposition q in MeV along step of length s in cm (fixme: really?)
13  - n : number of electrons.
14 
15 
16  */
17 
18 #ifndef WIRECELLSIO_JSONDEPOSOURCE
19 #define WIRECELLSIO_JSONDEPOSOURCE
20 
23 
24 namespace WireCell {
25  namespace Sio {
26 
27  class JsonRecombinationAdaptor;
28  class JsonDepoSource : public IDepoSource, public IConfigurable {
29  public:
30 
32  virtual ~JsonDepoSource();
33 
34  /// IDepoSource
35  virtual bool operator()(IDepo::pointer& out);
36 
37  /// IConfigurable
39  virtual void configure(const WireCell::Configuration& config);
40 
41  // local helper method
43 
44  private:
47  bool m_eos;
48 
49 
50  };
51  }
52 }
53 #endif
54 
std::shared_ptr< const IDepo > pointer
Definition: IData.h:19
JsonRecombinationAdaptor * m_adapter
IDepo::pointer jdepo2idepo(Json::Value jdepo)
std::vector< pointer > vector
Definition: IData.h:21
virtual bool operator()(IDepo::pointer &out)
IDepoSource.
GenericValue< UTF8<> > Value
GenericValue with UTF8 encoding.
Definition: document.h:2106
static Config * config
Definition: config.cpp:1054
WireCell::IDepo::vector m_depos
Definition: Main.h:22
Json::Value Configuration
Definition: Configuration.h:50
virtual WireCell::Configuration default_configuration() const
IConfigurable.
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.