22 , m_start_time(0.0*units::
ns)
23 , m_readout_time(5.0*units::
ms)
24 , m_tick(0.5*units::
us)
25 , m_drift_speed(1.0*units::
mm/units::us)
28 , m_mode("continuous")
59 put(cfg,
"continuous",
true);
63 put(cfg,
"fixed",
false);
75 cfg[
"pirs"] = Json::arrayValue;
90 bool continuous = get<bool>(
cfg,
"continuous",
true);
91 bool fixed = get<bool>(
cfg,
"fixed",
false);
97 else if (!continuous) {
98 m_mode =
"discontinuous";
105 m_rng = Factory::find_tn<IRandom>(
m_rng_tn);
114 auto jpirs = cfg[
"pirs"];
115 if (jpirs.isNull() or jpirs.empty()) {
116 l->critical(
"must configure with some plane impace response components");
117 THROW(
ValueError() <<
errmsg{
"Gen::Ductor: must configure with some plane impact response components"});
120 for (
auto jpir : jpirs) {
121 auto tn = jpir.asString();
122 auto pir = Factory::find_tn<IPlaneImpactResponse>(tn);
126 l->debug(
"AnodePlane: {}, mode: {}, fluctuate: {}, time start: {} ms, readout time: {} ms, frame start: {}",
m_anode_tn, m_mode, (
m_fluctuate ?
"on" :
"off"), m_start_time/
units::ms, m_readout_time/
units::ms, m_frame_count);
136 for (
auto plane : face->planes()) {
145 for (
auto depo : face_depos) {
146 bindiff.
add(depo, depo->extent_long() /
m_drift_speed, depo->extent_tran());
149 auto& wires = plane->wires();
151 auto pir =
m_pirs.at(iplane);
155 for (
int iwire=0; iwire<
nwires; ++iwire) {
159 if (
mm.first == (
int)wave.size()) {
163 int chid = wires[iwire]->channel();
167 auto trace = make_shared<SimpleTrace>(chid, tbin, charge);
168 traces.push_back(trace);
178 for (
auto face :
m_anode->faces()) {
182 auto bb = face->sensitive();
184 l->debug(
"anode: {} face: {} is marked insensitive, skipping",
185 m_anode->ident(), face->ident());
190 if (bb.inside(depo->pos())) {
191 face_depos.push_back(depo);
194 dropped_depos.push_back(depo);
198 if (face_depos.size()) {
199 auto ray = bb.bounds();
200 l->debug(
"anode: {}, face: {}, processing {} depos spanning " 201 "t:[{},{}]ms, bb:[{}-->{}]cm",
202 m_anode->ident(), face->ident(), face_depos.size(),
207 if (dropped_depos.size()) {
208 auto ray = bb.bounds();
209 l->debug(
"anode: {}, face: {}, dropped {} depos spanning " 210 "t:[{},{}]ms, outside bb:[{}-->{}]cm",
211 m_anode->ident(), face->ident(),
212 dropped_depos.size(),
220 traces.insert(traces.end(), newtraces.begin(), newtraces.end());
224 frames.push_back(frame);
225 l->debug(
"made frame: {} with {} traces @ {}ms",
226 m_frame_count, traces.size(), m_start_time/
units::ms);
235 if (
m_mode ==
"continuous") {
255 if (
m_mode ==
"discontinuous") {
282 frames.push_back(
nullptr);
virtual void process(output_queue &frames)
boost::error_info< struct tag_errmsg, std::string > errmsg
bool add(IDepo::pointer deposition, double sigma_time, double sigma_pitch)
WIRECELL_FACTORY(Ductor, WireCell::Gen::Ductor, WireCell::IDuctor, WireCell::IConfigurable) using namespace std
const Binning & region_binning() const
virtual void configure(const WireCell::Configuration &config)
Accept a configuration.
void put(Configuration &cfg, const std::string &dotpath, const T &val)
Put value in configuration at the dotted path.
IAnodePlane::pointer m_anode
std::vector< pointer > vector
bool start_processing(const input_pointer &depo)
std::deque< output_pointer > output_queue
virtual bool operator()(const input_pointer &depo, output_queue &frames)
The calling signature:
Binning tbins(nticks, t0, t0+readout_time)
std::shared_ptr< Interface > pointer
logptr_t logger(std::string name)
Thrown when a wrong value has been encountered.
Pimpos pimpos(nwires, min_wire_pitch, max_wire_pitch)
Json::Value Configuration
std::vector< IPlaneImpactResponse::pointer > m_pirs
std::shared_ptr< const IDepo > input_pointer
Waveform::realseq_t waveform(int wire) const
std::vector< float > ChargeSequence
Sequential collection of charge.
virtual ITrace::vector process_face(IAnodeFace::pointer face, const IDepo::vector &face_depos)