@@ -25,8 +25,7 @@ jupyter notebook. It can be run from outside of the ldmx-sw repository; however,
25
25
this directly contradicts the first reason for writing an analysis like this
26
26
in the first place. I would recommend that you store your analyzer source code
27
27
in ldmx-sw or the private ldmx-analysis. These repos also contain CMake infrastructure
28
- so you can avoid having to write the long ` g++ ` command necessary to compile
29
- and link the source code.
28
+ so you can more easily share code common amongst many processors.
30
29
31
30
## Set Up
32
31
I am going to use the same version of ldmx-sw that was used to generate
@@ -46,10 +45,10 @@ a C++ analyzer running with ldmx-sw.
46
45
``` cpp
47
46
{{#include analyzer-boilerplate.cxx}}
48
47
```
49
- And below is an example python config call `ana-cfg.py` that I will
48
+ And below is an example python config called `ana-cfg.py` that I will
50
49
use to run this analyzer with `fire`. It assumes to be in the same
51
- place as the source file so that it knows where the library it needs
52
- to load is .
50
+ place as the source file so that it knows where the files it needs
51
+ are located .
53
52
```python
54
53
{{#include ana-cfg.py}}
55
54
```
@@ -100,8 +99,10 @@ made within the function definitions.
100
99
```
101
100
102
101
In order to run this code on the data, we need to compile and run the program.
103
- Again, putting your analyzer within ldmx-sw or ldmx-analysis gives you infrastructure that
104
- shortens how much you type during this compilation step.
102
+ The special `from_file` function within the config script handles this in
103
+ most situations for us.
104
+ Below, you'll see that the analyzer is re-compiled into the library while
105
+ `fire` is loading the configuration and then the analyzer is used during event processing.
105
106
106
107
```
107
108
$ denv fire ana-cfg.py
@@ -117,9 +118,9 @@ Now there is a new file `hist.root` in this directory which has the histogram we
117
118
118
119
```
119
120
$ denv rootls -l hist.root
120
- TDirectoryFile Apr 30 22:30 2024 my-ana "my-ana "
121
+ TDirectoryFile Apr 30 22:30 2024 MyAnalyzer "MyAnalyzer "
121
122
$ denv rootls -l hist.root:*
122
- TH1F Apr 30 22:30 2024 my-ana_total_ecal_rec_energy ""
123
+ TH1F Apr 30 22:30 2024 MyAnalyzer_total_ecal_rec_energy ""
123
124
```
124
125
125
126
## Plotting Histograms
@@ -133,7 +134,7 @@ once I find the histogram I want to plot in order to pull the histogram into an
133
134
familiar with. For example
134
135
```python
135
136
f = uproot.open('hist.root')
136
- h = f['my-ana/my-ana_total_ecal_rec_energy '].to_hist()
137
+ h = f['MyAnalyzer/MyAnalyzer_total_ecal_rec_energy '].to_hist()
137
138
h.plot()
138
139
```
139
140
~~~
0 commit comments