From c6b199aaf87b368db75e1180abe674f0534e3680 Mon Sep 17 00:00:00 2001 From: scott snyder <sss@karma> Date: Fri, 19 Mar 2021 16:11:17 -0400 Subject: [PATCH] LArConditionsTest: Remove obsolete code. Remove obsolete/unused class TestLArConditionsTools. It relies on obsolete tools. --- .../LArTest/LArConditionsTest/CMakeLists.txt | 3 +- .../TestLArConditionsTools.h | 53 ---- .../TestLArConditionsTools_jobOptions.py | 97 -------- .../src/LArConditionsTest_entries.cxx | 4 +- .../src/TestLArConditionsTools.cxx | 228 ------------------ 5 files changed, 2 insertions(+), 383 deletions(-) delete mode 100644 LArCalorimeter/LArTest/LArConditionsTest/LArConditionsTest/TestLArConditionsTools.h delete mode 100644 LArCalorimeter/LArTest/LArConditionsTest/share/TestLArConditionsTools_jobOptions.py delete mode 100644 LArCalorimeter/LArTest/LArConditionsTest/src/TestLArConditionsTools.cxx diff --git a/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt b/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt index 92881e30f4bf..d32d15010c27 100644 --- a/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt +++ b/LArCalorimeter/LArTest/LArConditionsTest/CMakeLists.txt @@ -6,11 +6,10 @@ atlas_subdir( LArConditionsTest ) # Component(s) in the package: atlas_add_component( LArConditionsTest src/LArConditionsTest_entries.cxx - src/TestLArConditionsTools.cxx src/LArCondDataTest.cxx src/LArConditionsTestAlg.cxx src/LArCablingTest.cxx - LINK_LIBRARIES AthenaBaseComps StoreGateLib Identifier GaudiKernel LArCablingLib LArElecCalib LArIdentifier LArRawConditions LArRawUtilsLib LArRecConditions CaloDetDescrLib CaloEvent CaloIdentifier AthenaKernel CaloInterfaceLib ) + LINK_LIBRARIES AthenaBaseComps StoreGateLib Identifier GaudiKernel LArCablingLib LArElecCalib LArIdentifier LArRawConditions LArRawUtilsLib LArRecConditions CaloDetDescrLib CaloEvent CaloIdentifier AthenaKernel CaloInterfaceLib CaloConditions ) # Install files from the package: atlas_install_joboptions( share/*.py ) diff --git a/LArCalorimeter/LArTest/LArConditionsTest/LArConditionsTest/TestLArConditionsTools.h b/LArCalorimeter/LArTest/LArConditionsTest/LArConditionsTest/TestLArConditionsTools.h deleted file mode 100644 index 085f84202ca1..000000000000 --- a/LArCalorimeter/LArTest/LArConditionsTest/LArConditionsTest/TestLArConditionsTools.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TESTLARCONDITIONSTOOLS_H -#define TESTLARCONDITIONSTOOLS_H - -#include "AthenaBaseComps/AthAlgorithm.h" -#include "CaloInterface/ICaloNoiseTool.h" -#include "GaudiKernel/ToolHandle.h" -#include <string> - -class CaloCell_ID; - -#include "LArElecCalib/ILArOFCTool.h" -#include "LArElecCalib/ILArADC2MeVTool.h" -#include "LArElecCalib/ILArAutoCorrNoiseTool.h" -#include "LArElecCalib/ILArAutoCorrTotalTool.h" -#include "LArRawUtils/LArRoI_Map.h" -#include "StoreGate/ReadCondHandleKey.h" -#include "LArCabling/LArOnOffIdMapping.h" - -class TestLArConditionsTools : public AthAlgorithm -{ - public: - TestLArConditionsTools(const std::string& name,ISvcLocator* pSvcLocator); - virtual ~TestLArConditionsTools(); - - StatusCode initialize(); - StatusCode execute(); - StatusCode finalize(); - StatusCode retrieveTools(); - -private: - - SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; - - StatusCode testCaloNoiseDDE(); - StatusCode testCaloCellNoise(); - StatusCode testLArRoI_Map(); - - ToolHandle<ILArOFCTool> m_ofcTool; - ToolHandle<ILArAutoCorrTotalTool> m_acTotalTool; - ToolHandle<ILArAutoCorrNoiseTool> m_acNoiseTool; - ToolHandle<ILArADC2MeVTool> m_adc2MeVTool ; - ToolHandle<ICaloNoiseTool> m_noiseTool ; - ToolHandle<LArRoI_Map> m_roiMap ; - bool m_retrieveInInit ; - - const CaloCell_ID* m_idHelper ; -}; - -#endif // TESTLARCONDITIONSTOOLS_H diff --git a/LArCalorimeter/LArTest/LArConditionsTest/share/TestLArConditionsTools_jobOptions.py b/LArCalorimeter/LArTest/LArConditionsTest/share/TestLArConditionsTools_jobOptions.py deleted file mode 100644 index 4224d9ece760..000000000000 --- a/LArCalorimeter/LArTest/LArConditionsTest/share/TestLArConditionsTools_jobOptions.py +++ /dev/null @@ -1,97 +0,0 @@ -############################################################### -# -# Job options file -# -#============================================================== -#use McEventSelector - -include( "AthenaCommon/Atlas_Gen.UnixStandardJob.py" ) - -from AthenaCommon.AlgSequence import AlgSequence -topSequence = AlgSequence() - -#-------------------------------------------------------------- -# Set output level threshold (1=VERBOSE, 2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL ) -#-------------------------------------------------------------- -theMessageSvc = svcMgr.MessageSvc -theMessageSvc.OutputLevel = DEBUG -theMessageSvc.debugLimit = 100000 -theMessageSvc.infoLimit = 100000 - - -EventSelector = svcMgr.EventSelector -EventSelector.RunNumber=1 -EventSelector.EventsPerRun=10; -EventSelector.FirstEvent=1 - -theApp.Dlls += [ "GaudiAud" ] -theAuditorSvc = svcMgr.AuditorSvc -theAuditorSvc.Auditors = [ "ChronoAuditor" ] - -# DetDescrVersion = "DC2" -# DetDescrVersion = "Rome-Initial" -# DetDescrVersion = "ATLAS-DC3-05" - -from AthenaCommon.GlobalFlags import GlobalFlags -from AthenaCommon.JobProperties import jobproperties -jobproperties.Global.DetDescrVersion = "ATLAS-DC3-05" - -GlobalFlags.DataSource.set_geant4() -# GlobalFlags.InputFormat.set_bytestream() -GlobalFlags.DetGeo.set_atlas() -GlobalFlags.Luminosity.set_zero() - -#-------------------------------------------------------------- -# Detector Description -#-------------------------------------------------------------- -from AthenaCommon.DetFlags import DetFlags -DetFlags.Calo_setOn() -DetFlags.ID_setOff() -DetFlags.Muon_setOff() -DetFlags.Truth_setOff() -DetFlags.LVL1_setOff() -DetFlags.digitize.all_setOff() - -from AtlasGeoModel import SetGeometryVersion -from AtlasGeoModel import GeoModelInit - -include ("AthenaPoolCnvSvc/AthenaPool_jobOptions.py") - -# include the converters -include( "LArCondAthenaPool/LArCondAthenaPool_joboptions.py" ) -include ("LArRawConditions/LArRawConditionsDict_joboptions.py") -include ("CaloUtils/CaloUtilsDict_joboptions.py") - -# Other LAr related -include( "LArIdCnv/LArIdCnv_joboptions.py" ) - -include( "CaloDetMgrDetDescrCnv/CaloDetMgrDetDescrCnv_joboptions.py" ) - -include( "IdDictDetDescrCnv/IdDictDetDescrCnv_joboptions.py" ) - -include( "LArConditionsCommon/LArConditionsCommon_MC_jobOptions.py" ) -include( "LArConditionsCommon/LArIdMap_MC_jobOptions.py" ) - -#-------------------------------------------------------------- -# Private Application Configuration options -#-------------------------------------------------------------- -#load relevant libraries -theApp.Dlls += [ "LArRawUtils" ] -theApp.Dlls += [ "LArTools" ] -# theApp.Dlls += [ "LArConditionsTest" ] - -include ("CaloTools/CaloNoiseTool_jobOptions.py") - -from LArConditionsTest.LArConditionsTestConf import TestLArConditionsTools -topSequence += TestLArConditionsTools() -theCaloNoiseTool.LoadAtBegin= True - -theApp.EvtMax = 1 - -#-------------------------------------------------------------- -# Load POOL support -#-------------------------------------------------------------- -# Make sure AthenaPoolServices is loaded for custom streamer -# include ("AthenaPoolServices/AthenaRootStreamerSvc_jobOptions.py") - -EventSelector.OverrideRunNumber=False diff --git a/LArCalorimeter/LArTest/LArConditionsTest/src/LArConditionsTest_entries.cxx b/LArCalorimeter/LArTest/LArConditionsTest/src/LArConditionsTest_entries.cxx index 50af6ab76808..6e011198dbce 100644 --- a/LArCalorimeter/LArTest/LArConditionsTest/src/LArConditionsTest_entries.cxx +++ b/LArCalorimeter/LArTest/LArConditionsTest/src/LArConditionsTest_entries.cxx @@ -1,13 +1,11 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "LArConditionsTest/LArConditionsTestAlg.h" #include "LArConditionsTest/LArCondDataTest.h" -#include "LArConditionsTest/TestLArConditionsTools.h" #include "LArConditionsTest/LArCablingTest.h" DECLARE_COMPONENT( LArConditionsTestAlg ) DECLARE_COMPONENT( LArCondDataTest ) -DECLARE_COMPONENT( TestLArConditionsTools ) DECLARE_COMPONENT( LArCablingTest ) diff --git a/LArCalorimeter/LArTest/LArConditionsTest/src/TestLArConditionsTools.cxx b/LArCalorimeter/LArTest/LArConditionsTest/src/TestLArConditionsTools.cxx deleted file mode 100644 index c4aef5043e3d..000000000000 --- a/LArCalorimeter/LArTest/LArConditionsTest/src/TestLArConditionsTools.cxx +++ /dev/null @@ -1,228 +0,0 @@ -/* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration -*/ - -#include "LArConditionsTest/TestLArConditionsTools.h" -#include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/IAlgTool.h" - -#include "StoreGate/StoreGateSvc.h" -#include "CaloIdentifier/CaloCell_ID.h" -#include "CaloDetDescr/CaloDetDescrManager.h" -#include "CaloDetDescr/CaloDetDescrElement.h" -#include "CaloEvent/CaloCellContainer.h" - -#include "LArElecCalib/ILArOFCTool.h" -#include "LArElecCalib/ILArADC2MeVTool.h" -#include "LArElecCalib/ILArAutoCorrNoiseTool.h" -#include "LArElecCalib/ILArAutoCorrTotalTool.h" - -TestLArConditionsTools::TestLArConditionsTools(const std::string& name, ISvcLocator* pSvcLocator) : - AthAlgorithm(name,pSvcLocator), - m_ofcTool("LArOFCTool"), - m_acTotalTool("LArAutoCorrTotalTool"), - m_acNoiseTool("LArAutoCorrNoiseTool"), - m_adc2MeVTool("LArADC2MeVTool"), - m_noiseTool("CaloNoiseTool/calonoisetool"), - m_roiMap("LArRoI_Map"), - m_idHelper(0) - { - declareProperty ("RetrieveToolInInit", m_retrieveInInit=true); - //std::cout<<" in TestLArConditionsTools c-tor"<<std::endl; - } - -TestLArConditionsTools::~TestLArConditionsTools() -{ - //std::cout<<" in TestLArConditionsTools d-tor"<<std::endl; -} - -StatusCode TestLArConditionsTools::retrieveTools() { - ATH_CHECK( m_noiseTool.retrieve() ); - - ATH_MSG_DEBUG(" CaloNoiseTool typename "<<m_noiseTool.typeAndName()); - - ATH_CHECK( m_acNoiseTool.retrieve() ); - ATH_CHECK( m_adc2MeVTool.retrieve() ); - ATH_CHECK( m_acTotalTool.retrieve() ); - ATH_CHECK( m_ofcTool.retrieve() ); - ATH_CHECK( m_roiMap.retrieve() ); - return StatusCode::SUCCESS; -} - - -StatusCode TestLArConditionsTools::initialize() { - - ATH_MSG_DEBUG ( " in initialize "); - - ATH_CHECK( retrieveTools() ); - ATH_CHECK( detStore()->retrieve( m_idHelper) ); - ATH_CHECK( m_cablingKey.initialize() ); - - /* - log<<MSG::INFO<<" testing LArRoI_Map in init "<<endmsg; - sc = testLArRoI_Map(); - if(!sc.isSuccess()) { - log<<MSG::ERROR<<" failed LArRoI_Map test "<<endmsg; - } - - */ - - ATH_MSG_INFO ( " done initialize " ); - return StatusCode::SUCCESS; -} - -StatusCode TestLArConditionsTools::testCaloCellNoise() { - ATH_MSG_INFO ( " in testCaloCellNoise" ); - - const CaloCellContainer* cont = nullptr; - ATH_CHECK( evtStore()->retrieve(cont,"AllCalo") ); - - CaloCellContainer::const_iterator cell_it = cont->begin(); - CaloCellContainer::const_iterator cell_it_e = cont->end(); - - int n=0; - for( ; cell_it!=cell_it_e ; ++cell_it){ - - const CaloCell* cell = *cell_it; - Identifier id = cell->ID() ; - const CaloDetDescrElement* dde=cell->caloDDE(); - - if(dde==0) { - ATH_MSG_ERROR ( " DDE null " << m_idHelper->print_to_string(id)); - continue; - } - - ATH_MSG_DEBUG( " channel " << m_idHelper->print_to_string(id)); - - float f2 = m_noiseTool->elecNoiseRMSHighestGain(dde); - float f1 = m_noiseTool->elecNoiseRMS(cell); - // float f2 = m_noiseTool->elecNoiseRMSHighestGain(dde,1); - // float f1 = m_noiseTool->elecNoiseRMS(dde,CaloGain::LARHIGHGAIN,-1); - // float f2 = m_noiseTool->elecNoiseRMS(dde,CaloGain::LARHIGHGAIN,1); - // float f2 = 0; - - /* - std::vector<float> totalNoises = m_noiseTool->elecNoiseRMS3gains(dde,1); - if(totalNoises.size()==0){ - log << MSG::ERROR << " fail to get noise for this channel" << - m_idHelper->print_to_string(id)<<endmsg; - } - */ - ATH_MSG_DEBUG( " channel " << m_idHelper->print_to_string(id) - <<" noise "<<f1<<" "<<f2); - - ++n; - } - - ATH_MSG_INFO(" number of cells tested "<<n); - return StatusCode::SUCCESS; - -} - -StatusCode TestLArConditionsTools::testCaloNoiseDDE() { - - const CaloDetDescrManager* dd_man = nullptr; - ATH_CHECK( detStore()->retrieve( dd_man) ); - SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; - const LArOnOffIdMapping* cabling = *cablingHdl; - - std::vector<Identifier>::const_iterator cell_it = m_idHelper->cell_begin(); - std::vector<Identifier>::const_iterator cell_it_e = m_idHelper->cell_end(); - - int n=0; - for( ; cell_it!=cell_it_e ; ++cell_it){ - - Identifier id = *cell_it; - bool isLAr = m_idHelper->is_lar(id); - const CaloDetDescrElement* dde=dd_man->get_element(id); - if(dde==0) { - ATH_MSG_ERROR ( " DDE null " << m_idHelper->print_to_string(id)); - continue; - } - - ATH_MSG_DEBUG( " channel " << m_idHelper->print_to_string(id)); - - float f1 = m_noiseTool->elecNoiseRMS(dde,CaloGain::LARHIGHGAIN,-1); - float f2 = m_noiseTool->elecNoiseRMS(dde,CaloGain::LARHIGHGAIN,1); - - std::vector<float> totalNoises = m_noiseTool->elecNoiseRMS3gains(dde,1); - if(totalNoises.size()==0){ - ATH_MSG_ERROR ( " fail to get noise for this channel" << - m_idHelper->print_to_string(id)); - } - - ATH_MSG_DEBUG( " noise = " << f1<<" "<<f2); - - - if(isLAr){ - ILArOFCTool::OFCRef_t ofc_a = m_ofcTool->OFC_a(id,0); - if(ofc_a.size()==0){ - ATH_MSG_ERROR ( " fail to get OFC " << - m_idHelper->print_to_string(id)); - } - - const std::vector<float>& adc2mev = m_adc2MeVTool->ADC2MEV(id,0); - if(adc2mev.size()==0){ - ATH_MSG_ERROR ( " fail to get ADC2MEV " << - m_idHelper->print_to_string(id)); - } - - const std::vector<double> acTotal = m_acTotalTool->autoCorrTotal(cabling->createSignalChannelID(id),0); - if(acTotal.size()==0){ - ATH_MSG_ERROR ( " fail to get AutoCorrTotal " << - m_idHelper->print_to_string(id)); - } - } - - ++n; - - } - - ATH_MSG_INFO(" number of cells tested "<<n); - return StatusCode::SUCCESS; - -} - -StatusCode TestLArConditionsTools::testLArRoI_Map() { - - std::vector<Identifier>::const_iterator cell_it = m_idHelper->cell_begin(); - std::vector<Identifier>::const_iterator cell_it_e = m_idHelper->cell_end(); - - int n=0; - for( ; cell_it!=cell_it_e ; ++cell_it){ - - Identifier id = *cell_it; - bool isLAr = m_idHelper->is_lar(id); - int ttid = m_roiMap->TrigTowerID(id); - ATH_MSG_DEBUG ( " n " << n - << " id " << id.get_compact() - << " isLAr " << isLAr - << " ttid " << ttid ); - ++n; - } - - ATH_MSG_INFO(" number of cells tested for LArRoI_Map "<<n); - return StatusCode::SUCCESS; - -} -StatusCode TestLArConditionsTools::execute() { - - ATH_MSG_DEBUG(" in execute"); - //StatusCode sc = testCaloCellNoise(); - StatusCode sc = testCaloNoiseDDE(); - if(!sc.isSuccess()) { - ATH_MSG_ERROR(" failed CaloNoise Test"); - } - - - sc = testLArRoI_Map(); - if(!sc.isSuccess()) { - ATH_MSG_ERROR(" failed LArRoI_Map test "); - } - return StatusCode::SUCCESS; -} - -StatusCode TestLArConditionsTools::finalize() { - return StatusCode::SUCCESS; -} - -- GitLab