Skip to content

Commit 3f4c625

Browse files
authored
fix few formatting issues (root-project#535)
1 parent ac0e7e0 commit 3f4c625

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

manual/math/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ The following table lists the methods of the {% include ref class="TMatrixDEigen
16431643
</tbody>
16441644
</table>
16451645

1646-
_**Example**_
1646+
_**Example**_
16471647

16481648
The usage of the eigenvalue class is shown in this example where it is checked that the square of the singular values of
16491649
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:
16851685
- Constructor by passing directly the elements. This is possible only for vectors up to size 10.
16861686
- 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
16871687

1688-
_**Example**_
1688+
_**Example**_
16891689
The namespace [ROOT::Math](https://root.cern/doc/master/namespaceROOT_1_1Math.html){:target="_blank"} is used.
16901690

16911691
{% highlight C++ %}
@@ -1713,7 +1713,7 @@ Use one of the following constructors to create a matrix:
17131713
- 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.
17141714
- 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.
17151715

1716-
_**Example**_
1716+
_**Example**_
17171717
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.
17181718

17191719
{% highlight C++ %}

manual/roofit/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ You can also construct along similar lines the profile likelihood, which is the
266266
{% endhighlight %}
267267

268268

269-
_**Example**
269+
_**Example**_
270270

271271
A toy PDF and a data set are constructed. A likelihood scan and a profile likelihood scan are compared in one of the parameters:
272272

manual/trees/index.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,23 @@ It creates a tree with the title `Example Tree`.
6060

6161
_**Example: A simple tree**_
6262

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
69+
[TTree::Branch()](https://root.cern/doc/master/classTTree.html#ab47499eeb7793160b20fa950f4de716a){:target="_blank"}
70+
method. The first parameter of the `Branch()` method is the branch name. The second
71+
parameter is the address from which the first leaf is to be read. In this example, it is
72+
the address of the structure staff. Once the branch is defined,
73+
the script reads the data from the ASCII file into the `staff_t`
74+
structure and fills the tree. The ASCII file is closed, and the ROOT file is written to
75+
disk saving the tree. Trees and histograms are created in the current directory, which is
76+
the ROOT file in our example. Hence an `f->Write()` saves the tree.
6777

6878
{% highlight C++ %}
69-
gROOT->Reset();
70-
79+
{
7180
// Create the structure to hold the variables for the branch.
7281
struct staff_t {
7382
Int_t cat;
@@ -94,19 +103,19 @@ the script reads the data from the ASCII file into the `staff_t` structure and f
94103
// Create a TTree.
95104
TTree *tree = new TTree("T","Staff data from ASCII file");
96105

97-
// Create one branch with all information from the stucture.
106+
// Create one branch with all information from the structure.
98107
tree->Branch("staff",&staff.cat,"cat/I:division:flag:age:service:
99108
children:grade:step:nation:hrweek:cost");
100109

101110
// Fill the tree from the values in ASCII file.
102111
while (fgets(&line,80,fp)) {
103-
sscanf(&line[0],"%d%d%d%d",&staff.cat,&staff.division,
104-
&staff.flag,&staff.age);
105-
sscanf(&line[13],"%d%d%d%d",&staff.service,&staff.children,
106-
&staff.grade,&staff.step);
107-
sscanf(&line[24],"%d%d%d",&staff.nation,&staff.hrweek,
108-
&staff.cost);
109-
tree->Fill();
112+
sscanf(&line[0],"%d%d%d%d",&staff.cat,&staff.division,
113+
&staff.flag,&staff.age);
114+
sscanf(&line[13],"%d%d%d%d",&staff.service,&staff.children,
115+
&staff.grade,&staff.step);
116+
sscanf(&line[24],"%d%d%d",&staff.nation,&staff.hrweek,
117+
&staff.cost);
118+
tree->Fill();
110119
}
111120

112121
// Check what the tree looks like.
@@ -299,28 +308,31 @@ The index is built in the following way:
299308
- `sel = 231` × _majorname_ + _minorname_
300309
- For each entry in the tree the `sel` expression is evaluated and the result array is sorted into `fIndexValues`.
301310

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
312+
[TTree::GetEntryWithIndex(majornumber, minornumber)](https://root.cern/doc/master/classTTree.html#a3f6b5bb591ff7a5bTTree::Draw()d0b06eea6c12b998){:target="_blank"}.
303313

304314
_**Example**_
305315

306316
{% highlight C++ %}
307317
// To create an index using the leaves "Run" and "Event".
308318
tree.BuildIndex("Run","Event");
309-
319+
310320
// To read entry corresponding to Run=1234 and Event=56789.
311321
tree.GetEntryWithIndex(1234,56789);
312322
{% endhighlight %}
313323

314324
Note that `majorname` and `minorname` can be expressions using original tree variables e.g., `"run-90000"` or `"event +3*xx"`.
315325

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
327+
[TTree::GetEntryWithIndex(majornumber, minornumber)](https://root.cern/doc/master/classTTree.html#a3f6b5bb591ff7a5bTTree::Draw()d0b06eea6c12b998){:target="_blank"}.
328+
To build an index with only `majorname`, specify `minorname="0"` (default).
317329

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()`.
319331

320332
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.
321333

322334
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+
324336
## Tree Viewer
325337

326338
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
554566
%}
555567

556568
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).
558572

559573
{% highlight C++ %}
560574
root [] myCanvas->cd(3)

0 commit comments

Comments
 (0)