ATLAS Offline Software
Loading...
Searching...
No Matches
ConditionTestAlg.cxx
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7// ConditionTestAlg.cxx
8// Implementation file for class ConditionTestAlg
9// Author: B. Wynne <bwynne@cern.ch>
11
12#include "ConditionTestAlg.h"
13
14// STL includes
15
16// FrameWork includes
18
19namespace AthViews {
20
22// Public methods:
24
25// Constructors
27ConditionTestAlg::ConditionTestAlg( const std::string& name,
28 ISvcLocator* pSvcLocator ) :
29 ::AthCondAlgorithm( name, pSvcLocator )
30{
31 //
32 // Property declaration
33 //
34 //declareProperty( "Property", m_nProperty );
35}
36
37// Destructor
41
42// Athena Algorithm's Hooks
45{
46 ATH_MSG_INFO ("Initializing " << name() << "...");
47
48 CHECK( m_condKeyTest.initialize() );
49
50 return StatusCode::SUCCESS;
51}
52
54{
55 ATH_MSG_INFO ("Finalizing " << name() << "...");
56
57 return StatusCode::SUCCESS;
58}
59
60StatusCode ConditionTestAlg::execute(const EventContext& ctx) const
61{
62 ATH_MSG_DEBUG ("Executing " << name() << "...");
63
64 ATH_MSG_INFO( name() << " running with store " << Atlas::getExtendedEventContext(ctx).proxy()->name() );
65
66 // Make a (large) validity range
67 EventIDBase begin (0,
68 EventIDBase::UNDEFEVT, // event
69 EventIDBase::UNDEFNUM, // timestamp
70 EventIDBase::UNDEFNUM, // timestamp ns
71 0);
72 EventIDBase end (10000,
73 EventIDBase::UNDEFEVT, // event
74 EventIDBase::UNDEFNUM, // timestamp
75 EventIDBase::UNDEFNUM, // timestamp ns
76 10000);
77 EventIDRange range( begin, end );
78
79 // Write a dummy object with this validity range
81 ATH_CHECK( condHandleTest.record( range, std::make_unique< CondDataObj >( 987 ) ) );
82
83 return StatusCode::SUCCESS;
84}
85
86} //> end namespace AthViews
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
Base class for conditions algorithms.
ConditionTestAlg()
Default constructor:
virtual ~ConditionTestAlg()
Destructor:
virtual StatusCode execute(const EventContext &ctx) const override
virtual StatusCode finalize() override
virtual StatusCode initialize() override
SG::WriteCondHandleKey< CondDataObj > m_condKeyTest
Containers.
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.