otsdaq_utilities  v2_05_02_indev
JSRootIOEvolution.min.js
1 (function(a){if(typeof define==="function"&&define.amd){define(["JSRootCore","rawinflate"],a)}else{if(typeof JSROOT=="undefined"){throw new Error("This extension requires JSRootCore.js","JSRootIOEvolution.js")}if(typeof JSROOT.IO=="object"){throw new Error("This JSROOT IO already loaded","JSRootIOEvolution.js")}a(JSROOT)}}(function(a){a.IO={kBase:0,kOffsetL:20,kOffsetP:40,kCounter:6,kCharStar:7,kChar:1,kShort:2,kInt:3,kLong:4,kFloat:5,kDouble:8,kDouble32:9,kLegacyChar:10,kUChar:11,kUShort:12,kUInt:13,kULong:14,kBits:15,kLong64:16,kULong64:17,kBool:18,kFloat16:19,kObject:61,kAny:62,kObjectp:63,kObjectP:64,kTString:65,kTObject:66,kTNamed:67,kAnyp:68,kAnyP:69,kAnyPnoVT:70,kSTLp:71,kSkip:100,kSkipL:120,kSkipP:140,kConv:200,kConvL:220,kConvP:240,kSTL:300,kSTLstring:365,kStreamer:500,kStreamLoop:501,kMapOffset:2,kByteCountMask:1073741824,kNewClassTag:4294967295,kClassMask:2147483648,Z_DEFLATED:8,Z_HDRSIZE:9,Mode:"array",NativeArray:true};a.fUserStreamers=null;a.addUserStreamer=function(c,b){if(a.fUserStreamers==null){a.fUserStreamers={}}a.fUserStreamers[c]=b};a.R__unzip=function(k,i,e){var f=(typeof k!="string")&&("byteLength" in k),n=f?k.byteLength:k.length,o=0,d=0,j=null;function b(p){return f?String.fromCharCode(k.getUint8(p)):k.charAt(p)}function c(p){return f?k.getUint8(p):k.charCodeAt(p)}while(d<i){if(o+a.IO.Z_HDRSIZE>=n){if(!e){alert("Error R__unzip: header size exceeds buffer size")}return null}if(!((b(o)=="Z"&&b(o+1)=="L"&&c(o+2)==a.IO.Z_DEFLATED))){if(!e){alert("R__unzip: Old zlib format is not supported!")}return null}var m=a.IO.Z_HDRSIZE+((c(o+3)&255)|((c(o+4)&255)<<8)|((c(o+5)&255)<<16));if(f){var g=new Uint8Array(k.buffer,k.byteOffset+o+a.IO.Z_HDRSIZE+2,k.byteLength-o-a.IO.Z_HDRSIZE-2);if(j===null){j=new ArrayBuffer(i)}var l=window.RawInflate.arr_inflate(g,new Uint8Array(j,d));if(l<=0){break}d+=l}else{var h=window.RawInflate.inflate(k.substr(a.IO.Z_HDRSIZE+2+o,m));if((h===null)||(h.length===0)){break}if(j===null){j=h}else{j+=h}d+=h.length}o+=m}if(d!==i){if(!e){alert("R__unzip: fail to unzip data expacts "+i+" , got "+d)}return null}return f?new DataView(j):j};a.TBuffer=function(b,c){this._typename="TBuffer";this.o=(b==null)?0:b;this.fFile=c;this.ClearObjectMap();this.fTagOffset=0;this.last_read_version=0;return this};a.TBuffer.prototype.locate=function(b){this.o=b};a.TBuffer.prototype.shift=function(b){this.o+=b};a.TBuffer.prototype.GetMappedObject=function(b){return this.fObjectMap[b]};a.TBuffer.prototype.MapObject=function(b,c){if(c!==null){this.fObjectMap[b]=c}};a.TBuffer.prototype.MapClass=function(b,c){this.fClassMap[b]=c};a.TBuffer.prototype.GetMappedClass=function(b){if(b in this.fClassMap){return this.fClassMap[b]}return -1};a.TBuffer.prototype.ClearObjectMap=function(){this.fObjectMap={};this.fClassMap={};this.fObjectMap[0]=null};a.TBuffer.prototype.ReadVersion=function(){var b={};var c=this.ntou4();if(c&a.IO.kByteCountMask){b.bytecnt=c-a.IO.kByteCountMask-2}else{this.o-=4}this.last_read_version=b.val=this.ntou2();b.off=this.o;return b};a.TBuffer.prototype.CheckBytecount=function(b,c){if(("bytecnt" in b)&&(b.off+b.bytecnt!==this.o)){if(c!=null){alert("Missmatch in "+c+" bytecount expected = "+b.bytecnt+" got = "+(this.o-b.off))}this.o=b.off+b.bytecnt;return false}return true};a.TBuffer.prototype.ReadString=function(){var c=this.o,b=this.totalLength();while(this.o<b){if(this.codeAt(this.o++)==0){break}}return(this.o>c)?this.substring(c,this.o-1):""};a.TBuffer.prototype.ReadTString=function(){var b=this.ntou1();if(b==255){b=this.ntou4()}if(b==0){return""}var c=this.o;this.o+=b;return(this.codeAt(c)==0)?"":this.substring(c,c+b)};a.TBuffer.prototype.ReadFastArray=function(e,c){var d=null;switch(c){case a.IO.kDouble:d=a.IO.NativeArray?new Float64Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntod()}break;case a.IO.kFloat:case a.IO.kDouble32:d=a.IO.NativeArray?new Float32Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntof()}break;case a.IO.kLong:case a.IO.kLong64:d=a.IO.NativeArray?new Float64Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntoi8()}break;case a.IO.kULong:case a.IO.kULong64:d=a.IO.NativeArray?new Float64Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntou8()}break;case a.IO.kInt:d=a.IO.NativeArray?new Int32Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntoi4()}break;case a.IO.kUInt:d=a.IO.NativeArray?new Uint32Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntou4()}break;case a.IO.kShort:d=a.IO.NativeArray?new Int16Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntoi2()}break;case a.IO.kUShort:d=a.IO.NativeArray?new Uint16Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntou2()}break;case a.IO.kChar:d=a.IO.NativeArray?new Int8Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntoi1()}break;case a.IO.kUChar:d=a.IO.NativeArray?new Uint8Array(e):new Array(e);for(var b=0;b<e;++b){d[b]=this.ntoi1()}break;case a.IO.kTString:d=new Array(e);for(var b=0;b<e;++b){d[b]=this.ReadTString()}break;default:d=new Array(e);for(var b=0;b<e;++b){d[b]=this.ntou4()}break}return d};a.IO.GetArrayKind=function(b){if(b.length<7){return -1}if(b.indexOf("TArray")!=0){return -1}if(b.length==7){switch(b.charAt(6)){case"I":return a.IO.kInt;case"D":return a.IO.kDouble;case"F":return a.IO.kFloat;case"S":return a.IO.kShort;case"C":return a.IO.kChar;case"L":return a.IO.kLong;default:return -1}}return b=="TArrayL64"?a.IO.kLong64:-1};a.TBuffer.prototype.ReadTKey=function(c){c.fNbytes=this.ntoi4();c.fVersion=this.ntoi2();c.fObjlen=this.ntou4();var d=this.ntou4();c.fDatime=new Date();c.fDatime.setFullYear((d>>>26)+1995);c.fDatime.setMonth((d<<6)>>>28);c.fDatime.setDate((d<<10)>>>27);c.fDatime.setHours((d<<15)>>>27);c.fDatime.setMinutes((d<<20)>>>26);c.fDatime.setSeconds((d<<26)>>>26);c.fDatime.setMilliseconds(0);c.fKeylen=this.ntou2();c.fCycle=this.ntou2();if(c.fVersion>1000){c.fSeekKey=this.ntou8();this.shift(8)}else{c.fSeekKey=this.ntou4();this.shift(4)}c.fClassName=this.ReadTString();c.fName=this.ReadTString();c.fTitle=this.ReadTString();var b=c.fName.replace(/['"]/g,"");if(b!==c.fName){c.fRealName=c.fName;c.fName=b}return true};a.TBuffer.prototype.ReadTBasket=function(e){this.ReadTKey(e);var b=this.ReadVersion();e.fBufferSize=this.ntoi4();e.fNevBufSize=this.ntoi4();e.fNevBuf=this.ntoi4();e.fLast=this.ntoi4();var c=this.ntoi1();if((c%10)!=2){var d=this.ntoi4();this.shift(d*4);if(c>40){d=this.ntoi4();this.shift(d*4)}}if(c==1||c>10){var d=e.fLast;if(b.val<=1){d=this.ntoi4()}this.o+=d}return this.CheckBytecount(b,"ReadTBasket")};a.TBuffer.prototype.ReadClass=function(){var f={name:-1};var b=0;var e=this.ntou4();var d=this.o;if(!(e&a.IO.kByteCountMask)||(e==a.IO.kNewClassTag)){b=e;e=0}else{b=this.ntou4()}if(!(b&a.IO.kClassMask)){f.objtag=b;return f}if(b==a.IO.kNewClassTag){f.name=this.ReadString();if(this.GetMappedClass(this.fTagOffset+d+a.IO.kMapOffset)===-1){this.MapClass(this.fTagOffset+d+a.IO.kMapOffset,f.name)}}else{var c=(b&~a.IO.kClassMask);f.name=this.GetMappedClass(c);if(f.name===-1){alert("Did not found class with tag "+c)}}return f};a.TBuffer.prototype.ReadObjectAny=function(){var c=this.fTagOffset+this.o+a.IO.kMapOffset;var e=this.ReadClass();if("objtag" in e){return this.GetMappedObject(e.objtag)}if(e.name===-1){return null}var b=a.IO.GetArrayKind(e.name);var d={};if(b>0){d=this.ReadFastArray(this.ntou4(),b);this.MapObject(c,d)}else{this.MapObject(c,d);this.ClassStreamer(d,e.name)}return d};a.TBuffer.prototype.ClassStreamer=function(e,d){if(!("_typename" in e)){e._typename=d}var c=this.fFile.GetStreamer(d);if(c!==null){var b=this.ReadVersion();for(var f=0;f<c.length;++f){c[f].func(this,e)}this.CheckBytecount(b,d)}else{if(d=="TQObject"){}else{if(d=="TBasket"){this.ReadTBasket(e);a.addMethods(e)}else{var b=this.ReadVersion();this.CheckBytecount(b);a.addMethods(e)}}}return e};a.TStrBuffer=function(c,d,b){a.TBuffer.call(this,d,b);this.b=c};a.TStrBuffer.prototype=Object.create(a.TBuffer.prototype);a.TStrBuffer.prototype.totalLength=function(){return this.b?this.b.length:0};a.TStrBuffer.prototype.extract=function(c,b){return this.b.substr(c,b)};a.TStrBuffer.prototype.ntou1=function(){return(this.b.charCodeAt(this.o++)&255)>>>0};a.TStrBuffer.prototype.ntou2=function(){var b=((this.b.charCodeAt(this.o++)&255)<<8)>>>0;b+=(this.b.charCodeAt(this.o++)&255)>>>0;return b};a.TStrBuffer.prototype.ntou4=function(){var b=((this.b.charCodeAt(this.o++)&255)<<24)>>>0;b+=((this.b.charCodeAt(this.o++)&255)<<16)>>>0;b+=((this.b.charCodeAt(this.o++)&255)<<8)>>>0;b+=(this.b.charCodeAt(this.o++)&255)>>>0;return b};a.TStrBuffer.prototype.ntou8=function(){var b=((this.b.charCodeAt(this.o++)&255)<<56)>>>0;b+=((this.b.charCodeAt(this.o++)&255)<<48)>>>0;b+=((this.b.charCodeAt(this.o++)&255)<<40)>>>0;b+=((this.b.charCodeAt(this.o++)&255)<<32)>>>0;b+=((this.b.charCodeAt(this.o++)&255)<<24)>>>0;b+=((this.b.charCodeAt(this.o++)&255)<<16)>>>0;b+=((this.b.charCodeAt(this.o++)&255)<<8)>>>0;b+=(this.b.charCodeAt(this.o++)&255)>>>0;return b};a.TStrBuffer.prototype.ntoi1=function(){return(this.b.charCodeAt(this.o++)&255)};a.TStrBuffer.prototype.ntoi2=function(){var b=((this.b.charCodeAt(this.o++)&255)<<8);b+=((this.b.charCodeAt(this.o++)&255));return(b<32768)?b:-1-(~b&65535)};a.TStrBuffer.prototype.ntoi4=function(){var b=((this.b.charCodeAt(this.o++)&255)<<24);b+=((this.b.charCodeAt(this.o++)&255)<<16);b+=((this.b.charCodeAt(this.o++)&255)<<8);b+=((this.b.charCodeAt(this.o++)&255));return b};a.TStrBuffer.prototype.ntoi8=function(c,d){var e=(this.b.charCodeAt(this.o++)&255)<<56;e+=(this.b.charCodeAt(this.o++)&255)<<48;e+=(this.b.charCodeAt(this.o++)&255)<<40;e+=(this.b.charCodeAt(this.o++)&255)<<32;e+=(this.b.charCodeAt(this.o++)&255)<<24;e+=(this.b.charCodeAt(this.o++)&255)<<16;e+=(this.b.charCodeAt(this.o++)&255)<<8;e+=(this.b.charCodeAt(this.o++)&255);return e};a.TStrBuffer.prototype.ntof=function(){var c=this.b.substring(this.o,this.o+4);this.o+=4;if(c.length<4){return Number.NaN}var l="";for(var d=0;d<4;++d){var b=(c.charCodeAt(d)&255).toString(2);var e=b.length;if(e<8){for(var j=0;j<(8-e);++j){b="0"+b}}l=l+b}var h=(l.charAt(0)=="1")?-1:1;var k=parseInt(l.substring(1,9),2)-127;var f;if(k==-127){f=0}else{f=1;for(var d=0;d<23;++d){if(parseInt(l.substr(9+d,1))==1){f=f+1/Math.pow(2,d+1)}}}var g=h*Math.pow(2,k)*f;return(Math.abs(g)<1e-300)?0:g};a.TStrBuffer.prototype.ntod=function(){var c=this.b.substring(this.o,this.o+8);this.o+=8;if(c.length<8){return Number.NaN}var l="";for(var d=0;d<8;++d){var b=(c.charCodeAt(d)&255).toString(2);var e=b.length;if(e<8){for(var j=0;j<(8-e);++j){b="0"+b}}l=l+b}var h=(l.charAt(0)=="1")?-1:1;var k=parseInt(l.substring(1,12),2)-1023;var f;if(k==-127){f=0}else{f=1;for(var d=0;d<52;++d){if(parseInt(l.substr(12+d,1))==1){f=f+1/Math.pow(2,d+1)}}}var g=(h*Math.pow(2,k)*f);return(Math.abs(g)<1e-300)?0:g};a.TStrBuffer.prototype.codeAt=function(b){return this.b.charCodeAt(b)&255};a.TStrBuffer.prototype.substring=function(c,b){return this.b.substring(c,b)};a.TArrBuffer=function(b,d,c){a.TBuffer.call(this,d,c);this.arr=b};a.TArrBuffer.prototype=Object.create(a.TBuffer.prototype);a.TArrBuffer.prototype.totalLength=function(){return this.arr&&this.arr.buffer?this.arr.buffer.byteLength:0};a.TArrBuffer.prototype.extract=function(c,b){if(!this.arr||!this.arr.buffer||(this.arr.buffer.byteLength<c+b)){return null}return new DataView(this.arr.buffer,c,b)};a.TArrBuffer.prototype.codeAt=function(b){return this.arr.getUint8(b)};a.TArrBuffer.prototype.substring=function(c,b){var d="";for(var e=c;e<b;++e){d+=String.fromCharCode(this.arr.getUint8(e))}return d};a.TArrBuffer.prototype.ntou1=function(){return this.arr.getUint8(this.o++)};a.TArrBuffer.prototype.ntou2=function(){var b=this.o;this.o+=2;return this.arr.getUint16(b)};a.TArrBuffer.prototype.ntou4=function(){var b=this.o;this.o+=4;return this.arr.getUint32(b)};a.TArrBuffer.prototype.ntou8=function(){var c=this.arr.getUint32(this.o);this.o+=4;var b=this.arr.getUint32(this.o);this.o+=4;return c*4294967296+b};a.TArrBuffer.prototype.ntoi1=function(){return this.arr.getInt8(this.o++)};a.TArrBuffer.prototype.ntoi2=function(){var b=this.o;this.o+=2;return this.arr.getInt16(b)};a.TArrBuffer.prototype.ntoi4=function(){var b=this.o;this.o+=4;return this.arr.getInt32(b)};a.TArrBuffer.prototype.ntoi8=function(){var c=this.arr.getUint32(this.o);this.o+=4;var b=this.arr.getUint32(this.o);this.o+=4;if(c<2147483648){return c*4294967296+b}return -1-((~c)*4294967296+~b)};a.TArrBuffer.prototype.ntof=function(){var b=this.o;this.o+=4;return this.arr.getFloat32(b)};a.TArrBuffer.prototype.ntod=function(){var b=this.o;this.o+=8;return this.arr.getFloat64(b)};a.CreateTBuffer=function(b,d,c){if((b==null)||(typeof(b)=="string")){return new a.TStrBuffer(b,d,c)}return new a.TArrBuffer(b,d,c)};a.ReconstructObject=function(f,b,e){var d=new a.TFile;var c=a.CreateTBuffer(e,0,d);d.ExtractStreamerInfos(c);var g={};c=a.CreateTBuffer(b,0,d);c.MapObject(g,1);c.ClassStreamer(g,f);return g};a.TDirectory=function(c,d,b){if(!(this instanceof arguments.callee)){throw new Error("you must use new to instantiate this class","JSROOT.TDirectory.ctor")}this.fFile=c;this._typename="TDirectory";this.dir_name=d;this.dir_cycle=b;this.fKeys=new Array();return this};a.TDirectory.prototype.GetKey=function(g,c,e){for(var b=0;b<this.fKeys.length;++b){if(this.fKeys[b].fName==g&&this.fKeys[b].fCycle==c){a.CallBack(e,this.fKeys[b]);return this.fKeys[b]}}var j=g.lastIndexOf("/");while(j>0){var f=g.substr(0,j);var h=g.substr(j+1);var d=this.GetKey(f,1);if((d!==null)&&(typeof e=="function")&&(d.fClassName.indexOf("TDirectory")==0)){this.fFile.ReadObject(this.dir_name+"/"+f,1,function(i){if(i){i.GetKey(h,c,e)}});return null}j=g.lastIndexOf("/",j-1)}a.CallBack(e,null);return null};a.TDirectory.prototype.ReadKeys=function(b){var e=this;var d=this.fFile;var c=this.fNbytesName+22;c+=4;c+=4;c+=18;if(d.fVersion>=40000){c+=12}d.Seek(this.fSeekDir,this.fFile.ERelativeTo.kBeg);d.ReadBuffer(c,function(h){if(h==null){return a.CallBack(b,null)}var f=a.CreateTBuffer(h,e.fNbytesName,d);e.StreamHeader(f);f.locate(4);var g=f.ntoi2();if(g>1000){f.shift(28)}else{f.shift(20)}f.ReadTString();f.ReadTString();e.fTitle=f.ReadTString();if(e.fNbytesName<10||e.fNbytesName>10000){a.console("Cannot read directory info of file "+d.fURL);return a.CallBack(b,null)}if(e.fSeekKeys<=0){return a.CallBack(b,null)}d.Seek(e.fSeekKeys,d.ERelativeTo.kBeg);d.ReadBuffer(e.fNbytesKeys,function(n){if(n==null){return a.CallBack(b,null)}var j=a.CreateTBuffer(n,0,d);var l=d.ReadKey(j);var m=j.ntoi4();for(var k=0;k<m;++k){l=d.ReadKey(j);e.fKeys.push(l)}d.fDirectories.push(e);delete j;a.CallBack(b,e)});delete f})};a.TDirectory.prototype.StreamHeader=function(c){var b=c.ntou2();var d=b%1000;c.shift(8);this.fNbytesKeys=c.ntou4();this.fNbytesName=c.ntou4();this.fSeekDir=(b>1000)?c.ntou8():c.ntou4();this.fSeekParent=(b>1000)?c.ntou8():c.ntou4();this.fSeekKeys=(b>1000)?c.ntou8():c.ntou4();if(d>2){c.shift(18)}};a.TFile=function(c,b){if(!(this instanceof arguments.callee)){throw new Error("you must use new to instantiate this class","JSROOT.TFile.ctor")}this._typename="TFile";this.fOffset=0;this.fEND=0;this.fFullURL=c;this.fURL=c;this.fAcceptRanges=true;this.fUseStampPar=new Date;this.fFileContent=null;this.ERelativeTo={kBeg:0,kCur:1,kEnd:2};this.fDirectories=new Array();this.fKeys=new Array();this.fSeekInfo=0;this.fNbytesInfo=0;this.fTagOffset=0;this.fStreamers=0;this.fStreamerInfos=null;this.fFileName="";this.fStreamers=new Array;if(typeof this.fURL!="string"){return this}if(this.fURL.charAt(this.fURL.length-1)=="+"){this.fURL=this.fURL.substr(0,this.fURL.length-1);this.fAcceptRanges=false}var f=Math.max(this.fURL.lastIndexOf("/"),this.fURL.lastIndexOf("\\"));this.fFileName=f>=0?this.fURL.substr(f+1):this.fURL;if(!this.fAcceptRanges){this.ReadKeys(b)}else{var d=this;var e=a.NewHttpRequest(this.fURL,"head",function(h){if(h==null){return a.CallBack(b,null)}var i=h.getResponseHeader("Accept-Ranges");if(i==null){d.fAcceptRanges=false}var g=h.getResponseHeader("Content-Length");if(g!=null){d.fEND=parseInt(g)}else{d.fAcceptRanges=false}d.ReadKeys(b)});e.send(null)}return this};a.TFile.prototype.ReadBuffer=function(b,g){if((this.fFileContent!=null)&&(!this.fAcceptRanges||(this.fOffset+b<=this.fFileContent.totalLength()))){return g(this.fFileContent.extract(this.fOffset,b))}var d=this;var c=this.fURL;if(this.fUseStampPar){if(c.indexOf("?")>0){c+="&stamp="}else{c+="?stamp="}c+=this.fUseStampPar.getTime()}function e(h){if((h==null)&&d.fUseStampPar&&(d.fOffset==0)){d.fUseStampPar=false;var i=a.NewHttpRequest(this.fURL,((a.IO.Mode=="array")?"buf":"bin"),e);if(this.fAcceptRanges){i.setRequestHeader("Range","bytes="+this.fOffset+"-"+(this.fOffset+b-1))}i.send(null);return}else{if((h!=null)&&(d.fOffset==0)&&(d.fFileContent==null)){d.fFileContent=a.CreateTBuffer((typeof h=="string")?h:new DataView(h));if(!this.fAcceptRanges){d.fEND=d.fFileContent.totalLength()}return g(d.fFileContent.extract(d.fOffset,b))}}if((h==null)||(h===undefined)||(typeof h=="string")){return g(h)}g(new DataView(h))}var f=a.NewHttpRequest(c,((a.IO.Mode=="array")?"buf":"bin"),e);if(this.fAcceptRanges){f.setRequestHeader("Range","bytes="+this.fOffset+"-"+(this.fOffset+b-1))}f.send(null)};a.TFile.prototype.Seek=function(b,c){switch(c){case this.ERelativeTo.kBeg:this.fOffset=b;break;case this.ERelativeTo.kCur:this.fOffset+=b;break;case this.ERelativeTo.kEnd:if(this.fEND==0){throw new Error("Seek : seeking from end in file with fEND==0 is not supported")}this.fOffset=this.fEND-b;break;default:throw new Error("Seek : unknown seek option ("+c+")");break}};a.TFile.prototype.ReadKey=function(b){var c={};b.ReadTKey(c);return c};a.TFile.prototype.GetDir=function(e,d){if((d==null)&&(typeof e=="string")){var f=e.lastIndexOf(";");if(f>0){d=e.substr(f+1);e=e.substr(0,f)}}for(var c=0;c<this.fDirectories.length;++c){var b=this.fDirectories[c];if(b.dir_name!=e){continue}if((d!==undefined)&&(b.dir_cycle!==d)){continue}return b}return null};a.TFile.prototype.GetKey=function(f,d,b){for(var e=0;e<this.fKeys.length;++e){if(this.fKeys[e].fName===f&&this.fKeys[e].fCycle===d){a.CallBack(b,this.fKeys[e]);return this.fKeys[e]}}var j=f.lastIndexOf("/");while(j>0){var g=f.substr(0,j);var k=f.substr(j+1);var c=this.GetDir(g);if(c!=null){return c.GetKey(k,d,b)}var h=this.GetKey(g,1);if((h!==null)&&(b!=null)&&(h.fClassName.indexOf("TDirectory")==0)){this.ReadObject(g,function(i){if(i){i.GetKey(k,d,b)}});return null}j=f.lastIndexOf("/",j-1)}a.CallBack(b,null);return null};a.TFile.prototype.ReadObjBuffer=function(c,d){var b=this;this.Seek(c.fSeekKey+c.fKeylen,this.ERelativeTo.kBeg);this.ReadBuffer(c.fNbytes-c.fKeylen,function(g){if(g==null){d(null)}var e=null;if(c.fObjlen<=c.fNbytes-c.fKeylen){e=a.CreateTBuffer(g,0,b)}else{var f=a.R__unzip(g,c.fObjlen);if(f==null){return d(null)}e=a.CreateTBuffer(f,0,b)}e.fTagOffset=c.fKeylen;d(e)})};a.TFile.prototype.ReadObject=function(b,e,d){if(typeof e=="function"){d=e;e=1}var f=b.lastIndexOf(";");if(f>0){e=parseInt(b.slice(f+1));b=b.slice(0,f)}if((typeof e!="number")||(e<0)){e=1}while((b.length>0)&&(b[0]=="/")){b=b.substr(1)}var c=this;this.GetKey(b,e,function(i){if(i==null){return a.CallBack(d,null)}if((b=="StreamerInfo")&&(i.fClassName=="TList")){return c.fStreamerInfos}var g=false;if((i.fClassName=="TDirectory"||i.fClassName=="TDirectoryFile")){g=true;var h=c.GetDir(b,e);if(h!=null){return a.CallBack(d,h)}}c.ReadObjBuffer(i,function(k){if(!k){return a.CallBack(d,null)}if(g){var j=new a.TDirectory(c,b,e);j.StreamHeader(k);if(j.fSeekKeys){j.ReadKeys(d)}else{a.CallBack(d,j)}return}var l={};k.MapObject(1,l);k.ClassStreamer(l,i.fClassName);if(i.fClassName==="TF1"){return c.ReadFormulas(l,d,-1)}a.CallBack(d,l)})})};a.TFile.prototype.ReadFormulas=function(f,d,c){var e=c;while(++e<this.fKeys.length){if(this.fKeys[e].fClassName=="TFormula"){break}}if(e>=this.fKeys.length){return a.CallBack(d,f)}var b=this;this.ReadObject(this.fKeys[e].fName,this.fKeys[e].fCycle,function(g){f.addFormula(g);b.ReadFormulas(f,d,e)})};a.TFile.prototype.ExtractStreamerInfos=function(c){if(!c){return}var b={};c.MapObject(1,b);c.ClassStreamer(b,"TList");b._typename="TStreamerInfoList";this.fStreamerInfos=b;if(typeof a.addStreamerInfos==="function"){a.addStreamerInfos(b)}};a.TFile.prototype.ReadStreamerInfos=function(c){if(this.fSeekInfo==0||this.fNbytesInfo==0){return c(null)}this.Seek(this.fSeekInfo,this.ERelativeTo.kBeg);var b=this;b.ReadBuffer(b.fNbytesInfo,function(f){var d=a.CreateTBuffer(f,0,b);var e=b.ReadKey(d);if(e==null){return c(null)}b.fKeys.push(e);b.ReadObjBuffer(e,function(g){if(g==null){return c(null)}b.ExtractStreamerInfos(g);c(b)})})};a.TFile.prototype.ReadKeys=function(b){var c=this;this.ReadBuffer(1024,function(d){if(d==null){return a.CallBack(b,null)}var f=a.CreateTBuffer(d,0,c);if(f.substring(0,4)!=="root"){alert("NOT A ROOT FILE! "+c.fURL);return a.CallBack(b,null)}f.shift(4);c.fVersion=f.ntou4();c.fBEGIN=f.ntou4();if(c.fVersion<1000000){c.fEND=f.ntou4();c.fSeekFree=f.ntou4();c.fNbytesFree=f.ntou4();var g=f.ntoi4();c.fNbytesName=f.ntou4();c.fUnits=f.ntou1();c.fCompress=f.ntou4();c.fSeekInfo=f.ntou4();c.fNbytesInfo=f.ntou4()}else{c.fEND=f.ntou8();c.fSeekFree=f.ntou8();c.fNbytesFree=f.ntou4();var g=f.ntou4();c.fNbytesName=f.ntou4();c.fUnits=f.ntou1();c.fCompress=f.ntou4();c.fSeekInfo=f.ntou8();c.fNbytesInfo=f.ntou4()}if(!c.fSeekInfo&&!c.fNbytesInfo){return a.CallBack(b,null)}var e=c.fNbytesName+22;e+=4;e+=4;e+=18;if(c.fVersion>=40000){e+=12}c.Seek(c.fBEGIN,c.ERelativeTo.kBeg);c.ReadBuffer(Math.max(300,e),function(j){if(j==null){return a.CallBack(b,null)}var i=a.CreateTBuffer(j,c.fNbytesName,c);a.TDirectory.prototype.StreamHeader.call(c,i);i.o=4;var h=i.ntoi2();if(h>1000){i.shift(28)}else{i.shift(20)}i.ReadTString();i.ReadTString();c.fTitle=i.ReadTString();if(c.fNbytesName<10||this.fNbytesName>10000){a.console("Init : cannot read directory info of file "+c.fURL);return a.CallBack(b,null)}if(c.fSeekKeys<=0){a.console("Empty keys list - not supported"+c.fURL);return a.CallBack(b,null)}c.Seek(c.fSeekKeys,c.ERelativeTo.kBeg);c.ReadBuffer(c.fNbytesKeys,function(o){if(o==null){return a.CallBack(b,null)}var m=a.CreateTBuffer(o,0,c);var l=c.ReadKey(m);var n=m.ntoi4();for(var k=0;k<n;++k){l=c.ReadKey(m);c.fKeys.push(l)}c.ReadStreamerInfos(b);delete m});delete i});delete f})};a.TFile.prototype.ReadDirectory=function(d,c,b){return this.ReadObject(d,c,b)};a.TFile.prototype.AddMethods=function(d,e){if(e===null){return e}var b=a.getMethods(d);if(b!==null){for(var c in b){if((typeof b[c]==="function")||(c.indexOf("_")==0)){e.push({name:c,method:b[c],func:function(f,g){g[this.name]=this.method}})}}}return e};a.TFile.prototype.GetStreamer=function(b){var k=this.fStreamers[b];if(k!==undefined){return k}if(b=="TQObject"||b=="TBasket"){this.fStreamers[b]=null;return null}this.fStreamers[b]=k=new Array;if(b=="TObject"||b=="TMethodCall"){k.push({func:function(i,j){j.fUniqueID=i.ntou4();j.fBits=i.ntou4()}});return this.AddMethods(b,k)}if(b=="TNamed"){k.push({func:function(i,j){i.ReadVersion();j.fUniqueID=i.ntou4();j.fBits=i.ntou4();j.fName=i.ReadTString();j.fTitle=i.ReadTString()}});return this.AddMethods(b,k)}if((b=="TList")||(b=="THashList")){k.push({classname:b,func:function(j,n){n._typename=this.classname;n.name="";n.arr=new Array;n.opt=new Array;if(j.last_read_version>3){j.ClassStreamer(n,"TObject");n.name=j.ReadTString();var o=j.ntou4();for(var m=0;m<o;++m){n.arr.push(j.ReadObjectAny());n.opt.push(j.ReadTString())}}}});return this.AddMethods(b,k)}if(b=="TClonesArray"){k.push({func:function(m,p){p._typename="TClonesArray";p.name="";p.arr=new Array();var o=m.last_read_version;if(o>2){m.buf.ClassStreamer(p,"TObject")}if(o>1){p.name=m.ReadTString()}var t=m.ReadTString();var n=t;var r=0;var q=t.indexOf(";");if(q!=-1){n=t.slice(0,q);t=t.slice(q+1,t.length-q-1);r=parseInt(t)}var j=m.ntou4();if(j<0){j=-j}var i=m.ntou4()}});return this.AddMethods(b,k)}if(b=="TCanvas"){k.push({func:function(i,j){j._typename="TCanvas";i.ClassStreamer(j,"TPad");j.fDISPLAY=i.ReadTString();j.fDoubleBuffer=i.ntoi4();j.fRetained=(i.ntou1()!==0);j.fXsizeUser=i.ntoi4();j.fYsizeUser=i.ntoi4();j.fXsizeReal=i.ntoi4();j.fYsizeReal=i.ntoi4();j.fWindowTopX=i.ntoi4();j.fWindowTopY=i.ntoi4();j.fWindowWidth=i.ntoi4();j.fWindowHeight=i.ntoi4();j.fCw=i.ntou4();j.fCh=i.ntou4();j.fCatt=i.ClassStreamer({},"TAttCanvas");i.ntou1();i.ntou1();j.fHighLightColor=i.ntoi2();j.fBatch=(i.ntou1()!==0);i.ntou1();i.ntou1();i.ntou1()}});return this.AddMethods(b,k)}if(b=="TObjArray"){k.push({func:function(n,p){p._typename="TObjArray";p.name="";p.arr=new Array();var j=n.last_read_version;if(j>2){n.ClassStreamer(p,"TObject")}if(j>1){p.name=n.ReadTString()}var q=n.ntou4();var m=n.ntou4();for(var o=0;o<q;++o){p.arr.push(n.ReadObjectAny())}}});return this.AddMethods(b,k)}if(b=="TPolyMarker3D"){k.push({func:function(m,j){var i=m.last_read_version;m.ClassStreamer(j,"TObject");m.ClassStreamer(j,"TAttMarker");j.fN=m.ntoi4();j.fP=m.ReadFastArray(j.fN*3,a.IO.kFloat);j.fOption=m.ReadTString();if(i>1){j.fName=m.ReadTString()}else{j.fName="TPolyMarker3D"}}});return this.AddMethods(b,k)}if(b=="TStreamerInfo"){k.push({func:function(i,j){if(i.last_read_version>1){i.ClassStreamer(j,"TNamed");j.fCheckSum=i.ntou4();j.fClassVersion=i.ntou4();j.fElements=i.ReadObjectAny()}}});return this.AddMethods(b,k)}if(b=="TStreamerElement"){k.push({func:function(j,m){var i=j.last_read_version;j.ClassStreamer(m,"TNamed");m.fType=j.ntou4();m.fSize=j.ntou4();m.fArrayLength=j.ntou4();m.fArrayDim=j.ntou4();m.fMaxIndex=j.ReadFastArray((i==1)?j.ntou4():5,a.IO.kUInt);m.fTypeName=j.ReadTString();if((m.fType==a.IO.kUChar)&&(m.fTypeName=="Bool_t"||m.fTypeName=="bool")){m.fType=a.IO.kBool}if(i>1){}if(i<=2){}if(i==3){m.fXmin=j.ntod();m.fXmax=j.ntod();m.fFactor=j.ntod()}if(i>3){}}});return this.AddMethods(b,k)}if(b=="TStreamerBase"){k.push({func:function(j,m){var i=j.last_read_version;j.ClassStreamer(m,"TStreamerElement");if(i>2){m.fBaseVersion=j.ntou4()}}});return this.AddMethods(b,k)}if((b=="TStreamerBasicPointer")||(b=="TStreamerLoop")){k.push({func:function(i,j){if(i.last_read_version>1){i.ClassStreamer(j,"TStreamerElement");j.fCountVersion=i.ntou4();j.fCountName=i.ReadTString();j.fCountClass=i.ReadTString()}}});return this.AddMethods(b,k)}if(b=="TStreamerSTL"){k.push({func:function(i,j){if(i.last_read_version>1){i.ClassStreamer(j,"TStreamerElement");j.fSTLtype=i.ntou4();j.fCtype=i.ntou4()}}});return k}if(b=="TStreamerObject"||b=="TStreamerBasicType"||b=="TStreamerObjectAny"||b=="TStreamerString"||b=="TStreamerObjectPointer"){k.push({func:function(i,j){if(i.last_read_version>1){i.ClassStreamer(j,"TStreamerElement")}}});return this.AddMethods(b,k)}if(b=="TStreamerObjectAnyPointer"){k.push({func:function(i,j){if(i.last_read_version>0){i.ClassStreamer(j,"TStreamerElement")}}});return this.AddMethods(b,k)}var d=null;if(this.fStreamerInfos){for(var g=0;g<this.fStreamerInfos.arr.length;++g){if(this.fStreamerInfos.arr[g].fName==b){d=this.fStreamerInfos.arr[g];break}}}if(d==null){delete this.fStreamers[b];return null}if(d.fElements===null){return this.AddMethods(b,k)}for(var e=0;e<d.fElements.arr.length;++e){var h=d.fElements.arr[e];var f={name:h.fName,type:h.fType};if(h.fTypeName==="BASE"){if(a.IO.GetArrayKind(f.name)>0){f.name="fArray";f.type=a.IO.kAny}else{f.type=a.IO.kBase;this.GetStreamer(h.fName)}}switch(f.type){case a.IO.kBase:f.func=function(i,j){i.ClassStreamer(j,this.name)};break;case a.IO.kTString:f.func=function(i,j){j[this.name]=i.ReadTString()};break;case a.IO.kAnyP:case a.IO.kObjectP:f.func=function(i,j){j[this.name]=i.ReadObjectAny()};break;case a.IO.kOffsetL+a.IO.kInt:case a.IO.kOffsetL+a.IO.kDouble:case a.IO.kOffsetL+a.IO.kShort:case a.IO.kOffsetL+a.IO.kUShort:case a.IO.kOffsetL+a.IO.kUInt:case a.IO.kOffsetL+a.IO.kULong:case a.IO.kOffsetL+a.IO.kULong64:case a.IO.kOffsetL+a.IO.kLong:case a.IO.kOffsetL+a.IO.kLong64:case a.IO.kOffsetL+a.IO.kFloat:case a.IO.kOffsetL+a.IO.kDouble32:if(h.fArrayDim===1){f.arrlength=h.fArrayLength;f.func=function(i,j){j[this.name]=i.ReadFastArray(this.arrlength,this.type-a.IO.kOffsetL)}}else{if(h.fArrayDim===2){f.arrlength=h.fMaxIndex[1];f.maxindx=h.fMaxIndex[0];f.func=function(i,j){j[this.name]=[];for(var m=0;m<this.maxindx;++m){j[this.name].push(i.ReadFastArray(this.arrlength,this.type-a.IO.kOffsetL))}}}else{f.maxdim=h.fArrayDim-1;f.maxindx=h.fMaxIndex;f.arrlength=h.fArrayLength;f.func=function(n,r){var p=n.ReadFastArray(this.arrlength,this.type-a.IO.kOffsetL),q=[],j=[],o,m;for(o=0;o<=this.maxdim;++o){q[o]=0;j[o]=[]}for(o=0;o<p.length;++o){j[this.maxdim].push(p[o]);++q[this.maxdim];m=this.maxdim;while((q[m]===this.maxindx[m])&&(m>0)){q[m]=0;j[m-1].push(j[m]);j[m]=[];++q[--m]}}r[this.name]=j[0]}}}break;case a.IO.kOffsetP+a.IO.kInt:case a.IO.kOffsetP+a.IO.kDouble:case a.IO.kOffsetP+a.IO.kUChar:case a.IO.kOffsetP+a.IO.kChar:case a.IO.kOffsetP+a.IO.kShort:case a.IO.kOffsetP+a.IO.kUShort:case a.IO.kOffsetP+a.IO.kUInt:case a.IO.kOffsetP+a.IO.kULong:case a.IO.kOffsetP+a.IO.kULong64:case a.IO.kOffsetP+a.IO.kLong:case a.IO.kOffsetP+a.IO.kLong64:case a.IO.kOffsetP+a.IO.kFloat:case a.IO.kOffsetP+a.IO.kDouble32:f.cntname=h.fCountName;f.func=function(i,j){if(i.ntou1()===1){j[this.name]=i.ReadFastArray(j[this.cntname],this.type-a.IO.kOffsetP)}else{j[this.name]=new Array()}};break;case a.IO.kAny:case a.IO.kAnyp:case a.IO.kObjectp:case a.IO.kObject:var c=(h.fTypeName==="BASE")?h.fName:h.fTypeName;if(c.charAt(c.length-1)=="*"){c=c.substr(0,c.length-1)}var l=a.IO.GetArrayKind(c);if(l>0){f.arrkind=l;f.func=function(i,j){j[this.name]=i.ReadFastArray(i.ntou4(),this.arrkind)}}else{f.classname=c;f.func=function(i,j){j[this.name]=i.ClassStreamer({},this.classname)}}break;case a.IO.kOffsetL+a.IO.kObject:case a.IO.kOffsetL+a.IO.kAny:case a.IO.kOffsetL+a.IO.kAnyp:case a.IO.kOffsetL+a.IO.kObjectp:f.arrlength=h.fArrayLength;var c=h.fTypeName;if(c.charAt(c.length-1)=="*"){c=c.substr(0,c.length-1)}var l=a.IO.GetArrayKind(c);if(l>0){f.arrkind=l;f.func=function(j,m){m[this.name]=[];for(var i=0;i<this.arrlength;++i){m[this.name].push(j.ReadFastArray(j.ntou4(),this.arrkind))}}}else{f.classname=c;f.func=function(j,m){m[this.name]=[];for(var i=0;i<this.arrlength;++i){m[this.name].push(j.ClassStreamer({},this.classname))}}}break;case a.IO.kChar:f.func=function(i,j){j[this.name]=i.ntoi1()};break;case a.IO.kShort:f.func=function(i,j){j[this.name]=i.ntoi2()};break;case a.IO.kInt:case a.IO.kCounter:f.func=function(i,j){j[this.name]=i.ntoi4()};break;case a.IO.kLong:case a.IO.kLong64:f.func=function(i,j){j[this.name]=i.ntoi8()};break;case a.IO.kDouble:f.func=function(i,j){j[this.name]=i.ntod()};break;case a.IO.kFloat:case a.IO.kDouble32:f.func=function(i,j){j[this.name]=i.ntof()};break;case a.IO.kLegacyChar:case a.IO.kUChar:f.func=function(i,j){j[this.name]=i.ntou1()};break;case a.IO.kUShort:f.func=function(i,j){j[this.name]=i.ntou2()};break;case a.IO.kUInt:f.func=function(i,j){j[this.name]=i.ntou4()};break;case a.IO.kULong64:case a.IO.kULong:f.func=function(i,j){j[this.name]=i.ntou8()};break;case a.IO.kBool:f.func=function(i,j){j[this.name]=i.ntou1()!=0};break;case a.IO.kStreamLoop:case a.IO.kStreamer:f.cntname=h.fCountName;f.typename=h.fTypeName;f.func=function(j,q){var s=j.ReadVersion();var t=null;if(this.typename=="TString*"){var p=q[this.cntname];t=new Array(p);for(var r=0;r<p;++r){t[r]=j.ReadTString()}}else{if(this.typename=="vector<double>"){t=j.ReadFastArray(j.ntoi4(),a.IO.kDouble)}else{if(this.typename=="vector<int>"){t=j.ReadFastArray(j.ntoi4(),a.IO.kInt)}else{if(this.typename=="vector<float>"){t=j.ReadFastArray(j.ntoi4(),a.IO.kFloat)}else{if(this.typename=="vector<TObject*>"){var o=j.ntoi4();t=[];for(var r=0;r<o;++r){t.push(j.ReadObjectAny())}}else{if(this.typename.indexOf("map<TString,int")==0){var o=j.ntoi4();t=[];for(var r=0;r<o;++r){var u=j.ReadTString();var m=j.ntoi4();t.push({first:u,second:m})}}else{a.console("failed to stream element of type "+this.typename)}}}}}}if(!j.CheckBytecount(s,this.typename)){t=null}q[this.name]=t};break;default:if(a.fUserStreamers!==null){f.func=a.fUserStreamers[h.fTypeName]}if(typeof f.func!=="function"){alert("failed to provide function for "+h.fName+" ("+h.fTypeName+") typ = "+h.fType);f.func=function(i,j){}}}k.push(f)}return this.AddMethods(b,k)};a.TFile.prototype.Delete=function(){if(this.fDirectories){this.fDirectories.splice(0,this.fDirectories.length)}this.fDirectories=null;this.fKeys=null;this.fStreamers=null;this.fSeekInfo=0;this.fNbytesInfo=0;this.fTagOffset=0};(function(){var b=a.GetUrlOption("iomode");if((b=="str")||(b=="string")){a.IO.Mode="string"}else{if((b=="bin")||(b=="arr")||(b=="array")){a.IO.Mode="array"}}a.IO.NativeArray=("Float64Array" in window)})();return a}));