ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetConditions
SCT_ConditionsAlgorithms
src
SCT_LinkMaskingCondAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
SCT_LinkMaskingCondAlg.h
"
6
7
#include <memory>
8
9
SCT_LinkMaskingCondAlg::SCT_LinkMaskingCondAlg
(
const
std::string& name, ISvcLocator* pSvcLocator)
10
: ::
AthCondAlgorithm
(name, pSvcLocator)
11
{
12
}
13
14
StatusCode
SCT_LinkMaskingCondAlg::initialize
() {
15
ATH_MSG_DEBUG
(
"initialize "
<< name());
16
17
// Read Cond Handle
18
ATH_CHECK
(
m_readKey
.initialize());
19
// Write Cond Handles
20
ATH_CHECK
(
m_writeKey
.initialize());
21
22
return
StatusCode::SUCCESS;
23
}
24
25
StatusCode
SCT_LinkMaskingCondAlg::execute
(
const
EventContext& ctx)
const
{
26
ATH_MSG_DEBUG
(
"execute "
<< name());
27
28
// Write Cond Handle
29
SG::WriteCondHandle<SCT_ModuleVetoCondData>
writeHandle{
m_writeKey
, ctx};
30
// Do we have a valid Write Cond Handle for current time?
31
if
(writeHandle.
isValid
()) {
32
ATH_MSG_DEBUG
(
"CondHandle "
<< writeHandle.
fullKey
() <<
" is already valid."
33
<<
". In theory this should not be called, but may happen"
34
<<
" if multiple concurrent events are being processed out of order."
);
35
return
StatusCode::SUCCESS;
36
}
37
38
// Read Cond Handle
39
SG::ReadCondHandle<CondAttrListCollection>
readHandle{
m_readKey
, ctx};
40
const
CondAttrListCollection
* readCdo{*readHandle};
41
if
(readCdo==
nullptr
) {
42
ATH_MSG_FATAL
(
"Null pointer to the read conditions object"
);
43
return
StatusCode::FAILURE;
44
}
45
// Add dependency
46
writeHandle.
addDependency
(readHandle);
47
ATH_MSG_INFO
(
"Size of CondAttrListCollection "
<< readHandle.
fullKey
() <<
" readCdo->size()= "
<< readCdo->
size
());
48
ATH_MSG_INFO
(
"Range of input is "
<< readHandle.
getRange
());
49
50
// Construct the output Cond Object and fill it in
51
std::unique_ptr<SCT_ModuleVetoCondData> writeCdo{std::make_unique<SCT_ModuleVetoCondData>()};
52
53
// Read bad wafer info
54
CondAttrListCollection::const_iterator
linkItr{readCdo->
begin
()};
55
CondAttrListCollection::const_iterator
linkEnd{readCdo->
end
()};
56
for
(;linkItr != linkEnd; ++linkItr) {
57
//A CondAttrListCollection is a map of ChanNum and AttributeList
58
Identifier
waferId{(*linkItr).first};
59
const
CondAttrListCollection::AttributeList
&payload{(*linkItr).second};
60
bool
lastProbedState{payload[0].data<
bool
>()};
61
if
(not lastProbedState) writeCdo->setBadWaferId(waferId);
62
ATH_MSG_INFO
(
"LINK "
<< waferId <<
" ("
<< waferId.
get_identifier32
().
get_compact
() <<
" in 32 bit): "
<< lastProbedState);
63
}
64
if
(writeCdo->size()>0) writeCdo->setFilled();
65
66
// Record the output cond object
67
if
(writeHandle.
record
(std::move(writeCdo)).isFailure()) {
68
ATH_MSG_FATAL
(
"Could not record SCT_ModuleVetoCondData "
<< writeHandle.
key
()
69
<<
" with EventRange "
<< writeHandle.
getRange
()
70
<<
" into Conditions Store"
);
71
return
StatusCode::FAILURE;
72
}
73
ATH_MSG_INFO
(
"recorded new CDO "
<< writeHandle.
key
() <<
" with range "
<< writeHandle.
getRange
() <<
" into Conditions Store"
);
74
75
return
StatusCode::SUCCESS;
76
}
77
78
StatusCode
SCT_LinkMaskingCondAlg::finalize
() {
79
ATH_MSG_DEBUG
(
"finalize "
<< name());
80
return
StatusCode::SUCCESS;
81
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition
AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
SCT_LinkMaskingCondAlg.h
AthCondAlgorithm
Base class for conditions algorithms.
Definition
AthCondAlgorithm.h:22
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number.
Definition
CondAttrListCollection.h:51
CondAttrListCollection::end
const_iterator end() const
Definition
CondAttrListCollection.h:314
CondAttrListCollection::begin
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
Definition
CondAttrListCollection.h:308
CondAttrListCollection::size
size_type size() const
number of Chan/AttributeList pairs
Definition
CondAttrListCollection.h:321
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition
CondAttrListCollection.h:62
CondAttrListCollection::AttributeList
coral::AttributeList AttributeList
Definition
CondAttrListCollection.h:55
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition
Identifier32.h:47
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
SCT_LinkMaskingCondAlg::initialize
virtual StatusCode initialize() override final
Definition
SCT_LinkMaskingCondAlg.cxx:14
SCT_LinkMaskingCondAlg::finalize
virtual StatusCode finalize() override final
Definition
SCT_LinkMaskingCondAlg.cxx:78
SCT_LinkMaskingCondAlg::SCT_LinkMaskingCondAlg
SCT_LinkMaskingCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
SCT_LinkMaskingCondAlg.cxx:9
SCT_LinkMaskingCondAlg::m_writeKey
SG::WriteCondHandleKey< SCT_ModuleVetoCondData > m_writeKey
Definition
SCT_LinkMaskingCondAlg.h:29
SCT_LinkMaskingCondAlg::m_readKey
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey
Definition
SCT_LinkMaskingCondAlg.h:27
SCT_LinkMaskingCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition
SCT_LinkMaskingCondAlg.cxx:25
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::fullKey
const DataObjID & fullKey() const
Definition
ReadCondHandle.h:60
SG::ReadCondHandle::getRange
const EventIDRange & getRange()
Definition
ReadCondHandle.h:241
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
SG::WriteCondHandle::key
const std::string & key() const
Definition
WriteCondHandle.h:44
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition
WriteCondHandle.h:279
SG::WriteCondHandle::getRange
const EventIDRange & getRange() const
Definition
WriteCondHandle.h:93
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
Identifier
Definition
IdentifierFieldParser.cxx:14
Generated on
for ATLAS Offline Software by
1.17.0