Skip to content
Snippets Groups Projects
Commit c6b199aa authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

LArConditionsTest: Remove obsolete code.

Remove obsolete/unused class TestLArConditionsTools.
It relies on obsolete tools.
parent 38409b66
No related branches found
No related tags found
7 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!41882aligning "tracktwoef_nonrnn_chain" with master branch,!41855LArConditionsTest: Remove obsolete code.
...@@ -6,11 +6,10 @@ atlas_subdir( LArConditionsTest ) ...@@ -6,11 +6,10 @@ atlas_subdir( LArConditionsTest )
# Component(s) in the package: # Component(s) in the package:
atlas_add_component( LArConditionsTest atlas_add_component( LArConditionsTest
src/LArConditionsTest_entries.cxx src/LArConditionsTest_entries.cxx
src/TestLArConditionsTools.cxx
src/LArCondDataTest.cxx src/LArCondDataTest.cxx
src/LArConditionsTestAlg.cxx src/LArConditionsTestAlg.cxx
src/LArCablingTest.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: # Install files from the package:
atlas_install_joboptions( share/*.py ) atlas_install_joboptions( share/*.py )
......
/*
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
###############################################################
#
# 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
/* /*
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/LArConditionsTestAlg.h"
#include "LArConditionsTest/LArCondDataTest.h" #include "LArConditionsTest/LArCondDataTest.h"
#include "LArConditionsTest/TestLArConditionsTools.h"
#include "LArConditionsTest/LArCablingTest.h" #include "LArConditionsTest/LArCablingTest.h"
DECLARE_COMPONENT( LArConditionsTestAlg ) DECLARE_COMPONENT( LArConditionsTestAlg )
DECLARE_COMPONENT( LArCondDataTest ) DECLARE_COMPONENT( LArCondDataTest )
DECLARE_COMPONENT( TestLArConditionsTools )
DECLARE_COMPONENT( LArCablingTest ) DECLARE_COMPONENT( LArCablingTest )
/*
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;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment