Commit bc58cb9b authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'master-larminbiasalg' into 'master'

Two algorithms in CaloCondPhysAlgs switched to reading CaloDD Manager from Cond Store

See merge request atlas/athena!47077
parents 7ad09cf9 02098226
......@@ -23,9 +23,6 @@ using CLHEP::HepVector;
//Constructor
CaloCellNoiseAlg::CaloCellNoiseAlg(const std::string& name, ISvcLocator* pSvcLocator):
AthAlgorithm(name,pSvcLocator),
m_thistSvc(nullptr),
m_calodetdescrmgr(nullptr),
m_calo_id(nullptr),
m_ncell(0),
m_lumiblock(0),
m_lumiblockOld(0),
......@@ -97,7 +94,7 @@ StatusCode CaloCellNoiseAlg::initialize()
ATH_CHECK( detStore()->retrieve( mgr ) );
m_calo_id = mgr->getCaloCell_ID();
ATH_CHECK( detStore()->retrieve(m_calodetdescrmgr) );
ATH_CHECK(m_caloMgrKey.initialize());
ATH_CHECK( m_noiseKey.initialize ( m_doMC) );
ATH_CHECK( m_pedestalKey.initialize (!m_doMC) );
......@@ -218,10 +215,13 @@ StatusCode CaloCellNoiseAlg::execute()
totalNoise = noiseH.cptr();
}
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
ATH_CHECK(caloMgrHandle.isValid());
for (int i=0;i<m_ncell;i++) {
IdentifierHash idHash=i;
Identifier id=m_calo_id->cell_id(idHash);
const CaloDetDescrElement* calodde = m_calodetdescrmgr->get_element(id);
const CaloDetDescrElement* calodde = (*caloMgrHandle)->get_element(id);
CellInfo cell0{};
cell0.nevt = 0;
cell0.average = 0.;
......
......@@ -58,10 +58,14 @@
//---------------------------------------------------
// Member variables
//---------------------------------------------------
ITHistSvc* m_thistSvc;
ITHistSvc* m_thistSvc{nullptr};
const CaloDetDescrManager* m_calodetdescrmgr;
const CaloCell_ID* m_calo_id;
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" };
const CaloCell_ID* m_calo_id{nullptr};
SG::ReadCondHandleKey<ILArNoise> m_noiseKey{this,"NoiseKey","LArNoiseSym","SG Key of ILArNoise object"};
SG::ReadCondHandleKey<ILArPedestal> m_pedestalKey{this,"PedestalKey","LArPedestal","SG Key of LArPedestal object"};
SG::ReadCondHandleKey<LArADC2MeV> m_adc2mevKey
......
......@@ -72,13 +72,13 @@
m_larem_id = mgr->getEM_ID();
m_calo_id = mgr->getCaloCell_ID();
// retrieve CaloDetDescrMgr
ATH_CHECK( detStore()->retrieve(m_calodetdescrmgr) );
ATH_CHECK(m_mcSymKey.initialize());
ATH_CHECK(m_cablingKey.initialize());
ATH_CHECK(m_caloMgrKey.initialize());
ATH_CHECK(m_eventInfoKey.initialize());
m_n1=0;
......@@ -115,6 +115,9 @@
if (m_first) {
SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{m_caloMgrKey};
ATH_CHECK(caloMgrHandle.isValid());
SG::ReadCondHandle<LArMCSym> mcsym (m_mcSymKey, ctx);
SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl (m_cablingKey, ctx);
const LArOnOffIdMapping* cabling{*cablingHdl};
......@@ -158,7 +161,7 @@
doneCell[i2]=nsym;
m_symCellIndex[i] = nsym;
CellInfo cell;
const CaloDetDescrElement* calodde = m_calodetdescrmgr->get_element(id);
const CaloDetDescrElement* calodde = (*caloMgrHandle)->get_element(id);
cell.eta = calodde->eta();
cell.phi = calodde->phi();
cell.region = m_calo_id->region(id);
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// TheLArMinBiasAlg.h
//
/**
* @file TheLArMinBiasAlg.h
*/
#ifndef CALOCONDPHYSALGS_LARMINBIASALG_H
#define CALOCONDPHYSALGS_LARMINBIASALG_H
......@@ -39,13 +40,10 @@
/** Default Destructor */
~LArMinBiasAlg();
/** standard Athena-Algorithm method */
StatusCode initialize();
/** standard Athena-Algorithm method */
StatusCode execute();
/** standard Athena-Algorithm method */
StatusCode finalize();
StatusCode stop();
virtual StatusCode initialize() override;
virtual StatusCode execute() override;
virtual StatusCode finalize() override;
virtual StatusCode stop() override;
private:
......@@ -64,7 +62,11 @@
{ this, "MCSymKey", "LArMCSym", "SG Key of LArMCSym object" };
SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
const CaloDetDescrManager* m_calodetdescrmgr = nullptr;
SG::ReadCondHandleKey<CaloDetDescrManager> m_caloMgrKey { this
, "CaloDetDescrManager"
, "CaloDetDescrManager"
, "SG Key for CaloDetDescrManager in the Condition Store" };
const LArEM_ID* m_larem_id = nullptr;
const CaloCell_ID* m_calo_id = nullptr;
std::vector<double> m_eCell;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment