diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgFlagSelectionTool.h b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgFlagSelectionTool.h index 2c4cb378df711628634b18919cd946c60eb5cd57..77eb764d24a38526627dc00dd82a5ff8cc050ba6 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgFlagSelectionTool.h +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/AsgAnalysisAlgorithms/AsgFlagSelectionTool.h @@ -11,7 +11,9 @@ #include <AsgTools/AsgTool.h> #include <PATCore/IAsgSelectionTool.h> +#include <SelectionHelpers/ISelectionAccessor.h> #include <xAODBase/IParticle.h> +#include <memory> #include <string> #include <vector> @@ -73,7 +75,7 @@ namespace CP std::vector<std::string> m_selFlags; std::vector<bool> m_invertFlags; - std::vector<SG::AuxElement::ConstAccessor<char> > m_acc_selFlags; + std::vector<std::unique_ptr<ISelectionAccessor> > m_acc_selFlags; /// \} @@ -85,4 +87,3 @@ namespace CP } #endif - diff --git a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgFlagSelectionTool.cxx b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgFlagSelectionTool.cxx index ec25213ae991ab8db2df9472fe71db50dffef733..ac9c2aab0f408f2becebc509a276dc2d23ee861a 100644 --- a/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgFlagSelectionTool.cxx +++ b/PhysicsAnalysis/Algorithms/AsgAnalysisAlgorithms/Root/AsgFlagSelectionTool.cxx @@ -51,7 +51,9 @@ namespace CP if(m_invertFlags.size()<index+1) {m_invertFlags.push_back(false);} std::string doInvertStr = m_invertFlags[index] ? "!" : ""; m_accept.addCut (doInvertStr + thisflag, doInvertStr + thisflag); - m_acc_selFlags.push_back(SG::AuxElement::ConstAccessor<char>(thisflag)); + std::unique_ptr<ISelectionAccessor> accessor; + ATH_CHECK (makeSelectionAccessor (thisflag, accessor, true)); + m_acc_selFlags.push_back (std::move (accessor)); } } @@ -76,7 +78,7 @@ namespace CP // Test against the opposite of the invert value bool testval = !m_invertFlags[cutIndex]; ATH_MSG_VERBOSE("Now testing flag \"" << m_selFlags[cutIndex] << "\" requiring value " << testval); - m_accept.setCutResult (cutIndex, bool(m_acc_selFlags[cutIndex](*particle))==testval); + m_accept.setCutResult (cutIndex, m_acc_selFlags[cutIndex]->getBool (*particle)==testval); } ATH_MSG_VERBOSE(" Result: " << m_accept);