24 SelectionWriteAccessorSys ::
25 SelectionWriteAccessorSys (
const std::string& val_selectionName)
31 void SelectionWriteAccessorSys ::
37 throw std::logic_error (
"trying to write systematics accessor without systematic");
40 throw std::logic_error (
"unknown systematic: " + sys->name());
41 return std::get<1>(iter->second)->setBits (element,
selection, sys);
46 void SelectionWriteAccessorSys ::
52 throw std::logic_error (
"trying to write systematics accessor without systematic");
55 throw std::logic_error (
"unknown systematic: " + sys->name());
56 return std::get<1>(iter->second)->setBool (element,
selection, sys);
61 std::string SelectionWriteAccessorSys ::
69 StatusCode SelectionWriteAccessorSys ::
72 const std::vector<CP::SystematicSet>& sysList,
75 using namespace msgSelectionHelpers;
79 if (
auto split = baseName.find (
',');
80 split != std::string::npos)
82 suffix = baseName.substr (
split);
83 baseName.resize (
split);
86 for (
auto& sys : sysList)
88 std::string decorName;
89 ANA_CHECK (svc.makeSystematicsName (decorName, baseName, sys));
90 ANA_MSG_DEBUG (
"SelectionWriteAccessorSys: " << decorName <<
" (" << sys.name() <<
")");
91 std::unique_ptr<ISelectionWriteAccessor> accessor;
93 m_dataCache.emplace (sys, std::make_tuple (decorName, std::move (accessor)));
97 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< 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