diff --git a/Calorimeter/CaloCondPhysAlgs/CMakeLists.txt b/Calorimeter/CaloCondPhysAlgs/CMakeLists.txt index 51d446b0f6ab4702fb282ba71322dfd1085b06d3..2a7b7ca629b8d9ff8c323cfabe04bd4eed4cad7d 100644 --- a/Calorimeter/CaloCondPhysAlgs/CMakeLists.txt +++ b/Calorimeter/CaloCondPhysAlgs/CMakeLists.txt @@ -21,6 +21,7 @@ atlas_depends_on_subdirs( PUBLIC LArCalorimeter/LArIdentifier LArCalorimeter/LArRecUtils LArCalorimeter/LArTools + LArCalorimeter/LArRawConditions Trigger/TrigAnalysis/TrigDecisionTool PRIVATE Calorimeter/CaloConditions @@ -46,7 +47,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 SGtests GaudiKernel LArCablingLib LArIdentifier TrigDecisionToolLib + CaloIdentifier AthenaBaseComps AthenaKernel StoreGateLib SGtests GaudiKernel LArCablingLib LArIdentifier TrigDecisionToolLib LArRawConditions CaloConditions CaloEvent CaloUtilsLib AthenaPoolUtilities Identifier xAODEventInfo LArHV LArReadoutGeometry LArSimEvent CxxUtils) # Install files from the package: diff --git a/Calorimeter/CaloCondPhysAlgs/share/LArMinBiasAlg_jobOptions.py b/Calorimeter/CaloCondPhysAlgs/share/LArMinBiasAlg_jobOptions.py index 9dd71c33fc0fba9e2f81ae282abcd2b4a977acef..97d31e34f095d7355925f2cd5f824baf62f2b419 100644 --- a/Calorimeter/CaloCondPhysAlgs/share/LArMinBiasAlg_jobOptions.py +++ b/Calorimeter/CaloCondPhysAlgs/share/LArMinBiasAlg_jobOptions.py @@ -61,6 +61,9 @@ include( "LArDetDescr/LArDetDescr_joboptions.py" ) include("TileConditions/TileConditions_jobOptions.py" ) include("LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py") +from LArRecUtils.LArMCSymCondAlg import LArMCSymCondAlgDefault +LArMCSymCondAlgDefault() + from CaloCondPhysAlgs.CaloCondPhysAlgsConf import LArMinBiasAlg larMinBiasAlg = LArMinBiasAlg() larMinBiasAlg.datasetID_lowPt =119995 diff --git a/Calorimeter/CaloCondPhysAlgs/src/LArMinBiasAlg.cxx b/Calorimeter/CaloCondPhysAlgs/src/LArMinBiasAlg.cxx index 5236823be771143aa16ab4f98699d5fab1676e1a..d634db31e2d01d946b1d897031dc2f7c701279c0 100644 --- a/Calorimeter/CaloCondPhysAlgs/src/LArMinBiasAlg.cxx +++ b/Calorimeter/CaloCondPhysAlgs/src/LArMinBiasAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #include "LArMinBiasAlg.h" @@ -20,7 +20,6 @@ //Constructor LArMinBiasAlg:: LArMinBiasAlg(const std::string& name, ISvcLocator* pSvcLocator): AthAlgorithm(name,pSvcLocator), - m_larmcsym("LArMCSymTool"), m_datasetID_lowPt(119995), m_datasetID_highPt(119996), m_weight_lowPt(39.8606), @@ -76,7 +75,7 @@ // retrieve CaloDetDescrMgr ATH_CHECK( detStore()->retrieve(m_calodetdescrmgr) ); - ATH_CHECK(m_larmcsym.retrieve()); + ATH_CHECK(m_mcSymKey.initialize()); ATH_CHECK(m_cablingKey.initialize()); @@ -112,9 +111,12 @@ ATH_MSG_DEBUG(" LArMinBiasAlg execute()"); + const EventContext& ctx = Gaudi::Hive::currentContext(); + if (m_first) { - SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + SG::ReadCondHandle<LArMCSym> mcsym (m_mcSymKey, ctx); + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl (m_cablingKey, ctx); const LArOnOffIdMapping* cabling{*cablingHdl}; if(!cabling) { ATH_MSG_ERROR( "Do not have cabling mapping from key " << m_cablingKey.key() ); @@ -140,14 +142,14 @@ IdentifierHash idHash=i; Identifier id=m_calo_id->cell_id(idHash); if (m_calo_id->is_tile(id)) continue; - // convert cell id to symetric identifier - HWIdentifier hwid2=m_larmcsym->symOnline(id); + // convert cell id to symmetric identifier + HWIdentifier hwid2 = mcsym->ZPhiSymOfl(id); Identifier id2 = cabling->cnvToIdentifier(hwid2); int i2 = (int) (m_calo_id->calo_cell_hash(id2)); if(i2>=m_ncell) { ATH_MSG_WARNING("problem: i2: "<<i2<<" for id: "<<m_calo_id->print_to_string(id)<<" symmetrized: "<<m_calo_id->print_to_string(id2)); } - // we have already processed this hash => just need to associate cell i to the same symetric cell + // we have already processed this hash => just need to associate cell i to the same symmetric cell if (doneCell[i2]>=0) { m_symCellIndex[i]=doneCell[i2]; } diff --git a/Calorimeter/CaloCondPhysAlgs/src/LArMinBiasAlg.h b/Calorimeter/CaloCondPhysAlgs/src/LArMinBiasAlg.h index 0a8e3fc737fe5d7047c607b6033a7eaa20d8644a..2038ccd85de6a17fa98b4ababfea128cbf76c536 100644 --- a/Calorimeter/CaloCondPhysAlgs/src/LArMinBiasAlg.h +++ b/Calorimeter/CaloCondPhysAlgs/src/LArMinBiasAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ // TheLArMinBiasAlg.h @@ -22,9 +22,9 @@ #include "CaloIdentifier/CaloCell_ID.h" #include "CaloDetDescr/CaloDetDescrManager.h" -#include "LArElecCalib/ILArMCSymTool.h" #include "LArElecCalib/ILArMinBias.h" #include "LArCabling/LArOnOffIdMapping.h" +#include "LArRawConditions/LArMCSym.h" #include "GaudiKernel/ITHistSvc.h" #include "TTree.h" @@ -56,11 +56,12 @@ //--------------------------------------------------- // Member variables //--------------------------------------------------- - ToolHandle<ILArMCSymTool> m_larmcsym; int m_datasetID_lowPt; int m_datasetID_highPt; double m_weight_lowPt; double m_weight_highPt; + SG::ReadCondHandleKey<LArMCSym> m_mcSymKey + { 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;