ATLAS Offline Software
Loading...
Searching...
No Matches
TrigConfMD5.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "./TrigConfMD5.h"
6
7#include <sstream>
8
9#include "CxxUtils/MD5.h"
10
11namespace TrigConf {
12
13 uint32_t doTruncatedHash(const std::stringstream& ss) {
14 MD5 md5(ss.str());
15 const std::string truncated_hash_hex = md5.hex_digest().substr(0, 8); // Of 32
16 std::stringstream hex_to_int;
17 uint32_t truncated_hash_int = 0;
18 hex_to_int << std::hex << truncated_hash_hex;
19 hex_to_int >> truncated_hash_int;
20 return truncated_hash_int;
21 }
22
23 uint32_t truncatedHash(const DataStructure& dataStructure) {
24 std::stringstream ss;
25 dataStructure.printRaw(ss);
26 return doTruncatedHash(ss);
27 }
28
29
30 uint32_t truncatedHash(const TrigConf::L1Menu& L1DataStructure, const TrigConf::HLTMenu& HLTDataStructure) {
31 std::stringstream ss1;
32 L1DataStructure.printRaw(ss1);
33 std::stringstream ss2;
34 HLTDataStructure.printRaw(ss2);
35 std::stringstream ss_concatonate;
36 ss_concatonate << ss2.str() << ss1.str();
37 return doTruncatedHash(ss_concatonate);
38 }
39
40
41}
static Double_t ss
solar's public-domain MD5, wrapped for C++.
Definition MD5.h:20
std::string hex_digest() const
Definition MD5.cxx:94
Base class for Trigger configuration data and wrapper around underlying representation.
void printRaw(std::ostream &os=std::cout) const
HLT menu configuration.
Definition HLTMenu.h:21
L1 menu configuration.
Definition L1Menu.h:28
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22
uint32_t truncatedHash(const DataStructure &dataStructure)
Function to compute a truncated MD5 hash for a JSON file.
uint32_t doTruncatedHash(const std::stringstream &ss)