Snapshot of a column made from RVec::size()

Hi,

The RVec::size() does not return an int? Why not?

rd.Define(“nfatjets”, “int(Sel_fatjetpt.size())”)

For drawing histograms nfatjets can be defined without the int() type cast,
but for taking Snapshot, if the cast is missing, ROOT will complain and won’t save the column.


_ROOT Version: root-master 6.15.01
Platform: Not Provided
Compiler: Not Provided


Hi Suyong,
size returns a std::size_t – it’s the same default as all of the standard library’s size. This is usually an alias to unsigned long long int. The reason it’s not int is to allow for collection sizes larger than the maximum integer value (I realize that this will pretty much never happen for collections read from a TTree…).

Now why does Snapshot complain if the cast to int is missing? This is an issue in TTree: it does not support branches of long or unsigned long type, so Snapshot can’t write that variable to a TTree.

@pcanal or @Axel might be able to further comment about this issue.

Cheers,
Enrico

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.