-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add split encoding support and tests (#221)
* add split encoding support and tests
- Loading branch information
Showing
7 changed files
with
104 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
R__LOAD_LIBRARY(ROOTNTuple) | ||
#include <ROOT/RField.hxx> | ||
#include <ROOT/RNTuple.hxx> | ||
#include <ROOT/RNTupleModel.hxx> | ||
#include <ROOT/RRawFile.hxx> | ||
|
||
using RNTupleModel = ROOT::Experimental::RNTupleModel; | ||
using RNTupleWriter = ROOT::Experimental::RNTupleWriter; | ||
|
||
void rntuple_split_3e4() { | ||
std::string rootFileName{"test_ntuple_split_3e4.root"}; | ||
auto model = RNTupleModel::Create(); | ||
auto splitint_field = model->MakeField<int32_t>("one_int32"); | ||
auto splitint_field2 = model->MakeField<uint32_t>("two_uint32"); | ||
auto splitint_field3 = model->MakeField<std::vector<float>>("three_vint32"); | ||
auto splitint_field4 = model->MakeField<int64_t>("four_int64"); | ||
|
||
|
||
auto ntuple = RNTupleWriter::Recreate(std::move(model), "ntuple", rootFileName); | ||
for(auto i=30000; i>0; i--){ | ||
// 0x04030201 | ||
*splitint_field = 67305985; | ||
// 0xffddccbb | ||
*splitint_field2 = 4293844428; | ||
// 0x3dccbbaa | ||
splitint_field3->emplace_back(0.099967316); | ||
if (i % 10 == 0){ | ||
splitint_field3->clear(); | ||
} | ||
// 0x0807060504030201 | ||
*splitint_field4 = 578437695752307201; | ||
ntuple->Fill(); | ||
} | ||
} |
Binary file not shown.