ATLAS Offline Software
FoldDecoratorAlg.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 #ifndef FOLD_DECORATOR_ALG_H
6 #define FOLD_DECORATOR_ALG_H
7 
9 
13 
15 #include "xAODJet/JetContainer.h"
16 
17 namespace FlavorTagInference {
18 
20  {
21  public:
22  FoldDecoratorAlg(const std::string& name, ISvcLocator* svcloc);
23  virtual StatusCode initialize() override;
24  virtual StatusCode execute(const EventContext& cxt) const override;
25  // virtual StatusCode finalize() override;
26  protected:
27  using IPLV = std::vector<ElementLink<xAOD::IParticleContainer>>;
30  this, "eventID", "EventInfo.mcEventNumber", "event number key"
31  };
32  Gaudi::Property<uint32_t> m_salt {
33  this, "salt", 0, "hash salt, bitwise or-ed with the eventID"
34  };
35  Gaudi::Property<std::string> m_jetCollection {
36  this, "jetCollection", "", "name of jet collection"
37  };
39  this, "associations", {}, "jet accociation counts to use in hash"
40  };
42  this, "ints", {}, "jet ints to use in hash"
43  };
45  this, "jetFoldHash", "unofficialJetFoldHash", "name for jet fold hash"
46  };
47  Gaudi::Property<std::map<std::string, uint32_t>> m_jetVarSeeds {
48  this, "jetVariableSaltSeeds", {}, "salt jet variables using the these"
49  };
50  Gaudi::Property<std::string> m_constituentChars {
51  this, "constituentChars", "{}", "char variables to use off constituents"
52  };
53  Gaudi::Property<std::map<std::string, uint32_t>> m_constituentSeeds {
54  this, "constituentSaltSeeds", {}, "salts for constituent varaibles"
55  };
56 
57  // todo, use something more efficient than a string-keyed map here
58  std::unordered_map<std::string, uint32_t> m_hashedKeys;
59 
61  using SaltedCReader = std::pair<uint32_t, CharReader>;
62  std::unordered_map<std::string, std::vector<SaltedCReader>> m_chars;
63  };
64 
65 }
66 #endif
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: AssociationEnums.h:11
FlavorTagInference::FoldDecoratorAlg::IPLV
std::vector< ElementLink< xAOD::IParticleContainer > > IPLV
Definition: FoldDecoratorAlg.h:27
FlavorTagInference::FoldDecoratorAlg::m_jetAssociations
SG::ReadDecorHandleKeyArray< JC, IPLV > m_jetAssociations
Definition: FoldDecoratorAlg.h:38
FlavorTagInference::FoldDecoratorAlg::m_jetCollection
Gaudi::Property< std::string > m_jetCollection
Definition: FoldDecoratorAlg.h:35
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
FlavorTagInference::FoldDecoratorAlg::SaltedCReader
std::pair< uint32_t, CharReader > SaltedCReader
Definition: FoldDecoratorAlg.h:61
FlavorTagInference::FoldDecoratorAlg::m_hashKey
SG::WriteDecorHandleKey< JC > m_hashKey
Definition: FoldDecoratorAlg.h:44
FlavorTagInference::FoldDecoratorAlg
Definition: FoldDecoratorAlg.h:20
FlavorTagInference::FoldDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition: FoldDecoratorAlg.cxx:22
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
FlavorTagInference::FoldDecoratorAlg::m_jetInts
SG::ReadDecorHandleKeyArray< JC, int > m_jetInts
Definition: FoldDecoratorAlg.h:41
FlavorTagInference::FoldDecoratorAlg::m_hashedKeys
std::unordered_map< std::string, uint32_t > m_hashedKeys
Definition: FoldDecoratorAlg.h:58
FlavorTagInference::FoldDecoratorAlg::m_salt
Gaudi::Property< uint32_t > m_salt
Definition: FoldDecoratorAlg.h:32
FlavorTagInference::FoldDecoratorAlg::m_constituentSeeds
Gaudi::Property< std::map< std::string, uint32_t > > m_constituentSeeds
Definition: FoldDecoratorAlg.h:53
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
AthReentrantAlgorithm.h
FlavorTagInference::FoldDecoratorAlg::FoldDecoratorAlg
FoldDecoratorAlg(const std::string &name, ISvcLocator *svcloc)
Definition: FoldDecoratorAlg.cxx:16
FlavorTagInference::FoldDecoratorAlg::m_chars
std::unordered_map< std::string, std::vector< SaltedCReader > > m_chars
Definition: FoldDecoratorAlg.h:62
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
EventInfo.h
JetContainer.h
FlavorTagInference::FoldDecoratorAlg::m_mcEventNumberKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_mcEventNumberKey
Definition: FoldDecoratorAlg.h:29
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition: JetContainer.h:17
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
FlavorTagInference::FoldDecoratorAlg::m_constituentChars
Gaudi::Property< std::string > m_constituentChars
Definition: FoldDecoratorAlg.h:50
ReadDecorHandleKeyArray.h
FlavorTagInference::FoldDecoratorAlg::m_jetVarSeeds
Gaudi::Property< std::map< std::string, uint32_t > > m_jetVarSeeds
Definition: FoldDecoratorAlg.h:47
FlavorTagInference::FoldDecoratorAlg::execute
virtual StatusCode execute(const EventContext &cxt) const override
Definition: FoldDecoratorAlg.cxx:101