Fix mappings in nnpdfsettings parsing
Created by: Zaharid
In nnpdfsettings.h, we have mappings like:
map<int,DataSetInfo> fDataSetInfo; //!< Contains the dataset info
map<int, PosSetInfo> fPosSetInfo; //!< Map of PosSetInfo structs
which are constructed like:
// Generate hash of setname
std::hash<std::string> str_hash;
const size_t hashval = str_hash(setname);
DataSetInfo info = {setname, setsys, setfrac, cfactors};
map<int,DataSetInfo>::const_iterator iMap = fDataSetInfo.find(hashval);
if (iMap != fDataSetInfo.end()) { cerr << Colour::FG_RED << "NNPDFSettings::LoadExperiments error: hash collision for set: " << setname << Colour::FG_DEFAULT << endl; exit(-1); }
else { fDataSetInfo.insert(make_pair(hashval, info)); }
nsetname.push_back(setname);
fSetName.push_back(setname);
which is a bit silly. It overcomplicated, as we can just as well have map<string, Type>
, and we don't need to check for hash collisions, since maps can work anyway.