|
22 | 22 |
|
23 | 23 | ////////////////////////////////////////////////////////////////////////// |
24 | 24 | /// |
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`. |
32 | 33 | /// |
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. |
37 | 38 | /// |
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. |
43 | 50 | /// |
44 | 51 | /// The following is a summary of speed of filling 1000000 entries for TTree and |
45 | 52 | /// 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`. |
47 | 54 | /// for more details. |
48 | 55 | /// |
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 | +/// |
55 | 68 | ///_______________________________________________________________________________ |
56 | 69 | /// |
57 | 70 | /// RESTsoft - Software for Rare Event Searches with TPCs |
|
0 commit comments