@@ -66,14 +66,20 @@ hitn, pid, tid, E, time, totEdep
6666The true-info output includes tracking columns like:
6767
6868``` text
69- processName, avgTime, avgx, avgy, avgz, hitn, pid, tid, totalEDeposited
69+ processName, avgTime, avgx, avgy, avgz, hitn, pid, tid, mtid, vx, vy, vz, mvx, mvy, mvz, totalEDeposited
7070```
7171
7272When the matching digitized CSV is available, the analyzer also adds ` E ` to
7373true-info tables by matching rows on event, detector, hit, PID, and track ID.
7474In that case ` E ` is the track total energy, while ` totalEDeposited ` remains
7575the deposited energy.
7676
77+ The ` vx ` , ` vy ` , and ` vz ` columns are the current track vertex coordinates.
78+ The ` mvx ` , ` mvy ` , and ` mvz ` columns are the mother-track vertex coordinates
79+ when the mother track was available to GEMC hit processing; otherwise they use
80+ the GEMC uninitialized numeric sentinel. The ` mtid ` column stores the mother
81+ track id.
82+
7783The ROOT streamer writes one ROOT file per worker thread. For one thread and
7884` filename: b2 ` , the file is typically:
7985
@@ -100,7 +106,7 @@ Read one digitized CSV file:
100106``` python
101107from analyzer import read_output
102108
103- output = read_output(" tmp/ b2_t0_digitized.csv" )
109+ output = read_output(" b2_t0_digitized.csv" )
104110df = output.get_frame(" digitized" )
105111print (df.columns)
106112```
@@ -110,7 +116,7 @@ Read a CSV root name when both files exist:
110116``` python
111117from analyzer import read_output
112118
113- output = read_output(" tmp/ b2_t0" , kind = " csv" )
119+ output = read_output(" b2_t0" , kind = " csv" )
114120print (output.summary())
115121```
116122
@@ -119,7 +125,7 @@ Plot `totEdep` grouped by `pid`:
119125``` python
120126from analyzer import plot_variable, read_output
121127
122- output = read_output(" tmp/ b2_t0_digitized.csv" )
128+ output = read_output(" b2_t0_digitized.csv" )
123129plot_variable(
124130 output,
125131 " totEdep" ,
@@ -135,7 +141,7 @@ Read ROOT output:
135141``` python
136142from analyzer import read_output
137143
138- output = read_output(" tmp/ b2_t0.root" , kind = " root" )
144+ output = read_output(" b2_t0.root" , kind = " root" )
139145df = output.get_frame(" digitized" , detector = " flux" )
140146```
141147
@@ -145,31 +151,37 @@ Run `python3 -m analyzer` from the GEMC source directory, where the `analyzer`
145151package directory is visible to Python.
146152
147153The ` -m ` flag takes a module name, not a filesystem path. Do not run
148- ` python3 -m ../analyzer ` . If your shell is inside ` tmp/ ` , either move back to
149- the source directory or set ` PYTHONPATH=.. ` .
154+ ` python3 -m ../analyzer ` . If your shell is in another directory, move back to
155+ the source directory or set ` PYTHONPATH ` .
150156
151157Print a summary:
152158
153159``` sh
154- python3 -m analyzer tmp/ b2_t0_digitized.csv
160+ python3 -m analyzer b2_t0_digitized.csv
155161```
156162
157163Plot a digitized variable with matplotlib:
158164
159165``` sh
160- python3 -m analyzer tmp/ b2_t0_digitized.csv totEdep --kind csv --xlim 0.0 0.1
166+ python3 -m analyzer b2_t0_digitized.csv totEdep --kind csv --xlim 0.0 0.1
161167```
162168
163169Save a plot instead of showing it:
164170
165171``` sh
166- python3 -m analyzer tmp/ b2_t0_digitized.csv totEdep --kind csv --save tmp/ b2_totEdep.png
172+ python3 -m analyzer b2_t0_digitized.csv totEdep --kind csv --save b2_totEdep.png
167173```
168174
169175Plot ROOT output with matplotlib:
170176
171177``` sh
172- python3 -m analyzer tmp/b2_t0.root totEdep --kind root --detector flux --save tmp/b2_totEdep.png
178+ python3 -m analyzer b2_t0.root totEdep --kind root --detector flux --save b2_totEdep.png
179+ ```
180+
181+ Plot a true-info track vertex coordinate:
182+
183+ ``` sh
184+ python3 -m analyzer b2_t0_true_info.csv vx --kind csv --data true_info --save b2_vertex_x.png
173185```
174186
175187## Dependency-Free SVG Plot
@@ -178,51 +190,47 @@ If `pandas`, `numpy`, or `matplotlib` are unavailable, create an SVG histogram
178190directly from the CSV file:
179191
180192``` sh
181- python3 -B analyzer/svg_plot.py tmp/ b2_t0_digitized.csv totEdep --out tmp/ b2_totEdep.svg --bins 30
193+ python3 -B analyzer/svg_plot.py b2_t0_digitized.csv totEdep --out b2_totEdep.svg --bins 30
182194```
183195
184196Add an x-axis range with:
185197
186198``` sh
187- python3 -B analyzer/svg_plot.py tmp/ b2_t0_digitized.csv totEdep --out tmp/ b2_totEdep.svg --bins 30 --xlim 0.0 0.1
199+ python3 -B analyzer/svg_plot.py b2_t0_digitized.csv totEdep --out b2_totEdep.svg --bins 30 --xlim 0.0 0.1
188200```
189201
190202## Run the B2 Example
191203
192- Run these commands from the GEMC source directory:
193-
194- ``` sh
195- mkdir -p tmp
196- ```
204+ Run these commands from the GEMC source directory.
197205
198206Build the B2 geometry into a local SQLite database:
199207
200208``` sh
201209PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=/opt/projects/gemc/src/api \
202- python3 examples/basic/b2/b2.py -f sqlite -sql tmp/ gemc.db
210+ python3 examples/basic/b2/b2.py -f sqlite -sql gemc.db
203211```
204212
205- Run GEMC with CSV output rooted at ` tmp/ b2` :
213+ Run GEMC with CSV output rooted at ` b2 ` :
206214
207215``` sh
208216build/gemc examples/basic/b2/b2.yaml \
209217 ' -gsystem=[{name: b2, factory: sqlite}]' \
210- ' -gstreamer=[{format: csv, filename: tmp/ b2}]' \
211- -sql=tmp/ gemc.db \
218+ ' -gstreamer=[{format: csv, filename: b2}]' \
219+ -sql=gemc.db \
212220 -n=20
213221```
214222
215223With one worker thread, this produces:
216224
217225``` text
218- tmp/ b2_t0_digitized.csv
219- tmp/ b2_t0_true_info.csv
226+ b2_t0_digitized.csv
227+ b2_t0_true_info.csv
220228```
221229
222230Inspect the digitized CSV header:
223231
224232``` sh
225- head -1 tmp/ b2_t0_digitized.csv
233+ head -1 b2_t0_digitized.csv
226234```
227235
228236Expected columns include:
@@ -234,31 +242,31 @@ evn, timestamp, thread_id, detector, hitn, pid, tid, E, time, totEdep
234242Create the ` totEdep ` plot with the main analyzer API:
235243
236244``` sh
237- python3 -m analyzer tmp/ b2_t0_digitized.csv totEdep --kind csv --save tmp/ b2_totEdep.png
245+ python3 -m analyzer b2_t0_digitized.csv totEdep --kind csv --save b2_totEdep.png
238246```
239247
240248Or create the same style of histogram without third-party Python packages:
241249
242250``` sh
243- python3 -B analyzer/svg_plot.py tmp/ b2_t0_digitized.csv totEdep --out tmp/ b2_totEdep.svg --bins 30
251+ python3 -B analyzer/svg_plot.py b2_t0_digitized.csv totEdep --out b2_totEdep.svg --bins 30
244252```
245253
246254### Run B2 With ROOT Output
247255
248- To produce ROOT output instead of CSV, keep the same ` tmp/ gemc.db` and run:
256+ To produce ROOT output instead of CSV, keep the same ` gemc.db ` and run:
249257
250258``` sh
251259build/gemc examples/basic/b2/b2.yaml \
252260 ' -gsystem=[{name: b2, factory: sqlite}]' \
253- ' -gstreamer=[{format: root, filename: tmp/ b2}]' \
254- -sql=tmp/ gemc.db \
261+ ' -gstreamer=[{format: root, filename: b2}]' \
262+ -sql=gemc.db \
255263 -n=20
256264```
257265
258266With one worker thread, this produces:
259267
260268``` text
261- tmp/ b2_t0.root
269+ b2_t0.root
262270```
263271
264272Read the ROOT file from Python if you want to inspect or manipulate the data
@@ -267,7 +275,7 @@ before plotting:
267275``` python
268276from analyzer import plot_variable, read_output
269277
270- output = read_output(" tmp/ b2_t0.root" , kind = " root" )
278+ output = read_output(" b2_t0.root" , kind = " root" )
271279print (output.summary())
272280
273281df = output.get_frame(" digitized" , detector = " flux" )
@@ -287,28 +295,14 @@ The Python inspection step is not required for plotting. To plot directly from
287295the command line, use:
288296
289297``` sh
290- python3 -m analyzer tmp/b2_t0.root totEdep --kind root --detector flux --save tmp/b2_root_totEdep.png
291- ```
292-
293- If your shell is inside ` tmp/ ` , do not use ` python3 -m ../analyzer ` . The ` -m `
294- flag accepts a module name, not a relative path. Use either:
295-
296- ``` sh
297- cd ..
298- python3 -m analyzer tmp/b2_t0.root totEdep --kind root --detector flux --save tmp/b2_root_totEdep.png
299- ```
300-
301- or:
302-
303- ``` sh
304- PYTHONPATH=.. python3 -m analyzer b2_t0.root totEdep --kind root --detector flux --save b2_root_totEdep.png
298+ python3 -m analyzer b2_t0.root totEdep --kind root --detector flux --save b2_root_totEdep.png
305299```
306300
307301If matplotlib reports that its default cache directory is not writable, set a
308302writable ` MPLCONFIGDIR ` :
309303
310304``` sh
311- PYTHONPATH=.. MPLCONFIGDIR=. python3 -m analyzer b2_t0.root totEdep --kind root --detector flux --save b2_root_totEdep.png
305+ MPLCONFIGDIR=. python3 -m analyzer b2_t0.root totEdep --kind root --detector flux --save b2_root_totEdep.png
312306```
313307
314308## Extending Readers
0 commit comments