In the code above the tree name has a space bar inside it, is that a typo or is it expected? FADCData 882
And yes, Snapshot creates a completely new file and copies all the branches indicated in the 3rd argument list. I am not sure if the default behaviour is to rewrite the file. So be careful to rename it to something different than initial file name.
Error in <TTreeReaderArrayBase::GetBranchContentDataType()>: The branch Channel0 was created using a leaf list and cannot be represented as a C++ type. Please access one of its siblings using a TTreeReaderArray:
Error in <TTreeReaderArrayBase::GetBranchContentDataType()>: Channel0.ch0
Error in <TTreeReaderArrayBase::CreateContentProxy()>: Cannot determine the type contained in the collection of branch Channel0. That's weird - please report!
Traceback (most recent call last):
File "test.py", line 5, in <module>
print( df.Count().GetValue())
cppyy.gbl.std.runtime_error: const ULong64_t& ROOT::RDF::RResultPtr<ULong64_t>::GetValue() =>
runtime_error: An error was encountered while processing the data. TTreeReader status code is: 6
It even has “That’s weird - please report!” in the error…
sorry for the (very) late reply and thank you very much @FoxWise for taking a look.
I will be off for a while, I hope @vpadulan or @Axel can try to reproduce and debug in the meanwhile.
The greatest suspect in my opinion is neither Snapshot nor Redefine, but
Error in <TTreeReaderArrayBase::GetBranchContentDataType()>: The branch Channel0 was created using a leaf list and cannot be represented as a C++ type. Please access one of its siblings using a TTreeReaderArray
as this makes the practical usage of this column invalid in almost all the operations of the API, I will try to look further into this.
It’s maybe a long shot, but would it be possible to know how the “Channel0” column was created and filled in the first place?
What do you mean? A priori you type to change the variable type to “int” and the ’ /S to /I’ at write time.
Or can we copy data with changes?
Yes? It should be just to set the input/original/read tree as before and the output tree with the new layout and the same addresses for the size (where you have to have 2 variable one short for input, one int for output).
Probably this wasn’t clear enough. I meant to ask you if you had access to the code that writes the data to disk, and if you could share that with us.
Judging by the last few comments, this has now become sort of necessary to fix your problem.
Also, some RDataFrame experts should confirm that it can deal with “16-bit unsigned integer” (UShort_t) variable length arrays (e.g., the “Channel0 : ch0[size]/s”). Otherwise, one would need to change them, too.