Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:39

0001 
0002 #include "RecoBTag/FeatureTools/interface/sorting_modules.h"
0003 #include "FWCore/Utilities/interface/Exception.h"
0004 #include <iostream>
0005 
0006 namespace btagbtvdeep {
0007 
0008   std::vector<std::size_t> invertSortingVector(const std::vector<SortingClass<std::size_t> >& in) {
0009     std::size_t max = 0;
0010     for (const auto& s : in) {
0011       if (s.get() > max)
0012         max = s.get();
0013     }
0014 
0015     std::vector<std::size_t> out(max + 1, 0);
0016     for (std::size_t i = 0; i < in.size(); i++) {
0017       out.at(in[i].get()) = i;
0018     }
0019 
0020     return out;
0021   }
0022 
0023 }  // namespace btagbtvdeep