ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigConfiguration
TrigConfxAOD
src
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
8
namespace
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
16
StatusCode
KeyWriterTool::initialize
() {
17
ATH_CHECK
(
m_l1PrescaleSetInputKey
.initialize(
m_includeL1PrescaleKey
) );
18
ATH_CHECK
(
m_hltPrescaleSetInputKey
.initialize() );
19
ATH_CHECK
(
m_bgInputKey
.initialize(
m_includeBunchgroupKey
) );
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
42
if
(
m_includeL1PrescaleKey
) {
43
SG::ReadCondHandle<TrigConf::L1PrescalesSet>
l1psRH(
m_l1PrescaleSetInputKey
, ctx);
44
ATH_CHECK
( l1psRH.
isValid
() );
45
const
TrigConf::L1PrescalesSet
* l1PrescaleSet{*l1psRH};
46
l1psk = l1PrescaleSet->
psk
();
47
}
else
{
48
l1psk = 0;
49
}
50
51
SG::ReadCondHandle<TrigConf::HLTPrescalesSet>
hltpsRH(
m_hltPrescaleSetInputKey
, ctx);
52
ATH_CHECK
( hltpsRH.
isValid
() );
53
const
TrigConf::HLTPrescalesSet
* hltPrescaleSet{*hltpsRH};
54
hltpsk = hltPrescaleSet->
psk
();
55
56
SG::ReadHandle<TrigConf::HLTMenu>
hltRH(
m_hltMenuInputKey
, ctx);
57
ATH_CHECK
( hltRH.
isValid
() );
58
smk = hltRH->smk();
59
60
if
(!
m_writeKeys
.empty()) {
61
SG::WriteHandle<xAOD::TrigConfKeys>
writeKeys
(
m_writeKeys
, ctx);
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
71
if
(!
m_includeBunchgroupKey
) {
72
return
StatusCode::SUCCESS;
// Nothing to do
73
}
74
75
SG::ReadCondHandle<TrigConf::L1BunchGroupSet>
bgRH(
m_bgInputKey
, ctx);
76
ATH_CHECK
( bgRH.
isValid
() );
77
const
TrigConf::L1BunchGroupSet
* l1BunchGroupSet{*bgRH};
78
bgk = l1BunchGroupSet->
bgsk
();
79
80
if
(!
m_writeBgKey
.empty()) {
81
SG::WriteHandle<xAOD::BunchConfKey>
writeBgKey(
m_writeBgKey
, ctx);
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
KeyWriterTool.h
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::isValid
bool isValid()
Definition
ReadCondHandle.h:205
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
TrigConf::HLTPrescalesSet
HLT menu configuration.
Definition
HLTPrescalesSet.h:19
TrigConf::HLTPrescalesSet::psk
unsigned int psk() const
setter and getter for the HLT prescale key
Definition
HLTPrescalesSet.cxx:75
TrigConf::KeyWriterTool::m_bgInputKey
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgInputKey
Definition
KeyWriterTool.h:54
TrigConf::KeyWriterTool::m_writeBgKey
SG::WriteHandleKey< xAOD::BunchConfKey > m_writeBgKey
Definition
KeyWriterTool.h:61
TrigConf::KeyWriterTool::m_hltPrescaleSetInputKey
SG::ReadCondHandleKey< TrigConf::HLTPrescalesSet > m_hltPrescaleSetInputKey
Definition
KeyWriterTool.h:53
TrigConf::KeyWriterTool::KeyWriterTool
KeyWriterTool()=delete
TrigConf::KeyWriterTool::m_includeL1PrescaleKey
Gaudi::Property< bool > m_includeL1PrescaleKey
Definition
KeyWriterTool.h:57
TrigConf::KeyWriterTool::writeKeys
virtual StatusCode writeKeys(const EventContext &ctx, uint32_t &smk, uint32_t &l1psk, uint32_t &hltpsk) const final
Definition
KeyWriterTool.cxx:40
TrigConf::KeyWriterTool::m_writeKeys
SG::WriteHandleKey< xAOD::TrigConfKeys > m_writeKeys
Definition
KeyWriterTool.h:60
TrigConf::KeyWriterTool::writeBunchgroupKey
virtual StatusCode writeBunchgroupKey(const EventContext &ctx, uint32_t &bgk) const final
Definition
KeyWriterTool.cxx:69
TrigConf::KeyWriterTool::m_l1PrescaleSetInputKey
SG::ReadCondHandleKey< TrigConf::L1PrescalesSet > m_l1PrescaleSetInputKey
Definition
KeyWriterTool.h:52
TrigConf::KeyWriterTool::m_hltMenuInputKey
SG::ReadHandleKey< TrigConf::HLTMenu > m_hltMenuInputKey
Definition
KeyWriterTool.h:55
TrigConf::KeyWriterTool::m_includeBunchgroupKey
Gaudi::Property< bool > m_includeBunchgroupKey
Definition
KeyWriterTool.h:58
TrigConf::KeyWriterTool::initialize
virtual StatusCode initialize() final
Definition
KeyWriterTool.cxx:16
TrigConf::L1BunchGroupSet
L1 board configuration.
Definition
L1BunchGroupSet.h:71
TrigConf::L1BunchGroupSet::bgsk
unsigned int bgsk() const
setter and getter for the bunch group key
Definition
L1BunchGroupSet.h:95
TrigConf::L1PrescalesSet
L1 menu configuration.
Definition
L1PrescalesSet.h:19
TrigConf::L1PrescalesSet::psk
unsigned int psk() const
setter and getter for the L1 prescale key
Definition
L1PrescalesSet.cxx:44
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
TrigConf
Forward iterator to traverse the main components of the trigger configuration.
Definition
Config.h:22
type
TrigConf::name
Definition
HLTChainList.h:35
Generated on
for ATLAS Offline Software by
1.17.0