ATLAS Offline Software
Loading...
Searching...
No Matches
SolenoidParametrizationCondAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6#include <limits>
7namespace Trk
8{
9
10SolenoidParametrizationCondAlg::SolenoidParametrizationCondAlg(const std::string& name, ISvcLocator* pSvcLocator)
11 : ::AthReentrantAlgorithm(name, pSvcLocator)
12 , m_condSvc{"CondSvc", name}
13{
14}
15
17 ATH_CHECK( m_condSvc.retrieve());
19 ATH_CHECK( m_writeKey.initialize() );
20 return StatusCode::SUCCESS;
21}
22
23
24StatusCode SolenoidParametrizationCondAlg::execute(const EventContext &ctx) const {
26 if (write_handle.isValid()) {
27 return StatusCode::SUCCESS;
28 }
29
31 if (!readHandle.isValid()) {
32 ATH_MSG_FATAL("Failed to get magnetic field conditions data " << m_fieldCacheCondObjInputKey.key() );
33 return StatusCode::FAILURE;
34 }
35
36 write_handle.addDependency(readHandle);
37 ATH_CHECK( write_handle.record(std::make_unique<SolenoidParametrization>(*(readHandle.cptr())) ));
38 return StatusCode::SUCCESS;
39}
40
41
43 return StatusCode::SUCCESS;
44}
45
46}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
An algorithm that can be simultaneously executed in multiple threads.
const_pointer_type cptr()
void addDependency(const EventIDRange &range)
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
virtual StatusCode initialize() override final
virtual StatusCode finalize() override final
SolenoidParametrizationCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteCondHandleKey< SolenoidParametrization > m_writeKey
Ensure that the ATLAS eigen extensions are properly loaded.