Skip to content

Commit 3548361

Browse files
committed
Support custom streamers of TMaterial and TMixture
1 parent bafbf5a commit 3548361

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

scripts/JSRootIOEvolution.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,6 +2712,30 @@
27122712
}
27132713
}
27142714

2715+
cs['TMaterial'] = function(buf,obj) {
2716+
var v = buf.last_read_version;
2717+
buf.ClassStreamer(obj, "TNamed");
2718+
obj.fNumber = buf.ntoi4();
2719+
obj.fA = buf.ntof();
2720+
obj.fZ = buf.ntof();
2721+
obj.fDensity = buf.ntof();
2722+
if (v>2) {
2723+
buf.ClassStreamer(obj, "TAttFill");
2724+
obj.fRadLength = buf.ntof();
2725+
obj.fInterLength = buf.ntof();
2726+
} else {
2727+
obj.fRadLength = obj.fInterLength = 0;
2728+
}
2729+
}
2730+
2731+
cs['TMixture'] = function(buf,obj) {
2732+
buf.ClassStreamer(obj, "TMaterial");
2733+
obj.fNmixt = buf.ntoi4();
2734+
obj.fAmixt = buf.ReadFastArray(buf.ntoi4(), JSROOT.IO.kFloat);
2735+
obj.fZmixt = buf.ReadFastArray(buf.ntoi4(), JSROOT.IO.kFloat);
2736+
obj.fWmixt = buf.ReadFastArray(buf.ntoi4(), JSROOT.IO.kFloat);
2737+
}
2738+
27152739
// these are direct streamers - not follow version/checksum logic
27162740

27172741
var ds = JSROOT.IO.DirectStreamers;

0 commit comments

Comments
 (0)