Skip to content

Commit 64697f8

Browse files
committed
Output ROOT file
1 parent 77661e6 commit 64697f8

2 files changed

Lines changed: 257 additions & 178 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# edm4hep_mcpart_lambda
2+
3+
MC truth Lambda decay analysis directly from EDM4HEP/EDM4EIC files.
4+
Produces a ROOT file with histograms and a flat `TTree`, plus PNG images of every histogram — no CSV step required.
5+
6+
This is the ROOT-native counterpart of [`csv_convert/csv_mcpart_lambda.cxx`](../../csv_convert/csv_mcpart_lambda.cxx) + [`analysis/csv_mcpart_lambda/lambda_decay.py`](../csv_mcpart_lambda/lambda_decay.py).
7+
8+
## Output
9+
10+
All output goes into a single directory:
11+
12+
```
13+
<output_dir>/
14+
mcpart_lambda.root # TTree (lambda_decays) + all histograms
15+
h_lam_p.png
16+
h_lam_pt.png
17+
h_lam_decay_rz.png
18+
... # ~30 PNGs total
19+
```
20+
21+
### TTree columns
22+
23+
Same schema as `*.mcpart_lambda.csv`. One row per Lambda found in MCParticles.
24+
Columns: `event`, `lam_is_first`, `lam_decay`, then 15 fields per particle with prefixes
25+
`lam`, `prot`, `pimin`, `neut`, `pizero`, `gamone`, `gamtwo`
26+
(fields: `_id _pdg _gen _sim _px _py _pz _vx _vy _vz _epx _epy _epz _time _nd`).
27+
28+
`lam_decay` values: `0` = no decay, `1` = p+π⁻, `2` = n+π⁰, `3` = shower/recharge, `4` = other.
29+
30+
### Histograms
31+
32+
| Group | Histograms |
33+
|---|---|
34+
| Λ kinematics | \|p\|, pT, pz, η, φ, mass |
35+
| Λ decay | decay type, N daughters |
36+
| Λ decay vertex | z, r, r-vs-z (2D), x-vs-y (2D) |
37+
| Λ correlations (2D) | \|p\| vs η, pT vs η, pz vs pT |
38+
| Proton (p+π⁻) | \|p\|, pT, η |
39+
| π⁻ (p+π⁻) | \|p\|, pT, η |
40+
| Neutron (n+π⁰) | \|p\|, pT, η |
41+
| π⁰ (n+π⁰) | \|p\|, pT |
42+
| γ from π⁰ | energy, η |
43+
| p+π⁻ derived | opening angle, invariant mass (peaks at Λ mass) |
44+
| Λ generator status | status code distribution |
45+
46+
## Usage
47+
48+
### ROOT macro (no compilation needed)
49+
50+
```bash
51+
# single file
52+
root -x -l -b -q 'mcpart_lambda.cxx("input.edm4hep.root","output_dir")'
53+
54+
# multiple files, comma-separated, limit to 5000 events
55+
root -x -l -b -q 'mcpart_lambda.cxx("f1.root,f2.root","output_dir",5000)'
56+
```
57+
58+
### Compiled
59+
60+
```bash
61+
mkdir build && cd build
62+
cmake .. && make
63+
./mcpart_lambda -o output_dir input1.root input2.root
64+
./mcpart_lambda -n 5000 -o output_dir input1.root
65+
```
66+
67+
### Dependencies
68+
69+
`ROOT`, `podio`, `EDM4HEP`, `EDM4EIC`, `fmt` — all available in `eicweb/eic_xl:nightly`.

0 commit comments

Comments
 (0)