Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef RNTUPLEWRITERHELPER_H
6 #define RNTUPLEWRITERHELPER_H
10 #include "ROOT/REntry.hxx"
11 #include "ROOT/RField.hxx"
12 #include "ROOT/RNTuple.hxx"
13 #include "ROOT/RNTupleWriteOptions.hxx"
14 #include "ROOT/RNTupleWriter.hxx"
18 #if ROOT_VERSION_CODE < ROOT_VERSION( 6, 35, 0 )
20 using REntry = ROOT::Experimental::REntry;
21 using RNTupleWriter = ROOT::Experimental::RNTupleWriter;
22 using RNTupleWriteOptions = ROOT::Experimental::RNTupleWriteOptions;
23 using RNTupleModel = ROOT::Experimental::RNTupleModel;
24 using RFieldBase = ROOT::Experimental::RFieldBase;
34 bool enableBufferedWrite,
bool enableMetrics);
48 void addField(
const std::string& field_name,
const std::string& attr_type);
82 std::unique_ptr<ROOT::RNTupleModel>
m_model;
void close()
Close the writer.
~RNTupleWriterHelper()=default
Default Destructor.
bool isGrouped() const
Is this RNTuple used by more than one APR container?
void addField(const std::string &field_name, const std::string &attr_type)
Add a new field to the RNTuple.
void addFieldValue(const std::string &field_name, void *attr_data)
Supply data address for a given field.
bool needsCommit() const
Check if any data needs to be committed.
std::map< std::string, void * > m_attrDataMap
Store data ptr for the first row, when only creating the model.
std::tuple< std::string, std::string, void * > attrDataTuple
Add a new field to the RNTuple, collect the data pointer for the commit.
int commit()
Commit the data.
void increaseClientCount()
Keep track of how many APR containers are writing to this RNTuple.
const std::string & getName() const
Name of the RNTuple.
void addAttribute(const attrDataTuple &in)
Class to provide easy MsgStream access and capabilities.
std::unique_ptr< ROOT::RNTupleWriter > m_ntupleWriter
Internal cache for the native RNTupleWriter.
bool m_collectMetrics
Enable/Disable Metric Collection.
std::unique_ptr< ROOT::REntry > m_entry
Internal cache for the RNEntry.
int m_clients
Count how many APR Containers are writing to this RNTuple (more than one makes a Group)
std::unique_ptr< ROOT::RNTupleModel > m_model
Internal cache for the RNTuple model Before first commit the fields are added to the model At the fir...
ROOT::RNTupleWriteOptions m_opts
size_t size() const
Size of the RNTuple.
Selection rules: declare transient members.
RNTupleWriterHelper(TFile *file, const std::string &ntupleName, bool enableBufferedWrite, bool enableMetrics)
Constructor.
void makeNewEntry()
Create a new empty RNTuple row with the current model (fields)