ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigMonitoring
TrigJetMonitoring
src
L1JetCopyAlgorithm.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
TrigJetMonitoring/L1JetCopyAlgorithm.h
"
5
#include "
xAODCore/ShallowCopy.h
"
6
#include "
xAODCore/AuxContainerBase.h
"
7
8
//**********************************************************************
9
10
template
<
typename
T>
11
L1JetCopyAlgorithm<T>::L1JetCopyAlgorithm
(
const
std::string& name, ISvcLocator* pSvcLocator ) :
AthReentrantAlgorithm
(name,pSvcLocator){
12
declareProperty
(
"JetInContainerName"
,
m_jetInContainerKey
=
""
);
13
declareProperty
(
"JetOutContainerName"
,
m_jetOutContainerKey
=
""
);
14
}
15
16
template
<
typename
T>
17
StatusCode
L1JetCopyAlgorithm<T>::initialize
() {
18
19
ATH_MSG_INFO
(
" Initializing "
<< name());
20
ATH_CHECK
(
m_jetInContainerKey
.initialize() );
21
ATH_CHECK
(
m_jetOutContainerKey
.initialize() );
22
23
return
StatusCode::SUCCESS;
24
}
25
26
template
<
typename
T>
27
StatusCode
L1JetCopyAlgorithm<T>::finalize
() {
28
ATH_MSG_INFO
(
"Finalizing "
<< name());
29
return
StatusCode::SUCCESS;
30
}
31
32
//**********************************************************************
33
34
template
<
typename
T>
35
StatusCode
L1JetCopyAlgorithm<T>::execute
(
const
EventContext& ctx)
const
{
36
SG::ReadHandle<JetContainer>
inputJetsHandle(
m_jetInContainerKey
, ctx);
// read handle
37
if
(!inputJetsHandle.
isValid
() ) {
38
ATH_MSG_ERROR
(
"evtStore() does not contain jet Collection with name "
<<
m_jetInContainerKey
);
39
return
StatusCode::FAILURE;
40
}
41
42
ATH_MSG_DEBUG
(
"Shallow-copying "
<<
m_jetInContainerKey
);
43
SG::WriteHandle<JetContainer>
jetsOut(
m_jetOutContainerKey
,ctx);
44
45
auto
[copiedjets, shallowaux] =
xAOD::shallowCopy
(*inputJetsHandle, ctx);
46
47
if
(copiedjets.get() ==
nullptr
|| shallowaux.get() ==
nullptr
) {
48
ATH_MSG_ERROR
(
"Failed to make shallow copy of "
<<
m_jetInContainerKey
<<
"."
);
49
return
StatusCode::FAILURE;
50
}
51
ATH_CHECK
( jetsOut.
record
(std::move(copiedjets), std::move(shallowaux)) );
52
53
return
StatusCode::SUCCESS;
54
}
55
56
template
class
L1JetCopyAlgorithm<JTM_JetRoIContainer>
;
57
template
class
L1JetCopyAlgorithm<JTM_gFexJetRoIContainer>
;
58
template
class
L1JetCopyAlgorithm<JTM_jFexLRJetRoIContainer>
;
59
template
class
L1JetCopyAlgorithm<JTM_jFexSRJetRoIContainer>
;
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AuxContainerBase.h
L1JetCopyAlgorithm.h
ShallowCopy.h
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
L1JetCopyAlgorithm
Definition
L1JetCopyAlgorithm.h:15
L1JetCopyAlgorithm::initialize
StatusCode initialize() override
Definition
L1JetCopyAlgorithm.cxx:17
L1JetCopyAlgorithm::m_jetInContainerKey
SG::ReadHandleKey< JetContainer > m_jetInContainerKey
Definition
L1JetCopyAlgorithm.h:29
L1JetCopyAlgorithm::execute
StatusCode execute(const EventContext &ctx) const override
Definition
L1JetCopyAlgorithm.cxx:35
L1JetCopyAlgorithm::finalize
StatusCode finalize() override
Definition
L1JetCopyAlgorithm.cxx:27
L1JetCopyAlgorithm::L1JetCopyAlgorithm
L1JetCopyAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition
L1JetCopyAlgorithm.cxx:11
L1JetCopyAlgorithm::m_jetOutContainerKey
SG::WriteHandleKey< JetContainer > m_jetOutContainerKey
Definition
L1JetCopyAlgorithm.h:30
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.
xAOD::shallowCopy
ShallowCopyResult_t< T > shallowCopy(const T &cont, const EventContext &ctx)
Create a shallow copy of an existing container.
Generated on
for ATLAS Offline Software by
1.17.0