ATLAS Offline Software
hash.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Common file for a few small hashing helpers to store things in
6 // std::unordered_*
7 
8 #ifndef FTAG_HASH_H
9 #define FTAG_HASH_H
10 
11 namespace FlavorTagDiscriminants {
12  template<typename T>
13  std::size_t getHash(const T& obj) {
14  return std::hash<T>{}(obj);
15  }
16 
17  // stolen from https://stackoverflow.com/a/27952689
18  //
19  // it doesn't have to be good, this isn't called much
20  //
21  inline size_t combine( size_t lhs, size_t rhs ) {
22  lhs ^= rhs + 0x517cc1b727220a95 + (lhs << 6) + (lhs >> 2);
23  return lhs;
24  }
25 }
26 
27 #endif
FlavorTagDiscriminants
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: AssociationEnums.h:11
FlavorTagDiscriminants::combine
size_t combine(size_t lhs, size_t rhs)
Definition: hash.h:21
FlavorTagDiscriminants::getHash
std::size_t getHash(const T &obj)
Definition: hash.h:13
python.PyAthena.obj
obj
Definition: PyAthena.py:132