Go to the documentation of this file.
   11 #ifndef GAUDIALG_TUPLEPUT_H 
   12 #define GAUDIALG_TUPLEPUT_H 1 
   34   template <
class VALUE>
 
   48       if ( 
m_map.
end() != ifound ) 
return &ifound->second.first; 
 
   51       if ( !tuple ) 
return nullptr;
 
   67         auto nh  = 
m_map.extract( iter );
 
   68         nh.key() = nh.mapped().second; 
 
   75         tuple->
Warning( 
fmt::format( 
"ItemStore::getItem('{}') item already exists, new one not inserted!", 
key ) )
 
   79       auto& item = iter->second.first;
 
  116 template <
class TYPE>
 
  122   static bool    s_fail = 
false;   
 
  123   static TClass* s_type = 
nullptr; 
 
  128   else if ( !s_type ) {
 
  129     s_type = TClass::GetClass( 
typeid( TYPE ) );
 
  142   *item = 
const_cast<TYPE*
>( obj ); 
 
  151 #endif // GAUDIALG_TUPLEPUT_H 
  
 
StatusCode put(std::string_view name, const TYPE *obj)
The function allows to add almost arbitrary object into N-tuple.
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
virtual StatusCode Error(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
ItemStore & operator=(const ItemStore &)=delete
bool evtColType() const
Event collection ?
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
NTuple::Item< VALUE > * getItem(std::string_view key, Tuples::TupleObj *tuple)
the only one method:
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
std::unordered_map< std::string_view, std::pair< NTuple::Item< VALUE >, std::string > > m_map
the underlying map
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
bool goodItem(std::string_view name) const
check the uniqueness of the name
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
bool addItem(std::string name, std::string type)
add the item name into the list of known items
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
constexpr static const auto SUCCESS
bool invalid() const
invalid pointer to tuple ?
Abstract base class which allows the user to interact with the actual N tuple implementation.
ItemStore(const ItemStore &)=delete
ItemStore()=default
constructor : create empty map
const std::string & name() const
get the name
Class acting as a smart pointer holding a N tuple _Item.