Activate PID during tracking with the '--with-pid' flag.
o2-trd-global-tracking --with-pid --policy ML
Specify a which algorithm (called policy) should be use. Implemented are the following:
- LQ1D
- LQ2D
- LQ3D
- ML (every model, which is exported to the ONNX format):
- XGB (XGBoost model)
- NN (Pytorch model)
- Dummy (returns only -1)
- Test (one of the above)
- Default (one of the above, gets picked if '--policy' is unspecified)
Every TRDTrack gets a PID value set (mSignal), which then gets propergated to the AO2D writer.
The base interface for PID is defined in here. The 'init' function is such that each policy can specify what if anything it needs from the CCDB. For the 'process' each policy defines how a TRDTrack gets assigned a PID value. Additionally, the base class implements how to get the corrected charges from the tracklets. Corrected charges means z-row merged and calibrated charges.
The classical LQND policies (here) require an array of lookup tables (LUTs) from the ccdb.
From the charge
where
Extension to higher dimensions is easy each tracklet has charges
The combined electron likelihood is then:
The ML policies (here) are uploaded to the CCDB in the ONNX file format (most python machine learning libraries support this standardized format). In O2 we leverage the ONNXRuntime to use these formats and calculate a PID value. The models can thus be trained in python which is very convenient. The code should take care of most of the annoying stuff. Policies just have to specify how to get the electron likelihood from the ONNXRuntime output (each python library varies in that somewhat). The 'prepareModelInput' prepares the TRDTracks as input.