ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODJetCnv
src
JetCnvAlg.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// JetCnvAlg.cxx
8
// Implementation file for class JetCnvAlg
9
// Author: S.Binet<binet@cern.ch>
11
12
#include "
JetEvent/JetCollection.h
"
13
14
#include "
xAODJet/JetContainer.h
"
15
#include "
xAODJet/JetAuxContainer.h
"
16
17
// #include "xAOD"
18
// #include "Particle/TrackParticleContainer.h"
19
20
// xAODJetCnv includes
21
#include "
JetCnvAlg.h
"
22
23
// STL includes
24
25
// FrameWork includes
26
#include "Gaudi/Property.h"
27
#include "
AthenaKernel/errorcheck.h
"
28
29
31
// Public methods:
33
34
namespace
xAODMaker
{
35
// Constructors
37
JetCnvAlg::JetCnvAlg
(
const
std::string& name,
38
ISvcLocator* pSvcLocator ) :
39
::
AthAlgorithm
( name, pSvcLocator )
40
,
m_inputJetCollectionName
(
"AntiKt4LCTopoJets"
)
41
,
m_xaodJetCollectionName
(
""
)
42
,
m_constitContainerName
(
""
)
43
,
m_cnvTool
(
"xAODMaker::JetCnvTool/JetCnvTool"
)
44
{
45
//
46
// Property declaration
47
//
48
declareProperty
(
"InputJetCollection"
,
m_inputJetCollectionName
);
49
declareProperty
(
"xAODJetContainer"
,
m_xaodJetCollectionName
=
""
);
50
declareProperty
(
"ConstituentContainer"
,
m_constitContainerName
=
""
);
51
declareProperty
(
"JetCnvTool"
,
m_cnvTool
);
52
declareProperty
(
"ConstitSearch"
,
m_constitSearch
=
false
);
53
}
54
55
// Destructor
57
JetCnvAlg::~JetCnvAlg
()
58
{}
59
60
// Athena Algorithm's Hooks
62
StatusCode
JetCnvAlg::initialize
()
63
{
64
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
65
66
if
(
m_xaodJetCollectionName
.empty() )
m_xaodJetCollectionName
=
m_inputJetCollectionName
;
67
68
CHECK
(
m_cnvTool
.retrieve() );
69
70
return
StatusCode::SUCCESS;
71
}
72
73
StatusCode
JetCnvAlg::finalize
()
74
{
75
ATH_MSG_INFO
(
"Finalizing "
<< name() <<
"..."
);
76
return
StatusCode::SUCCESS;
77
}
78
79
80
81
StatusCode
JetCnvAlg::execute
(
const
EventContext&
/*ctx*/
)
82
{
83
ATH_MSG_DEBUG
(
"Executing "
<< name() <<
"..."
);
84
ATH_MSG_DEBUG
(
"Converting "
<<
m_inputJetCollectionName
<<
" into "
<<
m_xaodJetCollectionName
);
85
86
const
JetCollection
* inputJets=
evtStore
()->tryConstRetrieve<
JetCollection
>(
m_inputJetCollectionName
);
87
if
(!inputJets) {
88
ATH_MSG_WARNING
(
"No JetCollection with key "
<<
m_inputJetCollectionName
<<
" found. Do nothing."
);
89
return
StatusCode::SUCCESS;
90
}
91
92
// Create the xAOD container and its auxiliary store:
93
xAOD::JetContainer
* xaodJets =
new
xAOD::JetContainer
();
94
CHECK
(
evtStore
()->record( xaodJets,
m_xaodJetCollectionName
) );
95
xAOD::JetAuxContainer
* auxJets =
new
xAOD::JetAuxContainer
();
96
CHECK
(
evtStore
()->record( auxJets,
m_xaodJetCollectionName
+
"Aux."
) );
97
xaodJets->setStore( auxJets );
98
ATH_MSG_DEBUG
(
"Recorded xAOD jets with key: "
99
<<
m_xaodJetCollectionName
);
100
101
102
DataLink<xAOD::IParticleContainer>
constitContainer (
m_constitContainerName
);
103
if
( !constitContainer )
ATH_MSG_WARNING
(
"User given jet constituent xAOD container : "
<<
m_constitContainerName
<<
" not in SG !"
);
104
105
return
m_cnvTool
->convert(inputJets, xaodJets, constitContainer );
106
107
108
}
109
110
111
}
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
JetAuxContainer.h
JetCnvAlg.h
JetCollection.h
JetContainer.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
DataLink
Object reference supporting deferred reading from StoreGate.
Definition
AthLinks/DataLink.h:93
JetCollection
Definition
JetCollection.h:30
xAODMaker::JetCnvAlg::JetCnvAlg
JetCnvAlg()
Default constructor:
xAODMaker::JetCnvAlg::finalize
virtual StatusCode finalize()
Definition
JetCnvAlg.cxx:73
xAODMaker::JetCnvAlg::m_constitContainerName
std::string m_constitContainerName
Definition
JetCnvAlg.h:68
xAODMaker::JetCnvAlg::execute
virtual StatusCode execute(const EventContext &ctx)
Execute method.
Definition
JetCnvAlg.cxx:81
xAODMaker::JetCnvAlg::m_cnvTool
ToolHandle< IJetCnvTool > m_cnvTool
Definition
JetCnvAlg.h:72
xAODMaker::JetCnvAlg::m_inputJetCollectionName
std::string m_inputJetCollectionName
Containers.
Definition
JetCnvAlg.h:66
xAODMaker::JetCnvAlg::~JetCnvAlg
virtual ~JetCnvAlg()
Destructor:
Definition
JetCnvAlg.cxx:57
xAODMaker::JetCnvAlg::initialize
virtual StatusCode initialize()
Definition
JetCnvAlg.cxx:62
xAODMaker::JetCnvAlg::m_constitSearch
bool m_constitSearch
Definition
JetCnvAlg.h:70
xAODMaker::JetCnvAlg::m_xaodJetCollectionName
std::string m_xaodJetCollectionName
Definition
JetCnvAlg.h:67
xAODMaker
Definition
StoreGateSvc.h:70
xAOD::JetAuxContainer
JetAuxContainer_v1 JetAuxContainer
Definition of the current jet auxiliary container.
Definition
JetAuxContainer.h:22
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0