@@ -50,31 +50,10 @@ bool RNTupleReader::initCategory(const std::string& category) {
50
50
// Assume that the metadata is the same in all files
51
51
auto filename = m_filenames[0 ];
52
52
53
- // auto& collInfo = m_collectionInfo[category];
54
-
55
53
auto collInfo = m_metadata_readers[filename]->GetView <std::vector<root_utils::CollectionWriteInfo>>(
56
54
{root_utils::collInfoName (category)});
57
55
58
56
m_collectionInfo[category] = collInfo (0 );
59
-
60
- // auto id = m_metadata_readers[filename]->GetView<std::vector<unsigned int>>(root_utils::idTableName(category));
61
- // collInfo.collectionID = id(0);
62
-
63
- // auto collectionName =
64
- // m_metadata_readers[filename]->GetView<std::vector<std::string>>(root_utils::collectionName(category));
65
- // collInfo.name = collectionName(0);
66
-
67
- // auto collectionType =
68
- // m_metadata_readers[filename]->GetView<std::vector<std::string>>(root_utils::collInfoName(category));
69
- // collInfo.type = collectionType(0);
70
-
71
- // auto subsetCollection =
72
- // m_metadata_readers[filename]->GetView<std::vector<short>>(root_utils::subsetCollection(category));
73
- // collInfo.isSubset = subsetCollection(0);
74
-
75
- // auto schemaVersion = m_metadata_readers[filename]->GetView<std::vector<SchemaVersionT>>("schemaVersion_" +
76
- // category); collInfo.schemaVersion = schemaVersion(0);
77
-
78
57
m_idTables[category] = root_utils::makeCollIdTable (collInfo (0 ));
79
58
80
59
return true ;
@@ -191,46 +170,46 @@ std::unique_ptr<ROOTFrameData> RNTupleReader::readEntry(const std::string& categ
191
170
// we set all the fields there in any case.
192
171
auto dentry = m_readers[category][readerIndex]->GetModel ().CreateEntry ();
193
172
194
- for (size_t i = 0 ; i < collInfo. size (); ++i ) {
195
- if (!collsToRead.empty () && std::ranges::find (collsToRead, collInfo[i] .name ) == collsToRead.end ()) {
173
+ for (const auto & coll : collInfo) {
174
+ if (!collsToRead.empty () && std::ranges::find (collsToRead, coll .name ) == collsToRead.end ()) {
196
175
continue ;
197
176
}
198
- const auto & collType = collInfo[i] .dataType ;
177
+ const auto & collType = coll .dataType ;
199
178
const auto & bufferFactory = podio::CollectionBufferFactory::instance ();
200
- auto maybeBuffers = bufferFactory.createBuffers (collType, collInfo[i] .schemaVersion , collInfo[i] .isSubset );
179
+ auto maybeBuffers = bufferFactory.createBuffers (collType, coll .schemaVersion , coll .isSubset );
201
180
auto collBuffers = maybeBuffers.value_or (podio::CollectionReadBuffers{});
202
181
203
182
if (!maybeBuffers) {
204
- std::cout << " WARNING: Buffers couldn't be created for collection " << collInfo[i] .name << " of type "
205
- << collInfo[i]. dataType << " and schema version " << collInfo[i] .schemaVersion << std::endl;
183
+ std::cout << " WARNING: Buffers couldn't be created for collection " << coll .name << " of type " << coll. dataType
184
+ << " and schema version " << coll .schemaVersion << std::endl;
206
185
return nullptr ;
207
186
}
208
187
209
- if (collInfo[i] .isSubset ) {
210
- auto brName = root_utils::subsetBranch (collInfo[i] .name );
188
+ if (coll .isSubset ) {
189
+ auto brName = root_utils::subsetBranch (coll .name );
211
190
auto vec = new std::vector<podio::ObjectID>;
212
191
dentry->BindRawPtr (brName, vec);
213
192
collBuffers.references ->at (0 ) = std::unique_ptr<std::vector<podio::ObjectID>>(vec);
214
193
} else {
215
- dentry->BindRawPtr (collInfo[i] .name , collBuffers.data );
194
+ dentry->BindRawPtr (coll .name , collBuffers.data );
216
195
217
196
const auto relVecNames = podio::DatamodelRegistry::instance ().getRelationNames (collType);
218
197
for (size_t j = 0 ; j < relVecNames.relations .size (); ++j) {
219
198
const auto relName = relVecNames.relations [j];
220
199
auto vec = new std::vector<podio::ObjectID>;
221
- const auto brName = root_utils::refBranch (collInfo[i] .name , relName);
200
+ const auto brName = root_utils::refBranch (coll .name , relName);
222
201
dentry->BindRawPtr (brName, vec);
223
202
collBuffers.references ->at (j) = std::unique_ptr<std::vector<podio::ObjectID>>(vec);
224
203
}
225
204
226
205
for (size_t j = 0 ; j < relVecNames.vectorMembers .size (); ++j) {
227
206
const auto vecName = relVecNames.vectorMembers [j];
228
- const auto brName = root_utils::vecBranch (collInfo[i] .name , vecName);
207
+ const auto brName = root_utils::vecBranch (coll .name , vecName);
229
208
dentry->BindRawPtr (brName, collBuffers.vectorMembers ->at (j).second );
230
209
}
231
210
}
232
211
233
- buffers.emplace (collInfo[i] .name , std::move (collBuffers));
212
+ buffers.emplace (coll .name , std::move (collBuffers));
234
213
}
235
214
236
215
m_readers[category][readerIndex]->LoadEntry (localEntry, *dentry);
0 commit comments