20 : m_time(0.0*units::
ns)
21 , m_stop(1.0*units::
ms)
22 , m_readout(5.0*units::ms)
23 , m_tick(0.5*units::
us)
40 Gen::NoiseSource::~NoiseSource()
47 cfg[
"start_time"] =
m_time;
50 cfg[
"sample_period"] =
m_tick;
89 cerr <<
"Gen::NoiseSource: using IRandom: \"" <<
m_rng_tn <<
"\"" 90 <<
" IAnodePlane: \"" << m_anode_tn <<
"\"" 91 <<
" IChannelSpectrum: \"" << m_model_tn <<
"\"" 92 <<
" readout time: " << m_readout/
units::us <<
"us\n";
114 for (
auto chid :
m_anode->channels()) {
115 const auto& spec = (*m_model)(chid);
120 auto trace = make_shared<SimpleTrace>(chid, tbin, noise);
121 traces.push_back(
trace);
122 nsamples += noise.size();
124 cerr <<
"Gen::NoiseSource: made " << traces.size() <<
" traces, " 125 << nsamples <<
" samples\n";
std::shared_ptr< const IFrame > pointer
boost::error_info< struct tag_errmsg, std::string > errmsg
virtual bool operator()(IFrame::pointer &frame)
IFrameSource.
virtual void configure(const WireCell::Configuration &config)
IConfigurable.
std::vector< pointer > vector
IAnodePlane::pointer m_anode
IChannelSpectrum::pointer m_model
WIRECELL_FACTORY(NoiseSource, WireCell::Gen::NoiseSource, WireCell::IFrameSource, WireCell::IConfigurable) using namespace std
WireCell::Waveform::realseq_t generate_waveform(const std::vector< float > &spec, IRandom::pointer rng, double replace=0.02)
virtual WireCell::Configuration default_configuration() const
Optional, override to return a hard-coded default configuration.
Json::Value Configuration
Thrown when a wrong key or has been encountered.