ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonDetDescr
MuonRegionSelector
src
MuonRegSelCondAlg.cxx
Go to the documentation of this file.
1
13
14
15
#include "GaudiKernel/EventIDRange.h"
16
#include "
StoreGate/WriteCondHandle.h
"
17
#include "
MuonRegSelCondAlg.h
"
18
19
20
#include <iostream>
21
#include <fstream>
22
#include <string>
23
24
25
26
MuonRegSelCondAlg::MuonRegSelCondAlg
(
const
std::string& name, ISvcLocator* pSvcLocator):
27
AthCondAlgorithm
( name, pSvcLocator ) {
28
ATH_MSG_DEBUG
(
"MuonRegSelCondAlg::MuonRegSelCondAlg() "
<< name );
29
30
}
31
32
33
34
35
StatusCode
MuonRegSelCondAlg::initialize
()
36
{
37
ATH_MSG_DEBUG
(
"MuonRegSelCondAlg::initialize() "
);
38
ATH_CHECK
(
m_tableKey
.initialize());
39
ATH_CHECK
(
m_detMgrKey
.initialize());
40
ATH_MSG_INFO
(
"MuonRegSelCondAlg::initialize() "
<<
m_tableKey
);
41
return
StatusCode::SUCCESS;
42
}
43
44
45
46
StatusCode
MuonRegSelCondAlg::execute
(
const
EventContext& ctx )
const
{
47
ATH_MSG_DEBUG
(
"MuonRegSelCondAlg::execute() -- enter -- "
);
48
50
ATH_MSG_DEBUG
(
"Creating region selector table "
<<
m_tableKey
);
51
52
53
SG::WriteCondHandle<IRegSelLUTCondData>
lutCondData(
m_tableKey
, ctx );
54
if
(lutCondData.
isValid
()) {
60
ATH_MSG_DEBUG
(
"CondHandle "
<< lutCondData.
fullKey
() <<
" is already valid."
);
61
return
StatusCode::SUCCESS;
62
}
63
65
66
EventIDRange id_range;
67
68
std::unique_ptr<IRegSelLUT> rd =
createTable
( ctx, id_range );
69
70
if
( !rd )
return
StatusCode::FAILURE;
71
72
ATH_MSG_DEBUG
(
"Initialising new map "
);;
73
74
// write out new new LUT to a file if need be
75
76
if
(
m_printTable
) {
77
if
(
const
auto
*lut =
dynamic_cast<
const
RegSelSiLUT
*
>
(rd.get())) {
78
lut->write( name()+
".map"
);
79
}
80
}
81
83
84
IRegSelLUTCondData
* rcd =
new
IRegSelLUTCondData
( std::move(rd) );
85
86
try
{
91
if
( lutCondData.
record
( id_range, rcd ).isFailure() ) {
92
ATH_MSG_ERROR
(
"Could not record "
<<
m_tableKey
93
<<
" "
<< lutCondData.
key
()
94
<<
" with range "
<< id_range );
95
return
StatusCode::FAILURE;
96
}
97
ATH_MSG_INFO
(
"RegSelCondAlg LUT recorded: "
<<
m_tableKey
);
98
}
99
catch
(...) {
100
ATH_MSG_ERROR
(
"MuonRegSelCondAlg::execute() failed to record table: "
<<
m_tableKey
);
101
return
StatusCode::FAILURE;
102
}
103
104
105
ATH_MSG_DEBUG
(
"MuonRegSelCondAlg::execute() -- exit -- "
);
106
107
return
StatusCode::SUCCESS;
108
}
109
110
111
112
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_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
IRegSelLUTCondData
RegSelCondData< IRegSelLUT > IRegSelLUTCondData
Definition
IRegSelLUTCondData.h:20
MuonRegSelCondAlg.h
emacs: this is -*- c++ -*-
WriteCondHandle.h
AthCondAlgorithm
Base class for conditions algorithms.
Definition
AthCondAlgorithm.h:22
MuonRegSelCondAlg::m_printTable
Gaudi::Property< bool > m_printTable
Definition
MuonRegSelCondAlg.h:50
MuonRegSelCondAlg::createTable
virtual std::unique_ptr< RegSelSiLUT > createTable(const EventContext &ctx, EventIDRange &id_range) const =0
MuonRegSelCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
MuonRegSelCondAlg.cxx:46
MuonRegSelCondAlg::initialize
virtual StatusCode initialize() override
Definition
MuonRegSelCondAlg.cxx:35
MuonRegSelCondAlg::m_detMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_detMgrKey
MuonDetectorManager from the conditions store.
Definition
MuonRegSelCondAlg.h:45
MuonRegSelCondAlg::MuonRegSelCondAlg
MuonRegSelCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
MuonRegSelCondAlg.cxx:26
MuonRegSelCondAlg::m_tableKey
SG::WriteCondHandleKey< IRegSelLUTCondData > m_tableKey
Output conditions object.
Definition
MuonRegSelCondAlg.h:55
RegSelSiLUT
Definition
RegSelSiLUT.h:41
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
SG::WriteCondHandle::key
const std::string & key() const
Definition
WriteCondHandle.h:44
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition
WriteCondHandle.h:161
SG::WriteCondHandle::isValid
bool isValid() const
Definition
WriteCondHandle.h:252
SG::WriteCondHandle::fullKey
const DataObjID & fullKey() const
Definition
WriteCondHandle.h:45
Generated on
for ATLAS Offline Software by
1.17.0