Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions docs/analysis-tools/PID.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,30 +53,28 @@
Tables for PID values in O2 are defined in the following header files:

| Detector | Header File | Usage | Description |
| -------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------- |
|----------|---------------------------------------------------------------------------------------------------------------|------------------------------------------------|---------------------|
| ITS | [`PIDResponseITS.h`](https://github.com/AliceO2Group/O2Physics/blob/master/Common/DataModel/PIDResponseITS.h) | `#include "Common/DataModel/PIDResponseITS.h"` | ITS PID information |
| TPC | [`PIDResponseTPC.h`](https://github.com/AliceO2Group/O2Physics/blob/master/Common/DataModel/PIDResponseTPC.h) | `#include "Common/DataModel/PIDResponseTPC.h"` | TPC PID information |
| TOF | [`PIDResponseTOF.h`](https://github.com/AliceO2Group/O2Physics/blob/master/Common/DataModel/PIDResponseTOF.h) | `#include "Common/DataModel/PIDResponseTOF.h"` | TOF PID information |


## Available PID Information

The following table shows the available PID methods for each detector and particle species:

| Information Type | Description | TOF Methods | TPC Methods | ITS Methods |
| ----------------------- | ---------------------------------------- | ---------------------- | ---------------------- | -------------------------- |
|-------------------------|------------------------------------------|------------------------|------------------------|----------------------------|
| **nSigma** | Nsigma separation value | `tofNSigmaXX()` | `tpcNSigmaXX()` | `itsNSigmaXX()` |
| **Expected Signal** | Expected detector signal | `tofExpSignalXX()` | `tpcExpSignalXX()` | `expSignal<PID::XX>()` |
| **Expected Resolution** | Expected detector resolution | `tofExpSigmaXX()` | `tpcExpSigmaXX()` | `expResolution<PID::XX>()` |
| **Signal Difference** | Difference between measured and expected | `tofExpSignalDiffXX()` | `tpcExpSignalDiffXX()` | - |


## Supported Particle Species

The following nine (9) stable particle species are supported for PID calculations:

| Symbol | Particle | Mass Hypothesis |
| ------ | -------- | --------------- |
|--------|----------|-----------------|
| `El` | Electron | e⁻ |
| `Mu` | Muon | μ⁻ |
| `Pi` | Pion | π± |
Expand All @@ -92,7 +90,7 @@
The TOF detector provides additional specialized information beyond the standard PID methods:

| Information Type | Description | TOF Methods | Notes |
| -------------------- | -------------------------------------- | --------------------- | ----------------------------------------- |
|----------------------|----------------------------------------|-----------------------|-------------------------------------------|
| **Beta** | Velocity as fraction of speed of light | `beta()`, `tofBeta()` | β = v/c, fundamental for mass calculation |
| **Beta Error** | Uncertainty on beta measurement | `betaerror()` | Statistical uncertainty on β |
| **TOF Mass** | Reconstructed particle mass | `mass()`, `tofMass()` | Calculated from momentum and β |
Expand Down Expand Up @@ -134,10 +132,10 @@
void process(soa::Join<aod::Tracks, aod::pidTOFEl, aod::pidTPCEl>::iterator const& track) {
float tofNSigmaEl = track.tofNSigmaEl();
float tpcNSigmaEl = track.tpcNSigmaEl();

Check failure on line 135 in docs/analysis-tools/PID.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
// Combined nSigma calculation
float combNSigmaEl = std::sqrt(tofNSigmaEl * tofNSigmaEl + tpcNSigmaEl * tpcNSigmaEl);

Check failure on line 138 in docs/analysis-tools/PID.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
// Individual cuts
bool passTOF = std::abs(tofNSigmaEl) < 3.0;
bool passTPC = std::abs(tpcNSigmaEl) < 3.0;
Expand Down Expand Up @@ -185,7 +183,7 @@
```

- **Requirements**: Both tasks are typically needed
- **Configuration**: Can be configured according to detector expert specifications

Check failure on line 186 in docs/analysis-tools/PID.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
- **Reference**: Use Hyperloop [TPC configuration](https://alimonitor.cern.ch/hyperloop/view-wagon/34291/wagon-settings) as reference

### ITS PID Configuration
Expand All @@ -209,6 +207,7 @@
```

**Components:**

- [`o2-analysis-pid-tof-merge`](https://github.com/AliceO2Group/O2Physics/tree/master/Common/TableProducer/PID/pidTOFMerge.cxx): Main TOF PID task
- `o2-analysis-pid-tof-qa`: Optional QA histograms

Expand All @@ -221,11 +220,11 @@
```

**Components:**

- [`o2-analysis-pid-tpc`](https://github.com/AliceO2Group/O2Physics/tree/master/Common/TableProducer/PID/pidTPC.cxx): Main TPC PID task
- `o2-analysis-pid-tpc-base`: Base TPC PID processing
- `o2-analysis-pid-tpc-qa`: Optional QA histograms


### ITS PID Workflow

Complete workflow including QA:
Expand All @@ -235,10 +234,10 @@
```

**Components:**

- [`o2-analysis-pid-its`](https://github.com/AliceO2Group/O2Physics/tree/master/Common/TableProducer/PID/pidITS.cxx): Main ITS PID task (needed only to set the ITS PID Response parameters)
- `o2-analysis-pid-its-qa`: Optional QA histograms


**Note:** The `...` represents other tasks in your analysis workflow.

## Enabling QA histograms
Expand All @@ -248,18 +247,21 @@
### Enabling QA Tasks

**TOF QA histograms:**

```bash
... | o2-analysis-pid-tof-qa | ...
```

**TPC QA histograms:**

```bash
... | o2-analysis-pid-tpc-qa | ...
```

### QA Output

The QA tasks provide:

- nSigma distributions for each particle species
- Detector response monitoring
- Calibration validation plots
Expand All @@ -271,7 +273,7 @@

Beyond the basic PID functionality, the O2 Analysis Framework provides several advanced features for sophisticated particle identification workflows. These features are designed for users who need more control over PID calculations, better performance optimization, or specialized analysis requirements.

### Key Advanced Features:
### Key Advanced Features

1. **Dynamic Columns**: Compute PID quantities on-the-fly without storing pre-calculated tables
2. **Custom Parameterizations**: Use detector-specific response parameterizations from CCDB
Expand All @@ -280,8 +282,9 @@
5. **Binned Storage**: Use compressed storage formats for large-scale analyses

These advanced features are particularly useful for:

- **High-precision analyses** requiring detector-specific tuning
- **Large-scale productions** where storage optimization is critical

Check failure on line 287 in docs/analysis-tools/PID.md

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
- **Development workflows** where PID parameters need frequent updates
- **Quality assurance** studies requiring detailed detector response information

Expand All @@ -290,7 +293,7 @@
TOF beta and mass can be calculated dynamically using the following columns:

| Dynamic Column | Method | Description | Dependencies |
| -------------- | ----------- | ------------------------------ | --------------------------------------- |
|----------------|-------------|--------------------------------|-----------------------------------------|
| **TOF Beta** | `tofBeta()` | Dynamically calculated β value | Length, TOFSignal, TOFEvTime |
| **TOF Mass** | `tofMass()` | Dynamically calculated mass | Length, TOFSignal, TOFEvTime, TOFExpMom |

Expand All @@ -299,14 +302,15 @@
For advanced use cases, nSigma values can be computed dynamically for all detectors:

| Detector | Dynamic Column | Method | Description | Requirements |
| -------- | ---------------- | ------------------ | ----------------------------- | ----------------------------------- |
|----------|------------------|--------------------|-------------------------------|-------------------------------------|
| **TOF** | `TOFNSigmaDynXX` | `tofNSigmaDynXX()` | On-the-fly nSigma calculation | TOF response service initialization |
| **TPC** | `TPCNSigmaDynXX` | `tpcNSigmaDynXX()` | On-the-fly nSigma calculation | Standard table approach |
| **ITS** | `ITSNSigmaXX` | `itsNSigmaXX()` | On-the-fly nSigma calculation | Parameter initialization |

Where `XX` represents the particle species (`El`, `Mu`, `Pi`, `Ka`, `Pr`, `De`, `Tr`, `He`, `Al`).

**Dynamic nSigma advantages:**

- Use the most current detector calibrations
- Avoid pre-computed table storage requirements
- Allow for real-time parameter adjustments
Expand All @@ -317,6 +321,7 @@
### Example Usage

**Basic dynamic columns:**

```c++
// TOF Beta calculation
using TOFBeta = o2::aod::TOFBeta;
Expand All @@ -332,6 +337,7 @@
```

**Advanced dynamic nSigma with TOF response service:**

```c++
#include "Common/Core/PID/PIDTOFParamService.h"

Expand Down
Loading