ATLAS Offline Software
CaloBCIDCoeffsCondAlg.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration.
3  */
12 #include "CaloBCIDCoeffsCondAlg.h"
17 
18 
23 {
29 
30  if ( m_isSC ) {
31  const LArOnline_SuperCellID* ll = nullptr;
32  ATH_CHECK(detStore()->retrieve(ll,"LArOnline_SuperCellID"));
34  }
35  else {
36  const LArOnlineID* ll = nullptr;
37  ATH_CHECK(detStore()->retrieve(ll,"LArOnlineID"));
39  }
40 
41  return StatusCode::SUCCESS;
42 }
43 
44 
49 StatusCode 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,
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 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
CaloBCIDCoeffsCondAlg::m_minBiasAvgKey
SG::ReadCondHandleKey< ILArMinBiasAverage > m_minBiasAvgKey
Property: Min bias offset (conditions input).
Definition: CaloBCIDCoeffsCondAlg.h:67
detail::ll
long long ll
Definition: PrimitiveHelpers.h:46
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::WriteCondHandle::getRange
const EventIDRange & getRange() const
Definition: WriteCondHandle.h:89
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition: WriteCondHandle.h:157
CaloBCIDCoeffsCondAlg::m_laronline_id
const LArOnlineID_Base * m_laronline_id
LAr online ID helper.
Definition: CaloBCIDCoeffsCondAlg.h:77
ReadCondHandle.h
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
perfmonmt-refit.coeffs
coeffs
Definition: perfmonmt-refit.py:105
CaloBCIDCoeffsCondAlg::m_isSC
Gaudi::Property< bool > m_isSC
Property: m_isSC.
Definition: CaloBCIDCoeffsCondAlg.h:74
CaloBCIDCoeffsCondAlg.h
Conditions algorithm to create CaloBCIDCoeffs.
CaloBCIDCoeffsCondAlg::m_outputCoeffsKey
SG::WriteCondHandleKey< CaloBCIDCoeffs > m_outputCoeffsKey
Property: Offset calculation coefficients (conditions output).
Definition: CaloBCIDCoeffsCondAlg.h:71
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
WriteCondHandle.h
LArOnlineID_Base::channel_Id
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
Definition: LArOnlineID_Base.cxx:1565
CaloBCIDCoeffsCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Execute the algorithm.
Definition: CaloBCIDCoeffsCondAlg.cxx:49
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloBCIDCoeffsCondAlg::m_ofcKey
SG::ReadCondHandleKey< ILArOFC > m_ofcKey
Property: OFC coefficients (conditions input).
Definition: CaloBCIDCoeffsCondAlg.h:59
LArOnlineID_Base
Helper for the Liquid Argon Calorimeter cell identifiers.
Definition: LArOnlineID_Base.h:105
SG::WriteCondHandle::key
const std::string & key() const
Definition: WriteCondHandle.h:40
LArOnlineID_Base::channelHashMax
size_type channelHashMax(void) const
Define channel hash tables max size.
Definition: LArOnlineID_Base.cxx:1897
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArOnlineID
Definition: LArOnlineID.h:20
LArOnline_SuperCellID
Definition: LArOnline_SuperCellID.h:20
SG::WriteCondHandle::isValid
bool isValid() const
Definition: WriteCondHandle.h:248
LArOnline_SuperCellID.h
LArMCSym::symIds
const std::vector< HWIdentifier > & symIds() const
Return the list of symmetric hashes.
Definition: LArMCSym.h:132
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
CaloBCIDCoeffsCondAlg::initialize
virtual StatusCode initialize() override final
Gaudi initialize method.
Definition: CaloBCIDCoeffsCondAlg.cxx:22
CaloBCIDCoeffsCondAlg::m_shapeKey
SG::ReadCondHandleKey< ILArShape > m_shapeKey
Property: Pulse shape (conditions input).
Definition: CaloBCIDCoeffsCondAlg.h:63
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
LArOnlineID.h
CaloBCIDCoeffsCondAlg::m_mcSymKey
SG::ReadCondHandleKey< LArMCSym > m_mcSymKey
Property: Symmetrization helper (conditions input).
Definition: CaloBCIDCoeffsCondAlg.h:55
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition: WriteCondHandle.h:275