@@ -36,19 +36,6 @@ namespace o2::framework
3636// OR t2t.addBranch(column.get(), field.get()), ...;
3737// . t2t.process();
3838//
39- // .............................................................................
40- // -----------------------------------------------------------------------------
41- // TreeToTable allows to fill the contents of a given TTree to an arrow::Table
42- // ColumnIterator is used by TreeToTable
43- //
44- // To copy the contents of a tree tr to a table ta do:
45- // . TreeToTable t2t(tr);
46- // . t2t.addColumn(columnname1); t2t.addColumn(columnname2); ...
47- // OR
48- // t2t.addAllColumns();
49- // . auto ta = t2t.process();
50- //
51- // .............................................................................
5239struct ROOTTypeInfo {
5340 EDataType type;
5441 char suffix[3 ];
@@ -58,29 +45,6 @@ struct ROOTTypeInfo {
5845auto arrowTypeFromROOT (EDataType type, int size);
5946auto basicROOTTypeFromArrow (arrow::Type::type id);
6047
61- class BranchToColumn
62- {
63- public:
64- BranchToColumn (TBranch* branch, bool VLA, std::string name, EDataType type, int listSize, arrow::MemoryPool* pool);
65- // BranchToColumn(TBranch* branch, TBranch* sizeBranch, std::string name, EDataType type, arrow::MemoryPool* pool);
66- ~BranchToColumn () = default ;
67- TBranch* branch ();
68-
69- std::pair<std::shared_ptr<arrow::ChunkedArray>, std::shared_ptr<arrow::Field>> read (TBuffer* buffer);
70-
71- private:
72- TBranch* mBranch = nullptr ;
73- bool mVLA = false ;
74- std::string mColumnName ;
75- EDataType mType ;
76- std::shared_ptr<arrow::DataType> mArrowType ;
77- arrow::ArrayBuilder* mValueBuilder = nullptr ;
78- std::unique_ptr<arrow::ArrayBuilder> mListBuilder = nullptr ;
79- int mListSize = 1 ;
80- std::unique_ptr<arrow::ArrayBuilder> mBuilder = nullptr ;
81- arrow::MemoryPool* mPool = nullptr ;
82- };
83-
8448class ColumnToBranch
8549{
8650 public:
@@ -127,24 +91,6 @@ class TableToTree
12791 std::vector<std::unique_ptr<ColumnToBranch>> mColumnReaders ;
12892};
12993
130- class TreeToTable
131- {
132- public:
133- TreeToTable (arrow::MemoryPool* pool = arrow::default_memory_pool());
134- void setLabel (const char * label);
135- void addAllColumns (TTree* tree, std::vector<std::string>&& names = {});
136- void fill (TTree*);
137- std::shared_ptr<arrow::Table> finalize ();
138-
139- private:
140- arrow::MemoryPool* mArrowMemoryPool ;
141- std::vector<std::unique_ptr<BranchToColumn>> mBranchReaders ;
142- std::string mTableLabel ;
143- std::shared_ptr<arrow::Table> mTable ;
144-
145- void addReader (TBranch* branch, std::string const & name, bool VLA);
146- };
147-
14894class FragmentToBatch
14995{
15096 public:
0 commit comments