28 typename std::vector<T>::iterator fs,
ls;
30 std::vector<std::pair<float, float> > subset;
35 uint16_t
APV = firstAPV;
36 for (;
APV < digis.size() / 128 + firstAPV; ++
APV) {
39 for (uint16_t istrip =
APV * 128; istrip < (
APV + 1) * 128; ++istrip) {
41 std::pair<float, float> pin((
float)digis[istrip - firstAPV * 128],
43 subset.push_back(pin);
54 std::vector<std::pair<float, float> >::iterator si = subset.begin();
55 while (si != subset.end()) {
57 si = subset.erase(si);
69 fs = digis.begin() + (
APV - firstAPV) * 128;
70 ls = digis.begin() + (
APV - firstAPV + 1) * 128;
72 *fs = static_cast<T>(*fs -
offset);
79 std::vector<std::pair<float, float> >::iterator mid =
sample.begin() +
sample.size() / 2;
83 return ((*std::max_element(
sample.begin(), mid)).first + (*mid).first) / 2.;