Skip to content

Commit bb7cdf6

Browse files
authored
Merge pull request #343 from rest-for-physics/jgalan_tree_documentation
TRestAnalysisTree. Reviewing documentation
2 parents 133f2b7 + b32d06e commit bb7cdf6

1 file changed

Lines changed: 36 additions & 23 deletions

File tree

source/framework/core/src/TRestAnalysisTree.cxx

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,49 @@
2222

2323
//////////////////////////////////////////////////////////////////////////
2424
///
25-
/// TRestAnalysisTree is TTree but with **managed objects** for the branches to fill.
26-
/// There are six fixed branches of event information in TRestAnalysisTree: runOrigin,
27-
/// subRunOrigin, eventID, subEventID, subEventTag and timeStamp. They are pointing
28-
/// to the corresponding class members inside TRestAnalysisTree. Those branches are
29-
/// called `event branches`. Additional branches could be added by the user, they will
30-
/// point to some objects whose addresses are also stored in this class. Those objects
31-
/// are called `observables`.
25+
/// TRestAnalysisTree is a TTree but with **custom objects** for the branches that will be
26+
/// filled. The user will decide in each event data processing chain which branches/observables/variables
27+
/// will be finally added to the analysis tree. Inside a TRestAnalysisTree we find always the following six
28+
/// branches containing event information: runOrigin, subRunOrigin, eventID, subEventID, subEventTag and
29+
/// timeStamp. Those branches point to the corresponding class members inside TRestAnalysisTree, we name those
30+
/// branches the `event branches`. Additional branches can be added by the user in a processing chain by any
31+
/// class inheriting by TRestEventProcess. Those process generated branches will also point to some
32+
/// objects whose addresses are also stored in this class. Those objects are called `observables`.
3233
///
33-
/// In traditional TTree case, the user defines multiple global variables, and add
34-
/// branches with the address of these variables to the tree. Then the user changes the
35-
/// value of those variables somewhere in the code, and calls `TTree::Fill()` to create
36-
/// and save a new entry in the data list.
34+
/// In the traditional `TTree` case, the user defines multiple global variables,
35+
/// and adds branches with the address of these variables to the tree. Then the
36+
/// user changes the value of those variables somewhere in the code, and calls
37+
/// `TTree::Fill()` to create and save a new entry inside the tree.
3738
///
38-
/// In TRestAnalysisTree, the concept of "Branch" is weakened. We can directly call
39-
/// `SetObservableValue()` and then `TRestAnalysisTree::Fill()` to do the data saving.
40-
/// The code could be simplified while sacrificing a little performance. We can use
41-
/// temporary variable to set observable value directly. We can focus on the analysis
42-
/// code inside the loop, without caring about varaible initialization before that.
39+
/// In TRestAnalysisTree, the concept of "Branch" is weakened. We update the
40+
/// variables by invoking the `SetObservableValue()` method and then
41+
/// TRestAnalysisTree::Fill() to generate a new entry inside the tree. As soon as
42+
/// TRestEventProcess::SetObservable method is invoked, a new branch will be
43+
/// generated inside this tree. The code inside REST processes will be simplified
44+
/// while sacrificing a little performance. We can use
45+
/// temporary variable to set observable value directly. We can the focus on the analysis
46+
/// code inside each process, without caring about variable initialization before that.
47+
///
48+
/// As soon as TRestEventProcess::SetObservable method is invoked, a new branch will be
49+
/// generated inside this tree.
4350
///
4451
/// The following is a summary of speed of filling 1000000 entries for TTree and
4552
/// TRestAnalysisTree. Four observables and six event branches are added. We take the
46-
/// average of 3 tests as the result. See the file pipeline/analysistree/testspeed.cpp
53+
/// average of 3 tests as the result. See the file `pipeline/analysistree/testspeed.cpp`.
4754
/// for more details.
4855
///
49-
/// Condition | time(us) |
50-
/// A. Do not use observable | 846,522 |
51-
/// B. Use quick observable (default) | 1,188,232 |
52-
/// C. Do not use quick observable | 2,014,646 |
53-
/// D. Use reflected observable | 8,425,772 |
54-
/// TTree | 841,744 |
56+
/// <center>
57+
///
58+
/// Condition | time(us)
59+
/// ----------------------------------- | -------------
60+
/// A. Do not use observable | 846,522
61+
/// B. Use quick observable (default) | 1,188,232
62+
/// C. Do not use quick observable | 2,014,646
63+
/// D. Use reflected observable | 8,425,772
64+
/// TTree | 841,744
65+
///
66+
/// </center>
67+
///
5568
///_______________________________________________________________________________
5669
///
5770
/// RESTsoft - Software for Rare Event Searches with TPCs

0 commit comments

Comments
 (0)