ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Calorimeter
CaloRec
src
CaloBCIDCoeffsCondAlg.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
3
*/
10
11
12
#include "
CaloBCIDCoeffsCondAlg.h
"
13
#include "
StoreGate/ReadCondHandle.h
"
14
#include "
StoreGate/WriteCondHandle.h
"
15
#include "
LArIdentifier/LArOnline_SuperCellID.h
"
16
#include "
LArIdentifier/LArOnlineID.h
"
17
18
22
StatusCode
CaloBCIDCoeffsCondAlg::initialize
()
23
{
24
if
( !
m_isSC
)
ATH_CHECK
(
m_mcSymKey
.initialize() );
25
ATH_CHECK
(
m_ofcKey
.initialize() );
26
ATH_CHECK
(
m_shapeKey
.initialize() );
27
ATH_CHECK
(
m_minBiasAvgKey
.initialize() );
28
ATH_CHECK
(
m_outputCoeffsKey
.initialize() );
29
30
if
(
m_isSC
) {
31
const
LArOnline_SuperCellID
* ll =
nullptr
;
32
ATH_CHECK
(
detStore
()->retrieve(ll,
"LArOnline_SuperCellID"
));
33
m_laronline_id
=
static_cast<
const
LArOnlineID_Base
*
>
(ll);
34
}
35
else
{
36
const
LArOnlineID
* ll =
nullptr
;
37
ATH_CHECK
(
detStore
()->retrieve(ll,
"LArOnlineID"
));
38
m_laronline_id
=
static_cast<
const
LArOnlineID_Base
*
>
(ll);
39
}
40
41
return
StatusCode::SUCCESS;
42
}
43
44
49
StatusCode
CaloBCIDCoeffsCondAlg::execute
(
const
EventContext& ctx)
const
50
{
51
SG::WriteCondHandle<CaloBCIDCoeffs>
outputCoeffs (
m_outputCoeffsKey
, ctx);
52
if
(outputCoeffs.
isValid
()) {
53
ATH_MSG_DEBUG
(
"Found valid write handle"
);
54
return
StatusCode::SUCCESS;
55
}
56
57
std::vector<HWIdentifier> hwids ;
58
if
(!
m_isSC
) {
59
SG::ReadCondHandle<LArMCSym>
mcsym (
m_mcSymKey
, ctx);
60
hwids = mcsym->symIds();
61
}
62
else
{
63
for
(
long
long
unsigned
int
i=0;i<
m_laronline_id
->channelHashMax();i++){
64
hwids.push_back(
m_laronline_id
->channel_Id((
IdentifierHash
)i) );
65
}
66
}
67
SG::ReadCondHandle<ILArOFC>
ofcs (
m_ofcKey
, ctx);
68
SG::ReadCondHandle<ILArShape>
shapes (
m_shapeKey
, ctx);
69
SG::ReadCondHandle<ILArMinBiasAverage>
minBiasAvg (
m_minBiasAvgKey
, ctx);
70
71
auto
coeffs = std::make_unique<CaloBCIDCoeffs> (hwids,
72
*(
static_cast<
const
LArOnlineID_Base
*
>
(
m_laronline_id
)),
73
**ofcs,
74
**shapes,
75
**minBiasAvg);
76
77
outputCoeffs.
addDependency
(ofcs, shapes, minBiasAvg);
78
ATH_CHECK
( outputCoeffs.
record
(std::move (coeffs)) );
79
ATH_MSG_INFO
(
"recorded new "
<< outputCoeffs.
key
() <<
" with range "
<< outputCoeffs.
getRange
() );
80
return
StatusCode::SUCCESS;
81
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloBCIDCoeffsCondAlg.h
Conditions algorithm to create CaloBCIDCoeffs.
LArOnlineID.h
LArOnline_SuperCellID.h
ReadCondHandle.h
WriteCondHandle.h
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
CaloBCIDCoeffsCondAlg::m_isSC
Gaudi::Property< bool > m_isSC
Property: m_isSC.
Definition
CaloBCIDCoeffsCondAlg.h:73
CaloBCIDCoeffsCondAlg::initialize
virtual StatusCode initialize() override final
Gaudi initialize method.
Definition
CaloBCIDCoeffsCondAlg.cxx:22
CaloBCIDCoeffsCondAlg::m_mcSymKey
SG::ReadCondHandleKey< LArMCSym > m_mcSymKey
Property: Symmetrization helper (conditions input).
Definition
CaloBCIDCoeffsCondAlg.h:54
CaloBCIDCoeffsCondAlg::m_shapeKey
SG::ReadCondHandleKey< ILArShape > m_shapeKey
Property: Pulse shape (conditions input).
Definition
CaloBCIDCoeffsCondAlg.h:62
CaloBCIDCoeffsCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Execute the algorithm.
Definition
CaloBCIDCoeffsCondAlg.cxx:49
CaloBCIDCoeffsCondAlg::m_ofcKey
SG::ReadCondHandleKey< ILArOFC > m_ofcKey
Property: OFC coefficients (conditions input).
Definition
CaloBCIDCoeffsCondAlg.h:58
CaloBCIDCoeffsCondAlg::m_minBiasAvgKey
SG::ReadCondHandleKey< ILArMinBiasAverage > m_minBiasAvgKey
Property: Min bias offset (conditions input).
Definition
CaloBCIDCoeffsCondAlg.h:66
CaloBCIDCoeffsCondAlg::m_laronline_id
const LArOnlineID_Base * m_laronline_id
LAr online ID helper.
Definition
CaloBCIDCoeffsCondAlg.h:76
CaloBCIDCoeffsCondAlg::m_outputCoeffsKey
SG::WriteCondHandleKey< CaloBCIDCoeffs > m_outputCoeffsKey
Property: Offset calculation coefficients (conditions output).
Definition
CaloBCIDCoeffsCondAlg.h:70
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition
LArOnlineID_Base.h:97
LArOnlineID
Definition
LArOnlineID.h:21
LArOnline_SuperCellID
Definition
LArOnline_SuperCellID.h:21
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
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
Generated on
for ATLAS Offline Software by
1.17.0