diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgClassificationDecorationAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgClassificationDecorationAlg.h index f812dcfa9b6c2983bae144ac8f753000df949c2a..f80a11e9508ac9328592eecb067450e9aaf40580 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgClassificationDecorationAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgClassificationDecorationAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak <tadej@cern.ch> @@ -24,22 +24,16 @@ namespace CP /// on the \ref CP::IClassificationTool class AsgClassificationDecorationAlg final : public EL::AnaAlgorithm { + public: /// \brief the standard constructor -public: - AsgClassificationDecorationAlg(const std::string& name, - ISvcLocator* pSvcLocator); - - -public: + using EL::AnaAlgorithm::AnaAlgorithm; virtual StatusCode initialize() override; - -public: virtual StatusCode execute() override; /// \brief truth classifier tool handle private: - ToolHandle<IClassificationTool> m_tool; + ToolHandle<IClassificationTool> m_tool {this, "tool", "", "classification tool"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgCutBookkeeperAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgCutBookkeeperAlg.h index 4c052335643c08604aefa89b8e069c9f1b486356..5eb117c96d3e505d97fdd8912218f00396c3aa0b 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgCutBookkeeperAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgCutBookkeeperAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -14,6 +14,7 @@ #include <PMGAnalysisInterfaces/IPMGTruthWeightTool.h> #include <SystematicsHandles/ISystematicsSvc.h> #include <xAODCutFlow/CutBookkeeper.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -24,8 +25,7 @@ namespace CP { /// \brief the standard constructor public: - AsgCutBookkeeperAlg (const std::string& name, - ISvcLocator* pSvcLocator); + using EL::AnaAlgorithm::AnaAlgorithm; public: /// \brief initialize @@ -46,19 +46,19 @@ namespace CP /// \brief flag to enable systematics private: - bool m_enableSystematics{false}; + Gaudi::Property<bool> m_enableSystematics {this, "enableSystematics", false, "enable systematics"}; /// \brief the truth weight tool private: - ToolHandle<PMGTools::IPMGTruthWeightTool> m_truthWeightTool; + ToolHandle<PMGTools::IPMGTruthWeightTool> m_truthWeightTool {this, "truthWeightTool", "PMGTools::PMGTruthWeightTool", "the truth weight tool"}; /// \brief the systematics service private: - ServiceHandle<ISystematicsSvc> m_systematics {"SystematicsSvc", ""}; + ServiceHandle<ISystematicsSvc> m_systematics {this, "systematics", "SystematicsSvc", "systematics service"}; /// \brief run number we are processing private: - uint32_t m_runNumber {}; + Gaudi::Property<uint32_t> m_runNumber {this, "runNumber", 0, "the run number we are processing"}; /// \brief MC channel number we are processing private: @@ -79,7 +79,7 @@ namespace CP /// \brief the pattern for histogram names private: - std::string m_histPattern {"CutBookkeeper_%DSID%_%RUN%_%SYS%"}; + Gaudi::Property<std::string> m_histPattern {this, "histPattern", "CutBookkeeper_%DSID%_%RUN%_%SYS%", "the pattern for histogram names"}; }; } diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgFlagSelectionTool.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgFlagSelectionTool.h index a76f783d172d79f6f245450eec6412a648cb2100..43d77079246f01af5ccd9c097996d9d8ae9d66c5 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgFlagSelectionTool.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgFlagSelectionTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Teng Jian Khoo @@ -13,6 +13,7 @@ #include <PATCore/IAsgSelectionTool.h> #include <SelectionHelpers/ISelectionReadAccessor.h> #include <xAODBase/IParticle.h> +#include "AsgTools/PropertyWrapper.h" #include <memory> #include <string> #include <vector> @@ -49,7 +50,7 @@ namespace CP /// \par Failures /// out of memory II public: - AsgFlagSelectionTool (const std::string& name); + using asg::AsgTool::AsgTool; @@ -73,8 +74,8 @@ namespace CP /// tool properties /// \{ private: - std::vector<std::string> m_selFlags; - std::vector<bool> m_invertFlags; + Gaudi::Property<std::vector<std::string>> m_selFlags {this, "selectionFlags", {}, "list of flags to use as selection criteria"}; + Gaudi::Property<std::vector<bool>> m_invertFlags {this, "invertFlags", {}, "toggles for inverting the selection (index-parallel to selectionFlags)"}; std::vector<std::unique_ptr<ISelectionReadAccessor> > m_acc_selFlags; /// \} diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgLeptonTrackSelectionAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgLeptonTrackSelectionAlg.h index 5226dfeeac5ad4a3b3ec73a7695794b879cef395..e030d4585b035aaccb06dbffeb2681f0d3fbe873 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgLeptonTrackSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgLeptonTrackSelectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -17,6 +17,11 @@ #include <SystematicsHandles/SysListHandle.h> #include <SystematicsHandles/SysReadHandle.h> #include <xAODBase/IParticleContainer.h> +#include <AsgTools/PropertyWrapper.h> +#include "AsgDataHandles/ReadHandleKey.h" +#include <AsgDataHandles/ReadHandle.h> +#include <xAODTracking/VertexContainer.h> +#include <xAODEventInfo/EventInfo.h> namespace CP { @@ -37,14 +42,8 @@ namespace CP { /// \brief the standard constructor public: - AsgLeptonTrackSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; @@ -52,14 +51,12 @@ namespace CP /// \{ private: - float m_maxD0Significance {0}; - float m_maxDeltaZ0SinTheta {0}; - int m_nMinPixelHits{-1}; - int m_nMaxPixelHits{-1}; - int m_nMinSCTHits{-1}; - int m_nMaxSCTHits{-1}; - std::string m_eventInfo {"EventInfo"}; - std::string m_primaryVertices {"PrimaryVertices"}; + Gaudi::Property<float> m_maxD0Significance {this, "maxD0Significance", 0, "maximum d0 significance (or 0 for no cut)"}; + Gaudi::Property<float> m_maxDeltaZ0SinTheta {this, "maxDeltaZ0SinTheta", 0, "maximum Delta z0 sin theta (or 0 for no cut)"}; + Gaudi::Property<int> m_nMinPixelHits {this, "nMinPixelHits", -1, "minimum number of required Pixel hits (or -1 for no cut)"}; + Gaudi::Property<int> m_nMaxPixelHits {this, "nMaxPixelHits", -1, "maximum number of required Pixel hits (or -1 for no cut)"}; + Gaudi::Property<int> m_nMinSCTHits {this, "nMinSCTHits", -1, "minimum number of required SCT hits (or -1 for no cut)"}; + Gaudi::Property<int> m_nMaxSCTHits {this, "nMaxSCTHits", -1, "maximum number of required SCT hits (or -1 for no cut)"}; /// \} @@ -68,7 +65,13 @@ namespace CP private: SysListHandle m_systematicsList {this}; - /// \brief the particle continer we run on + /// \brief the EventInfo key + SG::ReadHandleKey<xAOD::EventInfo> m_eventInfoKey {this, "eventInfo", "EventInfo", "the name of the EventInfo object to retrieve"}; + + /// \brief the PrimaryVertex key + SG::ReadHandleKey<xAOD::VertexContainer> m_primaryVerticesKey {this, "primaryVertices", "PrimaryVertices", "the name of the PrimaryVertex container to retrieve"}; + + /// \brief the particle container we run on private: SysReadHandle<xAOD::IParticleContainer> m_particlesHandle { this, "particles", "", "the asg collection to run on"}; diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgMaskSelectionTool.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgMaskSelectionTool.h index 68cdf0ac93f445cd2022585aa91dba05e5b14ce6..cb4f44c6050fb594a9b91ce2e19a6a846cd58fde 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgMaskSelectionTool.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgMaskSelectionTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author RD Schaffer @@ -13,6 +13,7 @@ #include <PATCore/IAsgSelectionTool.h> #include <SelectionHelpers/ISelectionReadAccessor.h> #include <xAODBase/IParticle.h> +#include "AsgTools/PropertyWrapper.h" #include <memory> #include <string> #include <vector> @@ -41,8 +42,7 @@ namespace CP /// \par Failures /// out of memory II public: - AsgMaskSelectionTool (const std::string& name); - + using asg::AsgTool::AsgTool; @@ -65,8 +65,8 @@ namespace CP /// tool properties /// \{ private: - std::vector<std::string> m_selVars; - std::vector<unsigned int> m_selMasks; + Gaudi::Property<std::vector<std::string>> m_selVars {this, "selectionVars", {}, "list of variables to use as selection criteria"}; + Gaudi::Property<std::vector<unsigned int>> m_selMasks {this, "selectionMasks", {}, "list of masks, one per variable, for applying the selection"}; std::vector<std::unique_ptr<ISelectionReadAccessor> > m_acc_selVars; /// \} diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgOriginalObjectLinkAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgOriginalObjectLinkAlg.h index a69f19ca7f2ac8f91fae573ef566a19fdf8ace69..39c028ebcfea5cfc1fd953d3d6081b8569590671 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgOriginalObjectLinkAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgOriginalObjectLinkAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -12,7 +12,9 @@ #include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> #include <xAODBase/IParticleContainer.h> - +#include <AsgTools/PropertyWrapper.h> +#include <AsgDataHandles/ReadHandleKey.h> +#include <AsgDataHandles/ReadHandle.h> namespace CP { @@ -27,19 +29,13 @@ namespace CP { /// \brief the standard constructor public: - AsgOriginalObjectLinkAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief base container name private: - std::string m_baseContainerName {""}; + SG::ReadHandleKey<xAOD::IParticleContainer> m_baseContainerName {this, "baseContainerName", "", "base particle container name"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgPriorityDecorationAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgPriorityDecorationAlg.h index 4a16b6a44c180704f6af25735785c782797eb194..03d265988b35287cde8e0604df05b68497152faf 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgPriorityDecorationAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgPriorityDecorationAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak <tadej@cern.ch> @@ -12,6 +12,7 @@ #include <SystematicsHandles/SysListHandle.h> #include <SystematicsHandles/SysReadHandle.h> #include <xAODBase/IParticleContainer.h> +#include <AsgTools/PropertyWrapper.h> namespace CP @@ -22,14 +23,8 @@ class AsgPriorityDecorationAlg final : public EL::AnaAlgorithm { /// \brief the standard constructor public: - AsgPriorityDecorationAlg(const std::string& name, - ISvcLocator* pSvcLocator); - - -public: + using EL::AnaAlgorithm::AnaAlgorithm; virtual StatusCode initialize() override; - -public: virtual StatusCode execute() override; @@ -49,11 +44,11 @@ private: /// \brief the values of the priorities private: - std::vector<int> m_priorities {}; + Gaudi::Property<std::vector<int>> m_priorities {this, "priorities", {}, "priorities to use with the highest one first"}; /// \brief the decoration for the priority private: - std::string m_priorityDecoration {}; + Gaudi::Property<std::string> m_priorityDecoration {this, "priorityDecoration", "", "the decoration for the priority"}; /// \brief the accessor for \ref m_priorityDecoration private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgPtEtaSelectionTool.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgPtEtaSelectionTool.h index 59527fd8644b1a188565079b14d4ff9957e19d0c..6caac14c764aa08671e5c02a0063b07b5e666e7b 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgPtEtaSelectionTool.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgPtEtaSelectionTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -12,6 +12,7 @@ #include <AsgTools/AsgTool.h> #include <AthContainers/AuxElement.h> #include <PATCore/IAsgSelectionTool.h> +#include "AsgTools/PropertyWrapper.h" #include <atomic> namespace CP @@ -47,9 +48,7 @@ namespace CP /// \par Failures /// out of memory II public: - AsgPtEtaSelectionTool (const std::string& name); - - + using asg::AsgTool::AsgTool; // @@ -72,15 +71,15 @@ namespace CP /// \{ private: - float m_minPt {0}; - float m_maxPt {0}; - float m_maxEta {0}; - float m_etaGapLow {0}; - float m_etaGapHigh {0}; - bool m_useClusterEta {false}; - bool m_useDressedProperties {false}; - bool m_printCastWarning {true}; - bool m_printClusterWarning {true}; + Gaudi::Property<float> m_minPt {this, "minPt", 0, "minimum pt to require (or 0 for no pt cut)"}; + Gaudi::Property<float> m_maxPt {this, "maxPt", 0, "maximum pt to require (or 0 for no pt cut)"}; + Gaudi::Property<float> m_maxEta {this, "maxEta", 0, "maximum abs(eta) to allow (or 0 for no eta cut)"}; + Gaudi::Property<float> m_etaGapLow {this, "etaGapLow", 0, "low end of the eta gap"}; + Gaudi::Property<float> m_etaGapHigh {this, "etaGapHigh", 0, "high end of the eta gap (or 0 for no eta gap)"}; + Gaudi::Property<bool> m_useClusterEta {this, "useClusterEta", false, "whether to use the cluster eta (for electrons only)"}; + Gaudi::Property<bool> m_useDressedProperties {this, "useDressedProperties", false, "whether to use the dressed kinematic properties (for truth particles only)"}; + Gaudi::Property<bool> m_printCastWarning {this, "printCastWarning", true, "whether to print a warning/error when the cast fails"}; + Gaudi::Property<bool> m_printClusterWarning {this, "printClusterWarning", true, "whether to print a warning/error when the cluster is missing"}; /// \} diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgSelectionAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgSelectionAlg.h index 65ae36786907d6226181db4b17f689205071ce55..248c0eb5d0c83005886106e10c1667a891bb00fb 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgSelectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -45,21 +45,15 @@ namespace CP { /// \brief the standard constructor public: - AsgSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IAsgSelectionTool> m_selectionTool; + ToolHandle<IAsgSelectionTool> m_selectionTool {this, "selectionTool", "", "the selection tool we apply"}; /// \brief the smearing tool cast to an ISystematicsTool /// diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgUnionPreselectionAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgUnionPreselectionAlg.h index cc8424bcd7d96ea64dc9f2753dbcc856feb717c0..cba08250f559b7dd8045ba5801aefab1b60489ca 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgUnionPreselectionAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgUnionPreselectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -14,6 +14,7 @@ #include <SystematicsHandles/SysReadHandle.h> #include <SystematicsHandles/SysListHandle.h> #include <xAODBase/IParticleContainer.h> +#include <AsgTools/PropertyWrapper.h> #include <optional> @@ -41,14 +42,8 @@ namespace CP { /// \brief the standard constructor public: - AsgUnionPreselectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; virtual StatusCode initialize () override; - - public: virtual StatusCode execute () override; @@ -69,7 +64,7 @@ namespace CP /// \brief the decoration of the selection private: - std::string m_selectionDecoration; + Gaudi::Property<std::string> m_selectionDecoration {this, "selectionDecoration", "", "the decoration for the union selection"}; /// \brief the accessor for \ref m_selectionDecoration private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgUnionSelectionAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgUnionSelectionAlg.h index 40e4c81c23c2706f51a46c31b06659980a56e817..475d0075b63d8f7a534f717bddf468b378edf7b3 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgUnionSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgUnionSelectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -13,6 +13,7 @@ #include <SystematicsHandles/SysReadHandle.h> #include <SystematicsHandles/SysListHandle.h> #include <xAODBase/IParticleContainer.h> +#include <AsgTools/PropertyWrapper.h> namespace CP @@ -24,14 +25,8 @@ namespace CP { /// \brief the standard constructor public: - AsgUnionSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; virtual StatusCode initialize () override; - - public: virtual StatusCode execute () override; @@ -52,7 +47,7 @@ namespace CP /// \brief the decoration of the selection private: - std::string m_selectionDecoration; + Gaudi::Property<std::string> m_selectionDecoration {this, "selectionDecoration", "", "the decoration for the union selection"}; /// \brief the accessor for \ref m_selectionDecoration private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgViewFromSelectionAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgViewFromSelectionAlg.h index d64b7c904fd0c9fed62b28a6ee18aa177f660cea..21361156e86f25b3c31e441524620bb7ae514a7d 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgViewFromSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgViewFromSelectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -15,6 +15,7 @@ #include <SystematicsHandles/SysReadHandle.h> #include <SystematicsHandles/SysWriteHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <AsgTools/PropertyWrapper.h> #include <limits> namespace CP @@ -31,14 +32,8 @@ namespace CP { /// \brief the standard constructor public: - AsgViewFromSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; @@ -56,26 +51,28 @@ namespace CP SysWriteHandle<xAOD::IParticleContainer> m_outputHandle { this, "output", "", "the output view container to produce"}; + /// \todo this would probably better be an std::map, but this + /// isn't supported as a property type for AnaAlgorithm right now private: - std::vector<std::string> m_selection; + Gaudi::Property<std::vector<std::string>> m_selection {this, "selection", {}, "the list of selection decorations"}; private: - std::vector<SelectionType> m_ignore; + Gaudi::Property<std::vector<SelectionType>> m_ignore {this, "ignore", {}, "the list of cuts to *ignore* for each selection"}; /// \brief Sort the output (view) container by pT private: - bool m_sortPt {false}; + Gaudi::Property<bool> m_sortPt {this, "sortPt", false, "whether to sort objects in pt"}; /// \brief Allow the input container to be missing private: - bool m_allowMissing {false}; + Gaudi::Property<bool> m_allowMissing {this, "allowMissing", false, "Allow the input container to be missing"}; /// \brief Perform a deep copy for creating the output container private: - bool m_deepCopy {false}; + Gaudi::Property<bool> m_deepCopy {this, "deepCopy", false, "perform a deep copy"}; private: - std::size_t m_sizeLimit {std::numeric_limits<std::size_t>::max()}; + Gaudi::Property<std::size_t> m_sizeLimit {this, "sizeLimit", std::numeric_limits<std::size_t>::max(), "the limit on the size of the output container"}; /// the list of accessors and cut ignore list private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgxAODNTupleMakerAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgxAODNTupleMakerAlg.h index 2206933ab5b926b774adac4cd78c084d0606d2de..8dadc29a32935069cd80863f95c6043379479994 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgxAODNTupleMakerAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgxAODNTupleMakerAlg.h @@ -1,6 +1,6 @@ // Dear emacs, this is -*- c++ -*- // -// Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // #ifndef ASGANALYSISALGORITHMS_ASGXAODNTUPLEMAKERALG_H #define ASGANALYSISALGORITHMS_ASGXAODNTUPLEMAKERALG_H @@ -18,6 +18,7 @@ #include "AnaAlgorithm/AnaAlgorithm.h" #include "CxxUtils/checker_macros.h" #include "SystematicsHandles/SysListHandle.h" +#include <AsgTools/PropertyWrapper.h> // EDM include(s): #include "AthContainersInterfaces/IAuxTypeVector.h" @@ -59,7 +60,7 @@ namespace CP { public: /// Algorithm constructor - AsgxAODNTupleMakerAlg( const std::string& name, ISvcLocator* svcLoc ); + using EL::AnaAlgorithm::AnaAlgorithm; /// @name Functions inherited from @c EL::AnaAlgorithm /// @{ @@ -87,9 +88,9 @@ namespace CP { /// @{ /// The name of the output tree to write - std::string m_treeName; + Gaudi::Property<std::string> m_treeName {this, "TreeName", "physics", "Name of the tree to write"}; /// The branches to write into this output tree - std::vector< std::string > m_branches; + Gaudi::Property<std::vector<std::string>> m_branches {this, "Branches", {}, "Branches to write to the output tree"}; /// @} @@ -360,7 +361,7 @@ namespace CP { bool m_isInitialized = false; /// \brief the handle for the systematics service - ServiceHandle<ISystematicsSvc> m_systematicsService {"SystematicsSvc", ""}; + ServiceHandle<ISystematicsSvc> m_systematicsService {this, "systematicsService", "SystematicsSvc", "systematics service"}; /// @} diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/EventCutFlowHistAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/EventCutFlowHistAlg.h index 4d0bb096214d4c90380db4f92742485fd60afe25..676b4b73e990e2fc8b9ac05b5e0268a984153a16 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/EventCutFlowHistAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/EventCutFlowHistAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Baptiste Ravina @@ -15,6 +15,7 @@ #include <SystematicsHandles/SysReadHandle.h> #include <SystematicsHandles/SysListHandle.h> #include <xAODEventInfo/EventInfo.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -24,13 +25,8 @@ namespace CP { /// \brief the standard constructor public: - EventCutFlowHistAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; @@ -50,7 +46,7 @@ namespace CP /// \brief the pattern for histogram names private: - std::string m_histPattern {"cutflow_%SYS%"}; + Gaudi::Property<std::string> m_histPattern {this, "histPattern", "cutflow_%SYS%", "the pattern for histogram names"}; /// \brief the selection name service private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/EventFlagSelectionAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/EventFlagSelectionAlg.h index 597e9f60b3c9bd368412375c5c0a33520a23c398..e756c65b64ee3c0bf2fe23467cd886e02ac4d4b8 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/EventFlagSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/EventFlagSelectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -10,6 +10,7 @@ #include <AnaAlgorithm/AnaAlgorithm.h> #include <EventBookkeeperTools/FilterReporterParams.h> #include <SelectionHelpers/ISelectionReadAccessor.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -17,19 +18,17 @@ namespace CP class EventFlagSelectionAlg final : public EL::AnaAlgorithm { public: - EventFlagSelectionAlg(const std::string &name, - ISvcLocator *svcLoc = nullptr); - + using EL::AnaAlgorithm::AnaAlgorithm; virtual StatusCode initialize() final; virtual StatusCode execute() final; virtual StatusCode finalize() final; private: /// \brief flags that we want to select events with - std::vector<std::string> m_selFlags; + Gaudi::Property<std::vector<std::string>> m_selFlags {this, "selectionFlags", {}, "list of flags to use as selection criteria"}; /// \brief invert flags - std::vector<bool> m_invertFlags; + Gaudi::Property<std::vector<bool>> m_invertFlags {this, "invertFlags", {}, "toggles for inverting the selection (index-parallel to selectionFlags)"}; /// \brief a vector of accessors to read the flags std::vector<std::unique_ptr<ISelectionReadAccessor>> m_accessors; diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/KinematicHistAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/KinematicHistAlg.h index 774b02264f9a222535856af647b10ad1caaa7174..bf61375763682af994f764eb81c78f5c21b690eb 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/KinematicHistAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/KinematicHistAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -13,6 +13,7 @@ #include <SystematicsHandles/SysReadHandle.h> #include <SystematicsHandles/SysListHandle.h> #include <xAODBase/IParticleContainer.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -26,14 +27,8 @@ namespace CP { /// \brief the standard constructor public: - KinematicHistAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; @@ -53,7 +48,7 @@ namespace CP /// \brief the pattern for histogram names private: - std::string m_histPattern {"%VAR%_%SYS%"}; + Gaudi::Property<std::string> m_histPattern {this, "histPattern", "%VAR%_%SYS%", "the pattern for histogram names"}; /// \brief the histograms we fill per systematic and object diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/ObjectCutFlowHistAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/ObjectCutFlowHistAlg.h index 233cdb36c826b28b3e71d8cb5b7b9094c0d7176d..beee949e80b38ea9d4c7f0d525e5e02e513d2a62 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/ObjectCutFlowHistAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/ObjectCutFlowHistAlg.h @@ -25,13 +25,8 @@ namespace CP { /// \brief the standard constructor public: - ObjectCutFlowHistAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; @@ -51,7 +46,7 @@ namespace CP /// \brief the pattern for histogram names private: - std::string m_histPattern {"cutflow_%SYS%"}; + Gaudi::Property<std::string> m_histPattern {this, "histPattern", "cutflow_%SYS%", "the pattern for histogram names"}; /// \brief the selection name service private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/OverlapRemovalAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/OverlapRemovalAlg.h index 6daaec880a58b67c90509a71e16043ba2c14c2d1..9fff2376fb7ca396942d8ce193c7c68529350905 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/OverlapRemovalAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/OverlapRemovalAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -14,6 +14,7 @@ #include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> #include <SystematicsHandles/SysWriteDecorHandle.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -23,22 +24,15 @@ namespace CP { /// \brief the standard constructor public: - OverlapRemovalAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// The OR toolbox private: - ToolHandle<ORUtils::IOverlapRemovalTool> m_overlapTool { - "ORUtils::OverlapRemovalTool", this}; + ToolHandle<ORUtils::IOverlapRemovalTool> m_overlapTool { this, "overlapTool", "ORUtils::OverlapRemovalTool", "the overlap removal tool"}; /// \brief the systematics list we run private: @@ -75,7 +69,7 @@ namespace CP /// \brief the tool output decoration for the overlap removal status private: - std::string m_overlapRemovalDecoration; + Gaudi::Property<std::string> m_overlapRemovalDecoration {this, "OutputLabel", "", "the decoration for the overlap removal tool output"}; /// \brief the accessor for \ref m_overlapRemovalDecoration private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/PMGTruthWeightAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/PMGTruthWeightAlg.h index 6b6f4c9c5e49133f36750e4dfe8948acc7c429a5..696e48b91353d595db330332e3a271ab53eda135 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/PMGTruthWeightAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/PMGTruthWeightAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -21,20 +21,13 @@ namespace CP class PMGTruthWeightAlg final : public EL::AnaAlgorithm { /// \brief the standard constructor - public: - PMGTruthWeightAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the tool private: - ToolHandle<PMGTools::IPMGTruthWeightTool> m_truthWeightTool; + ToolHandle<PMGTools::IPMGTruthWeightTool> m_truthWeightTool {this, "truthWeightTool", "PMGTools::PMGTruthWeightTool", "the truth weight tool"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/PileupReweightingAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/PileupReweightingAlg.h index 0b7d5aff0a36733d07a2e1b87006940881bac5d7..df82ef0c8d4090ab288108484e8843e0462d3940 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/PileupReweightingAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/PileupReweightingAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -15,6 +15,9 @@ #include <SystematicsHandles/SysReadHandle.h> #include <SystematicsHandles/SysListHandle.h> #include <SystematicsHandles/SysWriteDecorHandle.h> +#include <AsgTools/PropertyWrapper.h> +#include <AsgDataHandles/ReadHandleKey.h> +#include <AsgDataHandles/ReadHandle.h> namespace CP { @@ -24,21 +27,15 @@ namespace CP { /// \brief the standard constructor public: - PileupReweightingAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IPileupReweightingTool> m_pileupReweightingTool; + ToolHandle<IPileupReweightingTool> m_pileupReweightingTool {this, "pileupReweightingTool", "PileupReweightingTool", "the pileup reweighting tool we apply"}; /// \brief the systematics list we run private: @@ -56,19 +53,21 @@ namespace CP /// \brief the name of the original event info (this should usually be the same as eventiNfoHandle and EventInfo) private: - std::string m_baseEventInfoName{"EventInfo"}; + SG::ReadHandleKey<xAOD::EventInfo> m_baseEventInfoName {this, "baseEventInfo", "EventInfo", "The name of the original event info. The non-systematic dependent decorations will be applied to this " + "object so it should be at least a base of the shallow copies read in by the 'eventInfo' handle. " + "The default (and strongly recommended behaviour) is to leave all of these pointed at the central 'EventInfo' object!"}; /// \brief the decoration for the corrected and scaled average interactions per crossing private: - std::string m_correctedScaledAverageMuDecoration; + Gaudi::Property<std::string> m_correctedScaledAverageMuDecoration {this, "correctedScaledAverageMuDecoration", "", "the decoration for the corrected and scaled average interactions per crossing"}; /// \brief the decoration for the corrected actual interactions per crossing private: - std::string m_correctedActualMuDecoration; + Gaudi::Property<std::string> m_correctedActualMuDecoration {this, "correctedActualMuDecoration", "", "the decoration for the corrected actual interactions per crossing"}; /// \brief the decoration for the corrected and scaled actual interactions per crossing private: - std::string m_correctedScaledActualMuDecoration; + Gaudi::Property<std::string> m_correctedScaledActualMuDecoration {this, "correctedScaledActualMuDecoration", "", "the decoration for the corrected and scaled actual interactions per crossing"}; /// \brief the accessor for \ref m_correctedScaledAverageMuDecoration private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/SysListDumperAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/SysListDumperAlg.h index 0588bfb459a50ea69ea219cea90c712233107a72..0e9c7a5042ac82abe5498989375815f99dcf9b99 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/SysListDumperAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/SysListDumperAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -11,6 +11,7 @@ #include <AnaAlgorithm/AnaAlgorithm.h> #include <AsgServices/ServiceHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -24,16 +25,9 @@ namespace CP /// \par Failures /// out of memory II public: - SysListDumperAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - public: + using EL::AnaAlgorithm::AnaAlgorithm; virtual ::StatusCode initialize () override; - - public: virtual ::StatusCode execute () override; - - public: virtual ::StatusCode finalize () override; /// \brief make the systematics vector using a regex @@ -42,15 +36,15 @@ namespace CP /// \brief the handle for the systematics service private: - ServiceHandle<ISystematicsSvc> m_systematicsService {"SystematicsSvc", ""}; + ServiceHandle<ISystematicsSvc> m_systematicsService {this, "systematicsService", "SystematicsSvc", "systematics service"}; /// \brief the regex private: - std::string m_regex {}; + Gaudi::Property<std::string> m_regex {this, "systematicsRegex", "", "systematics regex"}; /// \brief the name of the histogram to use private: - std::string m_histogramName {"systematics"}; + Gaudi::Property<std::string> m_histogramName {this, "histogramName", "systematics", "the name of the output histogram"}; /// \brief whether the next event will be the first event private: diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/TreeFillerAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/TreeFillerAlg.h index 366a5d6ac13f8320b0abb83fdd0f117791bf5cdb..a62e47b5ed9e01b3602e9828ccdbd9c5a72874b0 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/TreeFillerAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/TreeFillerAlg.h @@ -1,6 +1,6 @@ // Dear emacs, this is -*- c++ -*- // -// Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // #ifndef ASGANALYSISALGORITHMS_TREEFILLERALG_H #define ASGANALYSISALGORITHMS_TREEFILLERALG_H @@ -16,6 +16,7 @@ #include "AsgMessaging/AsgMessaging.h" #include "AnaAlgorithm/AnaAlgorithm.h" #include "SystematicsHandles/SysListHandle.h" +#include <AsgTools/PropertyWrapper.h> // EDM include(s): #include "AthContainersInterfaces/IAuxTypeVector.h" @@ -50,7 +51,7 @@ namespace CP { public: /// Algorithm constructor - TreeFillerAlg( const std::string& name, ISvcLocator* svcLoc ); + using EL::AnaAlgorithm::AnaAlgorithm; /// @name Functions inherited from @c EL::AnaAlgorithm /// @{ @@ -65,7 +66,7 @@ namespace CP { /// @{ /// The name of the output tree to write - std::string m_treeName; + Gaudi::Property<std::string> m_treeName {this, "TreeName", "physics", "Name of the tree to write"}; /// @} diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgClassificationDecorationAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgClassificationDecorationAlg.cxx index 55120a1f918e1ef49335d010d64fcc4f14080545..592c1743f1b153534aecd735a20dab3aa00fa537 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgClassificationDecorationAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgClassificationDecorationAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak <tadej@cern.ch> @@ -11,15 +11,6 @@ namespace CP { -AsgClassificationDecorationAlg::AsgClassificationDecorationAlg(const std::string &name, - ISvcLocator *pSvcLocator) - : AnaAlgorithm(name, pSvcLocator), m_tool("",this) -{ - declareProperty ("tool", m_tool, "classification tool"); -} - - - StatusCode AsgClassificationDecorationAlg::initialize() { diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgCutBookkeeperAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgCutBookkeeperAlg.cxx index 92dd9b19fb0ac2b4008d752bf27276d34cad122a..d3074c536d3c9e44421dd9b6bfff7d86506ce21f 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgCutBookkeeperAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgCutBookkeeperAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -27,25 +27,11 @@ namespace CP { - AsgCutBookkeeperAlg :: - AsgCutBookkeeperAlg (const std::string &name, - ISvcLocator *pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_truthWeightTool ("PMGTools::PMGTruthWeightTool", this) - { - declareProperty ("runNumber", m_runNumber, "the run number we are processing"); - declareProperty ("histPattern", m_histPattern, "the pattern for histogram names"); - declareProperty ("truthWeightTool", m_truthWeightTool, "the truth weight tool"); - declareProperty ("enableSystematics", m_enableSystematics, "enable systematics"); - declareProperty ("systematics", m_systematics, "systematics service"); - } - - StatusCode AsgCutBookkeeperAlg :: initialize () { - if (m_runNumber == 0) + if (m_runNumber.value() == 0) { ANA_MSG_ERROR ("Run number should be set"); return StatusCode::FAILURE; diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgFlagSelectionTool.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgFlagSelectionTool.cxx index 35917ff6b41cfbfa882601ce2b277f508b161c48..44944be6fd16183a57c93bc2232197ff7583b28e 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgFlagSelectionTool.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgFlagSelectionTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Teng Jian Khoo @@ -20,15 +20,6 @@ namespace CP { - AsgFlagSelectionTool :: - AsgFlagSelectionTool (const std::string& name) - : AsgTool (name) - { - declareProperty ("selectionFlags", m_selFlags, "list of flags to use as selection criteria"); - declareProperty ("invertFlags", m_invertFlags, "toggles for inverting the selection (index-parallel to selectionFlags)"); - } - - StatusCode AsgFlagSelectionTool :: initialize () @@ -48,7 +39,11 @@ namespace CP } else { // Extend m_invertFlags until the size matches m_selectionFlags // Only done in the case that m_invert was empty - if(m_invertFlags.size()<index+1) {m_invertFlags.push_back(false);} + if(m_invertFlags.size()<index+1) { + std::vector<bool> flags = m_invertFlags.value(); + flags.resize(index + 1, false); + m_invertFlags = flags; + } std::string doInvertStr = m_invertFlags[index] ? "!" : ""; m_accept.addCut (doInvertStr + thisflag, doInvertStr + thisflag); std::unique_ptr<ISelectionReadAccessor> accessor; diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgLeptonTrackSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgLeptonTrackSelectionAlg.cxx index b62aba8cf8bafc31ebc801341184a492c0abe6dd..60665a2a700ea8d50a5f7aeb4964e26d0d0baa60 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgLeptonTrackSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgLeptonTrackSelectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -13,10 +13,8 @@ #include <AsgAnalysisAlgorithms/AsgLeptonTrackSelectionAlg.h> #include <xAODEgamma/Electron.h> -#include <xAODEventInfo/EventInfo.h> #include <xAODMuon/Muon.h> #include <xAODTracking/TrackParticlexAODHelpers.h> -#include <xAODTracking/VertexContainer.h> // // method implementations @@ -24,22 +22,6 @@ namespace CP { - AsgLeptonTrackSelectionAlg :: - AsgLeptonTrackSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("maxD0Significance", m_maxD0Significance, "maximum d0 significance (or 0 for no cut)"); - declareProperty ("maxDeltaZ0SinTheta", m_maxDeltaZ0SinTheta, "maximum Delta z0 sin theta (or 0 for no cut)"); - declareProperty ("nMinPixelHits", m_nMinPixelHits, "minimum number of required Pixel hits (or -1 for no cut)"); - declareProperty ("nMaxPixelHits", m_nMaxPixelHits, "minimum number of required Pixel hits (or -1 for no cut)"); - declareProperty ("nMinSCTHits", m_nMinSCTHits, "minimum number of required SCT hits (or -1 for no cut)"); - declareProperty ("nMaxSCTHits", m_nMaxSCTHits, "minimum number of required SCT hits (or -1 for no cut)"); - declareProperty ("eventInfo", m_eventInfo, "the name of the EventInfo object to retrieve"); - declareProperty ("primaryVertices", m_primaryVertices, "the name of the PrimaryVertex container to retrieve"); - } - - StatusCode AsgLeptonTrackSelectionAlg :: initialize () @@ -71,6 +53,9 @@ namespace CP ANA_CHECK (m_selectionHandle.initialize (m_systematicsList, m_particlesHandle)); ANA_CHECK (m_systematicsList.initialize()); + ANA_CHECK (m_eventInfoKey.initialize()); + ANA_CHECK (m_primaryVerticesKey.initialize()); + if (!m_nameSvc.empty()) { ANA_CHECK (m_nameSvc.retrieve()); @@ -86,15 +71,12 @@ namespace CP StatusCode AsgLeptonTrackSelectionAlg :: execute () { - const xAOD::EventInfo *eventInfo {nullptr}; - if (m_maxD0Significance > 0) - ANA_CHECK (evtStore()->retrieve (eventInfo, m_eventInfo)); + SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfoKey); const xAOD::Vertex *primaryVertex {nullptr}; if (m_maxDeltaZ0SinTheta > 0) { - const xAOD::VertexContainer *vertices {nullptr}; - ANA_CHECK (evtStore()->retrieve (vertices, m_primaryVertices)); + SG::ReadHandle<xAOD::VertexContainer> vertices(m_primaryVerticesKey); for (const xAOD::Vertex *vertex : *vertices) { if (vertex->vertexType() == xAOD::VxType::PriVtx) diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgMaskSelectionTool.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgMaskSelectionTool.cxx index 780dd0c8200769a0d91965a6d060bf7d41d31f02..e58dc44bd99c1b4a60d62b5f2ccec7e34f12271d 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgMaskSelectionTool.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgMaskSelectionTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author RD Schaffer @@ -20,15 +20,6 @@ namespace CP { - AsgMaskSelectionTool :: - AsgMaskSelectionTool (const std::string& name) - : AsgTool (name) - { - declareProperty ("selectionVars", m_selVars, "list of variables to use as selection criteria"); - declareProperty ("selectionMasks", m_selMasks, "list of masks, one per variable, for applying the selection"); - } - - StatusCode AsgMaskSelectionTool :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgOriginalObjectLinkAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgOriginalObjectLinkAlg.cxx index a715e235ee337e34a012691daeba2621766c51f1..1c9494afd5347dae5cbe9b6f47f0ae2f355ea0ae 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgOriginalObjectLinkAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgOriginalObjectLinkAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -17,15 +17,6 @@ namespace CP { - AsgOriginalObjectLinkAlg :: - AsgOriginalObjectLinkAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("baseContainerName", m_baseContainerName, "base particle container name"); - } - - StatusCode AsgOriginalObjectLinkAlg :: initialize () @@ -38,6 +29,7 @@ namespace CP ANA_CHECK (m_particleHandle.initialize (m_systematicsList)); ANA_CHECK (m_systematicsList.initialize()); + ANA_CHECK (m_baseContainerName.initialize()); return StatusCode::SUCCESS; } @@ -51,8 +43,7 @@ namespace CP xAOD::IParticleContainer *particles = nullptr; ANA_CHECK (m_particleHandle.getCopy (particles, sys)); - const xAOD::IParticleContainer *baseParticles = nullptr; - ANA_CHECK (evtStore()->retrieve(baseParticles, m_baseContainerName)); + SG::ReadHandle<xAOD::IParticleContainer> baseParticles(m_baseContainerName); if (!xAOD::setOriginalObjectLink (*baseParticles, *particles)) { diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgPriorityDecorationAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgPriorityDecorationAlg.cxx index 544a3033c9cdbb3e01203c4f1fc2c12b31a2e9b4..30fce6367d8293fffaff9e2da0c53d6da4fb4b2c 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgPriorityDecorationAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgPriorityDecorationAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak <tadej@cern.ch> @@ -11,16 +11,6 @@ namespace CP { -AsgPriorityDecorationAlg::AsgPriorityDecorationAlg(const std::string &name, - ISvcLocator *pSvcLocator) - : AnaAlgorithm(name, pSvcLocator) -{ - declareProperty ("priorityDecoration", m_priorityDecoration, "the decoration for the priority"); - declareProperty ("priorities", m_priorities, "priorities to use with the highest one first"); -} - - - StatusCode AsgPriorityDecorationAlg::initialize() { if (m_priorityDecoration.empty()) @@ -35,7 +25,7 @@ StatusCode AsgPriorityDecorationAlg::initialize() return StatusCode::FAILURE; } - if (!std::is_sorted(std::rbegin(m_priorities), std::rend(m_priorities))) + if (!std::is_sorted(std::rbegin(m_priorities.value()), std::rend(m_priorities.value()))) { ANA_MSG_ERROR ("Priorities need to be provided in reverse order."); return StatusCode::FAILURE; diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgPtEtaSelectionTool.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgPtEtaSelectionTool.cxx index d055459cfcae11572e0c373778ada8f0e2637d8b..4f02542b990ec1eed76342caef9737992227a602 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgPtEtaSelectionTool.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgPtEtaSelectionTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -22,22 +22,6 @@ namespace CP { - AsgPtEtaSelectionTool :: - AsgPtEtaSelectionTool (const std::string& name) - : AsgTool (name) - { - declareProperty ("minPt", m_minPt, "minimum pt to require (or 0 for no pt cut)"); - declareProperty ("maxPt", m_maxPt, "maximum pt to require (or 0 for no pt cut)"); - declareProperty ("maxEta", m_maxEta, "maximum abs(eta) to allow (or 0 for no eta cut)"); - declareProperty ("etaGapLow", m_etaGapLow, "low end of the eta gap"); - declareProperty ("etaGapHigh", m_etaGapHigh, "high end of the eta gap (or 0 for no eta gap)"); - declareProperty ("useClusterEta", m_useClusterEta, "whether to use the cluster eta (for electrons only)"); - declareProperty ("useDressedProperties", m_useDressedProperties, "whether to use the dressed kinematic properties (for truth particles only)"); - declareProperty ("printCastWarning", m_printCastWarning, "whether to print a warning/error when the cast fails"); - declareProperty ("printClusterWarning", m_printClusterWarning, "whether to print a warning/error when the cluster is missing"); - } - - StatusCode AsgPtEtaSelectionTool :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgSelectionAlg.cxx index c48009d7960a07b49ce88b0ffeeae82e5385da2e..faba95aaafe4732acf5179c2fc83fc5938293058 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgSelectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -20,16 +20,6 @@ namespace CP { - AsgSelectionAlg :: - AsgSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_selectionTool ("", this) - { - declareProperty ("selectionTool", m_selectionTool, "the selection tool we apply"); - } - - StatusCode AsgSelectionAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgUnionPreselectionAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgUnionPreselectionAlg.cxx index dda595c8ac942b0567e639118ec7e7dfad94fb8f..2e0c693fcce9336b2fd868805a639554cf4b3f1f 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgUnionPreselectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgUnionPreselectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -18,15 +18,6 @@ namespace CP { - AsgUnionPreselectionAlg :: - AsgUnionPreselectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("selectionDecoration", m_selectionDecoration, "the decoration for the union selection"); - } - - StatusCode AsgUnionPreselectionAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgUnionSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgUnionSelectionAlg.cxx index fea42a4f2f0d919dd46d86dfa7f750eb4f9254c9..60d5e469dc9b40fd0dd3aebf3431ca62bc1cc3d1 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgUnionSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgUnionSelectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -18,15 +18,6 @@ namespace CP { - AsgUnionSelectionAlg :: - AsgUnionSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("selectionDecoration", m_selectionDecoration, "the decoration for the union selection"); - } - - StatusCode AsgUnionSelectionAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgViewFromSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgViewFromSelectionAlg.cxx index 800051cc3e1f66d41ea5bcd0455707fcec8095fc..287d0bbe65eed3e336432cf04835ede4c7221469 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgViewFromSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgViewFromSelectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -173,23 +173,6 @@ namespace CP - AsgViewFromSelectionAlg :: - AsgViewFromSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - /// \todo this would probably better be an std::map, but this - /// isn't supported as a property type for AnaAlgorithm right now - declareProperty ("selection", m_selection, "the list of selection decorations"); - declareProperty ("ignore", m_ignore, "the list of cuts to *ignore* for each selection"); - declareProperty ("sortPt", m_sortPt, "whether to sort objects in pt"); - declareProperty ("allowMissing", m_allowMissing, - "Allow the input container to be missing"); - declareProperty ("sizeLimit", m_sizeLimit, "the limit on the size of the output container"); - declareProperty ("deepCopy", m_deepCopy, "perform a deep copy"); - } - - StatusCode AsgViewFromSelectionAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgxAODNTupleMakerAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgxAODNTupleMakerAlg.cxx index 958d941215ef76387d03b5384b8f6c8e3a3c30e5..1ee88bc6903c4fe46ef84adb49375abfc7689671 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgxAODNTupleMakerAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgxAODNTupleMakerAlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // Local include(s): #include "AsgAnalysisAlgorithms/AsgxAODNTupleMakerAlg.h" @@ -353,19 +353,6 @@ namespace { namespace CP { - AsgxAODNTupleMakerAlg::AsgxAODNTupleMakerAlg( const std::string& name, - ISvcLocator* svcLoc ) - : EL::AnaAlgorithm( name, svcLoc ) { - - // Declare the algorithm's properties. - declareProperty( "TreeName", m_treeName = "physics", - "Name of the tree to write" ); - declareProperty( "Branches", m_branches, - "Branches to write to the output tree" ); - declareProperty( "systematicsService", m_systematicsService, - "systematics service" ); - } - StatusCode AsgxAODNTupleMakerAlg::initialize() { // Check that at least one branch is configured. diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/EventCutFlowHistAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/EventCutFlowHistAlg.cxx index 622090e7f6e5684331284014faedcd4bcb391fc3..5404817d54cd91b353ae50c4b6d07ae2e49fb175 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/EventCutFlowHistAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/EventCutFlowHistAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Baptiste Ravina @@ -20,15 +20,6 @@ namespace CP { - EventCutFlowHistAlg :: - EventCutFlowHistAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("histPattern", m_histPattern, "the pattern for histogram names"); - } - - StatusCode EventCutFlowHistAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/EventFlagSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/EventFlagSelectionAlg.cxx index dd4cfd93b286539329a9fe5c3feea962c451197f..3b3174037b04fccdd318159f7097781b27444b88 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/EventFlagSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/EventFlagSelectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -8,14 +8,6 @@ #include <EventBookkeeperTools/FilterReporter.h> #include <xAODEventInfo/EventInfo.h> -CP::EventFlagSelectionAlg::EventFlagSelectionAlg(const std::string &name, - ISvcLocator *svcLoc) - : EL::AnaAlgorithm(name, svcLoc) -{ - declareProperty ("selectionFlags", m_selFlags, "list of flags to use as selection criteria"); - declareProperty ("invertFlags", m_invertFlags, "toggles for inverting the selection (index-parallel to selectionFlags)"); -} - StatusCode CP::EventFlagSelectionAlg::initialize() { if (m_invertFlags.size() != m_selFlags.size() && !m_invertFlags.empty()) { @@ -31,7 +23,11 @@ StatusCode CP::EventFlagSelectionAlg::initialize() } else { // Extend m_invertFlags until the size matches m_selectionFlags // Only done in the case that m_invert was empty - if (m_invertFlags.size() < index + 1) { m_invertFlags.push_back(false); } + if (m_invertFlags.size() < index + 1) { + std::vector<bool> flags = m_invertFlags.value(); + flags.resize(index + 1, false); + m_invertFlags = flags; + } std::unique_ptr<ISelectionReadAccessor> accessor; ANA_CHECK (makeSelectionReadAccessor (m_selFlags[index], accessor)); diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/KinematicHistAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/KinematicHistAlg.cxx index 304b408c160dbfd87583dc47157e705fc7f90624..d817ec668c7ac61a0833852a838b4a23b01ab66b 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/KinematicHistAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/KinematicHistAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -20,15 +20,6 @@ namespace CP { - KinematicHistAlg :: - KinematicHistAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("histPattern", m_histPattern, "the pattern for histogram names"); - } - - StatusCode KinematicHistAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/ObjectCutFlowHistAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/ObjectCutFlowHistAlg.cxx index 24051cbac02a56a96a31cc07a535f742cdb22b1e..11fdf1c2433e22cbd25a70f3031b88657ed9c367 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/ObjectCutFlowHistAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/ObjectCutFlowHistAlg.cxx @@ -21,15 +21,6 @@ namespace CP { - ObjectCutFlowHistAlg :: - ObjectCutFlowHistAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("histPattern", m_histPattern, "the pattern for histogram names"); - } - - StatusCode ObjectCutFlowHistAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/OverlapRemovalAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/OverlapRemovalAlg.cxx index 966170ed16e23bd2364c5d68f379e0dde2fcee46..056b91807840565a3719b4e18f633dbddc7f87f6 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/OverlapRemovalAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/OverlapRemovalAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -17,16 +17,6 @@ namespace CP { - OverlapRemovalAlg :: - OverlapRemovalAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("overlapTool", m_overlapTool); - declareProperty ("OutputLabel", m_overlapRemovalDecoration, "the decoration for the overlap removal tool output"); - } - - StatusCode OverlapRemovalAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/PMGTruthWeightAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/PMGTruthWeightAlg.cxx index a124a5404402e9434733070a4195dd005b409895..4623b838d4ac1e592f7cfc2bb41ea54780057420 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/PMGTruthWeightAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/PMGTruthWeightAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -17,16 +17,6 @@ namespace CP { - PMGTruthWeightAlg :: - PMGTruthWeightAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_truthWeightTool ("PMGTools::PMGTruthWeightTool", this) - { - declareProperty ("truthWeightTool", m_truthWeightTool, "the truth weight tool"); - } - - StatusCode PMGTruthWeightAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/PileupReweightingAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/PileupReweightingAlg.cxx index ff313baf2e5e3990b2573d6e96ff902ee5361e7f..9d01d16400a90f56f97404f2c7ae4582fa8eb9a9 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/PileupReweightingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/PileupReweightingAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -24,24 +24,6 @@ namespace { namespace CP { - PileupReweightingAlg :: - PileupReweightingAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_pileupReweightingTool ("CP::PileupReweightingTool", this) - { - declareProperty ("pileupReweightingTool", m_pileupReweightingTool, "the pileup reweighting tool we apply"); - declareProperty ("baseEventInfo", m_baseEventInfoName, - "The name of the original event info. The non-systematic dependent decorations will be applied to this " - "object so it should be at least a base of the shallow copies read in by the 'eventInfo' handle. " - "The default (and strongly recommended behaviour) is to leave all of these pointed at the central 'EventInfo' object!" - ); - declareProperty ("correctedScaledAverageMuDecoration", m_correctedScaledAverageMuDecoration, "the decoration for the corrected and scaled average interactions per crossing"); - declareProperty ("correctedActualMuDecoration", m_correctedActualMuDecoration, "the decoration for the corrected actual interactions per crossing"); - declareProperty ("correctedScaledActualMuDecoration", m_correctedScaledActualMuDecoration, "the decoration for the corrected and scaled actual interactions per crossing"); - } - - StatusCode PileupReweightingAlg :: initialize () @@ -65,6 +47,7 @@ namespace CP ANA_CHECK (m_systematicsList.addSystematics (*m_pileupReweightingTool)); ANA_CHECK (m_systematicsList.initialize()); ANA_CHECK (m_outOfValidity.initialize()); + ANA_CHECK (m_baseEventInfoName.initialize()); return StatusCode::SUCCESS; } @@ -74,8 +57,7 @@ namespace CP execute () { - const xAOD::EventInfo* evtInfo = nullptr; - ANA_CHECK(evtStore()->retrieve(evtInfo, m_baseEventInfoName)); + SG::ReadHandle<xAOD::EventInfo> evtInfo(m_baseEventInfoName); // Add additional decorations - these apply to data (and on MC just redecorate the same value as // before) diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/SysListDumperAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/SysListDumperAlg.cxx index 84e2e1f59fd0958d2f984d5dcae1f8c4fb9f3189..3ac0d9ba07e2632156c8b51d08801c4d9c2ac758 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/SysListDumperAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/SysListDumperAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -19,17 +19,6 @@ namespace CP { - SysListDumperAlg :: - SysListDumperAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("systematicsService", m_systematicsService, "systematics service"); - declareProperty ("systematicsRegex", m_regex, "systematics regex"); - declareProperty ("histogramName", m_histogramName, "the name of the output histogram"); - } - - StatusCode SysListDumperAlg :: initialize () @@ -59,7 +48,7 @@ namespace CP const std::vector<CP::SystematicSet> systematics = makeSystematicsVector (m_regex); - ANA_CHECK (book (TH1F (m_histogramName.c_str(), "systematics", systematics.size(), 0, systematics.size()))); + ANA_CHECK (book (TH1F (m_histogramName.value().c_str(), "systematics", systematics.size(), 0, systematics.size()))); TH1 *histogram = hist (m_histogramName); int i = 1; @@ -108,4 +97,4 @@ namespace CP } return StatusCode::SUCCESS; } -} \ No newline at end of file +} diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/TreeFillerAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/TreeFillerAlg.cxx index ffc38375c1837b110b982dee8caef270df92711f..921d27908530f8f3fc106fb169901fe68f615a80 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/TreeFillerAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/TreeFillerAlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // Local include(s): #include "AsgAnalysisAlgorithms/TreeFillerAlg.h" @@ -23,15 +23,6 @@ namespace CP { - TreeFillerAlg::TreeFillerAlg( const std::string& name, - ISvcLocator* svcLoc ) - : EL::AnaAlgorithm( name, svcLoc ) { - - // Declare the algorithm's properties. - declareProperty( "TreeName", m_treeName = "physics", - "Name of the tree to write" ); - } - StatusCode TreeFillerAlg::execute() { // get the output tree for the first time if( ! m_tree ) { diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaCalibrationAndSmearingAlg.h b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaCalibrationAndSmearingAlg.h index 146bc51c9d50fe2930e5cb6bb008b409da26aed2..048f305362bf51d68de5478fab3a136cea11944c 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaCalibrationAndSmearingAlg.h +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaCalibrationAndSmearingAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -27,21 +27,15 @@ namespace CP { /// \brief the standard constructor public: - EgammaCalibrationAndSmearingAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<CP::IEgammaCalibrationAndSmearingTool> m_calibrationAndSmearingTool; + ToolHandle<CP::IEgammaCalibrationAndSmearingTool> m_calibrationAndSmearingTool {this, "calibrationAndSmearingTool", "EgammaCalibrationAndSmearingTool", "the smearing tool we apply"}; /// \brief whether to ignore all tool systematics /// diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsGoodOQSelectionTool.h b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsGoodOQSelectionTool.h index ab946833a4100f510a0824d709537edfd220233d..ea67ad989c443ad6d8b29cced73b76571fde2216 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsGoodOQSelectionTool.h +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsGoodOQSelectionTool.h @@ -1,6 +1,6 @@ // Dear emacs, this is -*- c++ -*- // -// Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // #ifndef EGAMMAANALYSISALGORITHMS_EGAMMAISGOODOQSELECTIONTOOL_H #define EGAMMAANALYSISALGORITHMS_EGAMMAISGOODOQSELECTIONTOOL_H @@ -10,6 +10,11 @@ #include "PATCore/IAsgSelectionTool.h" #include "EgammaAnalysisInterfaces/IAsgDeadHVCellRemovalTool.h" #include "AsgTools/AnaToolHandle.h" +#include "AsgTools/PropertyWrapper.h" + +// EDM include(s): +#include "xAODEgamma/Egamma.h" +#include "xAODEgamma/EgammaDefs.h" namespace CP { @@ -30,7 +35,7 @@ namespace CP { ASG_TOOL_CLASS( EgammaIsGoodOQSelectionTool, IAsgSelectionTool ) /// AsgTool constructor - EgammaIsGoodOQSelectionTool( const std::string& name ); + using asg::AsgTool::AsgTool; /// @name Interface inherited from @c IAsgSelectionTool /// @{ @@ -57,7 +62,7 @@ namespace CP { /// @{ /// The mask to require good object quality with - int m_mask; + Gaudi::Property<int> m_mask {this, "Mask", static_cast<int>(xAOD::EgammaParameters::ALLOQ), "Mask to require passing object quality bits with"}; /// @} diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationCorrectionAlg.h b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationCorrectionAlg.h index e770f9dc2819f1543ca900d22b4a1891cb34dc87..70ad14e19885f2af39f32f4e7828ab1e50756937 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationCorrectionAlg.h +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationCorrectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -26,21 +26,15 @@ namespace CP { /// \brief the standard constructor public: - EgammaIsolationCorrectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<CP::IIsolationCorrectionTool> m_isolationCorrectionTool; + ToolHandle<CP::IIsolationCorrectionTool> m_isolationCorrectionTool {this, "isolationCorrectionTool", "IsolationCorrectionTool", "the smearing tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h index 2781e66fba997a75d08624b9ecc230a57cc914bd..270f05a5dfd0b1ef35d9b0ec0fb4ca758be1364a 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -28,21 +28,15 @@ namespace CP { /// \brief the standard constructor public: - EgammaIsolationSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the selection tool private: - ToolHandle<IIsolationSelectionTool> m_selectionTool; + ToolHandle<IIsolationSelectionTool> m_selectionTool {this, "selectionTool", "", "the selection tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/ElectronEfficiencyCorrectionAlg.h b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/ElectronEfficiencyCorrectionAlg.h index 5c112bb09e150accb753e491f843536b604111b5..f4cd10b55d1d395c31f355fdd79f120993a4e469 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/ElectronEfficiencyCorrectionAlg.h +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/ElectronEfficiencyCorrectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -26,21 +26,15 @@ namespace CP { /// \brief the standard constructor public: - ElectronEfficiencyCorrectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IAsgElectronEfficiencyCorrectionTool> m_efficiencyCorrectionTool; + ToolHandle<IAsgElectronEfficiencyCorrectionTool> m_efficiencyCorrectionTool {this, "efficiencyCorrectionTool", "AsgElectronEfficiencyCorrectionTool", "the calibration and smearing tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/PhotonEfficiencyCorrectionAlg.h b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/PhotonEfficiencyCorrectionAlg.h index 5277ede6eebd52f5499773c10672cf4fb54b459b..35abb3f9dd1e357ef64d67e4c10d598346ba22dd 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/PhotonEfficiencyCorrectionAlg.h +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/PhotonEfficiencyCorrectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -25,21 +25,15 @@ namespace CP { /// \brief the standard constructor public: - PhotonEfficiencyCorrectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IAsgPhotonEfficiencyCorrectionTool> m_efficiencyCorrectionTool; + ToolHandle<IAsgPhotonEfficiencyCorrectionTool> m_efficiencyCorrectionTool {this, "efficiencyCorrectionTool", "AsgPhotonEfficiencyCorrectionTool", "the efficiency correction tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/PhotonShowerShapeFudgeAlg.h b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/PhotonShowerShapeFudgeAlg.h index cfb37d323a6f0b0294d1a8deddc786c203d93445..7437f0ad7b58875f437fb05a6ec6aff942dab5c2 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/PhotonShowerShapeFudgeAlg.h +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/PhotonShowerShapeFudgeAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -27,21 +27,15 @@ namespace CP { /// \brief the standard constructor public: - PhotonShowerShapeFudgeAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IElectronPhotonShowerShapeFudgeTool> m_showerShapeFudgeTool; + ToolHandle<IElectronPhotonShowerShapeFudgeTool> m_showerShapeFudgeTool {this, "showerShapeFudgeTool", "ElectronPhotonShowerShapeFudgeTool", "the smearing tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaCalibrationAndSmearingAlg.cxx b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaCalibrationAndSmearingAlg.cxx index 40f83b9f7bba9bb408f8c866e0ebc0149b398b60..49fe2bc36845f61116ea76b11e6c49b187b77b36 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaCalibrationAndSmearingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaCalibrationAndSmearingAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - EgammaCalibrationAndSmearingAlg :: - EgammaCalibrationAndSmearingAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_calibrationAndSmearingTool ("CP::EgammaCalibrationAndSmearingTool", this) - { - declareProperty ("calibrationAndSmearingTool", m_calibrationAndSmearingTool, "the smearing tool we apply"); - } - - StatusCode EgammaCalibrationAndSmearingAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsGoodOQSelectionTool.cxx b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsGoodOQSelectionTool.cxx index 718d27d525cafddc685a24f897840a1eaa83b908..d212433392e0e92faef677d312f19ba1e6d370e8 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsGoodOQSelectionTool.cxx +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsGoodOQSelectionTool.cxx @@ -1,28 +1,16 @@ // -// Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // // Local include(s): #include "EgammaAnalysisAlgorithms/EgammaIsGoodOQSelectionTool.h" -// EDM include(s): -#include "xAODEgamma/Egamma.h" -#include "xAODEgamma/EgammaDefs.h" // System include(s): #include <iomanip> namespace CP { - EgammaIsGoodOQSelectionTool:: - EgammaIsGoodOQSelectionTool( const std::string& name ) - : asg::AsgTool( name ) { - - // Declare the tool's properties. - declareProperty( "Mask", m_mask = xAOD::EgammaParameters::ALLOQ, - "Mask to require passing object quality bits with" ); - } - const asg::AcceptInfo& EgammaIsGoodOQSelectionTool::getAcceptInfo() const { // Return the internal object. diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationCorrectionAlg.cxx b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationCorrectionAlg.cxx index e47ac993239fc004f8cce241aad380197b95a084..8dc5705e66eca0e81420e6c414ba81daff380027 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationCorrectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationCorrectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - EgammaIsolationCorrectionAlg :: - EgammaIsolationCorrectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_isolationCorrectionTool ("CP::IsolationCorrectionTool", this) - { - declareProperty ("isolationCorrectionTool", m_isolationCorrectionTool, "the smearing tool we apply"); - } - - StatusCode EgammaIsolationCorrectionAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationSelectionAlg.cxx index c55e5cda5ebb040b8cf7fbfe5450bed3c78bb2b7..664dcf158c02986b7e4f9ee9d191f64f9b192e1d 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationSelectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - EgammaIsolationSelectionAlg :: - EgammaIsolationSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_selectionTool ("", this) - { - declareProperty ("selectionTool", m_selectionTool, "the selection tool we apply"); - } - - StatusCode EgammaIsolationSelectionAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/ElectronEfficiencyCorrectionAlg.cxx b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/ElectronEfficiencyCorrectionAlg.cxx index 2c0bb707ce6b136c8ab9bb1739a0c76d32e0581b..408c05b97764494909e1162f85e3137df7ec87ee 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/ElectronEfficiencyCorrectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/ElectronEfficiencyCorrectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - ElectronEfficiencyCorrectionAlg :: - ElectronEfficiencyCorrectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_efficiencyCorrectionTool ("AsgElectronEfficiencyCorrectionTool", this) - { - declareProperty ("efficiencyCorrectionTool", m_efficiencyCorrectionTool, "the calibration and smearing tool we apply"); - } - - StatusCode ElectronEfficiencyCorrectionAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/PhotonEfficiencyCorrectionAlg.cxx b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/PhotonEfficiencyCorrectionAlg.cxx index cb7132e76368f67d46f22a48d00d1163484ae6d4..b2b68b891ade9e54f0d350cafb25650e58cf0500 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/PhotonEfficiencyCorrectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/PhotonEfficiencyCorrectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - PhotonEfficiencyCorrectionAlg :: - PhotonEfficiencyCorrectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_efficiencyCorrectionTool ("AsgPhotonEfficiencyCorrectionTool", this) - { - declareProperty ("efficiencyCorrectionTool", m_efficiencyCorrectionTool, "the efficiency correction tool we apply"); - } - - StatusCode PhotonEfficiencyCorrectionAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/PhotonShowerShapeFudgeAlg.cxx b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/PhotonShowerShapeFudgeAlg.cxx index 72139c0ae1cf48dd9e5e9ed99034e9176a066f72..5a0552ae73757fb7139f53ef3d92b75f141210b4 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/PhotonShowerShapeFudgeAlg.cxx +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/PhotonShowerShapeFudgeAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - PhotonShowerShapeFudgeAlg :: - PhotonShowerShapeFudgeAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_showerShapeFudgeTool ("ElectronPhotonShowerShapeFudgeTool", this) - { - declareProperty ("showerShapeFudgeTool", m_showerShapeFudgeTool, "the smearing tool we apply"); - } - - StatusCode PhotonShowerShapeFudgeAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingEfficiencyAlg.h b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingEfficiencyAlg.h index c2ff0c44fe0057ff15842c78a9cbabf6efa81a75..1f7898f672b775e9cd3b8b61d487eb71fc56997c 100644 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingEfficiencyAlg.h +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingEfficiencyAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -17,6 +17,7 @@ #include <SystematicsHandles/SysListHandle.h> #include <SystematicsHandles/SysReadHandle.h> #include <xAODJet/JetContainer.h> +#include <AsgTools/PropertyWrapper.h> #include <memory> namespace CP @@ -27,21 +28,15 @@ namespace CP { /// \brief the standard constructor public: - BTaggingEfficiencyAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IBTaggingEfficiencyTool> m_efficiencyTool; + ToolHandle<IBTaggingEfficiencyTool> m_efficiencyTool {this, "efficiencyTool", "BTaggingEfficiencyTool", "the calibration and smearing tool we apply"}; /// \brief the systematics list we run private: @@ -73,11 +68,11 @@ namespace CP /// \brief only run the efficency for all jets private: - bool m_onlyEfficiency {false}; + Gaudi::Property<bool> m_onlyEfficiency {this, "onlyEfficiency", false, "whether only to calculate efficiencies"}; /// \brief only run the inefficency for all jets private: - bool m_onlyInefficiency {false}; + Gaudi::Property<bool> m_onlyInefficiency {this, "onlyInefficiency", false, "whether only to calculate inefficiencies"}; }; } diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingInformationDecoratorAlg.h b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingInformationDecoratorAlg.h index a92e865259a160dd5ffff5f7ea1ba5729a311b83..9b41f2633e891eadab475af397bd45f3d1eb926e 100644 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingInformationDecoratorAlg.h +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/FTagAnalysisAlgorithms/BTaggingInformationDecoratorAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -17,6 +17,7 @@ #include <SystematicsHandles/SysListHandle.h> #include <SystematicsHandles/SysWriteDecorHandle.h> #include <xAODJet/JetContainer.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -24,14 +25,8 @@ namespace CP { /// \brief the standard constructor public: - BTaggingInformationDecoratorAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; @@ -41,7 +36,7 @@ namespace CP /// \brief the selection tool private: - ToolHandle<IBTaggingSelectionTool> m_selectionTool; + ToolHandle<IBTaggingSelectionTool> m_selectionTool {this, "selectionTool", "", "the b-tagging selection tool"}; /// \brief the jets continer we run on private: @@ -59,7 +54,7 @@ namespace CP /// \brief the decoration for the b-tagging weight private: - std::string m_taggerWeightDecoration {}; + Gaudi::Property<std::string> m_taggerWeightDecoration {this, "taggerWeightDecoration", "", "the decoration for the tagger weight"}; /// \brief the decorator for \ref m_taggerWeightDecoration private: @@ -67,7 +62,7 @@ namespace CP /// \brief the decoration for the b-tagging quantiles private: - std::string m_quantileDecoration {}; + Gaudi::Property<std::string> m_quantileDecoration {this, "quantileDecoration", "", "the decoration for the continuous WP quantile"}; /// \brief the decorator for \ref m_quantileDecoration private: diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingEfficiencyAlg.cxx b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingEfficiencyAlg.cxx index 78a8acd88263189fba95384c83fddde3e0e03ade..bcd6b3b0c554878d52414839c1db08397c65ec9c 100644 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingEfficiencyAlg.cxx +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingEfficiencyAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,18 +18,6 @@ namespace CP { - BTaggingEfficiencyAlg :: - BTaggingEfficiencyAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_efficiencyTool ("BTaggingEfficiencyTool", this) - { - declareProperty ("efficiencyTool", m_efficiencyTool, "the calibration and smearing tool we apply"); - declareProperty ("onlyEfficiency", m_onlyEfficiency, "whether only to calculate efficiencies"); - declareProperty ("onlyInefficiency", m_onlyInefficiency, "whether only to calculate inefficiencies"); - } - - StatusCode BTaggingEfficiencyAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingInformationDecoratorAlg.cxx b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingInformationDecoratorAlg.cxx index 729e236fc1156e009f58a860df57314f0060f3ff..6bd31f9165bb60718efd2e0fd89c3239d5ba1d57 100644 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingInformationDecoratorAlg.cxx +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/Root/BTaggingInformationDecoratorAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -18,18 +18,6 @@ namespace CP { - BTaggingInformationDecoratorAlg :: - BTaggingInformationDecoratorAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_selectionTool ("", this) - { - declareProperty ("selectionTool", m_selectionTool, "the b-tagging selection tool"); - declareProperty ("taggerWeightDecoration", m_taggerWeightDecoration, "the decoration for the tagger weight"); - declareProperty ("quantileDecoration", m_quantileDecoration, "the decoration for the continuous WP quantile"); - } - - StatusCode BTaggingInformationDecoratorAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetCalibrationAlg.h b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetCalibrationAlg.h index 5d9e12501ed057c0664ccd846453d1fe0f4c34ab..0a6472b3d2499eb89a6bf6111d968f22a5a887f7 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetCalibrationAlg.h +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetCalibrationAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -21,21 +21,15 @@ namespace CP { /// \brief the standard constructor public: - JetCalibrationAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the calibration tool private: - ToolHandle<IJetCalibrationTool> m_calibrationTool; + ToolHandle<IJetCalibrationTool> m_calibrationTool {this, "calibrationTool", "JetCalibrationTool", "the calibration tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetModifierAlg.h b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetModifierAlg.h index 5b3b3abe2ca8f7491261a3c27f925099d76fbb62..b2bda82e7d9b7c0e5b082f51cafd6acab9d9ed85 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetModifierAlg.h +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetModifierAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -22,21 +22,15 @@ namespace CP { /// \brief the standard constructor public: - JetModifierAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the modifier tool private: - ToolHandle<IJetModifier> m_modifierTool; + ToolHandle<IJetModifier> m_modifierTool {this, "modifierTool", "JetForwardJvtTool", "the modifier tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetSelectionAlg.h b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetSelectionAlg.h index 2e964918342434b82bd7ea8b34699ec53f91ea1e..1aa6c943e10caf4d7fe74ccd00c9dcd4e5c98b15 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetSelectionAlg.h @@ -24,21 +24,15 @@ namespace CP { /// \brief the standard constructor public: - JetSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the selection tool private: - ToolHandle<IJetSelector> m_selectionTool; + ToolHandle<IJetSelector> m_selectionTool {this, "selectionTool", "", "the selection tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetUncertaintiesAlg.h b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetUncertaintiesAlg.h index eb3cf87fa7c257a2893cf882eed72bef2d9e364d..a8ff13a83ea613ffa87b9b8f1f5ac2b337729bde 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetUncertaintiesAlg.h +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetUncertaintiesAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -23,25 +23,19 @@ namespace CP { /// \brief the standard constructor public: - JetUncertaintiesAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the main jet uncertainties tool private: - ToolHandle<ICPJetUncertaintiesTool> m_uncertaintiesTool; + ToolHandle<ICPJetUncertaintiesTool> m_uncertaintiesTool {this, "uncertaintiesTool", "JetUncertaintiesTool", "the uncertainties tool we apply"}; /// \brief the secondary jet uncertainties tool, for pseudo-data JER smearing private: - ToolHandle<ICPJetUncertaintiesTool> m_uncertaintiesToolPD; + ToolHandle<ICPJetUncertaintiesTool> m_uncertaintiesToolPD {this, "uncertaintiesToolPD", "", "the uncertainties tool we apply specifically for the 'Full'/'All' JER systematic models"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JvtEfficiencyAlg.h b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JvtEfficiencyAlg.h index b39ba31320f778d4388da25cb1c02c632ad4c0e4..3d06d8aa60d820076e7e153dcbf719e0cfcc6b01 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JvtEfficiencyAlg.h +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JvtEfficiencyAlg.h @@ -27,12 +27,7 @@ namespace CP /// \brief the standard constructor public: using EL::AnaAlgorithm::AnaAlgorithm; - - - public: StatusCode initialize () override; - - public: StatusCode execute () override; diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JvtUpdateAlg.h b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JvtUpdateAlg.h index be567c701a648037e5c86a39f8b4c1cf0f8979ce..2cac3ce4a52657263bfdd2c184015d7cf7f59c8e 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JvtUpdateAlg.h +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JvtUpdateAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -14,6 +14,7 @@ #include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> #include <xAODJet/JetContainer.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -23,21 +24,15 @@ namespace CP { /// \brief the standard constructor public: - JvtUpdateAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the update tool private: - ToolHandle<IJetUpdateJvt> m_jvtTool; + ToolHandle<IJetUpdateJvt> m_jvtTool {this, "jvtTool", "", "the jvt tool we apply"}; /// \brief the systematics list we run private: @@ -55,7 +50,7 @@ namespace CP /// \brief the name of the decoration we create private: - std::string m_decorationName {"Jvt"}; + Gaudi::Property<std::string> m_decorationName {this, "decorationName", "Jvt", "the decoration name to use"}; /// \brief the decoration accessor we use private: diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetCalibrationAlg.cxx b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetCalibrationAlg.cxx index 1fa1adec98a2c521b918e77096c12cdcb92303e6..5cd2213daaf4e37b0ee844eba93b2530c2f036ad 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetCalibrationAlg.cxx +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetCalibrationAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -17,16 +17,6 @@ namespace CP { - JetCalibrationAlg :: - JetCalibrationAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_calibrationTool ("JetCalibrationTool", this) - { - declareProperty ("calibrationTool", m_calibrationTool, "the calibration tool we apply"); - } - - StatusCode JetCalibrationAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetModifierAlg.cxx b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetModifierAlg.cxx index 5fd383abe73273e302c9aa1ce6b8c542505677ca..4b9bcad572b392b4d6ce0208fb311217b9d24fd4 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetModifierAlg.cxx +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetModifierAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -17,16 +17,6 @@ namespace CP { - JetModifierAlg :: - JetModifierAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_modifierTool ("JetForwardJvtTool", this) - { - declareProperty ("modifierTool", m_modifierTool, "the modifier tool we apply"); - } - - StatusCode JetModifierAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetSelectionAlg.cxx index 2fa9898f8edc70c2e67ffb4bc64b8df19e7f80e2..812737768f88e981d742c39b34c547ab9030347d 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetSelectionAlg.cxx @@ -19,16 +19,6 @@ namespace CP { - JetSelectionAlg :: - JetSelectionAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_selectionTool ("", this) - { - declareProperty ("selectionTool", m_selectionTool, "the selection tool we apply"); - } - - StatusCode JetSelectionAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetUncertaintiesAlg.cxx b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetUncertaintiesAlg.cxx index c75a456da3530d96585c81a42a2a4338165f707f..4a7f827e41ececee012f076efc57dfde2ab4a6cb 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetUncertaintiesAlg.cxx +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetUncertaintiesAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -17,18 +17,6 @@ namespace CP { - JetUncertaintiesAlg :: - JetUncertaintiesAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_uncertaintiesTool ("JetUncertaintiesTool", this) - , m_uncertaintiesToolPD ("", this) - { - declareProperty ("uncertaintiesTool", m_uncertaintiesTool, "the uncertainties tool we apply"); - declareProperty ("uncertaintiesToolPD", m_uncertaintiesToolPD, "the uncertainties tool we apply specifically for the 'Full'/'All' JER systematic models"); - } - - StatusCode JetUncertaintiesAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JvtUpdateAlg.cxx b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JvtUpdateAlg.cxx index 681cb0709ad99f233d638abea9afaaad53da3c87..cce56f9e6e56a28c3391ef95925bf15666221ca9 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JvtUpdateAlg.cxx +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JvtUpdateAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -17,17 +17,6 @@ namespace CP { - JvtUpdateAlg :: - JvtUpdateAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_jvtTool ("", this) - { - declareProperty ("jvtTool", m_jvtTool, "the jvt tool we apply"); - declareProperty ("decorationName", m_decorationName, "the decoration name to use"); - } - - StatusCode JvtUpdateAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetBuilderAlg.h b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetBuilderAlg.h index fb9aaec2853ae602e5d5e54f1a7cb6121ebdc11c..691779422b2f53ce1d9ac81a5abae5e23eef1ce4 100644 --- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetBuilderAlg.h +++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetBuilderAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -14,6 +14,7 @@ #include <SystematicsHandles/SysListHandle.h> #include <METInterface/IMETMaker.h> #include <xAODMissingET/MissingETContainer.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -23,14 +24,8 @@ namespace CP { /// \brief the standard constructor public: - MetBuilderAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; @@ -46,11 +41,11 @@ namespace CP /// \brief the key for the final met term private: - std::string m_finalKey {"Final"}; + Gaudi::Property<std::string> m_finalKey {this, "finalKey", "Final", "the key for the final met term"}; /// \brief the key for the soft term private: - std::string m_softTerm {"PVSoftTrk"}; + Gaudi::Property<std::string> m_softTerm {this, "softTerm", "PVSoftTrk", "the key for the soft term"}; }; } diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetMakerAlg.h b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetMakerAlg.h index 81f688c9c6e89dd9ac668d7fff41dbd21df828b5..ec5ffbd5e20229ca8767dc74544a1babcabe2c69 100644 --- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetMakerAlg.h +++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetMakerAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -16,10 +16,10 @@ #include <SelectionHelpers/SysReadSelectionHandle.h> #include <METInterface/IMETMaker.h> #include <METInterface/IMETSystematicsTool.h> - #include <xAODBase/IParticleContainer.h> #include <xAODMissingET/MissingETContainer.h> #include <xAODMissingET/MissingETAuxContainer.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -37,33 +37,27 @@ namespace CP { /// \brief the standard constructor public: - MetMakerAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the maker tool private: - ToolHandle<IMETMaker> m_makerTool; + ToolHandle<IMETMaker> m_makerTool {this, "makerTool", "METMaker", "the METMaker tool we apply"}; /// \brief the systematics tool private: - ToolHandle<IMETSystematicsTool> m_systematicsTool; + ToolHandle<IMETSystematicsTool> m_systematicsTool {this, "systematicsTool", "", "the systematics tool we apply"}; /// \brief the name of the core MissingETContainer private: - std::string m_metCoreName; + Gaudi::Property<std::string> m_metCoreName {this, "metCore", "", "the name of the core MissingETContainer"}; /// \brief the name of the MissingETAssociationMap private: - std::string m_metAssociationName; + Gaudi::Property<std::string> m_metAssociationName {this, "metAssociation", "", "the name of the core MissingETContainer"}; /// \brief the systematics list we run private: @@ -81,7 +75,7 @@ namespace CP /// \brief the key for \ref m_electronsHandle private: - std::string m_electronsKey {"RefEle"}; + Gaudi::Property<std::string> m_electronsKey {this, "electronsKey", "RefEle", "the key for the electrons"}; /// \brief the photon container to use private: @@ -95,7 +89,7 @@ namespace CP /// \brief the key for \ref m_photonsHandle private: - std::string m_photonsKey {"RefGamma"}; + Gaudi::Property<std::string> m_photonsKey {this, "photonsKey", "RefGamma", "the key for the photons"}; /// \brief the muon container to use private: @@ -109,7 +103,7 @@ namespace CP /// \brief the key for \ref m_muonsHandle private: - std::string m_muonsKey {"Muons"}; + Gaudi::Property<std::string> m_muonsKey {this, "muonsKey", "Muons", "the key for the muons"}; /// \brief the electron container to use private: @@ -123,7 +117,7 @@ namespace CP /// \brief the key for \ref m_tausHandle private: - std::string m_tausKey {"RefTau"}; + Gaudi::Property<std::string> m_tausKey {this, "tausKey", "RefTau", "the key for the taus"}; /// \brief the input jet collection we run on private: @@ -136,19 +130,19 @@ namespace CP /// \brief the key for \ref m_jetsHandle private: - std::string m_jetsKey {"RefJet"}; + Gaudi::Property<std::string> m_jetsKey {this, "jetsKey", "RefJet", "the key for the jets"}; /// \brief the soft term key private: - std::string m_softTermKey {"PVSoftTrk"}; + Gaudi::Property<std::string> m_softTermKey {this, "softTermKey", "PVSoftTrk", "the soft term key"}; /// \brief whether to use track-met instead of jet-met private: - bool m_doTrackMet {false}; + Gaudi::Property<bool> m_doTrackMet {this, "doTrackMet", false, "whether to use track-met instead of jet-met"}; /// \brief whether to do jet JVT private: - bool m_doJetJVT {true}; + Gaudi::Property<bool> m_doJetJVT {this, "doJetJVT", true, "whether to do jet JVT"}; /// \brief the met collection we run on private: diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetSignificanceAlg.h b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetSignificanceAlg.h index f2dd8fcc93af2f1f0f639721512c20aa88951309..796a9dc2deb8906d5fcdeb078243c87ae00863e8 100644 --- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetSignificanceAlg.h +++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/MetAnalysisAlgorithms/MetSignificanceAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -15,6 +15,7 @@ #include <SystematicsHandles/SysWriteHandle.h> #include <METInterface/IMETSignificance.h> #include <xAODMissingET/MissingETContainer.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -24,21 +25,15 @@ namespace CP { /// \brief the standard constructor public: - MetSignificanceAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IMETSignificance> m_significanceTool; + ToolHandle<IMETSignificance> m_significanceTool {this, "significanceTool", "METMaker", "the significance tool we apply"}; /// \brief the systematics list we run private: @@ -51,19 +46,19 @@ namespace CP /// \brief the key for the final met term private: - std::string m_totalMETName {"Final"}; + Gaudi::Property<std::string> m_totalMETName {this, "totalMETName", "Final", "the key for the final met term"}; /// \brief the key for the jets term private: - std::string m_jetTermName {"RefJet"}; + Gaudi::Property<std::string> m_jetTermName {this, "jetTermName", "RefJet", "the key for the jets term"}; /// \brief the key for the soft term private: - std::string m_softTermName {"PVSoftTrk"}; + Gaudi::Property<std::string> m_softTermName {this, "softTermName", "PVSoftTrk", "the key for the soft term"}; /// \brief the decoration for the significance private: - std::string m_significanceDecoration {"significance"}; + Gaudi::Property<std::string> m_significanceDecoration {this, "significanceDecoration", "significance", "the decoration to use for the significance"}; /// \brief the accessor for \ref m_selectionDecoration private: diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetBuilderAlg.cxx b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetBuilderAlg.cxx index 82beca86c2a7ad4e5ea537bbe19ca0ef341d54f1..8b871b1402f45ae95495cfe3544e54125ced64cd 100644 --- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetBuilderAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetBuilderAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -21,16 +21,6 @@ namespace CP { - MetBuilderAlg :: - MetBuilderAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - { - declareProperty ("finalKey", m_finalKey, "the key for the final met term"); - declareProperty ("softTerm", m_softTerm, "the key for the soft term"); - } - - StatusCode MetBuilderAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetMakerAlg.cxx b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetMakerAlg.cxx index b4b39f81ac2403160676fa76f0237d4f90c08dd3..1cdb6b68c2ff037d21b2b31529865915bf0bfd60 100644 --- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetMakerAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetMakerAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -23,28 +23,6 @@ namespace CP { - MetMakerAlg :: - MetMakerAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_makerTool ("METMaker", this) - , m_systematicsTool ("", this) - { - declareProperty ("makerTool", m_makerTool, "the METMaker tool we apply"); - declareProperty ("systematicsTool", m_systematicsTool, "the systematics tool we apply"); - declareProperty ("metCore", m_metCoreName, "the name of the core MissingETContainer"); - declareProperty ("metAssociation", m_metAssociationName, "the name of the core MissingETContainer"); - declareProperty ("electronsKey", m_electronsKey, "the key for the electrons"); - declareProperty ("photonsKey", m_photonsKey, "the key for the photons"); - declareProperty ("muonsKey", m_muonsKey, "the key for the muons"); - declareProperty ("tausKey", m_tausKey, "the key for the taus"); - declareProperty ("jetsKey", m_jetsKey, "the key for jets"); - declareProperty ("softTermKey", m_softTermKey, "the soft term key"); - declareProperty ("doTrackMet", m_doTrackMet, "whether to use track-met instead of jet-met"); - declareProperty ("doJetJVT", m_doJetJVT, "whether to do jet JVT"); - } - - StatusCode MetMakerAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetSignificanceAlg.cxx b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetSignificanceAlg.cxx index 5b2e246aa19dd0009385e78c854933d31432ddc1..84e2f36521b3ef0419eed9ee5d47e522d7860db8 100644 --- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetSignificanceAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetSignificanceAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -20,20 +20,6 @@ // namespace CP { - MetSignificanceAlg :: - MetSignificanceAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_significanceTool ("METMaker", this) - { - declareProperty ("significanceTool", m_significanceTool, "the significance tool we apply"); - declareProperty ("significanceDecoration", m_significanceDecoration, "the decoration to use for the significance"); - declareProperty ("totalMETName", m_totalMETName, "the key for the final met term"); - declareProperty ("jetTermName", m_jetTermName, "the key for the jets term"); - declareProperty ("softTermName", m_softTermName, "the key for the soft term"); - } - - StatusCode MetSignificanceAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonCalibrationAndSmearingAlg.h b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonCalibrationAndSmearingAlg.h index 43017cc6250cbd788f1508979615726098843872..e5a8af430e555686db960dfc8193c9ecfded2246 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonCalibrationAndSmearingAlg.h +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonCalibrationAndSmearingAlg.h @@ -26,21 +26,15 @@ namespace CP { /// \brief the standard constructor public: - MuonCalibrationAndSmearingAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IMuonCalibrationAndSmearingTool> m_calibrationAndSmearingTool; + ToolHandle<IMuonCalibrationAndSmearingTool> m_calibrationAndSmearingTool {this, "calibrationAndSmearingTool", "CP::MuonCalibrationAndSmearingTool", "the calibration and smearing tool we apply"}; /// \brief whether to skip the nominal correction (for PHYSLITE) private: diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonEfficiencyScaleFactorAlg.h b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonEfficiencyScaleFactorAlg.h index d0dca92c143e456a8dd236839df2287bdb650018..784cc662293319a049eceeb8eb71ccc8d1459fc4 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonEfficiencyScaleFactorAlg.h +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonEfficiencyScaleFactorAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -27,21 +27,15 @@ namespace CP { /// \brief the standard constructor public: - MuonEfficiencyScaleFactorAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IMuonEfficiencyScaleFactors> m_efficiencyScaleFactorTool; + ToolHandle<IMuonEfficiencyScaleFactors> m_efficiencyScaleFactorTool {this, "efficiencyScaleFactorTool", "CP::MuonTriggerScaleFactors", "the trigger efficiency scale factor tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonIsolationAlg.h b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonIsolationAlg.h index 79a8cfdbfc3e04da83ee8021e4b47c98bc033f42..7033a949e6040208a6670efd350daccf3c294272 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonIsolationAlg.h +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonIsolationAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -26,21 +26,15 @@ namespace CP { /// \brief the standard constructor public: - MuonIsolationAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<IIsolationSelectionTool> m_isolationTool; + ToolHandle<IIsolationSelectionTool> m_isolationTool {this, "isolationTool", "CP::IsolationSelectionTool", "the isolation tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h index 6cc7172cbfd82578ba0e1f47495776dcedbfd34e..390bb7d745ae6622ac80ce29febe6cfd0bb61e62 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -24,21 +24,15 @@ namespace CP { /// \brief the standard constructor public: - MuonSelectionAlgV2 (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the selection tool private: - ToolHandle<IMuonSelectionTool> m_selectionTool; + ToolHandle<IMuonSelectionTool> m_selectionTool {this, "selectionTool", "", "the selection tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonTriggerEfficiencyScaleFactorAlg.h b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonTriggerEfficiencyScaleFactorAlg.h index 58f4e274e7ff9cc313abc093c68e9f593acc4955..4bb1c6a55d4ce7ef792610b0dc94b4b4fbffdf26 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonTriggerEfficiencyScaleFactorAlg.h +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonTriggerEfficiencyScaleFactorAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -18,6 +18,7 @@ #include <SystematicsHandles/SysReadHandle.h> #include <xAODEventInfo/EventInfo.h> #include <xAODMuon/MuonContainer.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -27,14 +28,8 @@ namespace CP { /// \brief the standard constructor public: - MuonTriggerEfficiencyScaleFactorAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; @@ -68,15 +63,15 @@ namespace CP /// \brief trigger to run efficiency for private: - std::string m_trigger; + Gaudi::Property<std::string> m_trigger {this, "trigger", "", "trigger or trigger leg to calculate efficiency for"}; /// \brief minimum run number this trigger is valid for private: - uint32_t m_minRunNumber; + Gaudi::Property<uint32_t> m_minRunNumber {this, "minRunNumber", 0, "minimum run number for the trigger or trigger leg to calculate efficiency for"}; /// \brief maximum run number this trigger is valid for private: - uint32_t m_maxRunNumber; + Gaudi::Property<uint32_t> m_maxRunNumber {this, "maxRunNumber", 999999, "maximum run number for the trigger or trigger leg to calculate efficiency for"}; /// \brief the decoration for the muon scale factor private: diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonCalibrationAndSmearingAlg.cxx b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonCalibrationAndSmearingAlg.cxx index 2f60430dd7fed0517b6fe0e8879b8873a7320c3e..b99f77a8d5c3a2f08370362b05b3b308f5b9a04a 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonCalibrationAndSmearingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonCalibrationAndSmearingAlg.cxx @@ -20,16 +20,6 @@ namespace CP { - MuonCalibrationAndSmearingAlg :: - MuonCalibrationAndSmearingAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_calibrationAndSmearingTool ("CP::MuonCalibrationAndSmearingTool", this) - { - declareProperty ("calibrationAndSmearingTool", m_calibrationAndSmearingTool, "the calibration and smearing tool we apply"); - } - - StatusCode MuonCalibrationAndSmearingAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonEfficiencyScaleFactorAlg.cxx b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonEfficiencyScaleFactorAlg.cxx index 95a99e914e76c41f951f572552195441bfbe86eb..d720505e344fedcd84a1eee33ee648cd39b64514 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonEfficiencyScaleFactorAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonEfficiencyScaleFactorAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -20,16 +20,6 @@ namespace CP { - MuonEfficiencyScaleFactorAlg :: - MuonEfficiencyScaleFactorAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_efficiencyScaleFactorTool ("CP::MuonEfficiencyScaleFactors", this) - { - declareProperty ("efficiencyScaleFactorTool", m_efficiencyScaleFactorTool, "the calibration and smearing tool we apply"); - } - - StatusCode MuonEfficiencyScaleFactorAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonIsolationAlg.cxx b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonIsolationAlg.cxx index 4c4597cb82c437b1ffdf10199c6e4993b0baf1b9..a0c11ac62bd31284570788611a8a5035d6f475eb 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonIsolationAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonIsolationAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -20,16 +20,6 @@ namespace CP { - MuonIsolationAlg :: - MuonIsolationAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_isolationTool ("CP::IsolationSelectionTool", this) - { - declareProperty ("isolationTool", m_isolationTool, "the isolation tool we apply"); - } - - StatusCode MuonIsolationAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx index 14d6bc6825c3c89df0005bfca1eb0c01f16c6f05..e2cf318acd724e6df01828dba11bd35be1f45dc8 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -17,16 +17,6 @@ namespace CP { - MuonSelectionAlgV2 :: - MuonSelectionAlgV2 (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_selectionTool ("", this) - { - declareProperty ("selectionTool", m_selectionTool, "the selection tool we apply"); - } - - StatusCode MuonSelectionAlgV2 :: initialize () diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonTriggerEfficiencyScaleFactorAlg.cxx b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonTriggerEfficiencyScaleFactorAlg.cxx index 247ade5094317b27faaa250fc40a01369d9b7b0e..dd79ea4c6a4cda3f97e81d3e2ebc035436ab07d8 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonTriggerEfficiencyScaleFactorAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonTriggerEfficiencyScaleFactorAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -21,18 +21,6 @@ namespace CP { - MuonTriggerEfficiencyScaleFactorAlg :: - MuonTriggerEfficiencyScaleFactorAlg (const std::string& name, ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_efficiencyScaleFactorTool ("CP::MuonTriggerScaleFactors", this) - { - declareProperty ("efficiencyScaleFactorTool", m_efficiencyScaleFactorTool, "the trigger efficiency scale factor tool we apply"); - declareProperty ("trigger", m_trigger, "trigger or trigger leg to calculate efficiency for"); - declareProperty ("minRunNumber", m_minRunNumber = 0, "trigger or trigger leg to calculate efficiency for"); - declareProperty ("maxRunNumber", m_maxRunNumber = 999999, "trigger or trigger leg to calculate efficiency for"); - } - - StatusCode MuonTriggerEfficiencyScaleFactorAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/Root/xAODWriterAlg.cxx b/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/Root/xAODWriterAlg.cxx index cd4025f2f50ada0a06c6a72c39cd3e8274f4e6fc..bab1b6062abe1e6f1d3ed5eb5b9d31a1b86b28ab 100644 --- a/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/Root/xAODWriterAlg.cxx +++ b/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/Root/xAODWriterAlg.cxx @@ -1,5 +1,5 @@ // -// Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // // System include(s): @@ -18,20 +18,6 @@ namespace CP { - xAODWriterAlg::xAODWriterAlg( const std::string& name, ISvcLocator* svcLoc ) - : EL::AnaAlgorithm( name, svcLoc ) { - - // Declare the algorithm's properties. - declareProperty( "OutputStreamName", m_outputStreamName = "ANALYSIS", - "Stream name of the output file to use" ); - declareProperty( "ItemList", m_itemList, - "Objects to write to the output file" ); - declareProperty( "BasketSize", m_basketSize = 32000, - "(Starter) Basket size for the created branches" ); - declareProperty( "SplitLevel", m_splitLevel = 0, - "Split level for the created branches" ); - } - StatusCode xAODWriterAlg::initialize() { // Make sure that the xAOD::TEvent object managed by EventLoop is the diff --git a/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/StandaloneAnalysisAlgorithms/xAODWriterAlg.h b/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/StandaloneAnalysisAlgorithms/xAODWriterAlg.h index 2be743298f94f86255598a2990a0a657027395c9..13c18e646d94da7e69f440c5fc53eeb16c840ffe 100644 --- a/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/StandaloneAnalysisAlgorithms/xAODWriterAlg.h +++ b/PhysicsAnalysis/Algorithms/StandaloneAnalysisAlgorithms/StandaloneAnalysisAlgorithms/xAODWriterAlg.h @@ -1,6 +1,6 @@ // Dear emacs, this is -*- c++ -*- // -// Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // #ifndef STANDALONEANALYSISALGORITHMS_XAODWRITERALG_H #define STANDALONEANALYSISALGORITHMS_XAODWRITERALG_H @@ -14,6 +14,7 @@ #include "AnaAlgorithm/AnaAlgorithm.h" #include "SystematicsHandles/SysListHandle.h" #include "xAODRootAccess/TEvent.h" +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -29,7 +30,7 @@ namespace CP { public: /// Algorithm constructor - xAODWriterAlg( const std::string& name, ISvcLocator* svcLoc ); + using EL::AnaAlgorithm::AnaAlgorithm; /// @name Function(s) inherited from @c EL::AnaAlgorithm /// @{ @@ -53,14 +54,13 @@ namespace CP { /// @{ /// Name of the output stream to write to - std::string m_outputStreamName; + Gaudi::Property<std::string> m_outputStreamName {this, "OutputStreamName", "ANALYSIS", "Stream name of the output file to use"}; /// Item list to write to the output file - std::vector< std::string > m_itemList; - + Gaudi::Property<std::vector<std::string>> m_itemList {this, "ItemList", {}, "Objects to write to the output file"}; /// (Starter) Basket size for the created branches - int m_basketSize; + Gaudi::Property<int> m_basketSize {this, "BasketSize", 32000, "(Starter) Basket size for the created branches"}; /// Split level for the created branches - int m_splitLevel; + Gaudi::Property<int> m_splitLevel {this, "SplitLevel", 0, "Split level for the created branches"}; /// @} diff --git a/PhysicsAnalysis/Algorithms/SystematicsHandles/Root/SystematicsSvc.cxx b/PhysicsAnalysis/Algorithms/SystematicsHandles/Root/SystematicsSvc.cxx index 325630bc290f9caa078bde6520bdb8cfa2019053..33fd0150972b97685b30c809e8326874833d8135 100644 --- a/PhysicsAnalysis/Algorithms/SystematicsHandles/Root/SystematicsSvc.cxx +++ b/PhysicsAnalysis/Algorithms/SystematicsHandles/Root/SystematicsSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -30,11 +30,6 @@ namespace CP ISvcLocator* pSvcLocator) : AsgService (name, pSvcLocator) { - declareProperty ("systematicsList", m_systematicsList, "the list of systematics to run"); - declareProperty ("systematicsRegex", m_systematicsRegex, "systematics filter regex"); - declareProperty ("sigmaRecommended", m_sigmaRecommended, "the sigma with which to run recommended systematics"); - declareProperty ("nominalSystematicsName", m_nominalSystematicsName, "the name to use for the nominal systematic (instead of the empty string)"); - declareServiceInterface<ISystematicsSvc>(); } @@ -77,7 +72,7 @@ namespace CP sys.setSigma (m_sigmaRecommended); sys.calc (m_recommendedSystematics); - std::regex expr (m_systematicsRegex); + std::regex expr (m_systematicsRegex.value()); for (const CP::SystematicSet& mysys : sys.result("")) { if (!regex_match (mysys.name(), expr)) diff --git a/PhysicsAnalysis/Algorithms/SystematicsHandles/SystematicsHandles/SystematicsSvc.h b/PhysicsAnalysis/Algorithms/SystematicsHandles/SystematicsHandles/SystematicsSvc.h index 6664382184e23efc13bbf047fd6b06ae8dda2685..5ee3dc7f45dd2e531f9ef872758835625b96096c 100644 --- a/PhysicsAnalysis/Algorithms/SystematicsHandles/SystematicsHandles/SystematicsSvc.h +++ b/PhysicsAnalysis/Algorithms/SystematicsHandles/SystematicsHandles/SystematicsSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -12,6 +12,7 @@ #include <CxxUtils/checker_macros.h> #include <PATInterfaces/SystematicSet.h> #include <SystematicsHandles/ISystematicsSvc.h> +#include "AsgTools/PropertyWrapper.h" #include <mutex> #include <unordered_map> @@ -78,11 +79,11 @@ namespace CP /// \brief the names of the systematics to request private: - std::vector<std::string> m_systematicsList; + Gaudi::Property<std::vector<std::string>> m_systematicsList {this, "systematicsList", {}, "the list of systematics to run"}; /// \brief the regular expression for filterinf systematics private: - std::string m_systematicsRegex {"(.*)"}; + Gaudi::Property<std::string> m_systematicsRegex {this, "systematicsRegex", "(.*)", "systematics filter regex"}; /// \brief load all recommended systematics at the given number of /// sigmas @@ -91,11 +92,11 @@ namespace CP /// itself without having to generate the list of systematics /// manually. private: - float m_sigmaRecommended = 0; + Gaudi::Property<float> m_sigmaRecommended {this, "sigmaRecommended", 0, "the sigma with which to run recommended systematics"}; /// \brief nominal systematics name private: - std::string m_nominalSystematicsName {"NOSYS"}; + Gaudi::Property<std::string> m_nominalSystematicsName {this, "nominalSystematicsName", "NOSYS", "the name to use for the nominal systematic (instead of the empty string)"}; /// \brief the list of affecting systematics diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauEfficiencyCorrectionsAlg.cxx b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauEfficiencyCorrectionsAlg.cxx index 10af37f50d1216b05951c15d03ad654a88b0adbc..7e0bf9d1071638eeb84224ab282d6f9ae5762c23 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauEfficiencyCorrectionsAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauEfficiencyCorrectionsAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - DiTauEfficiencyCorrectionsAlg :: - DiTauEfficiencyCorrectionsAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_efficiencyCorrectionsTool ("TauAnalysisTools::DiTauEfficiencyCorrectionsTool", this) - { - declareProperty ("efficiencyCorrectionsTool", m_efficiencyCorrectionsTool, "the calibration and smearing tool we apply"); - } - - StatusCode DiTauEfficiencyCorrectionsAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauSmearingAlg.cxx b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauSmearingAlg.cxx index 3938a36a72af617814978c4ecef7377ed64e7e99..c323e8526e9cbea01bbaaa5d6743f44750fe3236 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauSmearingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauSmearingAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - DiTauSmearingAlg :: - DiTauSmearingAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_smearingTool ("TauAnalysisTools::DiTauSmearingTool", this) - { - declareProperty ("smearingTool", m_smearingTool, "the calibration and smearing tool we apply"); - } - - StatusCode DiTauSmearingAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauTruthMatchingAlg.cxx b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauTruthMatchingAlg.cxx index b0042e081548a070e391ea8e216790acb844b438..9ab8fc356b139c9648499a31ad08d69c70f37ef8 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauTruthMatchingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauTruthMatchingAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - DiTauTruthMatchingAlg :: - DiTauTruthMatchingAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_matchingTool ("TauAnalysisTools::DiTauTruthMatchingTool", this) - { - declareProperty ("matchingTool", m_matchingTool, "the matching tool we apply"); - } - - StatusCode DiTauTruthMatchingAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauEfficiencyCorrectionsAlg.cxx b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauEfficiencyCorrectionsAlg.cxx index a409a87e861c36549272e25373561439979ef7ca..65b3982d92287010e492117c7f83e2c61214e270 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauEfficiencyCorrectionsAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauEfficiencyCorrectionsAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - TauEfficiencyCorrectionsAlg :: - TauEfficiencyCorrectionsAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_efficiencyCorrectionsTool ("TauAnalysisTools::TauEfficiencyCorrectionsTool", this) - { - declareProperty ("efficiencyCorrectionsTool", m_efficiencyCorrectionsTool, "the calibration and smearing tool we apply"); - } - - StatusCode TauEfficiencyCorrectionsAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauSmearingAlg.cxx b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauSmearingAlg.cxx index 1c844a9b56663160fbaacf3db6f4e6071729cd20..2d2636a837483fa78b764733ff2dea56d63a5c20 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauSmearingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauSmearingAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - TauSmearingAlg :: - TauSmearingAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_smearingTool ("TauAnalysisTools::TauSmearingTool", this) - { - declareProperty ("smearingTool", m_smearingTool, "the calibration and smearing tool we apply"); - } - - StatusCode TauSmearingAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauTruthMatchingAlg.cxx b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauTruthMatchingAlg.cxx index 18bcffd3ed0fda7327da959356a38ca68cf1e0d9..44fac51cd85da3a8c8b495392963b751e53296a9 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauTruthMatchingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauTruthMatchingAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -18,16 +18,6 @@ namespace CP { - TauTruthMatchingAlg :: - TauTruthMatchingAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_matchingTool ("TauAnalysisTools::TauTruthMatchingTool", this) - { - declareProperty ("matchingTool", m_matchingTool, "the matching tool we apply"); - } - - StatusCode TauTruthMatchingAlg :: initialize () diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauEfficiencyCorrectionsAlg.h b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauEfficiencyCorrectionsAlg.h index 9664c0b4cac936e29d118e19228e444d2cd785f8..0613f8cc2e00b494ae2b5a4f1c9f7fa505f61720 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauEfficiencyCorrectionsAlg.h +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauEfficiencyCorrectionsAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -25,21 +25,15 @@ namespace CP { /// \brief the standard constructor public: - DiTauEfficiencyCorrectionsAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<TauAnalysisTools::IDiTauEfficiencyCorrectionsTool> m_efficiencyCorrectionsTool; + ToolHandle<TauAnalysisTools::IDiTauEfficiencyCorrectionsTool> m_efficiencyCorrectionsTool {this, "efficiencyCorrectionsTool", "TauAnalysisTools::DiTauEfficiencyCorrectionsTool", "the calibration and smearing tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauSmearingAlg.h b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauSmearingAlg.h index 522b1a34086dbdffe5b4d1c30329596c5eb0268c..41993d2374aff4dcc2e1190e6d233e0216188395 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauSmearingAlg.h +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauSmearingAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -23,21 +23,15 @@ namespace CP { /// \brief the standard constructor public: - DiTauSmearingAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<TauAnalysisTools::IDiTauSmearingTool> m_smearingTool; + ToolHandle<TauAnalysisTools::IDiTauSmearingTool> m_smearingTool {this, "smearingTool", "TauAnalysisTools::DiTauSmearingTool", "the calibration and smearing tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauTruthMatchingAlg.h b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauTruthMatchingAlg.h index 3b0341ebf11a94e8601ac795f3ac4eca6f3c0f2f..45ab88c3873065c07f2650e118ffe3dc9dbf0d47 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauTruthMatchingAlg.h +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauTruthMatchingAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -24,21 +24,15 @@ namespace CP { /// \brief the standard constructor public: - DiTauTruthMatchingAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the matching tool private: - ToolHandle<TauAnalysisTools::IDiTauTruthMatchingTool> m_matchingTool; + ToolHandle<TauAnalysisTools::IDiTauTruthMatchingTool> m_matchingTool {this, "matchingTool", "TauAnalysisTools::DiTauTruthMatchingTool", "the matching tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauEfficiencyCorrectionsAlg.h b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauEfficiencyCorrectionsAlg.h index 561f5f75941e2d7391f15fec403932bae9358b08..cf4dcb105f1c0388a342ae9a3d4ce32e84cd20f2 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauEfficiencyCorrectionsAlg.h +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauEfficiencyCorrectionsAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -26,21 +26,15 @@ namespace CP { /// \brief the standard constructor public: - TauEfficiencyCorrectionsAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<TauAnalysisTools::ITauEfficiencyCorrectionsTool> m_efficiencyCorrectionsTool; + ToolHandle<TauAnalysisTools::ITauEfficiencyCorrectionsTool> m_efficiencyCorrectionsTool {this, "efficiencyCorrectionsTool", "TauAnalysisTools::TauEfficiencyCorrectionsTool", "the calibration and smearing tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauSmearingAlg.h b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauSmearingAlg.h index 58557be8d4ea716b85a5b9f99a5b4d768091fd68..274e95f29970f6538f47323c9350e1d03fc79cb7 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauSmearingAlg.h +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauSmearingAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -25,21 +25,15 @@ namespace CP { /// \brief the standard constructor public: - TauSmearingAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the smearing tool private: - ToolHandle<TauAnalysisTools::ITauSmearingTool> m_smearingTool; + ToolHandle<TauAnalysisTools::ITauSmearingTool> m_smearingTool {this, "smearingTool", "TauAnalysisTools::TauSmearingTool", "the calibration and smearing tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauTruthMatchingAlg.h b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauTruthMatchingAlg.h index b1fca5b81e8d8fbc82a1d8fbef5fb3dc87dd351c..02685bd6888d1b324349fbf6a0ccc62897227002 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauTruthMatchingAlg.h +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauTruthMatchingAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Nils Krumnack @@ -24,21 +24,15 @@ namespace CP { /// \brief the standard constructor public: - TauTruthMatchingAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the matching tool private: - ToolHandle<TauAnalysisTools::ITauTruthMatchingTool> m_matchingTool; + ToolHandle<TauAnalysisTools::ITauTruthMatchingTool> m_matchingTool {this, "matchingTool", "TauAnalysisTools::TauTruthMatchingTool", "the matching tool we apply"}; /// \brief the systematics list we run private: diff --git a/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/Root/VertexSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/Root/VertexSelectionAlg.cxx index 3e869514b8a272f06708cb31bea7e5459a397999..46b9165ee11f54e28d2f7e8531506a8e9c374149 100644 --- a/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/Root/VertexSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/Root/VertexSelectionAlg.cxx @@ -1,31 +1,14 @@ // -// Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // // Local include(s): #include "TrackingAnalysisAlgorithms/VertexSelectionAlg.h" -// EDM include(s): -#include "xAODTracking/VertexContainer.h" - #include <EventBookkeeperTools/FilterReporter.h> namespace CP { - VertexSelectionAlg::VertexSelectionAlg( const std::string& name, - ISvcLocator* svcLoc ) - : EL::AnaAlgorithm( name, svcLoc ) { - - // Declare the algorithm's properties: - declareProperty( "VertexContainer", m_vertexKey = "PrimaryVertices", - "Vertex container to check" ); - declareProperty( "MinVertices", m_minVertices = 1, - "Minimum number of vertices required" ); - declareProperty( "MinTracks", m_minTracks = 0, - "Minimum number of track particles required per " - "vertex" ); - } - StatusCode VertexSelectionAlg::initialize() { // Greet the user: @@ -34,6 +17,7 @@ namespace CP { << " track(s) each" ); ANA_CHECK (m_filterParams.initialize()); + ANA_CHECK (m_vertexKey.initialize()); // Return gracefully: return StatusCode::SUCCESS; @@ -51,8 +35,7 @@ namespace CP { FilterReporter filter (m_filterParams, false); // Retrieve the vertex container: - const xAOD::VertexContainer* vertices = nullptr; - ATH_CHECK( evtStore()->retrieve( vertices, m_vertexKey ) ); + SG::ReadHandle<xAOD::VertexContainer> vertices(m_vertexKey); // The number of "good" vertices found: unsigned goodVertices = 0; diff --git a/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/TrackingAnalysisAlgorithms/VertexSelectionAlg.h b/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/TrackingAnalysisAlgorithms/VertexSelectionAlg.h index 25387ad4b849ccd83e283d1b4c1751e2aa62fd02..34c693a743ba864b80f49a43f63898a6e0c6cd8b 100644 --- a/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/TrackingAnalysisAlgorithms/VertexSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/TrackingAnalysisAlgorithms/TrackingAnalysisAlgorithms/VertexSelectionAlg.h @@ -1,6 +1,6 @@ // Dear emacs, this is -*- c++ -*- // -// Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration // #ifndef TRACKINGANALYSISALGORITHMS_VERTEXSELECTIONALG_H #define TRACKINGANALYSISALGORITHMS_VERTEXSELECTIONALG_H @@ -8,6 +8,12 @@ // Framework include(s): #include <AnaAlgorithm/AnaAlgorithm.h> #include <EventBookkeeperTools/FilterReporterParams.h> +#include <AsgTools/PropertyWrapper.h> +#include <AsgDataHandles/ReadHandleKey.h> +#include <AsgDataHandles/ReadHandle.h> + +// EDM include(s): +#include "xAODTracking/VertexContainer.h" // System include(s): #include <string> @@ -26,7 +32,7 @@ namespace CP { public: /// Algorithm constructor - VertexSelectionAlg( const std::string& name, ISvcLocator* svcLoc ); + using EL::AnaAlgorithm::AnaAlgorithm; /// @name Function(s) inherited from @c EL::AnaAlgorithm /// @{ @@ -47,11 +53,11 @@ namespace CP { /// @{ /// Event store key of the vertex container - std::string m_vertexKey; + SG::ReadHandleKey<xAOD::VertexContainer> m_vertexKey {this, "VertexContainer", "PrimaryVertices", "Vertex container to check"}; /// Number of vertices required in the event - unsigned m_minVertices; + Gaudi::Property<unsigned> m_minVertices {this, "MinVertices", 1, "Minimum number of vertices required"}; /// Number of track particles required per vertex - unsigned m_minTracks; + Gaudi::Property<unsigned> m_minTracks {this, "MinTracks", 0, "Minimum number of track particles required per vertex"}; FilterReporterParams m_filterParams {this, "VertexSelection", "vertex selection"}; diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigEventSelectorAlg.cxx b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigEventSelectionAlg.cxx similarity index 88% rename from PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigEventSelectorAlg.cxx rename to PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigEventSelectionAlg.cxx index cc3e8e9262cb7069ebb22547beb3b5b4b4d01e52..7adbcd39bd9eb8fb8ff4dda4e705e5150995692c 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigEventSelectorAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigEventSelectionAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -15,8 +15,6 @@ CP::TrigEventSelectionAlg::TrigEventSelectionAlg(const std::string &name, m_trigDecisionTool("Trig::TrigDecisionTool/TrigDecisionTool") { declareProperty("tool", m_trigDecisionTool, "trigger decision tool"); - declareProperty("triggers", m_trigList, "trigger selection list"); - declareProperty("selectionDecoration", m_selectionDecoration, "the decoration the trigger pass status"); } StatusCode CP::TrigEventSelectionAlg::initialize() diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigGlobalEfficiencyAlg.cxx b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigGlobalEfficiencyAlg.cxx index 8a7d70c17de681ff3c77945824f2f8390c4b2d2b..b4bdf7532ed89b80d0f8d717462b5601b6d1705c 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigGlobalEfficiencyAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigGlobalEfficiencyAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Baptiste Ravina @@ -14,7 +14,6 @@ CP::TrigGlobalEfficiencyAlg::TrigGlobalEfficiencyAlg(const std::string &name, ISvcLocator *svcLoc) : EL::AnaAlgorithm(name, svcLoc) { - declareProperty("decisionTool", m_trigDecisionTool, "trigger decision tool"); declareProperty("matchingTool", m_trigMatchingTool, "trigger matching tool"); } @@ -41,9 +40,6 @@ StatusCode CP::TrigGlobalEfficiencyAlg::initialize() ANA_CHECK (m_filterParams.initialize(m_systematicsList)); - // retrieve the trigger decision tool - ANA_CHECK(m_trigDecisionTool.retrieve()); - // retrieve the trigger matching tool ANA_CHECK(m_trigMatchingTool.retrieve()); diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigPrescalesAlg.cxx b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigPrescalesAlg.cxx index ce45a0904afc5c38ee2cce0b46f7a1489079c243..0ea5deac04308baa19c5ec422f1f809839e06890 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigPrescalesAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/Root/TrigPrescalesAlg.cxx @@ -20,21 +20,6 @@ namespace CP { - TrigPrescalesAlg :: - TrigPrescalesAlg (const std::string& name, - ISvcLocator* pSvcLocator) - : AnaAlgorithm (name, pSvcLocator) - , m_pileupReweightingTool ("CP::PileupReweightingTool", this) - { - declareProperty ("pileupReweightingTool", m_pileupReweightingTool, "the pileup reweighting tool to be used"); - declareProperty ("triggers", m_trigList, "trigger list"); - declareProperty ("triggersAll", m_trigListAll, "all trigger list"); - declareProperty ("triggersFormula", m_trigFormula, "produce prescale based on formula instead of per trigger, " - "e.g. (trigA||trigB)"); - declareProperty ("prescaleDecoration", m_prescaleDecoration, "decoration to store prescales"); - } - - StatusCode TrigPrescalesAlg :: initialize () @@ -69,7 +54,8 @@ namespace CP // By putting the formula into` m_trigListAll` // the logic in `execute` does not have to change // depending on if `m_trigFormula` or `m_trigList` is used - m_trigListAll = {m_trigFormula}; + std::vector<std::string> formulaVector = {m_trigFormula.value()}; + m_trigListAll = formulaVector; return StatusCode::SUCCESS; } diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigEventSelectionAlg.h b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigEventSelectionAlg.h index 7c0f1b6466f159db9e433de770e776f2986cdb90..8da19c0e99b9bbde50075375aa1657053abc408c 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigEventSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigEventSelectionAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Tadej Novak @@ -14,6 +14,7 @@ #include <EventBookkeeperTools/FilterReporterParams.h> #include <TrigDecisionInterface/ITrigDecisionTool.h> #include <TrigDecisionInterface/Conditions.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -32,10 +33,10 @@ namespace CP ToolHandle<Trig::ITrigDecisionTool> m_trigDecisionTool; /// \brief list of triggers or trigger chains - std::vector<std::string> m_trigList; + Gaudi::Property<std::vector<std::string>> m_trigList {this, "triggers", {}, "trigger selection list"}; /// \brief the decoration for trigger selection - std::string m_selectionDecoration; + Gaudi::Property<std::string> m_selectionDecoration {this, "selectionDecoration", "", "the decoration the trigger pass status"}; /// \brief whether to not apply an event filter Gaudi::Property<bool> m_noFilter {this, "noFilter", false, "whether to not apply an event filter"}; diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigGlobalEfficiencyAlg.h b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigGlobalEfficiencyAlg.h index d6b2e2ca577f2acdd82c8d060c6255440a6567d6..4d24ae27c77921b2e3829337883f9088f8e80576 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigGlobalEfficiencyAlg.h +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigGlobalEfficiencyAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration */ /// @author Baptiste Ravina @@ -29,7 +29,6 @@ // Trigger includes #include <TriggerAnalysisInterfaces/ITrigGlobalEfficiencyCorrectionTool.h> -#include <TrigDecisionInterface/ITrigDecisionTool.h> #include <TriggerMatchingTool/IMatchingTool.h> #include <TrigGlobalEfficiencyCorrection/ImportData.h> #include "EgammaAnalysisInterfaces/IAsgElectronEfficiencyCorrectionTool.h" @@ -52,9 +51,6 @@ namespace CP /// \brief whether to use Run 3 settings Gaudi::Property<bool> m_isRun3Geo {this, "isRun3Geo", false, "use Run 3 settings for efficiency correction tools?"}; - /// \brief trigger decision tool - ToolHandle<Trig::ITrigDecisionTool> m_trigDecisionTool; - /// \brief trigger matching tool ToolHandle<Trig::IMatchingTool> m_trigMatchingTool; diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigPrescalesAlg.h b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigPrescalesAlg.h index 8b3e12c15c37f9f2d0698f385a3d963d28123629..260a4cce17c353241e7cac7d2c1b4d3021549c76 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigPrescalesAlg.h +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/TriggerAnalysisAlgorithms/TrigPrescalesAlg.h @@ -12,6 +12,7 @@ #include <AnaAlgorithm/AnaAlgorithm.h> #include <AsgAnalysisInterfaces/IPileupReweightingTool.h> +#include <AsgTools/PropertyWrapper.h> namespace CP { @@ -27,32 +28,26 @@ namespace CP { /// \brief the standard constructor public: - TrigPrescalesAlg (const std::string& name, - ISvcLocator* pSvcLocator); - - - public: + using EL::AnaAlgorithm::AnaAlgorithm; StatusCode initialize () override; - - public: StatusCode execute () override; /// \brief the pile-up reweighting tool private: - ToolHandle<IPileupReweightingTool> m_pileupReweightingTool; + ToolHandle<IPileupReweightingTool> m_pileupReweightingTool {this, "pileupReweightingTool", "PileupReweightingTool", "the pileup reweighting tool to be used"}; /// \brief list of prescaled triggers or trigger chains private: - std::vector<std::string> m_trigList; + Gaudi::Property<std::vector<std::string>> m_trigList {this, "triggers", {}, "trigger list"}; /// \brief list of all triggers or trigger chains private: - std::vector<std::string> m_trigListAll; + Gaudi::Property<std::vector<std::string>> m_trigListAll {this, "triggersAll", {}, "all trigger list"}; /// \brief list of all triggers or trigger chains private: - std::string m_trigFormula; + Gaudi::Property<std::string> m_trigFormula {this, "triggersFormula", "", "produce prescale based on formula instead of per trigger, e.g. (trigA||trigB)"}; /// \brief list of helper functions to compute the prescales private: @@ -60,7 +55,7 @@ namespace CP /// \brief the decoration for trigger prescales private: - std::string m_prescaleDecoration; + Gaudi::Property<std::string> m_prescaleDecoration {this, "prescaleDecoration", "", "decoration to store prescales"}; /// \brief the accessors for \ref m_prescaleDecoration and \ref m_trigList combination private: diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisConfig.py b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisConfig.py index 60c02eb588544e04fa90d86a5683a4038d9657ec..bcecc89fb3e0eed691c2b5a7e720de8c6bdfdca9 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisConfig.py +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisConfig.py @@ -59,7 +59,7 @@ class TriggerAnalysisBlock (ConfigBlock): def makeTriggerSelectionAlg(self, config, decisionTool): # Set up the trigger selection: - alg = config.createAlgorithm( 'CP::TrigEventSelectionAlg', 'TrigEventSelectorAlg' ) + alg = config.createAlgorithm( 'CP::TrigEventSelectionAlg', 'TrigEventSelectionAlg' ) alg.tool = '%s/%s' % \ ( decisionTool.getType(), decisionTool.getName() ) alg.triggers = self.triggerChainsForSelection @@ -112,7 +112,6 @@ class TriggerAnalysisBlock (ConfigBlock): elif config.campaign() is Campaign.MC20e: if not alg.triggers_2018: raise ValueError( 'TriggerAnalysisConfig: you must provide a set of triggers for the year 2018!' ) - alg.decisionTool = '%s/%s' % ( decisionTool.getType(), decisionTool.getName() ) alg.matchingTool = '%s/%s' % ( matchingTool.getType(), matchingTool.getName() ) alg.isRun3Geo = config.geometry() == LHCPeriod.Run3 alg.scaleFactorDecoration = 'globalTriggerEffSF_%SYS%' diff --git a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisSequence.py b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisSequence.py index e36fbca506d4988c5f89c73cae64d632bbd06b69..93c6867f74f3cf80a64440df008c75f684e4e4c3 100644 --- a/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisSequence.py +++ b/PhysicsAnalysis/Algorithms/TriggerAnalysisAlgorithms/python/TriggerAnalysisSequence.py @@ -35,7 +35,7 @@ def makeTriggerAnalysisSequence( dataType, if triggerChains: # Set up the trigger selection: - alg = createAlgorithm( 'CP::TrigEventSelectionAlg', 'TrigEventSelectorAlg' ) + alg = createAlgorithm( 'CP::TrigEventSelectionAlg', 'TrigEventSelectionAlg' ) alg.tool = '%s/%s' % \ ( decisionTool.getType(), decisionTool.getName() ) alg.triggers = list(triggerChains)