diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaCalibrationAndSmearingAlg.h b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaCalibrationAndSmearingAlg.h index 162625194def721c0b93f0e589e294f9fd217015..b4b53f3537da7a66f698cf85c9feadea8c499dfb 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaCalibrationAndSmearingAlg.h +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaCalibrationAndSmearingAlg.h @@ -10,6 +10,7 @@ #define EGAMMA_ANALYSIS_ALGORITHMS__EGAMMA_CALIBRATION_AND_SMEARING_ALG_H #include <AnaAlgorithm/AnaAlgorithm.h> +#include <AsgTools/PropertyWrapper.h> #include <EgammaAnalysisInterfaces/IEgammaCalibrationAndSmearingTool.h> #include <EgammaAnalysisAlgorithms/CopyHelpers.h> #include <SelectionHelpers/SysReadSelectionHandle.h> @@ -42,6 +43,19 @@ namespace CP private: ToolHandle<CP::IEgammaCalibrationAndSmearingTool> m_calibrationAndSmearingTool; + /// \brief whether to ignore all tool systematics + /// + /// The tool can be configured only to run the non-systematics or + /// only the systematics part of the corrections. That means this + /// algorithm needs to be scheduled twice, once without + /// systematics and once with. Besides configuring the tools for + /// their respective roles the first algorithm should have this + /// property set to avoid reporting any systematics or trying to + /// request any systematics. + private: + Gaudi::Property<bool> m_noToolSystematics { + this, "noToolSystematics", false, "whether to ignore all tool systematics"}; + /// \brief the systematics list we run private: SysListHandle m_systematicsList {this}; diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaCalibrationAndSmearingAlg.cxx b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaCalibrationAndSmearingAlg.cxx index babe7d687a98bf28c2a9e5ef8910ec5515ef76ae..356518533725d35f160e707e6d8fb907582646f2 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaCalibrationAndSmearingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaCalibrationAndSmearingAlg.cxx @@ -35,7 +35,8 @@ namespace CP ANA_CHECK (m_calibrationAndSmearingTool.retrieve()); ANA_CHECK (m_egammaHandle.initialize (m_systematicsList)); ANA_CHECK (m_preselection.initialize (m_systematicsList, m_egammaHandle, SG::AllowEmpty)); - ANA_CHECK (m_systematicsList.addSystematics (*m_calibrationAndSmearingTool)); + if (!m_noToolSystematics.value()) + ANA_CHECK (m_systematicsList.addSystematics (*m_calibrationAndSmearingTool)); ANA_CHECK (m_systematicsList.initialize()); ANA_CHECK (m_outOfValidity.initialize()); return StatusCode::SUCCESS; @@ -48,7 +49,8 @@ namespace CP { for (const auto& sys : m_systematicsList.systematicsVector()) { - ANA_CHECK (m_calibrationAndSmearingTool->applySystematicVariation (sys)); + if (!m_noToolSystematics.value()) + ANA_CHECK (m_calibrationAndSmearingTool->applySystematicVariation (sys)); xAOD::EgammaContainer *egammas = nullptr; ANA_CHECK (m_egammaHandle.getCopy (egammas, sys)); for (xAOD::Egamma *egamma : *egammas)