CMS 3D CMS Logo

L1TUtmTriggerMenu.cc
Go to the documentation of this file.
1 // auto-generated file by import_utm.pl
3 
4 //copied from tmUtil
5 const unsigned long L1TUtmTriggerMenu::getFirmwareUuidHashed() const {
6  const void* key = getFirmwareUuid().c_str();
7  int len = getFirmwareUuid().size();
8  unsigned int seed = 3735927486;
9  return murmurHashNeutral2(key, len, seed);
10 }
11 
12 //copied from tmUtil
13 unsigned long L1TUtmTriggerMenu::murmurHashNeutral2(const void* key, int len, unsigned int seed) {
14  // 'm' and 'r' are mixing constants generated offline.
15  // They're not really 'magic', they just happen to work well.
16 
17  const unsigned int m = 0x5bd1e995;
18  const int r = 24;
19 
20  // Initialize the hash to a 'random' value
21 
22  unsigned int h = seed ^ len;
23 
24  // Mix 4 bytes at a time into the hash
25 
26  const unsigned char* data = (const unsigned char*)key;
27 
28  while (len >= 4) {
29  unsigned int k;
30 
31  k = data[0];
32  k |= data[1] << 8;
33  k |= data[2] << 16;
34  k |= data[3] << 24;
35 
36  k *= m;
37  k ^= k >> r;
38  k *= m;
39 
40  h *= m;
41  h ^= k;
42 
43  data += 4;
44  len -= 4;
45  }
46 
47  // Handle the last few bytes of the input array
48 
49  switch (len) {
50  case 3:
51  h ^= data[2] << 16;
52  [[fallthrough]];
53  case 2:
54  h ^= data[1] << 8;
55  [[fallthrough]];
56  case 1:
57  h ^= data[0];
58  h *= m;
59  };
60 
61  // Do a few final mixes of the hash to ensure the last few
62  // bytes are well-incorporated.
63 
64  h ^= h >> 13;
65  h *= m;
66  h ^= h >> 15;
67 
68  return h;
69 }
static unsigned long murmurHashNeutral2(const void *key, int len, unsigned int seed)
key
prepare the HTCondor submission files and eventually submit them
const std::string & getFirmwareUuid() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const unsigned long getFirmwareUuidHashed() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4