diff --git a/include/DDPandoraPFANewProcessor.h b/include/DDPandoraPFANewProcessor.h index 83aec45..7f617fb 100644 --- a/include/DDPandoraPFANewProcessor.h +++ b/include/DDPandoraPFANewProcessor.h @@ -54,6 +54,16 @@ class DDPandoraPFANewProcessor : public marlin::Processor FloatVector m_inputEnergyCorrectionPoints{}; ///< The input energy points for non-linearity energy correction FloatVector m_outputEnergyCorrectionPoints{}; ///< The output energy points for non-linearity energy correction + // Software compensation parameters + FloatVector m_softCompParameters{}; + FloatVector m_softCompEnergyDensityBins{}; + float m_energyDensityFinalBin = 0.0; + float m_maxClusterEnergyToApplySoftComp = 100.0; + float m_minCleanHitEnergy = 0.5; + float m_minCleanHitEnergyFraction = 0.01; + float m_minCleanCorrectedHitEnergy = 0.1; + + ///ADDED BY NIKIFOROS //Detector names not needed anymore, accessed by det type flags std::string m_trackCreatorName = ""; ///< The name of the DDTrackCreator implementation to use diff --git a/src/DDPandoraPFANewProcessor.cc b/src/DDPandoraPFANewProcessor.cc index 6338b34..7158562 100644 --- a/src/DDPandoraPFANewProcessor.cc +++ b/src/DDPandoraPFANewProcessor.cc @@ -13,6 +13,7 @@ #include "Api/PandoraApi.h" #include "LCContent.h" +#include "LCPlugins/LCSoftwareCompensation.h" #include "DDExternalClusteringAlgorithm.h" #include "DDPandoraPFANewProcessor.h" @@ -301,6 +302,18 @@ pandora::StatusCode DDPandoraPFANewProcessor::RegisterUserComponents() const PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::RegisterAlgorithmFactory(*m_pPandora, "ExternalClustering", new DDExternalClusteringAlgorithm::Factory)); + + lc_content::LCSoftwareCompensationParameters softwareCompensationParameters; + softwareCompensationParameters.m_softCompParameters = m_settings.m_softCompParameters; + softwareCompensationParameters.m_softCompEnergyDensityBins = m_settings.m_softCompEnergyDensityBins; + softwareCompensationParameters.m_energyDensityFinalBin = m_settings.m_energyDensityFinalBin; + softwareCompensationParameters.m_maxClusterEnergyToApplySoftComp = m_settings.m_maxClusterEnergyToApplySoftComp; + softwareCompensationParameters.m_minCleanHitEnergy = m_settings.m_minCleanHitEnergy; + softwareCompensationParameters.m_minCleanHitEnergyFraction = m_settings.m_minCleanHitEnergyFraction; + softwareCompensationParameters.m_minCleanCorrectedHitEnergy = m_settings.m_minCleanCorrectedHitEnergy; + + PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, LCContent::RegisterSoftwareCompensationEnergyCorrection(*m_pPandora, + "SoftwareCompensation", softwareCompensationParameters)); return pandora::STATUS_CODE_SUCCESS; } @@ -777,7 +790,43 @@ void DDPandoraPFANewProcessor::ProcessSteeringFile() m_caloHitCreatorSettings.m_muonBarrelNormalVector, std::vector({0.0, 0.0, 1.0})); - + // Re-use LCSoftwareCompensationParameters default values + lc_content::LCSoftwareCompensationParameters softwareCompensationParameters; + + registerProcessorParameter("SoftwareCompensationWeights", + "The 9 software compensation weights for Pandora energy correction", + m_settings.m_softCompParameters, + softwareCompensationParameters.m_softCompParameters); + + registerProcessorParameter("SoftwareCompensationEnergyDensityBins", + "The 10 software compensation density bins for Pandora energy correction", + m_settings.m_softCompEnergyDensityBins, + softwareCompensationParameters.m_softCompEnergyDensityBins); + + registerProcessorParameter("FinalEnergyDensityBin", + "The software compensation final energy density bins for Pandora energy correction", + m_settings.m_energyDensityFinalBin, + softwareCompensationParameters.m_energyDensityFinalBin); + + registerProcessorParameter("MaxClusterEnergyToApplySoftComp", + "The maximum hadronic energy to apply software compensation in Pandora energy correction", + m_settings.m_maxClusterEnergyToApplySoftComp, + softwareCompensationParameters.m_maxClusterEnergyToApplySoftComp); + + registerProcessorParameter("MinCleanHitEnergy", + "The minimum hit energy to apply ecal correction in Pandora energy correction", + m_settings.m_minCleanHitEnergy, + softwareCompensationParameters.m_minCleanHitEnergy); + + registerProcessorParameter("MinCleanHitEnergyFraction", + "The minimum hit energy fraction to apply ecal correction in Pandora energy correction", + m_settings.m_minCleanHitEnergyFraction, + softwareCompensationParameters.m_minCleanHitEnergyFraction); + + registerProcessorParameter("MinCleanCorrectedHitEnergy", + "The minimum correction to on ecal hit in Pandora energy correction", + m_settings.m_minCleanCorrectedHitEnergy, + softwareCompensationParameters.m_minCleanCorrectedHitEnergy); } //------------------------------------------------------------------------------------------------------------------------------------------