24 SelectionAccessorReadSys ::
25 SelectionAccessorReadSys (
const std::string& val_selectionName)
36 throw std::logic_error (
"trying to read systematics accessor without systematic");
39 throw std::logic_error (
"unknown systematic: " + sys->name());
40 return std::get<1>(iter->second)->getBits (element, sys);
45 bool SelectionAccessorReadSys ::
50 throw std::logic_error (
"trying to read systematics accessor without systematic");
53 throw std::logic_error (
"unknown systematic: " + sys->name());
54 return std::get<1>(iter->second)->getBool (element, sys);
58 std::string SelectionAccessorReadSys ::
66 bool SelectionAccessorReadSys ::
70 if (!std::get<1>(item.second)->isBool())
79 const std::string& objectName)
const
82 if (
auto split = baseName.find (
',');
83 split != std::string::npos)
84 baseName.resize (
split);
85 return svc.getDecorSystematics (objectName, baseName);
90 StatusCode SelectionAccessorReadSys ::
92 const std::vector<CP::SystematicSet>& sysList,
95 using namespace msgSelectionHelpers;
99 if (
auto split = baseName.find (
',');
100 split != std::string::npos)
102 suffix = baseName.substr (
split);
103 baseName.resize (
split);
107 = svc.getDecorSystematics (objectHandle.
getNamePattern(), baseName);
108 for (
auto& sys : sysList)
112 std::string decorName;
113 ANA_CHECK (svc.makeSystematicsName (decorName, baseName, inputSys));
114 ANA_MSG_DEBUG (
"SysReadDecorHandle: " << decorName <<
" (" << sys.name() <<
")");
115 std::unique_ptr<ISelectionReadAccessor> accessor;
117 m_dataCache.emplace (sys, std::make_tuple (decorName, std::move (accessor)));
120 return StatusCode::SUCCESS;
a ISysHandleBase for a handle to a specific object/container
virtual StatusCode addDecorationDependency(const ISystematicsSvc &svc, const std::string &decoName, bool decoWrite)=0
add dependency information for the given decoration
virtual std::string getNamePattern() const =0
get the name pattern before substitution
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