File ROOTNTupleWriter.h

namespace podio
class ROOTNTupleWriter
#include <podio/ROOTNTupleWriter.h>

Public Functions

ROOTNTupleWriter(const std::string &filename)
~ROOTNTupleWriter()
ROOTNTupleWriter(const ROOTNTupleWriter&) = delete
ROOTNTupleWriter &operator=(const ROOTNTupleWriter&) = delete
template<typename T>
void fillParams(GenericParameters &params, ROOT::Experimental::REntry *entry)
void writeFrame(const podio::Frame &frame, const std::string &category)
void writeFrame(const podio::Frame &frame, const std::string &category, const std::vector<std::string> &collsToWrite)
void finish()
std::tuple<std::vector<std::string>, std::vector<std::string>> checkConsistency(const std::vector<std::string> &collsToWrite, const std::string &category) const

Check whether the collsToWrite are consistent with the state of the passed category.

Return two vectors of collection names. The first one contains all the names that were missing from the collsToWrite but were present in the category. The second one contains the names that are present in the collsToWrite only. If both vectors are empty the category and the passed collsToWrite are consistent.

NOTE: This will only be a meaningful check if the first Frame of the passed category has already been written. Also, this check is rather expensive as it has to effectively do two set differences.

Private Types

using StoreCollection = std::pair<const std::string&, podio::CollectionBase*>

Private Functions

std::unique_ptr<ROOT::Experimental::RNTupleModel> createModels(const std::vector<StoreCollection> &collections)
CollectionInfo &getCategoryInfo(const std::string &category)
template<typename T>
std::pair<std::vector<std::string>&, std::vector<std::vector<T>>&> getKeyValueVectors()

Private Members

std::unique_ptr<ROOT::Experimental::RNTupleModel> m_metadata = {}
std::unique_ptr<ROOT::Experimental::RNTupleWriter> m_metadataWriter = {}
std::unique_ptr<TFile> m_file = {}
DatamodelDefinitionCollector m_datamodelCollector = {}
std::unordered_map<std::string, CollectionInfo> m_categories = {}
bool m_finished = {false}
std::vector<std::string> m_intkeys = {}
std::vector<std::string> m_floatkeys = {}
std::vector<std::string> m_doublekeys = {}
std::vector<std::string> m_stringkeys = {}
std::vector<std::vector<int>> m_intvalues = {}
std::vector<std::vector<float>> m_floatvalues = {}
std::vector<std::vector<double>> m_doublevalues = {}
std::vector<std::vector<std::string>> m_stringvalues = {}
struct CollectionInfo

Public Members

std::vector<uint32_t> id = {}
std::vector<std::string> name = {}
std::vector<std::string> type = {}
std::vector<short> isSubsetCollection = {}
std::vector<SchemaVersionT> schemaVersion = {}
std::unique_ptr<ROOT::Experimental::RNTupleWriter> writer = {nullptr}