Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Software compensation energy correction externalized #13

Merged
merged 3 commits into from
Oct 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions include/DDPandoraPFANewProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
51 changes: 50 additions & 1 deletion src/DDPandoraPFANewProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "Api/PandoraApi.h"

#include "LCContent.h"
#include "LCPlugins/LCSoftwareCompensation.h"

#include "DDExternalClusteringAlgorithm.h"
#include "DDPandoraPFANewProcessor.h"
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -777,7 +790,43 @@ void DDPandoraPFANewProcessor::ProcessSteeringFile()
m_caloHitCreatorSettings.m_muonBarrelNormalVector,
std::vector<float>({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);
}

//------------------------------------------------------------------------------------------------------------------------------------------
Expand Down