Follow-up from "add functional decoding of Muon system"
The following discussions from !1611 (merged) should be addressed:
-
@graven started a discussion: (+1 comment) that's not the correct size -- as it happens to be 14 all the time... you need something like:
decoding.reserve( std::accumulate( m_decoding.begin(), m_decoding.end(), 0, [](int s, const auto& v) { return s+v.size(); } ) );
-
@graven started a discussion: (+1 comment) Given that
std::sort
can be expensive, is there already some pre-defined ordering in the data? Eg. is it possible to assume that in any given raw bank, all the hits are from the same station, and thus one could figure out station contributes to which raw banks, and then already take that into account when doing the flattening on lines 114-119, and then one only has to sort for regions within each station, significantly partitioning the problem, and thus making it faster... -
@graven started a discussion: (+1 comment) it would be good to reserve the right amount of storage here:
auto computeSize = [](const unsigned int* it) { unsigned N = 0 for (int i=0;i<4;++i) auto M = *it++; it+=M; N+=M; } return N; } storage.reserve( computeSize(it) );
or use what looks like a small overestimate:
storage.reserve( rawdata->range<unsigned short>().size() );