File indexing completed on 2024-04-06 12:24:47
0001 #ifndef RecoEgamma_EgammaElectronAlgos_utils_h
0002 #define RecoEgamma_EgammaElectronAlgos_utils_h
0003
0004 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
0005
0006 #include <unordered_map>
0007 #include <cstring>
0008
0009 struct HashIntGlobalPointPair {
0010 inline std::size_t operator()(std::pair<int, GlobalPoint> const& g) const {
0011 auto h1 = std::hash<unsigned long long>()((unsigned long long)g.first);
0012 unsigned long long k;
0013 memcpy(&k, &g.second, sizeof(k));
0014 auto h2 = std::hash<unsigned long long>()(k);
0015 return h1 ^ (h2 << 1);
0016 }
0017 };
0018
0019 template <class T>
0020 using IntGlobalPointPairUnorderedMap = std::unordered_map<std::pair<int, GlobalPoint>, T, HashIntGlobalPointPair>;
0021
0022 #endif