23 SelectionWriteAccessorSys ::
24 SelectionWriteAccessorSys (
const std::string& val_selectionName)
30 void SelectionWriteAccessorSys ::
36 throw std::logic_error (
"trying to write systematics accessor without systematic");
39 throw std::logic_error (
"unknown systematic: " + sys->name());
40 return std::get<1>(iter->second)->setBits (element,
selection, sys);
45 void SelectionWriteAccessorSys ::
51 throw std::logic_error (
"trying to write systematics accessor without systematic");
54 throw std::logic_error (
"unknown systematic: " + sys->name());
55 return std::get<1>(iter->second)->setBool (element,
selection, sys);
60 std::string SelectionWriteAccessorSys ::
68 StatusCode SelectionWriteAccessorSys ::
71 const std::vector<CP::SystematicSet>& sysList,
72 const std::string& objectName)
74 using namespace msgSelectionHelpers;
78 if (
auto split = baseName.find (
',');
79 split != std::string::npos)
81 suffix = baseName.substr (
split);
82 baseName.resize (
split);
85 for (
auto& sys : sysList)
87 std::string decorName;
88 ANA_CHECK (svc.makeSystematicsName (decorName, baseName, sys));
89 ANA_MSG_DEBUG (
"SelectionWriteAccessorSys: " << decorName <<
" (" << sys.name() <<
")");
90 std::unique_ptr<ISelectionWriteAccessor> accessor;
92 m_dataCache.emplace (sys, std::make_tuple (decorName, std::move (accessor)));
94 ANA_CHECK (svc.setDecorSystematics (objectName, baseName, fullAffecting));
95 return StatusCode::SUCCESS;
the interface for the central systematics service
std::unordered_map< CP::SystematicSet, std::tuple< std::string, std::unique_ptr< ISelectionWriteAccessor > > > m_dataCache
the map of accessor we use
std::string m_selectionName
the selectionName for this accessor
Class to wrap a set of SystematicVariations.
Base class for elements of a container that can have aux data.
const std::string selection
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Select isolated Photons, Electrons and Muons.
StatusCode makeSelectionWriteAccessor(const std::string &name, std::unique_ptr< ISelectionWriteAccessor > &accessor, bool defaultToChar)
Produces a simple ISelectionWriteAccessor accessing the given decoration.
uint32_t SelectionType
the type for selection decorations that are meant to hold a asg::AcceptData