ATLAS Offline Software
TriggerBitsMakerTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef TRIGOUTPUTHANDLING_TRIGGERBITSMAKERTOOL_H
5 #define TRIGOUTPUTHANDLING_TRIGGERBITSMAKERTOOL_H
6 
7 #include <string>
12 #include "TrigConfData/HLTMenu.h"
13 
18 class TriggerBitsMakerTool : public extends<AthAlgTool, HLTResultMTMakerTool, ITriggerBitsMakerTool> {
19 public:
20  TriggerBitsMakerTool(const std::string& type, const std::string& name, const IInterface* parent);
21  virtual ~TriggerBitsMakerTool() override = default;
22 
23  virtual StatusCode fill( HLT::HLTResultMT& resultToFill, const EventContext& ctx ) const override;
24 
25  virtual StatusCode getBits(boost::dynamic_bitset<uint32_t>& passRaw,
26  boost::dynamic_bitset<uint32_t>& prescaled,
27  const EventContext& ctx) const override;
28 
29  virtual StatusCode initialize() override;
30  virtual StatusCode start() override;
31 
32 private:
33 
37  StatusCode setBit(const TrigCompositeUtils::DecisionID chain, boost::dynamic_bitset<uint32_t>& resultToFill) const;
38 
42  StatusCode hashConsistencyCheck(const std::string& chain, const size_t hash) const;
43 
47  StatusCode preInsertCheck(const std::string& chain, const uint32_t bit) const;
48 
50  "Container with final chain decisions" };
51 
52  SG::ReadHandleKey<TrigConf::HLTMenu> m_HLTMenuKey{this, "HLTTriggerMenu", "DetectorStore+HLTTriggerMenu", "HLT Menu"};
53 
54  Gaudi::Property<std::map<std::string, uint32_t>> m_extraChainToBit { this, "ExtraChainToBit", {},
55  "Special case and testing purposes hard-coded chain-to-bit mappings to use in addition to those from the HLT menu."};
56 
57  using ChainToBitMap = std::map< TrigCompositeUtils::DecisionID, uint32_t>;
59 
61 };
62 
63 #endif // TRIGOUTPUTHANDLING_TRIGGERBITSMAKERTOOL_H
TriggerBitsMakerTool::preInsertCheck
StatusCode preInsertCheck(const std::string &chain, const uint32_t bit) const
Check that no existing key maps to a given value and that the string is not empty.
Definition: TriggerBitsMakerTool.cxx:59
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition: TrigComposite_v1.h:27
TriggerBitsMakerTool::m_extraChainToBit
Gaudi::Property< std::map< std::string, uint32_t > > m_extraChainToBit
Definition: TriggerBitsMakerTool.h:54
ITriggerBitsMakerTool.h
TrigCompositeUtils.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TriggerBitsMakerTool::m_finalChainDecisions
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_finalChainDecisions
Definition: TriggerBitsMakerTool.h:49
TriggerBitsMakerTool::~TriggerBitsMakerTool
virtual ~TriggerBitsMakerTool() override=default
TriggerBitsMakerTool::m_HLTMenuKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
Definition: TriggerBitsMakerTool.h:52
TriggerBitsMakerTool::ChainToBitMap
std::map< TrigCompositeUtils::DecisionID, uint32_t > ChainToBitMap
Definition: TriggerBitsMakerTool.h:57
TriggerBitsMakerTool::setBit
StatusCode setBit(const TrigCompositeUtils::DecisionID chain, boost::dynamic_bitset< uint32_t > &resultToFill) const
Set to 1 the bit correspinding to 'chain' in 'resultToFill'.
Definition: TriggerBitsMakerTool.cxx:167
HLT::HLTResultMT
A container class for data required to build online output from HLT.
Definition: HLTResultMT.h:38
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
TriggerBitsMakerTool::hashConsistencyCheck
StatusCode hashConsistencyCheck(const std::string &chain, const size_t hash) const
Check that a chain's hash in the menu JSON (via python) agrees with the C++ implementation.
Definition: TriggerBitsMakerTool.cxx:50
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
TriggerBitsMakerTool::start
virtual StatusCode start() override
Definition: TriggerBitsMakerTool.cxx:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
HLTResultMTMakerTool.h
TriggerBitsMakerTool::TriggerBitsMakerTool
TriggerBitsMakerTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TriggerBitsMakerTool.cxx:11
TriggerBitsMakerTool::getBits
virtual StatusCode getBits(boost::dynamic_bitset< uint32_t > &passRaw, boost::dynamic_bitset< uint32_t > &prescaled, const EventContext &ctx) const override
Definition: TriggerBitsMakerTool.cxx:76
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TriggerBitsMakerTool::m_mapping
ChainToBitMap m_mapping
Mapping of each chain's hash ID to its chain counter.
Definition: TriggerBitsMakerTool.h:58
TriggerBitsMakerTool::fill
virtual StatusCode fill(HLT::HLTResultMT &resultToFill, const EventContext &ctx) const override
Definition: TriggerBitsMakerTool.cxx:136
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TriggerBitsMakerTool
Obtains trigger bits from Navigation summary via getBits and (online) fills trigger bits in the HLTRe...
Definition: TriggerBitsMakerTool.h:18
HLTMenu.h
TriggerBitsMakerTool::m_largestBit
uint32_t m_largestBit
Largest chain counter hence largest bit needed to be stored in result bitmap.
Definition: TriggerBitsMakerTool.h:60
TriggerBitsMakerTool::initialize
virtual StatusCode initialize() override
Definition: TriggerBitsMakerTool.cxx:14