Go to the documentation of this file.
17 #include <nlohmann/json.hpp>
37 .orThrow(
"Unable to set typesToSaveProperty",
"Histograming::Sink::Base" );
41 return BaseSink::initialize().
andThen( [&] {
57 [&histoFile,
this](
auto& ent ) {
58 auto j = ent.toJSON();
59 auto dim =
j.at(
"dimension" ).
template get<unsigned int>();
60 auto type =
j.at(
"type" ).
template get<std::string>();
65 if ( saver !=
m_registry.
end() ) ( saver->second )( histoFile, ent.component, ent.name,
j );
82 "Name of file where to save histograms" };
Gaudi::Property< std::string > m_fileName
Base class for all Sinks registering to the Monitoring Hub.
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
StatusCode stop() override
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
StatusCode initialize() override
const std::string & name() const override
Retrieve name of the service
void registerHandler(HistoIdentification const &id, HistoHandler const &func)
const ValueType & value() const
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
HistoRegistry m_registry
map of supported type and the way to handle them
Base(std::string name, ISvcLocator *svcloc)
constexpr static const auto SUCCESS
StatusCode stop() override
void applytoAllEntities(Callable func, bool sortFirst=false)
applies a callable to all monitoring entities