1 #define ALLOW_ALL_TYPES
4 #include "GaudiKernel/MsgStream.h"
5 #include "GaudiKernel/NTuple.h"
6 #include "GaudiKernel/INTupleSvc.h"
23 rtree =
new TTree(desc.c_str(),nt->title().c_str());
25 for (
const auto&
i : nt->items() ) {
26 std::string tag =
i->name() + rootVarType(
i->type() );
28 log <<
MSG::INFO <<
"ID " << desc <<
": added branch: "
29 <<
i->name() <<
" / " << tag <<
endmsg;
30 rtree->Branch(
i->name().c_str(),
const_cast<void*
>(
i->buffer()),tag.c_str());
32 log <<
MSG::INFO <<
"Booked TTree with ID:" << desc
33 <<
" \"" << nt->title() <<
"\"" <<
endmsg;
49 log <<
MSG::ERROR <<
"Attempt to write invalid N-tuple.";
50 if ( nt ) log << nt->
title();
Definition of the MsgStream class used to transmit messages.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
virtual StatusCode readData(TTree *rtree, INTuple *pObject, long ievt)
Read N tuple data.
virtual const std::string & title() const =0
Object title.
SmartIF< IMessageSvc > & msgSvc() const
Retrieve pointer to message service.
virtual StatusCode writeData(TTree *rtree, INTuple *pObject)
Write N tuple data.
#define DECLARE_NAMESPACE_CONVERTER_FACTORY(n, x)
Row wise NTuple converter class definition.
NTuple interface class definition.
virtual void reset()=0
Reset all entries to their default values.
This class is used for returning status codes from appropriate routines.
virtual StatusCode load(TTree *tree, INTuple *&refpObject)
Create the transient representation of an object.
GAUDI_API AIDA::IHistogram1D * book(IHistogramSvc *svc, const std::string &path, const Gaudi::Histo1DDef &hist)
helper function to book 1D-histogram