Repository to study particle identification (PID) using ACT charge distributions and tank data from WCTE readout windows.
This repository is targeted at ACT PID taskforce members (Bruno, Marie, Viet, Alie) and provides a lightweight analysis prototype for:
- selecting muons/pions/electrons from WCTE merged ROOT files,
- comparing ACT and tank-based taggers,
- estimating efficiency/purity from ACT charge histograms,
- producing PDF summaries per run.
python/ACT_PID_analysis.py: driver script for one run; reads a ROOT file, instantiatesACTAnalysis, and prints run info.python/ACT_PID_module.py: coreACTAnalysisclass; data loading + analysis method stubs + example high-momentum algorithm.output/: expected output location for per-run PDF plots (e.g.ACT_PID_run_<run>.pdf).
- Python 3.8+
- numpy
- pandas
- matplotlib
- uproot
Install with:
pip install numpy pandas matplotlib uproot(should not be needed on the CERN clusters)
- Set
run_numberinpython/ACT_PID_analysis.py. - Confirm the ROOT path is valid (example path in the script):
/eos/experiment/wcte/data/2025_commissioning/processed_offline_data/production_v1_0/<run>/WCTE_merged_production_R<run>.root - Create output directory if needed:
mkdir -p output- Run:
python3 python/ACT_PID_analysis.py- Expected output:
- printed run info on console
- currently placeholder for plots and save to
output/ACT_PID_run_<run>.pdffromACTAnalysis.load_data().
ACTAnalysis class:
__init__(self, input_files): store input file names, init data structures, callload_data().load_data(self): for each input ROOT file:- read
WCTEReadoutWindowstree with branches (temporary):vme_evt_quality_bitmaskvme_digi_issues_bitmaskvme_act_taggervme_act_evetovme_mu_tag_l_charge
- read
vme_analysis_run_infotree into run metadata holding information about the run, the momentum and refractive index of the ACTs - open a
PdfPagesfile../output/ACT_PID_run_<run_number>.pdfper run
- read
get_run_info(self, run_number): return run metadata DataFrame matching run number.
Placeholder methods to implement:
apply_ring_finding_algorithm()select_muon_sample_tank()plot_act35_charge()read_cut_lines()apply_cuts()plot_non_electron_non_proton_distribution()scale_and_plot_distributions()calculate_efficiency_purity()produce_likelihood_distributions()
high_momentum_analysis_example(self) implements an end-to-end histogram-based extraction of muon/pion components and efficiency/purity curves using ACT35 charge and muon tagger cuts. This is very dirty copy-paste from Alie's high momentum analysis, will have to be re-written cleanly.
- sets
run_numberandfile_namefor one run - builds
ACTAnalysis(input_files=[file_name]) - prints run metadata
- currently has comments describing desired analysis pipeline steps (ring finding, 2D cuts, ACT02/ACT35 + TOF cuts, distribution scaling, likelihood calculation, comparisons)
- identifies the different particles based on the shape of the charge deposited inside the tank
- runs over the full dataset
- Applies a 6 ns time cut on all events (cleaner sample)
- Add ring finding code into
apply_ring_finding_algorithm()using tank charge data. - Implement muon selection in
select_muon_sample_tank()(2D tank inside/outside cut). - Implement ACT35 charge plotting and distribution extraction.
- Load ACT02 / proton TOF cuts in
read_cut_lines()using VME beam analysis lines. - Apply filtering cuts in
apply_cuts(). - Compute separate distributions and scale in
scale_and_plot_distributions(). - Calculate efficiency/purity and likelihoods in
calculate_efficiency_purity()andproduce_likelihood_distributions(). - Save all figures through
PdfPagesobjects inself.pdfs.
- Keep
outputrelative path consistent with module code (../output). Running script fromACT_PID/pythonmay createACT_PID/outputvia relative path. - The code is currently a skeleton with key algorithm in
high_momentum_analysis_exampleand should be refactored into modular methods. - Add unit tests or analysis notebooks as needed for reproducibility.