35 typename std::vector<T>::iterator fs,
ls;
37 std::vector<std::pair<float, float> > subset;
42 uint16_t
APV = firstAPV;
43 for (;
APV < digis.size() / 128 + firstAPV; ++
APV) {
46 for (uint16_t istrip =
APV * 128; istrip < (
APV + 1) * 128; ++istrip) {
48 std::pair<float, float> pin((
float)digis[istrip - firstAPV * 128],
50 subset.push_back(pin);
61 std::vector<std::pair<float, float> >::iterator si = subset.begin();
62 while (si != subset.end()) {
64 si = subset.erase(si);
76 fs = digis.begin() + (
APV - firstAPV) * 128;
77 ls = digis.begin() + (
APV - firstAPV + 1) * 128;
79 *fs = static_cast<T>(*fs -
offset);
86 std::vector<std::pair<float, float> >::iterator mid =
sample.begin() +
sample.size() / 2;
90 return ((*std::max_element(
sample.begin(), mid)).first + (*mid).first) / 2.;