1 #ifndef PhysicsTools_NanoAOD_TableOutputFields_h 2 #define PhysicsTools_NanoAOD_TableOutputFields_h 12 #include <ROOT/RNTuple.hxx> 13 #include <ROOT/RNTupleModel.hxx> 14 #if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0) 15 using ROOT::Experimental::RCollectionNTupleWriter;
17 #include <ROOT/RNTupleCollectionWriter.hxx> 18 using ROOT::Experimental::RNTupleCollectionWriter;
20 using ROOT::Experimental::RNTupleModel;
21 using ROOT::Experimental::RNTupleWriter;
30 if (!
table.columnName(
i).empty()) {
35 if (
table.name().empty()) {
36 throw cms::Exception(
"LogicError",
"Empty FlatTable name and field name");
55 std::vector<typename T::value_type>
buf(
table.size());
56 for (std::size_t
i = 0;
i <
table.size();
i++) {
118 #if ROOT_VERSION_CODE < ROOT_VERSION(6, 31, 0)
RNTupleFieldPtr< T > m_field
TableOutputVectorFields()=default
void fillEntry(const nanoaod::FlatTable &table, std::size_t i)
const edm::EDGetToken & getToken() const
TableOutputFields(const edm::EDGetToken &token)
TableOutputVectorFields(const edm::EDGetToken &token)
std::vector< TableOutputFields > m_singletonFields
TableCollection()=default
std::vector< FlatTableField< std::vector< float > > > m_vfloatFields
void createFields(const edm::EventForOutput &event, RNTupleModel &eventModel)
std::vector< FlatTableField< bool > > m_boolFields
std::string m_collectionName
std::shared_ptr< RNTupleCollectionWriter > m_collection
Container::value_type value_type
std::vector< FlatTableField< std::vector< bool > > > m_vboolFields
const std::string & getCollectionName() const
std::vector< FlatTableField< std::uint8_t > > m_uint8Fields
void fill(const edm::EventForOutput &event)
std::vector< TableOutputVectorFields > m_vectorFields
std::vector< TableOutputFields > m_extensions
std::vector< FlatTableField< int > > m_intFields
const std::string & getFlatTableName() const
std::vector< FlatTableField< std::vector< int > > > m_vintFields
std::string m_flatTableName
void createFields(const edm::EventForOutput &event, RNTupleModel &model)
std::vector< FlatTableField< float > > m_floatFields
void fill(const edm::EventForOutput &event)
void add(const edm::EDGetToken &table_token, const nanoaod::FlatTable &table)
FlatTableField(const nanoaod::FlatTable &table, std::size_t i, RNTupleModel &model)
static bool hasAnonymousColumn(const nanoaod::FlatTable &table)
void add(const edm::EDGetToken &table_token, const nanoaod::FlatTable &table)
std::vector< FlatTableField< std::vector< std::uint8_t > > > m_vuint8Fields
void fill(const edm::EventForOutput &event)
std::vector< TableCollection > m_collections
void createFields(const edm::EventForOutput &event, RNTupleModel &model)
void fill(const nanoaod::FlatTable &table, std::size_t i)
void createFields(const edm::EventForOutput &event, RNTupleModel &eventModel)
void fillVectored(const nanoaod::FlatTable &table)
TableOutputFields()=default