ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
TrackCaloClusterRec
TrackCaloClusterRecAlgs
src
TrackCaloClusterAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// TrackCaloClusterAlgs includes
6
#include "
TrackCaloClusterRecAlgs/TrackCaloClusterAlg.h
"
7
8
#include "
TrkParametersIdentificationHelpers/TrackParametersIdHelper.h
"
9
#include "
AtlasDetDescr/AtlasDetectorID.h
"
10
11
#include "
xAODPFlow/TrackCaloClusterAuxContainer.h
"
12
#include "
xAODPFlow/FlowElementContainer.h
"
13
#include "
xAODPFlow/FlowElementAuxContainer.h
"
14
15
#include "
StoreGate/ReadDecorHandle.h
"
16
#include "
StoreGate/WriteDecorHandle.h
"
17
18
19
20
TrackCaloClusterAlg::TrackCaloClusterAlg
(
const
std::string& name, ISvcLocator* pSvcLocator ) :
21
AthAlgorithm
( name, pSvcLocator ) { }
22
23
24
// *****************************************************
25
StatusCode
TrackCaloClusterAlg::initialize
() {
26
ATH_MSG_INFO
(
"Initializing "
<< name() <<
"..."
);
27
ATH_CHECK
(
m_tccTools
.retrieve());
28
ATH_MSG_VERBOSE
(
"TCCAlg::init got tcc tools"
);
29
ATH_CHECK
(
m_tccInfoHandle
.initialize());
30
ATH_MSG_VERBOSE
(
"TCCAlg::init got tcc info handle"
);
31
ATH_CHECK
(
m_outputTCCHandle
.initialize());
32
ATH_MSG_VERBOSE
(
"TCCAlg::init got output tcc handle"
);
33
ATH_CHECK
(
m_copiedTCCHandle
.initialize(!
m_copiedTCCHandle
.empty()) );
34
ATH_MSG_VERBOSE
(
"TCCAlg::init got copied tcc handle"
);
35
return
StatusCode::SUCCESS;
36
}
37
38
// *****************************************************
39
StatusCode
TrackCaloClusterAlg::execute
(
const
EventContext& ctx) {
40
ATH_MSG_DEBUG
(
"Executing "
<< name() <<
"..."
);
41
42
SG::ReadHandle<TrackCaloClusterInfo>
tccInfo(
m_tccInfoHandle
, ctx);
43
44
// Create containers
45
SG::WriteHandle<xAOD::FlowElementContainer>
tccContainer(
m_outputTCCHandle
, ctx) ;
46
ATH_CHECK
( tccContainer.
record
(std::make_unique<xAOD::FlowElementContainer>(),
47
std::make_unique<xAOD::FlowElementAuxContainer>()) );
48
ATH_MSG_DEBUG
(
"Recorded TrackCaloClusterContainer with key: "
<<
m_outputTCCHandle
.key() );
49
50
// Optionnaly recopy an existing container.
51
// This option is mainly to enable functionalities of the original alg.
52
if
(!
m_copiedTCCHandle
.empty() ){
53
SG::ReadHandle<xAOD::FlowElementContainer>
tccToCopy(
m_copiedTCCHandle
, ctx) ;
54
for
(
const
xAOD::FlowElement
* tobecopied: *tccToCopy){
55
xAOD::FlowElement
* tcc =
new
xAOD::FlowElement
;
56
tccContainer->push_back(tcc);
57
*tcc = *tobecopied;
58
}
59
}
60
61
62
// Loop over each TCC tool ...
63
for
(
const
ToolHandle<ITrackCaloClusterTool> & tool :
m_tccTools
){
64
// .. and have it fill tccContainer
65
ATH_MSG_DEBUG
(
"executing "
<<tool.name() );
66
StatusCode
sc
=tool->fillTCC(tccContainer.
ptr
(), *tccInfo);
67
if
(
sc
.isFailure()){
68
ATH_MSG_ERROR
(
" TCC tool "
<< tool->name() <<
" failed. "
);
return
sc
;
69
}
70
ATH_MSG_DEBUG
(
"executed "
<<tool.name() <<
" num object= "
<< tccContainer->size() );
71
}
72
73
return
StatusCode::SUCCESS;
74
}
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_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
FlowElementAuxContainer.h
FlowElementContainer.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
ReadDecorHandle.h
Handle class for reading a decoration on an object.
WriteDecorHandle.h
Handle class for adding a decoration to an object.
TrackCaloClusterAlg.h
TrackCaloClusterAuxContainer.h
TrackParametersIdHelper.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
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.
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
TrackCaloClusterAlg::m_outputTCCHandle
SG::WriteHandleKey< xAOD::FlowElementContainer > m_outputTCCHandle
Cluster Collection container.
Definition
TrackCaloClusterAlg.h:45
TrackCaloClusterAlg::m_tccTools
ToolHandleArray< ITrackCaloClusterTool > m_tccTools
The tools implementting the creation of TCC.
Definition
TrackCaloClusterAlg.h:39
TrackCaloClusterAlg::initialize
virtual StatusCode initialize() override
Definition
TrackCaloClusterAlg.cxx:25
TrackCaloClusterAlg::m_tccInfoHandle
SG::ReadHandleKey< TrackCaloClusterInfo > m_tccInfoHandle
TrackCaloClusterInfo used by this alg.
Definition
TrackCaloClusterAlg.h:42
TrackCaloClusterAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
TrackCaloClusterAlg.cxx:39
TrackCaloClusterAlg::TrackCaloClusterAlg
TrackCaloClusterAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TrackCaloClusterAlg.cxx:20
TrackCaloClusterAlg::m_copiedTCCHandle
SG::ReadHandleKey< xAOD::FlowElementContainer > m_copiedTCCHandle
Definition
TrackCaloClusterAlg.h:47
xAOD::FlowElement
FlowElement_v1 FlowElement
Definition of the current "pfo version".
Definition
FlowElement.h:16
Generated on
for ATLAS Offline Software by
1.17.0