Commit 4c993f88 authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

CaloCondPhysAlgs: Migrate CaloCellCalcEnergyCorr to conditions data.

Migrate CaloCellCalcEnergyCorr to use conditions data.
Looking to try to get rid of the obsolete LArHVCablingTool.
parent 1ca6b90c
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
# Declare the package name:
atlas_subdir( CaloCondPhysAlgs )
......@@ -15,7 +15,7 @@ atlas_add_component( CaloCondPhysAlgs
src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CORAL_INCLUDE_DIRS} ${COOL_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CORAL_LIBRARIES} ${COOL_LIBRARIES} ${CLHEP_LIBRARIES} CaloCondBlobObjs CaloDetDescrLib CaloGeoHelpers
CaloIdentifier AthenaBaseComps AthenaKernel StoreGateLib GaudiKernel LArCablingLib LArElecCalib LArIdentifier TrigDecisionToolLib LArRawConditions
CaloIdentifier AthenaBaseComps AthenaKernel StoreGateLib GaudiKernel LArCablingLib LArElecCalib LArIdentifier TrigDecisionToolLib LArRawConditions LArRecConditions
CaloConditions CaloEvent CaloInterfaceLib CaloUtilsLib AthenaPoolUtilities Identifier xAODEventInfo LArHV LArReadoutGeometry LArSimEvent CxxUtils)
# Install files from the package:
......
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// CaloCellCalcEnergyCorr.cxx
......@@ -34,13 +34,15 @@
#include "CoolKernel/types.h"
#include "CoolKernel/Record.h"
#include "CoralBase/AttributeListSpecification.h"
#include "StoreGate/ReadCondHandle.h"
#include "GaudiKernel/ThreadLocalContext.h"
#include "CxxUtils/checker_macros.h"
struct ATLAS_NOT_THREAD_SAFE CaloCellCalcEnergyCorr::HVData
struct CaloCellCalcEnergyCorr::HVData
{
HVData (const LArHVManager& manager);
HVData (const LArHVManager& manager,
const LArHVIdMapping& hvCabling,
const std::vector<const CondAttrListCollection*>& attrvec);
EMBHVManager::EMBHVData m_hvdata_EMB;
EMBPresamplerHVManager::EMBPresamplerHVData m_hvdata_EMBPS;
EMECHVManager::EMECHVData m_hvdata_EMEC_IN;
......@@ -51,14 +53,16 @@ struct ATLAS_NOT_THREAD_SAFE CaloCellCalcEnergyCorr::HVData
};
CaloCellCalcEnergyCorr::HVData::HVData (const LArHVManager& manager)
: m_hvdata_EMB (manager.getEMBHVManager().getData()),
m_hvdata_EMBPS (manager.getEMBPresamplerHVManager().getData()),
m_hvdata_EMEC_IN (manager.getEMECHVManager(EMECHVModule::IOType::INNER).getData()),
m_hvdata_EMEC_OUT (manager.getEMECHVManager(EMECHVModule::IOType::OUTER).getData()),
m_hvdata_EMECPS (manager.getEMECPresamplerHVManager().getData()),
m_hvdata_HEC (manager.getHECHVManager().getData()),
m_hvdata_FCAL (manager.getFCALHVManager().getData())
CaloCellCalcEnergyCorr::HVData::HVData (const LArHVManager& manager,
const LArHVIdMapping& hvCabling,
const std::vector<const CondAttrListCollection*>& attrvec)
: m_hvdata_EMB (manager.getEMBHVManager().getData (hvCabling, attrvec)),
m_hvdata_EMBPS (manager.getEMBPresamplerHVManager().getData (hvCabling, attrvec)),
m_hvdata_EMEC_IN (manager.getEMECHVManager(EMECHVModule::IOType::INNER).getData (hvCabling, attrvec)),
m_hvdata_EMEC_OUT (manager.getEMECHVManager(EMECHVModule::IOType::OUTER).getData (hvCabling, attrvec)),
m_hvdata_EMECPS (manager.getEMECPresamplerHVManager().getData (hvCabling, attrvec)),
m_hvdata_HEC (manager.getHECHVManager().getData (hvCabling, attrvec)),
m_hvdata_FCAL (manager.getFCALHVManager().getData (hvCabling, attrvec))
{
}
......@@ -109,6 +113,9 @@ StatusCode CaloCellCalcEnergyCorr::initialize()
ATH_CHECK( detStore()->retrieve(m_calodetdescrmgr) );
ATH_CHECK( m_hvCablingKey.initialize() );
ATH_CHECK( m_DCSFolderKeys.initialize() );
return StatusCode::SUCCESS;
}
......@@ -122,7 +129,7 @@ StatusCode CaloCellCalcEnergyCorr::execute()
return StatusCode::SUCCESS;
}
StatusCode CaloCellCalcEnergyCorr::stop ATLAS_NOT_THREAD_SAFE ()
StatusCode CaloCellCalcEnergyCorr::stop()
{
const CaloCell_ID* calocell_id;
......@@ -174,7 +181,16 @@ StatusCode CaloCellCalcEnergyCorr::stop ATLAS_NOT_THREAD_SAFE ()
const LArHVManager* manager = nullptr;
CHECK( detStore()->retrieve (manager) );
HVData hvdata (*manager);
const EventContext& ctx = Gaudi::Hive::currentContext();
SG::ReadCondHandle<LArHVIdMapping> hvCabling (m_hvCablingKey, ctx);
std::vector<const CondAttrListCollection*> attrvec;
for (const auto& fldkey: m_DCSFolderKeys ) {
SG::ReadCondHandle<CondAttrListCollection> dcsHdl(fldkey, ctx);
attrvec.push_back (*dcsHdl);
}
HVData hvdata (*manager, **hvCabling, attrvec);
std::vector<float> setVec(1,1);
unsigned nSet=0;
......
///////////////////////// -*- C++ -*- /////////////////////////////
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef CALOCONDPHYSALGS_CALOCELLCALCENERGYCORR_H
......@@ -14,8 +14,11 @@
#include "CaloIdentifier/LArEM_ID.h"
#include "CaloIdentifier/LArHEC_ID.h"
#include "CaloIdentifier/LArFCAL_ID.h"
#include "LArRecConditions/LArHVIdMapping.h"
#include "AthenaPoolUtilities/CondAttrListCollection.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "StoreGate/CondHandleKeyArray.h"
#include "CxxUtils/checker_macros.h"
class CaloCellCalcEnergyCorr: public AthAlgorithm
{
......@@ -34,13 +37,13 @@ class CaloCellCalcEnergyCorr: public AthAlgorithm
virtual ~CaloCellCalcEnergyCorr();
// Athena algorithm's Hooks
virtual StatusCode initialize();
virtual StatusCode execute();
virtual StatusCode finalize();
virtual StatusCode stop ATLAS_NOT_THREAD_SAFE /* Calls getData() method of HV managers */();
virtual StatusCode initialize() override;
virtual StatusCode execute() override;
virtual StatusCode finalize() override;
virtual StatusCode stop() override;
private:
struct ATLAS_NOT_THREAD_SAFE HVData;
struct HVData;
// Properties
std::string m_folder;
......@@ -49,6 +52,12 @@ private:
std::vector<int> m_hvlines; // which hvlines should be changed in addition
std::vector<float> m_hvvalue; // value to fill for every hvline
SG::ReadCondHandleKey<LArHVIdMapping> m_hvCablingKey
{this, "LArHVIdMapping", "LArHVIdMap", "SG key for HV ID mapping"};
SG::ReadCondHandleKeyArray<CondAttrListCollection> m_DCSFolderKeys
{ this, "DCSFolderNames", {"/LAR/DCS/HV/BARREl/I16", "/LAR/DCS/HV/BARREL/I8"},
"DCS folders with HV values"};
// Private members
const CaloDetDescrManager* m_calodetdescrmgr;
const LArEM_ID* m_larem_id;
......
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