Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions modules/rntuple.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -757,14 +757,15 @@ async function readHeaderFooter(tuple) {

class ReaderItem {

constructor(column, name) {
constructor(column, name, preserveBigInt) {
this.column = null;
this.name = name;
this.id = -1;
this.coltype = 0;
this.sz = 0;
this.simple = true;
this.page = -1; // current page for the reading
this.preserveBigInt = preserveBigInt; // keep precision of bigint

if (column?.coltype !== undefined) {
this.column = column;
Expand Down Expand Up @@ -914,16 +915,16 @@ class ReaderItem {
case kInt64:
case kIndex64:
this.func = function(obj) {
// FIXME: let process BigInt in the TTree::Draw
obj[this.name] = Number(this.view.getBigInt64(this.o, LITTLE_ENDIAN));
const val = this.view.getBigInt64(this.o, LITTLE_ENDIAN);
obj[this.name] = this.preserveBigInt ? val : Number(val);
this.shift_o(8);
};
this.sz = 8;
break;
case kUInt64:
this.func = function(obj) {
// FIXME: let process BigInt in the TTree::Draw
obj[this.name] = Number(this.view.getBigUint64(this.o, LITTLE_ENDIAN));
const val = this.view.getBigUint64(this.o, LITTLE_ENDIAN);
obj[this.name] = this.preserveBigInt ? val : Number(val);
this.shift_o(8);
};
this.sz = 8;
Expand Down Expand Up @@ -1446,7 +1447,7 @@ async function rntupleProcess(rntuple, selector, args = {}) {
}

function addColumnReadout(column, tgtname) {
const item = new ReaderItem(column, tgtname);
const item = new ReaderItem(column, tgtname, args.preserveBigInt);
item.assignReadFunc();
handle.columns.push(item);
return item;
Expand Down
Loading