diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgClassificationDecorationAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgClassificationDecorationAlg.h index 069d942c101a39e5aab166c94d03991b5b32b0ad..4320217c88b8d06f24eb8fe8cfbf8ebdf02e3b55 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgClassificationDecorationAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgClassificationDecorationAlg.h @@ -8,8 +8,8 @@ #define ASG_ANALYSIS_ALGORITHMS__ASG_CLASSIFICATION_DECORATION_ALG_H #include <AnaAlgorithm/AnaAlgorithm.h> -#include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <SystematicsHandles/SysReadHandle.h> #include <xAODBase/IParticle.h> #include <xAODBase/IParticleContainer.h> @@ -46,7 +46,7 @@ private: /// \brief particles container handle private: - CP::SysCopyHandle<xAOD::IParticleContainer> m_particlesHandle { + CP::SysReadHandle<xAOD::IParticleContainer> m_particlesHandle { this, "particles", "", "the container to use"}; /// \brief the decoration for the truth classification @@ -55,7 +55,7 @@ private: /// \brief the accessor for \ref m_truthClassificationDecoration private: - std::unique_ptr<const SG::AuxElement::Accessor<unsigned int> > m_classificationAccessor {}; + std::unique_ptr<const SG::AuxElement::Decorator<unsigned int> > m_classificationDecorator {}; }; } // namespace CP diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgLeptonTrackSelectionAlg.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgLeptonTrackSelectionAlg.h index d512edb992970d1d093c4dd11853c6824b46b711..ef989f61cdab698ea4b495dbd1d1df671fce894a 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgLeptonTrackSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgLeptonTrackSelectionAlg.h @@ -13,8 +13,9 @@ #include <PATCore/IAsgSelectionTool.h> #include <SelectionHelpers/ISelectionAccessor.h> #include <SelectionHelpers/SelectionReadHandle.h> -#include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <SystematicsHandles/SysReadHandle.h> +#include <xAODBase/IParticleContainer.h> namespace CP { @@ -69,7 +70,7 @@ namespace CP /// \brief the particle continer we run on private: - SysCopyHandle<xAOD::IParticleContainer> m_particlesHandle { + SysReadHandle<xAOD::IParticleContainer> m_particlesHandle { this, "particles", "", "the asg collection to run on"}; /// \brief the preselection we apply to our input diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgClassificationDecorationAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgClassificationDecorationAlg.cxx index 0497fa75289559bb1bff4a9a31e5644a13f37d34..8a04f6bc53c8d351b72f1b75fd6a67fe419a6a37 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgClassificationDecorationAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgClassificationDecorationAlg.cxx @@ -29,7 +29,7 @@ StatusCode AsgClassificationDecorationAlg::initialize() return StatusCode::FAILURE; } - m_classificationAccessor = std::make_unique<SG::AuxElement::Accessor<unsigned int> > (m_classificationDecoration); + m_classificationDecorator = std::make_unique<SG::AuxElement::Decorator<unsigned int> > (m_classificationDecoration); ANA_CHECK (m_particlesHandle.initialize (m_systematicsList)); ANA_CHECK(m_systematicsList.initialize()); @@ -45,13 +45,14 @@ StatusCode AsgClassificationDecorationAlg::execute() { for (const auto& sys : m_systematicsList.systematicsVector()) { - xAOD::IParticleContainer *particles{}; - ANA_CHECK(m_particlesHandle.getCopy(particles, sys)); + const xAOD::IParticleContainer *particles{}; + ANA_CHECK(m_particlesHandle.retrieve(particles, sys)); - for (xAOD::IParticle *particle : *particles) { + for (const xAOD::IParticle *particle : *particles) + { unsigned int classification{}; ANA_CHECK(m_tool->classify(*particle, classification)); - (*m_classificationAccessor)(*particle) = classification; + (*m_classificationDecorator)(*particle) = classification; } } return StatusCode::SUCCESS; diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgLeptonTrackSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgLeptonTrackSelectionAlg.cxx index 9a2cd74fe0890102a9f1db28a19bc85fa4f82eb4..320dcd78a180ec028a8294fecf88647406396a2c 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgLeptonTrackSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgLeptonTrackSelectionAlg.cxx @@ -116,9 +116,9 @@ namespace CP for (const auto& sys : m_systematicsList.systematicsVector()) { - xAOD::IParticleContainer *particles = nullptr; - ANA_CHECK (m_particlesHandle.getCopy (particles, sys)); - for (xAOD::IParticle *particle : *particles) + const xAOD::IParticleContainer *particles = nullptr; + ANA_CHECK (m_particlesHandle.retrieve (particles, sys)); + for (const xAOD::IParticle *particle : *particles) { asg::AcceptData acceptData (&m_accept); @@ -127,9 +127,9 @@ namespace CP std::size_t cutIndex {0}; const xAOD::TrackParticle *track {nullptr}; - if (const xAOD::Muon *muon = dynamic_cast<xAOD::Muon*>(particle)) + if (const xAOD::Muon *muon = dynamic_cast<const xAOD::Muon *>(particle)) track = muon->primaryTrackParticle(); - else if (const xAOD::Electron *electron = dynamic_cast<xAOD::Electron*>(particle)) + else if (const xAOD::Electron *electron = dynamic_cast<const xAOD::Electron *>(particle)) track = electron->trackParticle(); else { diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h index 8b4503a8387eefb40355db16b27deb5a0d1e338a..709a2ed769f19246082332dc4ae096667275f6c8 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/EgammaAnalysisAlgorithms/EgammaIsolationSelectionAlg.h @@ -15,8 +15,8 @@ #include <SelectionHelpers/ISelectionAccessor.h> #include <SelectionHelpers/OutOfValidityHelper.h> #include <SelectionHelpers/SelectionReadHandle.h> -#include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <SystematicsHandles/SysReadHandle.h> namespace CP { @@ -53,7 +53,7 @@ namespace CP /// \brief the particle continer we run on private: - SysCopyHandle<xAOD::EgammaContainer> m_egammasHandle { + SysReadHandle<xAOD::EgammaContainer> m_egammasHandle { this, "egammas", "Electrons", "the egamma collection to run on"}; /// \brief the decoration for the asg selection diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationSelectionAlg.cxx index ce802747d9fd71ac24394d5cc2024e22d3847f22..bb419d639c2a27e8a817661dc1120d4f1f7854f7 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/Root/EgammaIsolationSelectionAlg.cxx @@ -58,9 +58,9 @@ namespace CP { for (const auto& sys : m_systematicsList.systematicsVector()) { - xAOD::EgammaContainer *egammas = nullptr; - ANA_CHECK (m_egammasHandle.getCopy (egammas, sys)); - for (xAOD::Egamma *egamma : *egammas) + const xAOD::EgammaContainer *egammas = nullptr; + ANA_CHECK (m_egammasHandle.retrieve (egammas, sys)); + for (const xAOD::Egamma *egamma : *egammas) { if (m_preselection.getBool (*egamma)) { diff --git a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py index 7ba200c2d023682ef9eba89d376d158e0d4bf932..83b0828b4b73911a294c383757537c8ad91ab38c 100644 --- a/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py +++ b/PhysicsAnalysis/Algorithms/EgammaAnalysisAlgorithms/python/PhotonAnalysisSequence.py @@ -94,7 +94,6 @@ def makePhotonAnalysisSequence( dataType, workingPoint, addPrivateTool( alg, 'selectionTool', 'CP::EgammaIsGoodOQSelectionTool' ) alg.selectionTool.Mask = xAOD.EgammaParameters.BADCLUSPHOTON seq.append( alg, inputPropName = 'particles', - outputPropName = 'particlesOut', stageName = 'calibration', metaConfig = {'selectionDecorNames' : [alg.selectionDecoration], 'selectionDecorCount' : [1]}, @@ -154,7 +153,7 @@ def makePhotonAnalysisSequence( dataType, workingPoint, alg.selectionDecoration = 'isolated' + postfix addPrivateTool( alg, 'selectionTool', 'CP::IsolationSelectionTool' ) alg.selectionTool.PhotonWP = isolationWP - seq.append( alg, inputPropName = 'egammas', outputPropName = 'egammasOut', + seq.append( alg, inputPropName = 'egammas', stageName = 'selection', metaConfig = {'selectionDecorNames' : [alg.selectionDecoration], 'selectionDecorCount' : [1]} ) diff --git a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisSequence.py b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisSequence.py index dd6006e3ab2fab426479e692da93cb6126e58e3b..53b2e65a23bd72717d767a2503d4359e222639e6 100644 --- a/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisSequence.py +++ b/PhysicsAnalysis/Algorithms/FTagAnalysisAlgorithms/python/FTagAnalysisSequence.py @@ -84,15 +84,14 @@ def makeFTagAnalysisSequence( seq, dataType, jetCollection, addPrivateTool( alg, 'selectionTool', 'CP::AsgPtEtaSelectionTool' ) alg.selectionTool.minPt = minPt alg.selectionTool.maxEta = 2.5 - alg.selectionDecoration = 'ftag_kin_select' - seq.append( alg, inputPropName = 'particles', - outputPropName = 'particlesOut' ) + alg.selectionDecoration = 'ftag_kin_select_' + btagger + '_' + btagWP + seq.append( alg, inputPropName = 'particles' ) # Set up an algorithm that makes a view container using the selections # performed previously: alg = createAlgorithm( 'CP::AsgViewFromSelectionAlg', 'FTagKinViewFromSelectionAlg'+postfix ) - alg.selection = [ 'ftag_kin_select' ] + alg.selection = [ 'ftag_kin_select_' + btagger + '_' + btagWP ] seq.append( alg, inputPropName = 'input', outputPropName = 'output', stageName = 'selection' ) @@ -108,7 +107,6 @@ def makeFTagAnalysisSequence( seq, dataType, jetCollection, alg.preselection = preselection alg.selectionDecoration = 'ftag_select_' + btagger + '_' + btagWP + ',as_char' seq.append( alg, inputPropName = 'particles', - outputPropName = 'particlesOut', stageName = 'selection' ) if not noEfficiency and dataType != 'data': diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetSelectionAlg.h b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetSelectionAlg.h index 14e727242a5c770df989c32222ebc705d9029ff1..26477a246855565ca42f32660039615bb37d0906 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/JetAnalysisAlgorithms/JetSelectionAlg.h @@ -12,8 +12,8 @@ #include <JetInterface/IJetSelector.h> #include <SelectionHelpers/ISelectionAccessor.h> #include <SelectionHelpers/SelectionReadHandle.h> -#include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <SystematicsHandles/SysReadHandle.h> #include <xAODJet/JetContainer.h> namespace CP @@ -46,7 +46,7 @@ namespace CP /// \brief the jet collection we run on private: - SysCopyHandle<xAOD::JetContainer> m_jetHandle { + SysReadHandle<xAOD::JetContainer> m_jetHandle { this, "jets", "AntiKt4EMTopoJets", "the jet collection to run on"}; /// \brief the preselection we apply to our input diff --git a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetSelectionAlg.cxx index e99e0179bd8a769f592f030210dcfbc161470817..24bfe88b4ec12d67d2a3e7a8b7782a227445bcb5 100644 --- a/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/JetAnalysisAlgorithms/Root/JetSelectionAlg.cxx @@ -56,9 +56,9 @@ namespace CP { for (const auto& sys : m_systematicsList.systematicsVector()) { - xAOD::JetContainer *jets = nullptr; - ANA_CHECK (m_jetHandle.getCopy (jets, sys)); - for (xAOD::Jet *jet : *jets) + const xAOD::JetContainer *jets = nullptr; + ANA_CHECK (m_jetHandle.retrieve (jets, sys)); + for (const xAOD::Jet *jet : *jets) { if (m_preselection.getBool (*jet)) { diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonIsolationAlg.h b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonIsolationAlg.h index 3f8b83f301f2d85b32067698be7c7250a6d6d8e8..43f950ae3c79f68b928f098b5bdca1c0251285d1 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonIsolationAlg.h +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonIsolationAlg.h @@ -13,8 +13,8 @@ #include <IsolationSelection/IIsolationSelectionTool.h> #include <SelectionHelpers/ISelectionAccessor.h> #include <SelectionHelpers/SelectionReadHandle.h> -#include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <SystematicsHandles/SysReadHandle.h> #include <xAODMuon/MuonContainer.h> namespace CP @@ -47,7 +47,7 @@ namespace CP /// \brief the muon collection we run on private: - SysCopyHandle<xAOD::MuonContainer> m_muonHandle { + SysReadHandle<xAOD::MuonContainer> m_muonHandle { this, "muons", "Muons", "the muon collection to run on"}; /// \brief the preselection we apply to our input diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h index 7537d0ce572af66642f7309355f6627db3519dd6..7a7268c68e2116711a0af15ea10adf7499727d39 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/MuonAnalysisAlgorithms/MuonSelectionAlg.h @@ -11,8 +11,8 @@ #include <MuonAnalysisInterfaces/IMuonSelectionTool.h> #include <SelectionHelpers/ISelectionAccessor.h> #include <SelectionHelpers/SelectionReadHandle.h> -#include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <SystematicsHandles/SysReadHandle.h> #include <xAODMuon/MuonContainer.h> namespace CP @@ -50,7 +50,7 @@ namespace CP /// \brief the particle continer we run on private: - SysCopyHandle<xAOD::MuonContainer> m_muonsHandle { + SysReadHandle<xAOD::MuonContainer> m_muonsHandle { this, "muons", "Muons", "the muons collection to run on"}; /// \brief the decoration for the quality selection diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonIsolationAlg.cxx b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonIsolationAlg.cxx index e1b8b7825ddf981926dd5b31dfdbe5240377a4fc..48a6dadc5df2e35d84d76411cdf861ca6ef7e998 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonIsolationAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonIsolationAlg.cxx @@ -60,9 +60,9 @@ namespace CP { for (const auto& sys : m_systematicsList.systematicsVector()) { - xAOD::MuonContainer *muons = nullptr; - ANA_CHECK (m_muonHandle.getCopy (muons, sys)); - for (xAOD::Muon *muon : *muons) + const xAOD::MuonContainer *muons = nullptr; + ANA_CHECK (m_muonHandle.retrieve (muons, sys)); + for (const xAOD::Muon *muon : *muons) { if (m_preselection.getBool (*muon)) { diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx index 4c37cbcd823b2b3859c45f06a5f23bb33271907d..91eefd86098a66344c819135c7acd05d9c317b88 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/Root/MuonSelectionAlg.cxx @@ -65,9 +65,9 @@ namespace CP { for (const auto& sys : m_systematicsList.systematicsVector()) { - xAOD::MuonContainer *muons = nullptr; - ANA_CHECK (m_muonsHandle.getCopy (muons, sys)); - for (xAOD::Muon *muon : *muons) + const xAOD::MuonContainer *muons = nullptr; + ANA_CHECK (m_muonsHandle.retrieve (muons, sys)); + for (const xAOD::Muon *muon : *muons) { if (m_preselection.getBool (*muon)) { diff --git a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/python/MuonAnalysisSequence.py b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/python/MuonAnalysisSequence.py index 2b79d744c5e5a2764366883c3891702b5c258221..2f110c62dc6b6c9873cd90459b756fcb9e995dee 100644 --- a/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/python/MuonAnalysisSequence.py +++ b/PhysicsAnalysis/Algorithms/MuonAnalysisAlgorithms/python/MuonAnalysisSequence.py @@ -152,7 +152,7 @@ def makeMuonAnalysisSequence( dataType, workingPoint, 'MuonIsolationAlg' + postfix ) addPrivateTool( alg, 'isolationTool', 'CP::IsolationSelectionTool' ) alg.isolationDecoration = 'isolated_muon' + postfix + ',as_bits' - seq.append( alg, inputPropName = 'muons', outputPropName = 'muonsOut', + seq.append( alg, inputPropName = 'muons', stageName = 'selection', metaConfig = {'selectionDecorNames' : [alg.isolationDecoration], 'selectionDecorNamesOutput' : [alg.isolationDecoration], diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauEfficiencyCorrectionsAlg.cxx b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauEfficiencyCorrectionsAlg.cxx index 50fd77d3d6b31c2cf6c3a63106bdfff0d5209c69..2e926a5ec87ec88630b47f09bc9e3b8a8db5c6db 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauEfficiencyCorrectionsAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauEfficiencyCorrectionsAlg.cxx @@ -25,7 +25,6 @@ namespace CP , m_efficiencyCorrectionsTool ("TauAnalysisTools::DiTauEfficiencyCorrectionsTool", this) { declareProperty ("efficiencyCorrectionsTool", m_efficiencyCorrectionsTool, "the calibration and smearing tool we apply"); - declareProperty ("scaleFactorDecoration", m_scaleFactorDecoration, "the decoration for the tau scale factor"); } @@ -38,10 +37,10 @@ namespace CP ANA_MSG_ERROR ("no scale factor decoration name set"); return StatusCode::FAILURE; } - m_scaleFactorAccessor = std::make_unique<SG::AuxElement::Accessor<float> > (m_scaleFactorDecoration); ANA_CHECK (m_efficiencyCorrectionsTool.retrieve()); ANA_CHECK (m_tauHandle.initialize (m_systematicsList)); + ANA_CHECK (m_scaleFactorDecoration.initialize (m_systematicsList, m_tauHandle)); ANA_CHECK (m_systematicsList.addSystematics (*m_efficiencyCorrectionsTool)); ANA_CHECK (m_systematicsList.initialize()); ANA_CHECK (m_preselection.initialize()); @@ -57,15 +56,17 @@ namespace CP for (const auto& sys : m_systematicsList.systematicsVector()) { ANA_CHECK (m_efficiencyCorrectionsTool->applySystematicVariation (sys)); - xAOD::DiTauJetContainer *taus = nullptr; - ANA_CHECK (m_tauHandle.getCopy (taus, sys)); - for (xAOD::DiTauJet *tau : *taus) + const xAOD::DiTauJetContainer *taus = nullptr; + ANA_CHECK (m_tauHandle.retrieve (taus, sys)); + for (const xAOD::DiTauJet *tau : *taus) { if (m_preselection.getBool (*tau)) { double sf = 0; ANA_CHECK_CORRECTION (m_outOfValidity, *tau, m_efficiencyCorrectionsTool->getEfficiencyScaleFactor (*tau, sf)); - (*m_scaleFactorAccessor) (*tau) = sf; + m_scaleFactorDecoration.set (*tau, sf, sys); + } else { + m_scaleFactorDecoration.set (*tau, invalidScaleFactor(), sys); } } } diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauTruthMatchingAlg.cxx b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauTruthMatchingAlg.cxx index 9812aedf17d32f160d8dfda578797edac3915f65..a68e691a580381beceed75db18d9921b0cae3415 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauTruthMatchingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/DiTauTruthMatchingAlg.cxx @@ -46,9 +46,9 @@ namespace CP { for (const auto& sys : m_systematicsList.systematicsVector()) { - xAOD::DiTauJetContainer *taus = nullptr; - ANA_CHECK (m_tauHandle.getCopy (taus, sys)); - for (xAOD::DiTauJet *tau : *taus) + const xAOD::DiTauJetContainer *taus = nullptr; + ANA_CHECK (m_tauHandle.retrieve (taus, sys)); + for (const xAOD::DiTauJet *tau : *taus) { if (m_preselection.getBool (*tau)) { diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauTruthMatchingAlg.cxx b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauTruthMatchingAlg.cxx index 9394bc749620520ceee889379aaa7a0b846f2eac..3bcef22826423be5fc7a8003e4d468f03af48267 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauTruthMatchingAlg.cxx +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/Root/TauTruthMatchingAlg.cxx @@ -46,9 +46,9 @@ namespace CP { for (const auto& sys : m_systematicsList.systematicsVector()) { - xAOD::TauJetContainer *taus = nullptr; - ANA_CHECK (m_tauHandle.getCopy (taus, sys)); - for (xAOD::TauJet *tau : *taus) + const xAOD::TauJetContainer *taus = nullptr; + ANA_CHECK (m_tauHandle.retrieve (taus, sys)); + for (const xAOD::TauJet *tau : *taus) { if (m_preselection.getBool (*tau)) { diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauEfficiencyCorrectionsAlg.h b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauEfficiencyCorrectionsAlg.h index 194af5403133fc1bef8ec19bea7923f213b1945f..eb53719611c54f6ea56f4e8c8139a5051227ca6a 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauEfficiencyCorrectionsAlg.h +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauEfficiencyCorrectionsAlg.h @@ -12,9 +12,9 @@ #include <TauAnalysisTools/IDiTauEfficiencyCorrectionsTool.h> #include <SelectionHelpers/OutOfValidityHelper.h> #include <SelectionHelpers/SelectionReadHandle.h> -#include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> #include <SystematicsHandles/SysReadHandle.h> +#include <SystematicsHandles/SysWriteDecorHandle.h> #include <xAODTau/DiTauJetContainer.h> namespace CP @@ -47,7 +47,7 @@ namespace CP /// \brief the tau collection we run on private: - SysCopyHandle<xAOD::DiTauJetContainer> m_tauHandle { + SysReadHandle<xAOD::DiTauJetContainer> m_tauHandle { this, "taus", "DiTauJets", "the tau collection to run on"}; /// \brief the preselection we apply to our input @@ -59,13 +59,10 @@ namespace CP private: OutOfValidityHelper m_outOfValidity {this}; - /// \brief the decoration for the tau scale factor + /// \brief the decoration for the muon scale factor private: - std::string m_scaleFactorDecoration; - - /// \brief the accessor for \ref m_scaleFactorDecoration - private: - std::unique_ptr<const SG::AuxElement::Accessor<float> > m_scaleFactorAccessor; + SysWriteDecorHandle<float> m_scaleFactorDecoration { + this, "scaleFactorDecoration", "", "the decoration for the di-tau efficiency scale factor"}; }; } diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauTruthMatchingAlg.h b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauTruthMatchingAlg.h index a93a3aaf61726eaf6a52e2d82079aaa9059107ae..578ac577f66e5f040a82c0fa67d96ad33bc518ab 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauTruthMatchingAlg.h +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/DiTauTruthMatchingAlg.h @@ -12,8 +12,8 @@ #include <AnaAlgorithm/AnaAlgorithm.h> #include <TauAnalysisTools/IDiTauTruthMatchingTool.h> #include <SelectionHelpers/SelectionReadHandle.h> -#include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <SystematicsHandles/SysReadHandle.h> #include <xAODTau/DiTauJetContainer.h> namespace CP @@ -46,7 +46,7 @@ namespace CP /// \brief the tau collection we run on private: - SysCopyHandle<xAOD::DiTauJetContainer> m_tauHandle { + SysReadHandle<xAOD::DiTauJetContainer> m_tauHandle { this, "taus", "DiTauJets", "the tau collection to run on"}; /// \brief the preselection we apply to our input diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauTruthMatchingAlg.h b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauTruthMatchingAlg.h index 0bd2409052c34bd10dd8fcd40157123108aca6e2..494183e1cd195b44ba3f488a6c4caf0256fe4075 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauTruthMatchingAlg.h +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/TauAnalysisAlgorithms/TauTruthMatchingAlg.h @@ -12,8 +12,8 @@ #include <AnaAlgorithm/AnaAlgorithm.h> #include <TauAnalysisTools/ITauTruthMatchingTool.h> #include <SelectionHelpers/SelectionReadHandle.h> -#include <SystematicsHandles/SysCopyHandle.h> #include <SystematicsHandles/SysListHandle.h> +#include <SystematicsHandles/SysReadHandle.h> #include <xAODTau/TauJetContainer.h> namespace CP @@ -46,7 +46,7 @@ namespace CP /// \brief the tau collection we run on private: - SysCopyHandle<xAOD::TauJetContainer> m_tauHandle { + SysReadHandle<xAOD::TauJetContainer> m_tauHandle { this, "taus", "TauJets", "the tau collection to run on"}; /// \brief the preselection we apply to our input diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/DiTauAnalysisSequence.py b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/DiTauAnalysisSequence.py index 52239dcf487651b17f5394fc75173e86a89fef3e..169c2a0fe766c51fad713a545306433578a8ec8b 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/DiTauAnalysisSequence.py +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/DiTauAnalysisSequence.py @@ -71,7 +71,7 @@ def makeDiTauAnalysisSequence( dataType, workingPoint, alg.scaleFactorDecoration = 'tau_effSF' + postfix # alg.outOfValidity = 2 #silent # alg.outOfValidityDeco = "bad_eff" - seq.append( alg, inputPropName = 'taus', outputPropName = 'tausOut', + seq.append( alg, inputPropName = 'taus', stageName = 'efficiency' ) # Set up the tau truth matching algorithm: @@ -81,7 +81,7 @@ def makeDiTauAnalysisSequence( dataType, workingPoint, addPrivateTool( alg, 'matchingTool', 'TauAnalysisTools::DiTauTruthMatchingTool' ) alg.matchingTool.WriteTruthTaus = 1 - seq.append( alg, inputPropName = 'taus', outputPropName = 'tausOut', + seq.append( alg, inputPropName = 'taus', stageName = 'selection' ) pass diff --git a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/TauAnalysisSequence.py b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/TauAnalysisSequence.py index 29817be835098911f81bffe8486576b82be51038..a5c1615f77e71e75289c8f99acc5e7d47539b496 100644 --- a/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/TauAnalysisSequence.py +++ b/PhysicsAnalysis/Algorithms/TauAnalysisAlgorithms/python/TauAnalysisSequence.py @@ -75,7 +75,7 @@ def makeTauAnalysisSequence( dataType, workingPoint, postfix = '', addPrivateTool( alg, 'matchingTool', 'TauAnalysisTools::TauTruthMatchingTool' ) alg.matchingTool.WriteTruthTaus = 1 - seq.append( alg, inputPropName = 'taus', outputPropName = 'tausOut', + seq.append( alg, inputPropName = 'taus', stageName = 'selection' ) pass