![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include <nlohmann/json.hpp>
17 const std::string&
name, ISvcLocator* svcloc):
27 return StatusCode::FAILURE;
43 std::map<std::string, uint32_t> fullSeeds;
47 auto addHashKeys = [
this, &fullSeeds](
auto keys) {
50 if (
auto h = fullSeeds.extract(
key.key())) {
51 salt = std::mt19937(
h.mapped())();
58 if (!fullSeeds.empty()) {
59 for (
const auto& [
k,
v]: fullSeeds) {
62 return StatusCode::FAILURE;
66 std::set<std::string> associations;
68 using charmap_t = std::map<std::string,std::vector<std::string>>;
70 for (
const auto& [
k, vlist]: chars.get<charmap_t>()) {
73 if (!associations.count(
key)) {
75 return StatusCode::FAILURE;
77 for (
const auto&
v: vlist) {
79 salt = std::mt19937(
h.mapped())();
88 return StatusCode::FAILURE;
91 return StatusCode::SUCCESS;
100 auto hjetint =
m_jetInts.makeHandles(cxt);
105 auto getSalt = [
this, event_hash](
const auto& handle) {
106 return this->
m_hashedKeys.at(handle.decorKey()) ^ event_hash;
108 for (
const auto*
jet: *hhash) {
110 for (
const auto& assoc: hjetassoc) {
111 const auto& iplc = assoc(*
jet);
112 jet_hash ^= std::mt19937( iplc.size() ^ getSalt(assoc))();
113 if (
m_chars.count(assoc.decorKey())) {
114 for (
const auto& [salt,
acc]:
m_chars.at(assoc.decorKey())) {
115 unsigned int count = 0;
116 for (
const auto& lnk: iplc)
count +=
acc(**lnk);
117 jet_hash ^= std::mt19937(
count ^ salt ^ event_hash)();
121 for (
const auto& hint: hjetint) {
122 jet_hash ^= std::mt19937( hint(*
jet) ^ getSalt(hint))();
124 hhash(*
jet) = event_hash ^ jet_hash;
126 return StatusCode::SUCCESS;
virtual StatusCode initialize() override
std::unordered_map< std::string, std::vector< SaltedCReader > > m_chars
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Gaudi::Property< std::map< std::string, uint32_t > > m_jetVarSeeds
FoldDecoratorAlg(const std::string &name, ISvcLocator *svcloc)
SG::WriteDecorHandleKey< JC > m_hashKey
An algorithm that can be simultaneously executed in multiple threads.
Gaudi::Property< uint32_t > m_salt
std::unordered_map< std::string, uint32_t > m_hashedKeys
Handle class for reading a decoration on an object.
::StatusCode StatusCode
StatusCode definition for legacy code.
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
Gaudi::Property< std::string > m_jetCollection
SG::ReadDecorHandleKeyArray< JC, IPLV > m_jetAssociations
Gaudi::Property< std::map< std::string, uint32_t > > m_constituentSeeds
SG::ReadDecorHandleKey< xAOD::EventInfo > m_mcEventNumberKey
Gaudi::Property< std::string > m_constituentChars
Handle class for reading a decoration on an object.
SG::ReadDecorHandleKeyArray< JC, int > m_jetInts
virtual StatusCode execute(const EventContext &cxt) const override