You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: manual/math/index.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1643,7 +1643,7 @@ The following table lists the methods of the {% include ref class="TMatrixDEigen
1643
1643
</tbody>
1644
1644
</table>
1645
1645
1646
-
_**Example**_
1646
+
_**Example**_
1647
1647
1648
1648
The usage of the eigenvalue class is shown in this example where it is checked that the square of the singular values of
1649
1649
a matrix `c` are identical to the eigenvalues of c<sup>T</sup>.c:
@@ -1685,7 +1685,7 @@ Use one of the following constructors to create a vector:
1685
1685
- Constructor by passing directly the elements. This is possible only for vectors up to size 10.
1686
1686
- Constructor from an iterator copying the data referred by the iterator. It is possible to specify the begin and end of the iterator or the begin and the size. Note that for
1687
1687
1688
-
_**Example**_
1688
+
_**Example**_
1689
1689
The namespace [ROOT::Math](https://root.cern/doc/master/namespaceROOT_1_1Math.html){:target="_blank"} is used.
1690
1690
1691
1691
{% highlight C++ %}
@@ -1713,7 +1713,7 @@ Use one of the following constructors to create a matrix:
1713
1713
- Constructor (and assignment) from a matrix expression, like `D=A*B+C`. Due to the expression template technique, no temporary objects are created in this operation. In the case of an operation like `A=A*B+C`, a temporary object is needed and it is created automatically to store the intermediary result in order to preserve the validity of this operation.
1714
1714
- Constructor from a generic STL-like iterator copying the data referred by the iterator, following its order. It is both possible, to specify the begin and end of the iterator or the begin and the size. In case of a symmetric matrix, it is required only the triangular block and the user can specify whether giving a block representing the lower (default case) or the upper diagonal part.
1715
1715
1716
-
_**Example**_
1716
+
_**Example**_
1717
1717
Typedef’s are used in this example to avoid the full C++ names for the matrix classes. For a general matrix, the representation has the default value [ROOT::Math::MatRepStd](https://root.cern/doc/master/classROOT_1_1Math_1_1MatRepStd.html){:target="_blank"}. For a general square matrix, the number of columns can be omitted.
Copy file name to clipboardExpand all lines: manual/trees/index.md
+34-20Lines changed: 34 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,14 +60,23 @@ It creates a tree with the title `Example Tree`.
60
60
61
61
_**Example: A simple tree**_
62
62
63
-
The following script builds a {% include ref class="TTree" %} from an ASCII file containing statistics about the staff at CERN. Both, `staff.C` and `staff.dat` are in available in `$ROOTSYS/tutorials/tree`.
64
-
65
-
The following script declares a structure called `staff_t`. It opens the ASCII file, creates a ROOT file and a `TTree`. Then it creates one branch with the [TTree::Branch()](https://root.cern/doc/master/classTTree.html#ab47499eeb7793160b20fa950f4de716a){:target="_blank"} method. The first parameter of the `Branch()` method is the branch name. The second parameter is the address from which the first leaf is to be read. In this example, it is the address of the structure staff. Once the branch is defined,
66
-
the script reads the data from the ASCII file into the `staff_t` structure and fills the tree. The ASCII file is closed, and the ROOT file is written to disk saving the tree. Trees and histograms are created in the current directory, which is the ROOTfile in our example. Hence an `f->Write()saves the tree.
63
+
The following script builds a {% include ref class="TTree" %} from an ASCII file containing
64
+
statistics about the staff at CERN. Both, `staff.C` and `staff.dat` are in available in
65
+
`$ROOTSYS/tutorials/tree`.
66
+
67
+
The following script declares a structure called `staff_t`. It opens the ASCII file, creates
68
+
a ROOT file and a `TTree`. Then it creates one branch with the
@@ -299,28 +308,31 @@ The index is built in the following way:
299
308
-`sel = 231` × _majorname_ + _minorname_
300
309
- For each entry in the tree the `sel` expression is evaluated and the result array is sorted into `fIndexValues`.
301
310
302
-
Once the index is calculated, an entry can be retrieved with [TTree::GetEntryWithIndex(majornumber, minornumber)](https://root.cern/doc/master/classTTree.html#a3f6b5bb591ff7a5bTTree::Draw()d0b06eea6c12b998)){:target="_blank"}.
311
+
Once the index is calculated, an entry can be retrieved with
// To create an index using the leaves "Run" and "Event".
308
318
tree.BuildIndex("Run","Event");
309
-
319
+
310
320
// To read entry corresponding to Run=1234 and Event=56789.
311
321
tree.GetEntryWithIndex(1234,56789);
312
322
{% endhighlight %}
313
323
314
324
Note that `majorname` and `minorname` can be expressions using original tree variables e.g., `"run-90000"` or `"event +3*xx"`.
315
325
316
-
In case an expression is specified, the equivalent expression must be computed when calling [TTree::GetEntryWithIndex(majornumber, minornumber)](https://root.cern/doc/master/classTTree.html#a3f6b5bb591ff7a5bTTree::Draw()d0b06eea6c12b998)){:target="_blank"}. To build an index with only `majorname`, specify `minorname="0"` (default).
326
+
In case an expression is specified, the equivalent expression must be computed when calling
To build an index with only `majorname`, specify `minorname="0"` (default).
317
329
318
-
Once the index is built, it can be saved with the `TTree` object with `tree.Write()`.
330
+
Once the index is built, it can be saved with the `TTree` object with `tree.Write()`.
319
331
320
332
The most convenient place to create the index is at the end of the filling process just before saving the tree header. If a previous index was calculated, it will be redefined by this new call.
321
333
322
334
Note that this function can also be applied to a {% include ref class="TChain" %}. The return value is the number of entries in the Index (< 0 indicates failure).
323
-
335
+
324
336
## Tree Viewer
325
337
326
338
With the Tree Viewer you can examine a tree in a GUI.
@@ -554,7 +566,9 @@ In general, this parameter is a string containing up to three expressions, one f
554
566
%}
555
567
556
568
Next, the third pad is activated and a selection is added. `Cost` versus `Age` for the entries where the nation is equal to `"CH"` is drawn.<br>
557
-
You can use any C++ operator. The value of the selection is used as a weight when filling the histogram. If the expression includes only Boolean operations the result is 0 (histogram is not filled) or 1 ((histogram is filled).
569
+
You can use any C++ operator. The value of the selection is used as a weight when filling
570
+
the histogram. If the expression includes only Boolean operations the result is 0
571
+
(histogram is not filled) or 1 (histogram is filled).
0 commit comments