How dmesonanalysers/dmesonanalysis works
Project type and purpose
• DmesonAnalysis is an open‐source, physics data analysis pipeline (not a web app), built to process the outputs of AliPhysics ROOT‐based tasks and produce pₜ‐differential yields, cross sections, and systematic studies for various charm hadrons.
• It consists of C++ “analysis tasks” run inside the AliROOT/AliPhysics framework and Python orchestration scripts that drive filtering, ML model training/application, physics observables computation, systematics, and final comparisons/plots.
High‐level architecture and main components
A. Data Sources & Ingestion
• AliPhysics processing tasks (C++):
– AliAnalysisTaskSEDs, SEDplus, SENonPromptLc, SEDmesonTree → produce ROOT trees or sparse output.
• runanalysistask/ and run3/tool/ modules orchestrate task submission & pre‐processing.
B. Data Preparation & Filtering
• filterdata/ (Python/C++ filters + YAML configs) – skim trees and sparses.
• cutobjects/ (C++ cut definitions) & configfiles/cutsets – apply selection criteria.
C. ML Model Pipeline
• ML/ folder:
– Training: config_Training_*.yml → MLClassification.py → trained_models/*.pickle
– Application: MLApplication.py (applies BDT/XGBoost)
– Model conversion & validation: ConvertModel.py, CheckFeatureDistr…
D. Physics Observable Computation
• Compute* scripts at root:
– ComputeDataDrivenFraction, ComputeDataDrivenCrossSection, ComputeRawYields, ComputeEfficiency…
– charmhadronflow/, femto/, resonances/ – specialized subsystems for flow (v₂), femtoscopy, resonance analysis
E. Systematics & Uncertainties
• systematics/ (multiple subfolders for checks, fraction, rawyields, seleff, tracking, genptshape…)
• run3/flow/systematics for Run3‐specific systematics
F. Merging, Combining & Comparisons
• merge/ (MergeTrainOutputs.py + YAML)
• comparisons/ (CompareCrossSecToFONLL.py, CompareRaa.py, etc.)
G. Models & Theory Predictions
• models/ (FONLL, MC@, PHSD, TAMU… files and scripts)
H. Orchestration & Utilities
• RunFullAnalysis.sh – top‐level driver
• utils/ (common Python helpers)
• requirements.txt, .pylintrc
Relationships & data flow
• ROOT files → filterdata → selected trees/sparses.
• Selected data → ML training (if training run) → train models → stored in ML/trained_models.
• Selected data + trained models → ML application → produce ML‐tagged output.
• Tagged data → Compute* modules & resonances/femto/charmhadronflow → produce physics observables.
• Observables → systematics sub‐pipelines → generate uncertainty envelopes.
• Results → merge & comparisons → final plots, tables.
Key architectural patterns & principles
• Modular pipeline: each analysis step (filter, train, apply, compute, systematics, compare) is decoupled and configurable via YAML.
• Config‐driven: all selection cuts, training, systematics, merging are parameterized in configfiles/ and ML/*.yml.
• C++ for ROOT tasks, Python for orchestration and high‐level computation.
• Reuse of utilities (utils/) and standard ML package (hipe4ml, xgboost).
Detailed capture of essential elements
• Do not omit the systematics subfolders—they represent distinct computation nodes.
• That RunFullAnalysis.sh calls multiple stages in sequence or parallel.
• That merge/ and comparisons/ consume outputs from all Compute* and systematics modules.