Skip to content

Commit e48d82c

Browse files
committed
Update docu vor v 5.0.0
1 parent 62ed3dc commit e48d82c

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

docs/HttpServer.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ To start the http server, at any time, create an instance of the [THttpServer](h
1414

1515
This will start a [civetweb](https://github.com/civetweb/civetweb)-based http server on the port 8080. Then one should be able to open the address "http://localhost:8080" in any modern browser (Firefox, Chrome, Opera, Safari, IE11) and browse objects created in application. By default, the server can access files, canvases, and histograms via the gROOT pointer. All those objects can be displayed with JSROOT graphics.
1616

17-
There is a [snapshot (frozen copy)](https://root.cern/js/latest/httpserver.C/) of such server, running in [tutorials/http/httpserver.C](https://github.com/root-mirror/root/blob/master/tutorials/http/httpserver.C) macro from ROOT tutorial.
18-
19-
<iframe width="800" height="500" src="https://root.cern/js/latest/httpserver.C/?layout=simple&item=Canvases/c1">
20-
</iframe>
17+
There is a [server snapshot](https://root.cern/js/latest/httpserver.C/?layout=simple&item=Canvases/c1) of running macro [tutorials/http/httpserver.C](https://github.com/root-mirror/root/blob/master/tutorials/http/httpserver.C) from ROOT tutorials.
2118

2219
One could specify several options when creating http server. They could be add as additional URL parameters to the constructor arguments like:
2320

@@ -422,6 +419,6 @@ To use `multi.json` request from the JavaScript, one should create special 'POST
422419
});
423420
xhr.send("Files/job1.root/hpx/root.json\nFiles/job1.root/hpxpy/root.json\nFiles/job1.root/hprof/root.json\n");
424421

425-
Here arguemnt "multi" identifies, that server response should be parsed with `JSROOT.parse_multi` function, which correctly interprets JSON code, produced by multi.json request. When sending such request to the server, one should provide list of objects names and not forget "?number=N" parameter in the request URL string.
422+
Here arguemnt "multi" identifies, that server response should be parsed with `JSROOT.parse_multi()` function, which correctly interprets JSON code, produced by `multi.json` request. When sending such request to the server, one should provide list of objects names and not forget "?number=N" parameter in the request URL string.
426423

427424

docs/JSROOT.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -175,57 +175,57 @@ While draw option can include "+" sign itself, for superposition one could speci
175175

176176
JSROOT provides possibility to display TTree data, using [TTree::Draw](https://root.cern/doc/master/classTTree.html) syntax:
177177

178-
- [opt=px](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple;1&opt=px)
179-
- [opt=px:py](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple;1&opt=px:py)
180-
- [opt=px:py:pz](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple;1&opt=px:py:pz)
178+
- [opt=px](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple;1&opt=px)
179+
- [opt=px:py](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple;1&opt=px:py)
180+
- [opt=px:py:pz](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple;1&opt=px:py:pz)
181181

182182
Histogram ranges and binning defined after reading first 1000 entries from the tree.
183183
Like in ROOT, one could configure histogram binning and range directly:
184184

185-
- [opt=px:py>>h(50,-5,5,50,-5,5)](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple&opt=px:py>>h%2850,-5,5,50,-5,5%29)
185+
- [opt=px:py>>h(50,-5,5,50,-5,5)](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple&opt=px:py>>h%2850,-5,5,50,-5,5%29)
186186

187187
For any integer value one can accumulate histogram with value bits distribution, specifying as output ">>bits(16)" or ">>bits":
188188

189-
- [opt=event.fTracks.fBits>>bits](http://jsroot.gsi.de/dev/?file=https://root.cern/files/Event100000.root&item=T;2&opt=event.fTracks.fBits>>bits)
189+
- [opt=event.fTracks.fBits>>bits](https://root.cern/js/latest/?file=https://root.cern/files/Event100000.root&item=T;2&opt=event.fTracks.fBits>>bits)
190190

191191
There is special handling of TBits objects:
192192

193-
- [opt=event.fTriggerBits](http://jsroot.gsi.de/dev/?file=https://root.cern/files/event/event_0.root&item=EventTree&opt=event.fTriggerBits)
193+
- [opt=event.fTriggerBits](https://root.cern/js/latest/?file=https://root.cern/files/event/event_0.root&item=EventTree&opt=event.fTriggerBits)
194194

195195
It is allowed to use different expressions with branch values:
196196

197-
- [opt=px+py:px-py](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple&opt=px+py:px-py)
197+
- [opt=px+py:px-py](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple&opt=px+py:px-py)
198198

199199
Such expression can include arithmetical operations and all methods, provided in JavaScript [Math](http://www.w3schools.com/jsref/jsref_obj_math.asp) class:
200200

201-
- [opt=Math.abs(px+py)](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple&opt=Math.abs%28px+py%29)
201+
- [opt=Math.abs(px+py)](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple&opt=Math.abs%28px+py%29)
202202

203203
In the expression one could use "Entry$" and "Entries$" variables.
204204

205205
One also could specify cut condition, separating it with "::" from the rest draw expression like:
206206

207-
- [opt=px:py::pz>5](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple&opt=px:py::pz>5)
207+
- [opt=px:py::pz>5](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple&opt=px:py::pz>5)
208208

209209
Contrary to the normal ROOT, JSROOT allows to use "(expr?res1:res2)" operator (placed into brackets):
210210

211-
- [opt=px:py::(pz>5?2:1)](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple&opt=px:py::%28pz>5?2:1%29)
211+
- [opt=px:py::(pz>5?2:1)](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple&opt=px:py::%28pz>5?2:1%29)
212212

213213
It is possible to "dump" content of any branch (by default - first 10 entries):
214214

215-
- [item=ntuple/px&opt=dump](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple/px&opt=dump)
215+
- [item=ntuple/px&opt=dump](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple/px&opt=dump)
216216

217217
Or one could dump values produced with draw expression (also first 10 entries by default):
218218

219-
- [opt=px:py::pz>>dump](http://jsroot.gsi.de/dev/?file=../files/hsimple.root&item=ntuple&opt=px:py::pz>>dump)
219+
- [opt=px:py::pz>>dump](https://root.cern/js/latest/?file=../files/hsimple.root&item=ntuple&opt=px:py::pz>>dump)
220220

221221
Working with array indexes is supported. By default, all elements in array are used for the drawing.
222222
One could specify index for any array dimension (-1 means last element in the array). For instance, dump last element from `event.fTracks` array:
223223

224-
- [opt=event.fTracks[-1].fBits>>dump](http://jsroot.gsi.de/dev/?file=https://root.cern/files/event/event_0.root&item=EventTree&opt=event.fTracks[-1].fBits>>dump)
224+
- [opt=event.fTracks[-1].fBits>>dump](https://root.cern/js/latest/?file=https://root.cern/files/event/event_0.root&item=EventTree&opt=event.fTracks[-1].fBits>>dump)
225225

226226
For any array or collection kind one could extract its size with expression:
227227

228-
- [opt=event.fTracks.@size](http://jsroot.gsi.de/dev/?file=https://root.cern/files/event/event_0.root&item=EventTree&opt=event.fTracks.@size;num:3000)
228+
- [opt=event.fTracks.@size](https://root.cern/js/latest/?file=https://root.cern/files/event/event_0.root&item=EventTree&opt=event.fTracks.@size;num:3000)
229229

230230
At the end of expression one can add several parameters with the syntax:
231231

@@ -240,7 +240,7 @@ Following parameters are supported:
240240
- "htype" - last letter in histogram type like "I", "F", "D", "S", "L", "C"
241241
- "drawopt" - drawing option for produced histogram
242242

243-
Example - [opt=event.fTracks[].fTriggerBits;entries:1000;first:200;maxrange:25](http://jsroot.gsi.de/dev/?file=https://root.cern/files/event/event_0.root&item=EventTree&opt=event.fTracks[].fTriggerBits;entries:1000;first:200;maxrange:25)
243+
Example - [opt=event.fTracks[].fTriggerBits;entries:1000;first:200;maxrange:25](https://root.cern/js/latest/?file=https://root.cern/files/event/event_0.root&item=EventTree&opt=event.fTracks[].fTriggerBits;entries:1000;first:200;maxrange:25)
244244

245245

246246
## Geometry viewer
@@ -318,7 +318,7 @@ Example of major LHC detectors:
318318

319319
Other detectors examples:
320320
* HADES: [full](https://root.cern/js/latest/?file=https://root.cern/files/hades2.root&item=CBMGeom;1&opt=all;dflt_colors), [preselected](https://root.cern/js/latest/?json=../files/geom/hades.json.gz)
321-
* BABAR: [full](https://root.cern/js/latest/?file=https://root.cern/files/babar.root&item=babar;1&opt=macro:https://root.cern/files/babar_all.C), [emca](https://root.cern/js/latest/?file=https://root.cern/files/babar.root&item=babar;1&opt=macro:http://jsroot.gsi.de/files/geom/babar_emca.C)
321+
* BABAR: [full](https://root.cern/js/latest/?file=https://root.cern/files/babar.root&item=babar;1&opt=macro:https://root.cern/files/babar_all.C), [emca](https://root.cern/js/latest/?file=https://root.cern/files/babar.root&item=babar;1&opt=macro:https://root.cern/files/babar_emca.C)
322322
* STAR: [full](https://root.cern/js/latest/?file=https://root.cern/files/star.root&item=star;1&opt=macro:https://root.cern/files/star_all.C;clipxyz), [svtt](https://root.cern/js/latest/?file=https://root.cern/files/star.root&item=star;1&opt=macro:https://root.cern/files/star_svtt.C)
323323
* D0: [full](https://root.cern/js/latest/?file=https://root.cern/files/d0.root&item=d0;1&opt=clipxyz)
324324
* NA47: [full](https://root.cern/js/latest/?file=https://root.cern/files/na47.root&item=na47;1&opt=dflt_colors)
@@ -382,7 +382,7 @@ Major limitation here - user should interactively select files for reading.
382382
There is button __"..."__ on the main JSROOT page, which starts file selection dialog.
383383
Or one could invoke such dialog with "localfile" parameter in URL string.
384384

385-
- <https://jsroot.gsi.de/dev/?localfile>
385+
- <https://root.cern/js/latest/?localfile>
386386

387387
If valid ROOT file is selected, JSROOT will be able to normally read content of such file.
388388

@@ -459,7 +459,7 @@ In this particular case, the histogram is not changing.
459459

460460
Even without any server-side application, JSROOT provides nice ROOT-like graphics,
461461
which could be used in arbitrary HTML pages.
462-
There is [example page](https://root.cern/js/latest/demo/example.htm),
462+
There is [example page](https://root.cern/js/latest/demo/th2.htm),
463463
where a 2-D histogram is artificially generated and displayed.
464464
Details about the JSROOT API can be found in the next chapters.
465465

@@ -491,6 +491,7 @@ In URL string with JSRootCore.js script one can specify which JSROOT functionali
491491
+ '3d' 3D drawing for 2D/3D histograms
492492
+ 'geo' 3D drawing of TGeo classes
493493
+ 'io' binary file I/O
494+
+ 'tree' TTree functionality
494495
+ 'math' advanced mathemathical functions
495496
+ 'mathjax' loads MathJax.js and use it for latex output
496497
+ 'gui' default gui for offline/online applications
@@ -582,7 +583,7 @@ For example, reading an object from a file and displaying it will look like:
582583

583584
Similar example with JSON file:
584585

585-
var filename = "http://jsroot.gsi.de/files/th2ul.json.gz";
586+
var filename = "https://root.cern/js/files/th2ul.json.gz";
586587
JSROOT.NewHttpRequest(filename, 'object', function(obj) {
587588
JSROOT.draw("drawing", obj, "lego");
588589
}).send(null);

0 commit comments

Comments
 (0)