ATLAS Offline Software
Loading...
Searching...
No Matches
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
17
18
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
49StatusCode CaloBCIDCoeffsCondAlg::execute (const EventContext& ctx) const
50{
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) {
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 }
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
Conditions algorithm to create CaloBCIDCoeffs.
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< bool > m_isSC
Property: m_isSC.
virtual StatusCode initialize() override final
Gaudi initialize method.
SG::ReadCondHandleKey< LArMCSym > m_mcSymKey
Property: Symmetrization helper (conditions input).
SG::ReadCondHandleKey< ILArShape > m_shapeKey
Property: Pulse shape (conditions input).
virtual StatusCode execute(const EventContext &ctx) const override final
Execute the algorithm.
SG::ReadCondHandleKey< ILArOFC > m_ofcKey
Property: OFC coefficients (conditions input).
SG::ReadCondHandleKey< ILArMinBiasAverage > m_minBiasAvgKey
Property: Min bias offset (conditions input).
const LArOnlineID_Base * m_laronline_id
LAr online ID helper.
SG::WriteCondHandleKey< CaloBCIDCoeffs > m_outputCoeffsKey
Property: Offset calculation coefficients (conditions output).
This is a "hash" representation of an Identifier.
Helper for the Liquid Argon Calorimeter cell identifiers.
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED