Skip to content

Commit bfa31f5

Browse files
language editing for ldmx-sw analysis tutorial
1 parent 0fbe3b2 commit bfa31f5

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/analysis/ldmx-sw.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jupyter notebook. It can be run from outside of the ldmx-sw repository; however,
2525
this directly contradicts the first reason for writing an analysis like this
2626
in the first place. I would recommend that you store your analyzer source code
2727
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.
3029

3130
## Set Up
3231
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.
4645
```cpp
4746
{{#include analyzer-boilerplate.cxx}}
4847
```
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
5049
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.
5352
```python
5453
{{#include ana-cfg.py}}
5554
```
@@ -100,8 +99,10 @@ made within the function definitions.
10099
```
101100
102101
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.
105106
106107
```
107108
$ 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
117118
118119
```
119120
$ 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"
121122
$ 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 ""
123124
```
124125
125126
## Plotting Histograms
@@ -133,7 +134,7 @@ once I find the histogram I want to plot in order to pull the histogram into an
133134
familiar with. For example
134135
```python
135136
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()
137138
h.plot()
138139
```
139140
~~~

0 commit comments

Comments
 (0)