 |
ATLAS Offline Software
|
Go to the documentation of this file.
10 #include <nlohmann/json.hpp>
17 const std::string&
name, ISvcLocator* svcloc):
29 return StatusCode::FAILURE;
50 std::map<std::string, uint32_t> fullSeeds;
54 auto addHashKeys = [
this, &fullSeeds](
auto keys) {
57 if (
auto h = fullSeeds.extract(
key.key())) {
58 salt = std::mt19937(
h.mapped())();
65 if (!fullSeeds.empty()) {
66 for (
const auto& [
k,
v]: fullSeeds) {
69 return StatusCode::FAILURE;
73 std::set<std::string> associations;
75 using charmap_t = std::map<std::string,std::vector<std::string>>;
77 for (
const auto& [
k, vlist]: chars.get<charmap_t>()) {
80 if (!associations.count(
key)) {
82 return StatusCode::FAILURE;
84 for (
const auto&
v: vlist) {
86 salt = std::mt19937(
h.mapped())();
95 return StatusCode::FAILURE;
98 return StatusCode::SUCCESS;
107 auto hjetint =
m_jetInts.makeHandles(cxt);
112 auto getSalt = [
this, event_hash](
const auto& handle) {
113 return this->
m_hashedKeys.at(handle.decorKey()) ^ event_hash;
115 for (
const auto*
jet: *hhash) {
117 for (
const auto& assoc: hjetassoc) {
118 const auto& iplc = assoc(*
jet);
119 jet_hash ^= std::mt19937( iplc.size() ^ getSalt(assoc))();
120 if (
m_chars.count(assoc.decorKey())) {
121 for (
const auto& [salt,
acc]:
m_chars.at(assoc.decorKey())) {
122 unsigned int count = 0;
123 for (
const auto& lnk: iplc)
count +=
acc(**lnk);
124 jet_hash ^= std::mt19937(
count ^ salt ^ event_hash)();
128 for (
const auto& hint: hjetint) {
129 jet_hash ^= std::mt19937( hint(*
jet) ^ getSalt(hint))();
131 hhash(*
jet) = event_hash ^ jet_hash;
133 return StatusCode::SUCCESS;
This file contains "getter" functions used for accessing tagger inputs from the EDM.
SG::ReadDecorHandleKeyArray< JC, IPLV > m_jetAssociations
Gaudi::Property< std::string > m_jetCollection
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
void renounceArray(SG::VarHandleKeyArray &handlesArray)
remove all handles from I/O resolution
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteDecorHandleKey< JC > m_hashKey
virtual StatusCode initialize() override
Handle class for reading a decoration on an object.
SG::ReadDecorHandleKeyArray< JC, int > m_jetInts
std::unordered_map< std::string, uint32_t > m_hashedKeys
Gaudi::Property< uint32_t > m_salt
Gaudi::Property< std::map< std::string, uint32_t > > m_constituentSeeds
::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.
FoldDecoratorAlg(const std::string &name, ISvcLocator *svcloc)
std::unordered_map< std::string, std::vector< SaltedCReader > > m_chars
SG::ReadDecorHandleKey< xAOD::EventInfo > m_mcEventNumberKey
Handle class for reading a decoration on an object.
Gaudi::Property< std::string > m_constituentChars
Gaudi::Property< std::map< std::string, uint32_t > > m_jetVarSeeds
virtual StatusCode execute(const EventContext &cxt) const override