diff --git a/Calorimeter/CaloRec/python/CaloCellFlags.py b/Calorimeter/CaloRec/python/CaloCellFlags.py index 407313f26fb54d8d6f54b7cf06ec68196ae5ce19..8a016e6d2abe62a94c52c63561ead5c1e20ce8fe 100644 --- a/Calorimeter/CaloRec/python/CaloCellFlags.py +++ b/Calorimeter/CaloRec/python/CaloCellFlags.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration # @file: CaloCellFlags.py # @purpose: a container of flags for CaloCell making configuring @@ -73,13 +73,6 @@ class doMinBiasAverage(JobProperty): allowedTypes = ['bool'] StoredValue = False -class doLArRecalibration(JobProperty): - """ Flag to activate cell recalibration, undoing online energy computation and applying new calibration - """ - statusOn = True - allowedTypes = ['bool'] - StoredValue = False - class doLArNoiseMasking(JobProperty): """ Flag to activate masking of high noise / dead cell for all events """ @@ -183,7 +176,6 @@ list_jobproperties = [ doLArHVCorr, doPedestalCorr, doMinBiasAverage, - doLArRecalibration, doLArNoiseMasking, doLArSporadicMasking, doLArBadFebMasking, diff --git a/Calorimeter/CaloRec/python/CaloCellGetter.py b/Calorimeter/CaloRec/python/CaloCellGetter.py index bb48fc6e9d8239ad55dfba34d33babe128c00071..662c90b416b71280a9c95cc5a88a7a79ac310ff7 100644 --- a/Calorimeter/CaloRec/python/CaloCellGetter.py +++ b/Calorimeter/CaloRec/python/CaloCellGetter.py @@ -492,67 +492,6 @@ class CaloCellGetter (Configured) : #theCaloCellMaker += theHVCorrTool theCaloCellMaker.CaloCellMakerToolNames += [theLArCellHVCorrTool] - # - # correction to undo online calibration and apply new LAr electronics calibration for ADC->MeV conversion - # - doLArRecalibration = False - if jobproperties.CaloCellFlags.doLArRecalibration.statusOn: - from AthenaCommon.GlobalFlags import globalflags - from LArConditionsCommon.LArCondFlags import larCondFlags - if jobproperties.CaloCellFlags.doLArRecalibration() and globalflags.DataSource() == 'data' and (not larCondFlags.SingleVersion()) : - doLArRecalibration = True - mlog.info("Redoing LAr electronics calibration for ADC->MeV") - - - if doLArRecalibration: - - # get tool for cell recalibration - try: - from LArCellRec.LArCellRecConf import LArCellRecalibration - theLArCellRecalibration = LArCellRecalibration("LArCellRecalibration") - except Exception: - mlog.error("could not get handle to LArCellRecalibration Quit") - print(traceback.format_exc()) - return False - - # get new ADC2MeVTool - try: - from LArRecUtils.LArADC2MeVToolDefault import LArADC2MeVToolDefault - theLArADC2MeVToolDefault = LArADC2MeVToolDefault() - except Exception: - mlog.error("Could not get handle to LArADC2MeVToolDefault Quit") - print(traceback.format_exc()) - return False - ToolSvc += theLArADC2MeVToolDefault - - # get old ADC2MeVTool - try: - from LArRecUtils.LArADC2MeVToolOnline import LArADC2MeVToolOnline - theLArADC2MeVToolOnline = LArADC2MeVToolOnline() - except Exception: - mlog.error("Could not get handle to LArADC2MeVToolOnline Quit") - print(traceback.format_exc()) - return False - ToolSvc += theLArADC2MeVToolOnline - - theLArCellRecalibration.adc2MeVTool = theLArADC2MeVToolDefault - theLArCellRecalibration.adc2MeVToolOnline = theLArADC2MeVToolOnline - - - try: - from CaloRec.CaloRecConf import CaloCellContainerCorrectorTool - from CaloIdentifier import SUBCALO - theLArRecalibrationTool = CaloCellContainerCorrectorTool("LArRecalibrationTool", - CaloNums=[ SUBCALO.LAREM, SUBCALO.LARHEC, SUBCALO.LARFCAL ], - CellCorrectionToolNames=[ theLArCellRecalibration]) - except Exception: - mlog.error("could not get handle to HVCorrTool Quit") - print(traceback.format_exc()) - return False - theCaloCellMaker += theLArRecalibrationTool - theCaloCellMaker.CaloCellMakerToolNames += [theLArRecalibrationTool] - - # # Correction for MinBias energy shift for MC pileup reco # diff --git a/LArCalorimeter/LArCellRec/src/LArCellRecalibration.cxx b/LArCalorimeter/LArCellRec/src/LArCellRecalibration.cxx deleted file mode 100644 index 7fbe71475778737f268019826463ccd61deae8e1..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCellRec/src/LArCellRecalibration.cxx +++ /dev/null @@ -1,62 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "LArCellRecalibration.h" -#include "CaloEvent/CaloCell.h" -#include "CaloIdentifier/CaloGain.h" - - -LArCellRecalibration::LArCellRecalibration (const std::string& type, - const std::string& name, - const IInterface* parent) : - CaloCellCorrection(type, name, parent), - m_adc2mevTool("LArADC2MevToolDefault"), - m_adc2mevToolOnline("LArADC2MeVToolOnline"), - m_useInterceptOld(false), - m_useInterceptNew(true) -{ - declareInterface<CaloCellCorrection>(this); - declareProperty("adc2MeVTool",m_adc2mevTool); - declareProperty("adc2MeVToolOnline",m_adc2mevToolOnline); - declareProperty("useIntercept",m_useInterceptNew); - declareProperty("useInterceptOnline",m_useInterceptOld); -} - - -LArCellRecalibration::~LArCellRecalibration() {} - - -StatusCode LArCellRecalibration::initialize() { - ATH_MSG_INFO( " initialization " ); - ATH_CHECK( m_adc2mevTool.retrieve() ); - ATH_CHECK( m_adc2mevToolOnline.retrieve() ); - return StatusCode::SUCCESS; -} - - -void LArCellRecalibration::MakeCorrection (CaloCell* theCell, - const EventContext& /*ctx*/) const -{ - Identifier id = theCell->ID(); - CaloGain::CaloGain gain = theCell->gain(); - float newEnergy=theCell->energy(); - const std::vector<float>& adc2mev_new = m_adc2mevTool->ADC2MEV(id,gain); - const std::vector<float>& adc2mev_old = m_adc2mevToolOnline->ADC2MEV(id,gain); - - if (adc2mev_old[1]>0 && adc2mev_new[1]>0) { - float adc = newEnergy/adc2mev_old[1]; - if (m_useInterceptOld && gain != CaloGain::LARHIGHGAIN) adc = adc - adc2mev_old[0]; - - newEnergy = 0.; - float adcPower = adc; - for (unsigned int i=1;i<adc2mev_new.size();i++) { - newEnergy += adc2mev_new[i]*adcPower; - adcPower = adcPower*adc; - } - if (m_useInterceptNew && gain != CaloGain::LARHIGHGAIN) newEnergy = newEnergy + adc2mev_new[0]; - } - - theCell->setEnergy(newEnergy); - return; -} diff --git a/LArCalorimeter/LArCellRec/src/LArCellRecalibration.h b/LArCalorimeter/LArCellRec/src/LArCellRecalibration.h deleted file mode 100644 index 0f2d373bad5b063b3798a86eb23655e2571eed01..0000000000000000000000000000000000000000 --- a/LArCalorimeter/LArCellRec/src/LArCellRecalibration.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef LARCELLREC_LARCELLRECALIBRATION_H -#define LARCELLREC_LARCELLRECALIBRATION_H - - -#include "CaloUtils/CaloCellCorrection.h" -#include "GaudiKernel/ToolHandle.h" -#include "LArElecCalib/ILArADC2MeVTool.h" - -class CaloCell; - -/** @class LArCellRecalibration - @brief Tool to re-scale cell energies undoing online calibration and applying new MeV/ADC factors - -To invoke this tool: -CaloCellMaker.CaloCellMakerToolNames+=["CaloCellContainerCorrectorTool"] -ToolSvc.CaloCellContainerCorrectorTool.CellCorrectionToolNames+=["LArCellRecalibration"] - -*/ - -class LArCellRecalibration : public CaloCellCorrection { - -public: - - LArCellRecalibration (const std::string& type, const std::string& name, - const IInterface* parent); - - ~LArCellRecalibration(); - virtual StatusCode initialize() override; - - virtual void MakeCorrection (CaloCell* theCell, - const EventContext& ctx) const override; - - private: - - ToolHandle<ILArADC2MeVTool> m_adc2mevTool; - ToolHandle<ILArADC2MeVTool> m_adc2mevToolOnline; - - bool m_useInterceptOld; - bool m_useInterceptNew; - -}; - -#endif diff --git a/LArCalorimeter/LArCellRec/src/components/LArCellRec_entries.cxx b/LArCalorimeter/LArCellRec/src/components/LArCellRec_entries.cxx index f0799d28074dd0287b0467b69b75d09b52f1a27b..e137b7393a97e5bfa669e654278b639af713b533 100644 --- a/LArCalorimeter/LArCellRec/src/components/LArCellRec_entries.cxx +++ b/LArCalorimeter/LArCellRec/src/components/LArCellRec_entries.cxx @@ -4,7 +4,6 @@ #include "../LArCellRescaler.h" #include "../LArCellMaskingTool.h" #include "../LArCellHVCorr.h" -#include "../LArCellRecalibration.h" #include "../LArCellNoiseMaskingTool.h" #include "../LArBadFebMaskingTool.h" #include "../LArCellGainPathology.h" @@ -24,7 +23,6 @@ DECLARE_COMPONENT( LArCellEmMiscalib ) DECLARE_COMPONENT( LArCellRescaler ) DECLARE_COMPONENT( LArCellMaskingTool ) DECLARE_COMPONENT( LArCellHVCorr ) -DECLARE_COMPONENT( LArCellRecalibration ) DECLARE_COMPONENT( LArCellNoiseMaskingTool ) DECLARE_COMPONENT( LArBadFebMaskingTool ) DECLARE_COMPONENT( LArCellGainPathology ) diff --git a/Reconstruction/RecExample/RecExTB/share/RecExTB_Combined_2004_jobOptions.py b/Reconstruction/RecExample/RecExTB/share/RecExTB_Combined_2004_jobOptions.py index f0a915d419c835f0eb05dc1f53c5272d81bc4e2d..30c36af111d27c7fa10905ee7ac3344707c6c05a 100755 --- a/Reconstruction/RecExample/RecExTB/share/RecExTB_Combined_2004_jobOptions.py +++ b/Reconstruction/RecExample/RecExTB/share/RecExTB_Combined_2004_jobOptions.py @@ -522,7 +522,6 @@ if doLAr or doTile: jobproperties.CaloCellFlags.doLArSporadicMasking = False jobproperties.CaloCellFlags.doLArCellEmMisCalib = False jobproperties.CaloCellFlags.doPedestalCorr = False - jobproperties.CaloCellFlags.doLArRecalibration = False jobproperties.CaloCellFlags.doDeadCellCorr = False include( "CaloTBRec/CaloTBRec_H8_Cell_jobOptions.py" ) diff --git a/Reconstruction/RecExample/RecExTB/share/RecExTB_H6_jobOptions.py b/Reconstruction/RecExample/RecExTB/share/RecExTB_H6_jobOptions.py index db2360ac3bf9cbb68d7c655d61f546ec34be0901..87d39914c09a195b8847f743323d8daa150838c3 100755 --- a/Reconstruction/RecExample/RecExTB/share/RecExTB_H6_jobOptions.py +++ b/Reconstruction/RecExample/RecExTB/share/RecExTB_H6_jobOptions.py @@ -238,7 +238,6 @@ jobproperties.CaloCellFlags.doLArHVCorr = False jobproperties.CaloCellFlags.doLArSporadicMasking = False jobproperties.CaloCellFlags.doLArCellEmMisCalib = False jobproperties.CaloCellFlags.doPedestalCorr = False -jobproperties.CaloCellFlags.doLArRecalibration = False jobproperties.CaloCellFlags.doLArBadFebMasking = False jobproperties.CaloCellFlags.doLArDeadOTXCorr = False