-
Notifications
You must be signed in to change notification settings - Fork 1.5k
TTreeReaderArray does not support Double32_t #11260
Copy link
Copy link
Closed
Description
With the example below, we get:
Error in <TTreeReaderArrayBase::GetBranchContentDataType()>: The branch h.fData.fPx contains a data type 9 for which the dictionary cannot be retrieved.
This was seen during investigations by CMSSW team of leveraging Double32_t and Float16_t to reduce data size.
Cheers,
Philippe.
#include "TTree.h"
#include "TTreeReader.h"
#include "TTreeReaderArray.h"
struct Inside {
Double32_t fPx;
double fPy;
};
struct Holder {
std::vector<Double32_t> fValues;
std::vector<Inside> fData;
};
#ifdef __ROOTCLING__
#pragma link C++ class Inside+;
#pragma link C++ class Holder+;
#pragma link C++ class std::vector<Inside>+;
#pragma link C++ class std::vector<Double32_t>+;
#endif
void exec()
{
auto t = new TTree("t","t");
Holder h;
t->Branch("h.", &h);
t->Fill();
t->Print();
TTreeReader r(t);
//TTreeReaderArray<Double32_t> arr1(r, "h.fValues");
TTreeReaderArray<Double32_t> arr2(r, "h.fData.fPx");
TTreeReaderArray<Double32_t> arr3(r, "h.fData.fPy");
r.Next();
// arr1.GetSize();
arr2.GetSize();
arr3.GetSize();
}
Reactions are currently unavailable