ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
TileCalorimeter
TileRecUtils
src
TileRawChannelCorrectionAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Tile includes
6
#include "
TileRawChannelCorrectionAlg.h
"
7
#include "
TileEvent/TileMutableRawChannelContainer.h
"
8
9
// Athena includes
10
#include "
StoreGate/ReadHandle.h
"
11
#include "
StoreGate/WriteHandle.h
"
12
#include "
AthenaKernel/errorcheck.h
"
13
14
#include <memory>
15
16
StatusCode
TileRawChannelCorrectionAlg::initialize
() {
17
18
ATH_MSG_DEBUG
(
"Input raw channel container: '"
<<
m_inputRawChannelContainerKey
.key()
19
<<
"' output container: '"
<<
m_outputRawChannelContainerKey
.key() <<
"'"
);
20
21
ATH_CHECK
(
m_inputRawChannelContainerKey
.initialize() );
22
ATH_CHECK
(
m_outputRawChannelContainerKey
.initialize() );
23
24
ATH_CHECK
(
m_noiseFilterTools
.retrieve() );
25
ATH_MSG_DEBUG
(
"Successfully retrieved corection tools: "
<<
m_noiseFilterTools
);
26
27
ATH_MSG_DEBUG
(
"initialization completed"
);
28
29
return
StatusCode::SUCCESS;
30
}
31
32
33
StatusCode
TileRawChannelCorrectionAlg::execute
(
const
EventContext& ctx)
const
{
34
35
36
const
TileRawChannelContainer
* inputRawChannels =
SG::makeHandle
(
m_inputRawChannelContainerKey
, ctx).get();
37
auto
outputRawChannels = std::make_unique<TileMutableRawChannelContainer>(*inputRawChannels);
38
ATH_CHECK
( outputRawChannels->status() );
39
40
for
(
const
ToolHandle<ITileRawChannelTool>& noiseFilterTool :
m_noiseFilterTools
) {
41
if
(noiseFilterTool->process(*outputRawChannels.get(), ctx).isFailure()) {
42
ATH_MSG_ERROR
(
" Error status returned from "
<< noiseFilterTool.name() );
43
}
else
{
44
ATH_MSG_DEBUG
( noiseFilterTool.name() <<
" applied to the container"
);
45
}
46
}
47
48
SG::WriteHandle<TileRawChannelContainer>
outputRawChannelContainer(
m_outputRawChannelContainerKey
, ctx);
49
ATH_CHECK
( outputRawChannelContainer.
record
(std::move(outputRawChannels)) );
50
51
ATH_MSG_DEBUG
(
"TileRawChannelContainer registered successfully ("
52
<<
m_outputRawChannelContainerKey
.key() <<
")"
);
53
54
return
StatusCode::SUCCESS;
55
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
errorcheck.h
Helpers for checking error return status codes and reporting errors.
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
TileMutableRawChannelContainer.h
Helper for holding non-const raw data prior to recording in SG.
TileRawChannelCorrectionAlg.h
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.
TileRawChannelContainer
Definition
TileRawChannelContainer.h:13
TileRawChannelCorrectionAlg::m_noiseFilterTools
ToolHandleArray< ITileRawChannelTool > m_noiseFilterTools
Definition
TileRawChannelCorrectionAlg.h:42
TileRawChannelCorrectionAlg::m_inputRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_inputRawChannelContainerKey
Definition
TileRawChannelCorrectionAlg.h:36
TileRawChannelCorrectionAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
TileRawChannelCorrectionAlg.cxx:33
TileRawChannelCorrectionAlg::m_outputRawChannelContainerKey
SG::WriteHandleKey< TileRawChannelContainer > m_outputRawChannelContainerKey
Definition
TileRawChannelCorrectionAlg.h:39
TileRawChannelCorrectionAlg::initialize
virtual StatusCode initialize() override
Definition
TileRawChannelCorrectionAlg.cxx:16
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:268
Generated on
for ATLAS Offline Software by
1.17.0