23 SelectionAccessorReadSys ::
24 SelectionAccessorReadSys (
const std::string& val_selectionName)
35 throw std::logic_error (
"trying to read systematics accessor without systematic");
38 throw std::logic_error (
"unknown systematic: " + sys->name());
39 return std::get<1>(iter->second)->getBits (element, sys);
44 bool SelectionAccessorReadSys ::
49 throw std::logic_error (
"trying to read systematics accessor without systematic");
52 throw std::logic_error (
"unknown systematic: " + sys->name());
53 return std::get<1>(iter->second)->getBool (element, sys);
57 std::string SelectionAccessorReadSys ::
65 bool SelectionAccessorReadSys ::
69 if (!std::get<1>(item.second)->isBool())
78 const std::string& objectName)
const
81 if (
auto split = baseName.find (
',');
82 split != std::string::npos)
83 baseName.resize (
split);
84 return svc.getDecorSystematics (objectName, baseName);
89 StatusCode SelectionAccessorReadSys ::
91 const std::vector<CP::SystematicSet>& sysList,
92 const std::string& objectName)
94 using namespace msgSelectionHelpers;
98 if (
auto split = baseName.find (
',');
99 split != std::string::npos)
101 suffix = baseName.substr (
split);
102 baseName.resize (
split);
106 = svc.getDecorSystematics (objectName, baseName);
107 for (
auto& sys : sysList)
111 std::string decorName;
112 ANA_CHECK (svc.makeSystematicsName (decorName, baseName, inputSys));
113 ANA_MSG_DEBUG (
"SysReadDecorHandle: " << decorName <<
" (" << sys.name() <<
")");
114 std::unique_ptr<ISelectionReadAccessor> accessor;
116 m_dataCache.emplace (sys, std::make_tuple (decorName, std::move (accessor)));
118 return StatusCode::SUCCESS;
the interface for the central systematics service
std::unordered_map< CP::SystematicSet, std::tuple< std::string, std::unique_ptr< ISelectionReadAccessor > > > m_dataCache
the map of accessor we use
std::string m_selectionName
the selectionName for this accessor
Class to wrap a set of SystematicVariations.
static StatusCode filterForAffectingSystematics(const SystematicSet &systConfig, const SystematicSet &affectingSystematics, SystematicSet &filteredSystematics)
description: filter the systematics for the affected systematics returns: success guarantee: strong f...
Base class for elements of a container that can have aux data.
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Select isolated Photons, Electrons and Muons.
StatusCode makeSelectionReadAccessor(const std::string &expr, std::unique_ptr< ISelectionReadAccessor > &accessor, bool defaultToChar)
make the ISelectionReadAccessor for the given name
uint32_t SelectionType
the type for selection decorations that are meant to hold a asg::AcceptData