ATLAS Offline Software
Loading...
Searching...
No Matches
KeyWriterTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4#include "KeyWriterTool.h"
5
6#include <limits>
7
8namespace TrigConf {
9
10 KeyWriterTool::KeyWriterTool( const std::string& type,
11 const std::string& name,
12 const IInterface* parent ) :
13 base_class(type, name, parent)
14 {}
15
18 ATH_CHECK( m_hltPrescaleSetInputKey.initialize() );
20 ATH_CHECK( m_hltMenuInputKey.initialize() );
21 renounce(m_hltMenuInputKey); // This is DetStore
22
23 if (not m_includeBunchgroupKey) {
24 m_writeBgKey = "";
25 }
26
27 ATH_CHECK( m_writeKeys.initialize( SG::AllowEmpty ) );
28 ATH_CHECK( m_writeBgKey.initialize( SG::AllowEmpty ) );
29
30 return StatusCode::SUCCESS;
31 }
32
33
34 StatusCode KeyWriterTool::writeKeys(const EventContext& ctx) const {
35 uint32_t a, b, c; // Unused
36 return writeKeys(ctx, a, b, c);
37 }
38
39
40 StatusCode KeyWriterTool::writeKeys(const EventContext& ctx, uint32_t&smk, uint32_t& l1psk, uint32_t& hltpsk) const {
41
44 ATH_CHECK( l1psRH.isValid() );
45 const TrigConf::L1PrescalesSet* l1PrescaleSet{*l1psRH};
46 l1psk = l1PrescaleSet->psk();
47 } else {
48 l1psk = 0;
49 }
50
52 ATH_CHECK( hltpsRH.isValid() );
53 const TrigConf::HLTPrescalesSet* hltPrescaleSet{*hltpsRH};
54 hltpsk = hltPrescaleSet->psk();
55
57 ATH_CHECK( hltRH.isValid() );
58 smk = hltRH->smk();
59
60 if (!m_writeKeys.empty()) {
62 ATH_CHECK( writeKeys.record( std::make_unique<xAOD::TrigConfKeys>(smk, l1psk, hltpsk) ) );
63 }
64
65 return StatusCode::SUCCESS;
66 }
67
68
69 StatusCode KeyWriterTool::writeBunchgroupKey(const EventContext& ctx, uint32_t&bgk) const {
70
72 return StatusCode::SUCCESS; // Nothing to do
73 }
74
76 ATH_CHECK( bgRH.isValid() );
77 const TrigConf::L1BunchGroupSet* l1BunchGroupSet{*bgRH};
78 bgk = l1BunchGroupSet->bgsk();
79
80 if (!m_writeBgKey.empty()) {
82 ATH_CHECK( writeBgKey.record( std::make_unique<xAOD::BunchConfKey>(bgk) ) );
83 }
84
85 return StatusCode::SUCCESS;
86 }
87
88
89 StatusCode KeyWriterTool::writeBunchgroupKey(const EventContext& ctx) const {
90 uint32_t a; // Unused
91 return writeBunchgroupKey(ctx, a);
92 }
93
94}
#define ATH_CHECK
Evaluate an expression and check for errors.
static Double_t a
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
HLT menu configuration.
unsigned int psk() const
setter and getter for the HLT prescale key
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgInputKey
SG::WriteHandleKey< xAOD::BunchConfKey > m_writeBgKey
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet > m_hltPrescaleSetInputKey
Gaudi::Property< bool > m_includeL1PrescaleKey
virtual StatusCode writeKeys(const EventContext &ctx, uint32_t &smk, uint32_t &l1psk, uint32_t &hltpsk) const final
SG::WriteHandleKey< xAOD::TrigConfKeys > m_writeKeys
virtual StatusCode writeBunchgroupKey(const EventContext &ctx, uint32_t &bgk) const final
SG::ReadCondHandleKey< TrigConf::L1PrescalesSet > m_l1PrescaleSetInputKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_hltMenuInputKey
Gaudi::Property< bool > m_includeBunchgroupKey
virtual StatusCode initialize() final
L1 board configuration.
unsigned int bgsk() const
setter and getter for the bunch group key
L1 menu configuration.
unsigned int psk() const
setter and getter for the L1 prescale key
Forward iterator to traverse the main components of the trigger configuration.
Definition Config.h:22