9 {
10 auto hits = composite_pulse_.
hits();
11
12 std::ranges::sort(
13 hits.begin(), hits.end(),
14 [](const std::pair<double, double> &a,
15 const std::pair<double, double> &b) { return a.second < b.second; });
16 double starttime = hits.at(0).second - 100;
17 double endtime = hits.at(hits.size() - 1).second + 200;
18
19 double peak = -9999.0;
20 for (int i = 0; i < 100; i++) {
21 double time = starttime + (endtime - starttime) / 100.0 * i;
22 double v = composite_pulse_.
at(time);
23 if (v > peak) peak = v;
24 }
25
26 return peak;
27}
const std::vector< std::pair< double, double > > & hits() const
Get list of individual pulses that are entering the chip.
double at(double time) const
Measure the voltage at the input time.