32 std::unordered_map<int, std::vector<float> > chch;
39 for (
auto plane : face->planes()) {
42 const Pimpos*
pimpos = plane->pimpos();
45 const Binning& wbins = pimpos->region_binning();
48 auto& wires = plane->wires();
57 for (
auto depo :
depos) {
59 const double pwid =
m_nsigma * depo->extent_tran();
60 const double pcen = pimpos->distance(depo->pos());
62 const double twid =
m_nsigma*depo->extent_long();
63 const double tcen = depo->time();
65 const int pbeg =
std::max(wbins.bin(pcen-pwid), 0);
66 const int pend =
std::min(wbins.bin(pcen+pwid)+1, (
int)wires.size());
67 const int tbeg =
tbins.bin(tcen-twid);
68 const int tend =
tbins.bin(tcen+twid)+1;
77 for (
int ip = pbeg; ip < pend; ++ip) {
78 auto iwire = wires[ip];
79 auto& charge = chch[iwire->channel()];
80 if ((
int)charge.size() < tend) {
81 charge.resize(tend, 0.0);
83 for (
int it = tbeg; it < tend; ++it) {
84 charge[it] +=
std::abs(depo->charge());
93 for (
auto& chchit : chch) {
94 const int chid = chchit.first;
95 auto& chv = chchit.second;
96 auto trace = std::make_shared<SimpleTrace>(chid, 0, chv);
97 traces.push_back(
trace);
std::vector< pointer > vector
Binning tbins(nticks, t0, t0+readout_time)
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Pimpos pimpos(nwires, min_wire_pitch, max_wire_pitch)