23 const double pitch_range =
m_pir->pitch_range();
28 const double wire_pos = rb.
center(iwire);
30 const int min_impact = ib.edge_index(wire_pos - 0.5*pitch_range);
31 const int max_impact = ib.edge_index(wire_pos + 0.5*pitch_range);
37 const bool share=
true;
42 for (
int imp = min_impact; imp <= max_impact; ++imp) {
57 if (charge_spectrum.empty()) {
59 std::cerr <<
"ImpactZipper: no charge for absolute impact number: " << imp <<
std::endl;
62 if (weightcharge_spectrum.empty()) {
64 std::cerr <<
"ImpactZipper: no weight charge for absolute impact number: " << imp <<
std::endl;
68 const double imp_pos = ib.center(imp);
69 const double rel_imp_pos = imp_pos - wire_pos;
75 if (!two_ir.first || !two_ir.second) {
83 for (
int ind=0; ind < nsamples; ++ind) {
87 conv_spectrum[ind] = weightcharge_spectrum[ind]*rs1[ind]+(charge_spectrum[ind]-weightcharge_spectrum[ind])*rs2[ind];
100 auto ir =
m_pir->closest(rel_imp_pos);
106 for (
int ind=0; ind < nsamples; ++ind) {
107 conv_spectrum[ind] = response_spectrum[ind]*charge_spectrum[ind];
double center(int ind) const
const Binning & region_binning() const
void erase(int begin_impact_index, int end_impact_index)
IPlaneImpactResponse::pointer m_pir
const Binning & impact_binning() const
std::pair< IImpactResponse::pointer, IImpactResponse::pointer > TwoImpactResponses
const Pimpos & pimpos() const
std::shared_ptr< Interface > pointer
ImpactData::pointer impact_data(int bin) const
Pimpos pimpos(nwires, min_wire_pitch, max_wire_pitch)
const Binning & tbins() const
Waveform::realseq_t waveform(int wire) const
QTextStream & endl(QTextStream &s)