Skip to content

Commit ef1fe3e

Browse files
committed
Fix
1 parent 0e37bb8 commit ef1fe3e

File tree

1 file changed

+70
-41
lines changed

1 file changed

+70
-41
lines changed

docs/analysis-tools/PID.md

Lines changed: 70 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -39,40 +39,40 @@ The ITS PID columns are only dynamical and do not need a task to produce them, h
3939

4040
Tables for PID values in O2 are defined in the following header files:
4141

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

4848

4949
## Available PID Information
5050

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

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

6060

6161
#### Supported Particle Species
6262

6363
Where `XX` represents the particle species: `El` (electron), `Mu` (muon), `Pi` (pion), `Ka` (kaon), `Pr` (proton), `De` (deuteron), `Tr` (triton), `He` (helium3), `Al` (alpha, i.e. helium4).
6464

6565
| Symbol | Particle | Mass Hypothesis |
66-
|--------|----------|----------------|
67-
| `El` | Electron | e⁻ |
68-
| `Mu` | Muon | μ⁻ |
69-
| `Pi` | Pion | π± |
70-
| `Ka` | Kaon ||
71-
| `Pr` | Proton | p |
72-
| `De` | Deuteron | d |
73-
| `Tr` | Triton | t |
74-
| `He` | Helium-3 | ³He |
75-
| `Al` | Alpha | α (⁴He) |
66+
| ------ | -------- | --------------- |
67+
| `El` | Electron | e⁻ |
68+
| `Mu` | Muon | μ⁻ |
69+
| `Pi` | Pion | π± |
70+
| `Ka` | Kaon | |
71+
| `Pr` | Proton | p |
72+
| `De` | Deuteron | d |
73+
| `Tr` | Triton | t |
74+
| `He` | Helium-3 | ³He |
75+
| `Al` | Alpha | α (⁴He) |
7676

7777
In the process functions, you can join the table to add the PID (per particle mass hypothesis) information to the track.
7878
In this case, we are using the mass hypothesis of the electron (and only for the **NSigma** information), but tables for nine (9) stable particle species are produced (`El`, `Mu`, `Pi`, `Ka`, `Pr`, `De`, `Tr`, `He`, `Al`).
@@ -81,14 +81,14 @@ In this case, we are using the mass hypothesis of the electron (and only for the
8181

8282
The TOF detector provides additional specialized information beyond the standard PID methods:
8383

84-
| Information Type | Description | TOF Methods | Notes |
85-
|------------------|-------------|-------------|-------|
86-
| **Beta** | Velocity as fraction of speed of light | `beta()`, `tofBeta()` | β = v/c, fundamental for mass calculation |
87-
| **Beta Error** | Uncertainty on beta measurement | `betaerror()` | Statistical uncertainty on β |
88-
| **TOF Mass** | Reconstructed particle mass | `mass()`, `tofMass()` | Calculated from momentum and β |
89-
| **Event Time** | Collision time for TOF measurement | `tofEvTime()` | Event collision time used for PID |
90-
| **Event Time Error** | Uncertainty on event time | `tofEvTimeErr()` | Error on collision time determination |
91-
| **TOF Signal** | Raw TOF signal | `tofSignal()` | Direct detector measurement |
84+
| Information Type | Description | TOF Methods | Notes |
85+
| -------------------- | -------------------------------------- | --------------------- | ----------------------------------------- |
86+
| **Beta** | Velocity as fraction of speed of light | `beta()`, `tofBeta()` | β = v/c, fundamental for mass calculation |
87+
| **Beta Error** | Uncertainty on beta measurement | `betaerror()` | Statistical uncertainty on β |
88+
| **TOF Mass** | Reconstructed particle mass | `mass()`, `tofMass()` | Calculated from momentum and β |
89+
| **Event Time** | Collision time for TOF measurement | `tofEvTime()` | Event collision time used for PID |
90+
| **Event Time Error** | Uncertainty on event time | `tofEvTimeErr()` | Error on collision time determination |
91+
| **TOF Signal** | Raw TOF signal | `tofSignal()` | Direct detector measurement |
9292

9393
> **Note**: For advanced TOF features including dynamic columns for beta, mass, nSigma calculations, see the [Advanced Features](#advanced-features) section.
9494
@@ -205,22 +205,23 @@ Beyond the basic PID functionality, the O2 Analysis Framework provides several a
205205

206206
The TOF beta and mass can also be calculated dynamically using the following columns:
207207

208-
| Dynamic Column | Method | Description |
209-
|----------------|--------|-------------|
210-
| **TOF Beta** | `tofBeta()` | Dynamically calculated β value |
211-
| **TOF Mass** | `tofMass()` | Dynamically calculated mass |
208+
| Dynamic Column | Method | Description |
209+
| -------------- | ----------- | ------------------------------ |
210+
| **TOF Beta** | `tofBeta()` | Dynamically calculated β value |
211+
| **TOF Mass** | `tofMass()` | Dynamically calculated mass |
212212
213213
#### Dynamic Columns for nSigma Calculations
214214
215215
For more advanced use cases, nSigma values can also be computed dynamically for all detectors:
216216
217-
| Detector | Dynamic Column | Method | Description |
218-
|----------|----------------|--------|-------------|
219-
| **TOF** | `TOFNSigmaDynXX` | `tofNSigmaDynXX()` | On-the-fly nSigma calculation |
220-
| **TPC** | `TPCNSigmaDynXX` | `tpcNSigmaDynXX()` | On-the-fly nSigma calculation |
221-
| **ITS** | `ITSNSigmaXX` | `itsNSigmaXX()` | On-the-fly nSigma calculation |
217+
| Detector | Dynamic Column | Method | Description |
218+
| -------- | ---------------- | ------------------ | ----------------------------- |
219+
| **TOF** | `TOFNSigmaDynXX` | `tofNSigmaDynXX()` | On-the-fly nSigma calculation |
220+
| **TPC** | `TPCNSigmaDynXX` | `tpcNSigmaDynXX()` | On-the-fly nSigma calculation |
221+
| **ITS** | `ITSNSigmaXX` | `itsNSigmaXX()` | On-the-fly nSigma calculation |
222222
223223
Where `XX` represents the particle species (`El`, `Mu`, `Pi`, `Ka`, `Pr`, `De`, `Tr`, `He`, `Al`).
224+
The dynamic column need to initialize the TOF response, as a service.
224225
225226
**Dynamic nSigma advantages:**
226227
- Use the most current detector calibrations
@@ -230,9 +231,6 @@ Where `XX` represents the particle species (`El`, `Mu`, `Pi`, `Ka`, `Pr`, `De`,
230231
231232
These tasks do not need a dedicated task apart from the computation of the `tofSignal` and `tofEvTime`.
232233
233-
234-
235-
236234
**Example usage with dynamic columns:**
237235
```c++
238236
// For TOF Beta
@@ -247,3 +245,34 @@ void process(soa::Join<aod::Tracks, TOFMass>::iterator const& track) {
247245
float mass = track.tofMass();
248246
}
249247
```
248+
249+
For the nSigma:
250+
251+
**Example usage with dynamic nSigma columns:**
252+
```c++
253+
#include "Common/Core/PID/PIDTOFParamService.h"
254+
255+
struct exampleTask{
256+
Service<o2::pid::tof::TOFResponse> tofResponse;
257+
Service<o2::ccdb::BasicCCDBManager> ccdb;
258+
259+
void init(o2::framework::InitContext& initContext){
260+
tofResponse->initSetup(ccdb, initContext);
261+
}
262+
263+
264+
// For TOF dynamic nSigma (electron hypothesis)
265+
void process(soa::Join<aod::Tracks, aod::pidtofsignal::TOFSignal, aod::pidtofevtime::TOFEvTime, o2::aod::TOFNSigmaDynEl>::iterator const& track,
266+
aod::BCsWithTimestamps const& bcs) {
267+
tofResponse->processSetup(bcs.iteratorAt(0)); // Update the calibration parameters
268+
// float tofNSigmaEl = track.tofNSigmaDynEl();
269+
}
270+
};
271+
272+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
273+
{
274+
// Parse the metadata
275+
o2::pid::tof::TOFResponseImpl::metadataInfo.initMetadata(cfgc);
276+
return WorkflowSpec{adaptAnalysisTask<exampleTask>(cfgc)};
277+
}
278+
```

0 commit comments

Comments
 (0)