tbisanz

Untitled

Jun 17th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. if( m_existingMetaDataChan.insert(mcChannelNumber).second )
  2. {
  3.   xAOD::TruthMetaData* md = new xAOD::TruthMetaData();
  4.   m_tmd->push_back( md );
  5.  
  6.   auto weightNameMap = genEvt->m_weights.m_names;
  7.  
  8.   std::vector<std::string> orderedWeightNameVec( weightNameMap.size() );
  9.  
  10.   for (auto& weightNameMap: entry) {
  11.     orderedWeightNameVec.push_back(entry.first);
  12.   }
  13.  
  14.   //The map from the HepMC record pairs the weight names with a corresponding index,
  15.   //it is not guaranteed that the indices are ascending when iterating over the map
  16.   std::sort(orderedWeightNameVec.begin(), orderedWeightNameVec.end(),
  17.   [&](std::string i, std::string j){return weightNameMap.at(i) < weightNameMap.at(j);});
  18.    
  19.   md->setMcChannelNumber(mcChannelNumber);
  20.   md->setWeightNames( std::move(orderedWeightNameVec) );
  21. }
Advertisement
Add Comment
Please, Sign In to add comment