7 std::cout <<
" singleton: " << (
table.singleton() ?
"true" :
"false") <<
"\n";
9 std::cout <<
" extension: " << (
table.extension() ?
"true" :
"false") <<
"\n";
11 for (std::size_t
i = 0;
i <
table.nColumns();
i++) {
13 switch (
table.columnType(
i)) {
37 std::cout <<
" " << field.getFlatTableName() <<
": f32,\n";
40 std::cout <<
" " << field.getFlatTableName() <<
": i32,\n";
43 std::cout <<
" " << field.getFlatTableName() <<
": u8,\n";
46 std::cout <<
" " << field.getFlatTableName() <<
": bool,\n";
54 for (std::size_t
i = 0;
i <
table.nColumns();
i++) {
55 switch (
table.columnType(
i)) {
97 for (std::size_t
i = 0;
i <
table.nColumns();
i++) {
98 switch (
table.columnType(
i)) {
121 field.fillVectored(
table);
124 field.fillVectored(
table);
127 field.fillVectored(
table);
130 field.fillVectored(
table);
140 if (
table.extension()) {
151 auto collectionModel = RNTupleModel::Create();
159 collectionModel->SetDescription(
table.doc());
166 const auto& main_table = *
handle;
167 auto table_size = main_table.size();
168 for (std::size_t
i = 0;
i < table_size;
i++) {
172 event.getByToken(
ext.getToken(),
handle);
173 const auto& ext_table = *
handle;
174 if (ext_table.size() != table_size) {
176 "Mismatch in number of entries between extension and main table for " +
m_collectionName);
178 ext.fillEntry(ext_table,
i);
201 if (
table.nColumns() == 0) {
202 std::cout <<
"Warning: skipping empty table: \n";
210 throw cms::Exception(
"LogicError",
"Anonymous FlatTable and anonymous field");
214 if (
table.singleton()) {
223 return c.getCollectionName() ==
table.name();
244 "Trying to save an extension table for " +
collection.getCollectionName() +
245 " without the corresponding main table\n");
274 for (std::size_t
i = 0;
i <
table.nColumns();
i++) {
275 if (
table.columnName(
i).empty()) {
void fillEntry(const nanoaod::FlatTable &table, std::size_t i)
const edm::EDGetToken & getToken() const
std::vector< TableOutputFields > m_singletonFields
std::vector< FlatTableField< std::vector< float > > > m_vfloatFields
void createFields(const edm::EventForOutput &event, RNTupleModel &eventModel)
static std::string to_string(const XMLCh *ch)
std::vector< FlatTableField< bool > > m_boolFields
std::string m_collectionName
std::shared_ptr< RNTupleCollectionWriter > m_collection
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
std::vector< FlatTableField< std::vector< int > > > m_vintFields
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)
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)
constexpr bool isUninitialized() const noexcept
std::vector< TableCollection > m_collections
void createFields(const edm::EventForOutput &event, RNTupleModel &model)
void createFields(const edm::EventForOutput &event, RNTupleModel &eventModel)