ATLAS Offline Software
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
8 
9 // Athena includes
10 #include "StoreGate/ReadHandle.h"
11 #include "StoreGate/WriteHandle.h"
13 
14 #include <memory>
15 
17 
18  ATH_MSG_DEBUG( "Input raw channel container: '" << m_inputRawChannelContainerKey.key()
19  << "' output container: '" << m_outputRawChannelContainerKey.key() << "'" );
20 
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 
49  ATH_CHECK( outputRawChannelContainer.record(std::move(outputRawChannels)) );
50 
51  ATH_MSG_DEBUG( "TileRawChannelContainer registered successfully ("
53 
54  return StatusCode::SUCCESS;
55 }
TileRawChannelContainer
Definition: TileRawChannelContainer.h:13
TileRawChannelCorrectionAlg::m_outputRawChannelContainerKey
SG::WriteHandleKey< TileRawChannelContainer > m_outputRawChannelContainerKey
Definition: TileRawChannelCorrectionAlg.h:39
TileRawChannelCorrectionAlg::m_noiseFilterTools
ToolHandleArray< ITileRawChannelTool > m_noiseFilterTools
Definition: TileRawChannelCorrectionAlg.h:42
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
TileRawChannelCorrectionAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TileRawChannelCorrectionAlg.cxx:33
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
WriteHandle.h
Handle class for recording to StoreGate.
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TileRawChannelCorrectionAlg::m_inputRawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_inputRawChannelContainerKey
Definition: TileRawChannelCorrectionAlg.h:36
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TileRawChannelCorrectionAlg.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
errorcheck.h
Helpers for checking error return status codes and reporting errors.
TileRawChannelCorrectionAlg::initialize
virtual StatusCode initialize() override
Definition: TileRawChannelCorrectionAlg.cxx:16
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
TileMutableRawChannelContainer.h
Helper for holding non-const raw data prior to recording in SG.
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
ReadHandle.h
Handle class for reading from StoreGate.