Skip to content

Data Format ​

CSV files are written by eic2ai, a single-pass C++ converter that reads an eicrecon file (.edm4eic.root) and, when a role needs it, the paired npsim file (.edm4hep.root) once, and writes one CSV per role. The rows are identical to those of the older csv_convert/ ROOT macros (except the shared Λ decay codes and the added truth_* block of reco_dis); the column names follow one shared vocabulary (below).

eic2ai --list-columns prints the header of every role, eic2ai --list-writers the collections each role reads. CSV Schema shows every file and column, and which columns point into which file.

Files ​

<stem>.<role>.csv.zip     default: one deflate ZIP64 entry named <stem>.<role>.csv
<stem>.<role>.csv         --compress none
<stem>.<role>.csv.gz      --compress gz

<stem> is the reco file name without .eicrecon.edm4eic.root or .edm4eic.root (the sim file name without .edm4hep.root in sim-only runs), so k_lambda_18x275_5000evt_0022.edm4eic.root gives k_lambda_18x275_5000evt_0022.trk_hits.csv.zip. pandas reads the zip directly.

A role whose writer fails leaves no file; a file that exists is complete.

Column vocabulary ​

Every column is <prefix>_<quantity>, and evt (the entry counter of the input file) is the join key of every role.

PrefixObject
prtthe MC particle behind a hit, cluster or row
trk_hitreconstructed tracker hit
cal_hitdigitized calorimeter hit
clucalorimeter cluster
recreconstructed particle
simsimulation truth aggregated over a calorimeter cell

Units: GeV, GeV/c, mm, ns, rad, charge in e.

Signal or background: prt_origin ​

ValueMeaning
0unknown
1signal particle from the generator
2Geant4 secondary of a signal particle
3background particle from the generator
4Geant4 secondary of a background particle

The background merger adds a source-specific offset (a multiple of 1000, see Backgrounds) to the generator status of background particles before Geant4 runs. Generator particles are classified by prt_gen_status (1 or 2 signal, >= 1000 background); Geant4 secondaries (prt_gen_status = 0) take the class of their first generator ancestor up the parent chain.

Roles ​

Every column of every role, with its meaning and unit, is on the CSV Schema page. That page is generated from one list, which the eic2ai CI checks against the columns eic2ai writes.

RoleOne row perNeeds
trk_hitsreconstructed tracker hit, with its MC particlereco
cal_hitsdigitized calorimeter hit, truth-labeled from the sim cellreco + sim
calo_clusterscluster ↔ MC particle associationreco
mc_particlesMC particlereco
reco_particlesreconstructed particlereco
mc_disevent: generator DIS kinematicsreco
event_indexprocessed eventany
reco_disevent: reconstructed DIS kinematics by seven methods, with truthreco
mcpart_lambda, lambda_acceptance, reco_ff_lambda, reco_charged_lambda, acceptance_ppim, acceptance_npi0, combinatorics_ppim, comb_candidatesΛ analysis tablesreco or sim

The Λ and DIS roles serve the Meson Structure analyses; the CSV Schema page lists their columns.

trk_hits ​

One row per tracker hit association (raw hit → sim hit → MC particle), joined with the reconstructed hit. Hits from these association collections:

B0TrackerRawHitAssociations            OuterMPGDBarrelRawHitAssociations
BackwardMPGDEndcapRawHitAssociations   RICHEndcapNRawHitsAssociations
ForwardMPGDEndcapRawHitAssociations    SiBarrelRawHitAssociations
ForwardOffMTrackerRawHitAssociations   SiBarrelVertexRawHitAssociations
ForwardRomanPotRawHitAssociations      SiEndcapTrackerRawHitAssociations
MPGDBarrelRawHitAssociations           TOFBarrelRawHitAssociations
TOFEndcapRawHitAssociations

Columns: CSV Schema → trk_hits.

cal_hits ​

One row per digitized calorimeter hit. The reco file has no calorimeter hit ↔ particle association, so each hit is matched by (evt, cellID) to the sim hit of the same cell in the paired .edm4hep.root file. A cell with several contributing particles gets the prt_origin of the energy-majority class, label_purity = that class's energy fraction, and the prt_* block of the largest contributor of that class. A hit whose cell has no sim hit keeps its features with prt_origin = 0 and zeros in the prt_* block.

Calorimeters: EcalBarrelScFiRecHits, EcalBarrelImagingRecHits, EcalEndcapNRecHits, EcalEndcapPRecHits, HcalBarrelRecHits, HcalEndcapNRecHits, HcalEndcapPInsertRecHits, LFHCALRecHits, B0ECalRecHits, EcalFarForwardZDCRecHits, HcalFarForwardZDCRecHits.

The cal_hit_* columns are the detector-level features; sim_*, n_contrib, label_purity and prt_* are truth. Columns: CSV Schema → cal_hits.

calo_clusters ​

One row per cluster ↔ MC particle association, from a fixed list of 27 *ClusterAssociations collections (regular, truth and split-merge clusters of the ECAL, HCAL, B0, ZDC and luminosity calorimeters); collections absent from a file are skipped. Columns: CSV Schema → calo_clusters.

mc_particles ​

One row per particle of MCParticles. prt_index here is the same index as prt_index in trk_hits and calo_clusters (both read the reco file's MCParticles), so (evt, prt_index) joins a hit or cluster to its full particle record. Columns: CSV Schema → mc_particles.

reco_particles ​

One row per ReconstructedParticles entry, with the sizes of its relations (clusters, tracks, daughters, PID hypotheses, and the hits behind them). Columns: CSV Schema → reco_particles.

mc_dis ​

One row per event with the generator's DIS kinematics, read from the event parameters dis_<name> that the generator writes; the columns keep the generator's names. A missing parameter leaves an empty field. Columns: CSV Schema → mc_dis.

event_index ​

One row per processed event: evt, event_number (from EventHeader), reco_collections, sim_collections (collections in each frame, 0 without that file). Its row count is the event count of a complete conversion.

Loading the CSV ​

python
import pandas as pd

hits = pd.read_csv("k_lambda_18x275_5000evt_0022.trk_hits.csv.zip")

event_0 = hits[hits["evt"] == 0]
primaries = hits[hits["prt_gen_status"] == 1]

signal = hits[hits["prt_origin"].isin([1, 2])]
background = hits[hits["prt_origin"].isin([3, 4])]

hits_per_system = hits.groupby("trk_hit_system_name").size()

# Full particle record of each hit
particles = pd.read_csv("k_lambda_18x275_5000evt_0022.mc_particles.csv.zip")
hits = hits.merge(particles[["evt", "prt_index", "prt_sim_status", "prt_parent_index"]],
                  on=["evt", "prt_index"])

Files written by the macros before the column unification use older names (prt_status, rec_collection, event, …). eic2ai/column_renames.py holds the old → new table per role; rename_dataframe(df, role) renames a loaded file.

Released under the MIT License.