Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if( m_existingMetaDataChan.insert(mcChannelNumber).second )
- {
- xAOD::TruthMetaData* md = new xAOD::TruthMetaData();
- m_tmd->push_back( md );
- auto weightNameMap = genEvt->m_weights.m_names;
- std::vector<std::string> orderedWeightNameVec( weightNameMap.size() );
- for (auto& weightNameMap: entry) {
- orderedWeightNameVec.push_back(entry.first);
- }
- //The map from the HepMC record pairs the weight names with a corresponding index,
- //it is not guaranteed that the indices are ascending when iterating over the map
- std::sort(orderedWeightNameVec.begin(), orderedWeightNameVec.end(),
- [&](std::string i, std::string j){return weightNameMap.at(i) < weightNameMap.at(j);});
- md->setMcChannelNumber(mcChannelNumber);
- md->setWeightNames( std::move(orderedWeightNameVec) );
- }
Advertisement
Add Comment
Please, Sign In to add comment