37 {
38
39 std::map<unsigned int, std::pair<double, int> > mean_t0;
40 for (std::map<MuonFixedId, double>::const_iterator it =
m_tube_t0.begin(); it !=
m_tube_t0.end(); ++it) {
42 std::map<unsigned int, std::pair<double, int> >::iterator it2 = mean_t0.find(grp_id);
43 if (it2 == mean_t0.end()) {
44 mean_t0[grp_id] = std::pair<double, int>(
it->second, 1.);
45 } else {
46 it2->second.first +=
it->second;
47 it2->second.second++;
48 }
49 }
50 for (auto & it : mean_t0) {
51 it.second.first /=
it.second.second;
52 }
53
54
56 offsets.clear();
57 for (std::map<MuonFixedId, double>::const_iterator it =
m_tube_t0.begin(); it !=
m_tube_t0.end(); ++it) {
59 offsets[
it->first] =
it->second - mean_t0[grp_id].first;
60 }
61 }
unsigned int get_group_id(const MuonFixedId &id, const MdtRelativeTubeT0::TubeGroup &grp)