44 std::string fileName = gSystem->TempDirectory();
45 fileName +=
"/test_RootTreeReader.root";
48 std::unique_ptr<TFile> testFile(TFile::Open(fileName.c_str(),
"RECREATE"));
49 std::unique_ptr<TTree> testTree = std::make_unique<TTree>(
"testtree",
"testtree");
51 std::vector<o2::test::TriviallyCopyable> msgblarray;
52 std::vector<o2::test::Polymorphic> valarray;
53 auto* branch1 = testTree->Branch(
"msgblarray", &msgblarray);
54 auto* branch2 = testTree->Branch(
"dataarray", &valarray);
59 for (
int idx = 0; idx <
entry + 1; ++idx) {
60 msgblarray.emplace_back((
entry * 10) + idx, 0, 0);
61 valarray.emplace_back((
entry * 10) + idx);
66 testTree->SetDirectory(
nullptr);
70 auto reader = std::make_shared<RootTreeReader>(
"testtree",
73 Output{
"TST",
"ARRAYOFDATA", 0},
81 if (reader->getCount() == 0) {
85 (++(*reader))(pc, auxHeader, dummyheader);
111 for (
auto& input : pc.inputs()) {
112 auto dh = DataRefUtils::getHeader<const DataHeader*>(input);
113 LOG(info) << dh->dataOrigin.str <<
" " << dh->dataDescription.str <<
" " << dh->payloadSize;
115 auto data = pc.inputs().get<std::vector<o2::test::Polymorphic>>(
"input1");
118 auto auxHeader = DataRefUtils::getHeader<o2::header::NameHeader<16>*>(pc.inputs().get(
"input1"));
120 if (auxHeader !=
nullptr) {
121 ASSERT_ERROR(std::string(
"extended_info") == auxHeader->getName());
123 auto dummyheader = auxHeader->next();
128 LOG(info) <<
"count: " <<
counter <<
" data elements:" <<
data.size();
132 auto msgblvec = pc.inputs().get<std::vector<o2::test::TriviallyCopyable>*>(
"input2");
136 auto msgblspan = pc.inputs().get<gsl::span<o2::test::TriviallyCopyable>>(
"input2");
139 for (
unsigned int idx = 0; idx <
data.size(); idx++) {
151 {
InputSpec{
"input1",
"TST",
"ARRAYOFDATA"},
152 InputSpec{
"input2",
"TST",
"ARRAYOFMSGBL"}},