You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PWGCF/Tutorial/README.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ This tutorial is made and tested for pilot-beam data (reconstruction pass4). You
30
30
<!-- markdown-link-check-disable-next-line -->
31
31
A lot of Run 2 data converted into the Run 3 format can be found [here](https://alimonitor.cern.ch/trains/train.jsp?train_id=132). A detailed description of how to download converted Run 2 data is reported in the [offifial documentation](https://aliceo2group.github.io/analysis-framework/docs/download/)
32
32
33
-
In summary, to download a bunch of data, do the following: <br>
33
+
In summary, to download a bunch of data, do the following: <br>
34
34
1. scroll all the way down, choose the train number you are interested in and click on run number. <br>
35
35
2. A pop-up window appears: click on the **Test Results**. <br>
36
36
3. Scroll down, find the **Full Train** option and then click on **output**. <br>
@@ -44,7 +44,7 @@ ____________________________
44
44
____________________________
45
45
# Create your task in O2Physics
46
46
47
-
There are many examples of simple introductory tasks in O2Physics that can be found in `O2Physics/Tutorials`.
47
+
There are many examples of simple introductory tasks in O2Physics that can be found in `O2Physics/Tutorials`.
48
48
All the information about how to write a task can be found in the [official documentation](https://aliceo2group.github.io/analysis-framework/docs/tutorials/).
49
49
50
50
We hope that this hands-on tutorial will help you learning to write your analysis tasks starting from scratch.
@@ -58,7 +58,7 @@ In addition, the task can also have an `init` funcion, which is used to initiali
58
58
59
59
In the same source file where the `struct` is defined, one has to add a `defineDataProcessing` method, which is necessary to include the task to the workflow, assigning it a specific name.
60
60
61
-
The task must be added to the `CMakeLists.txt` file in the same directory. For our tutorial, the first task has name `cf-tutorial-0` and it is defined in the source file `CFTutorialTask0.cxx`. The corresponfing lines in the `CMakeLists.txt` file are:
61
+
The task must be added to the `CMakeLists.txt` file in the same directory. For our tutorial, the first task has name `cf-tutorial-0` and it is defined in the source file `CFTutorialTask0.cxx`. The corresponfing lines in the `CMakeLists.txt` file are:
62
62
63
63
```
64
64
o2physics_add_dpl_workflow(cf-tutorial-0
@@ -87,7 +87,7 @@ Go to `~/alice/sw/BUILD/O2Physics-latest-master/O2Physics`.
87
87
</details>
88
88
89
89
In `~/alice/sw/BUILD/O2Physics-latest-master/O2Physics` enter ninja and O2Physics environment (`alienv load ninja/latest O2Physics/latest`). Then build your task using `ninja stage/bin/<your-analysis-file>`. If you don't know what you should type in `<your-analysis-file>` place, open `CMakeList.txt` and see how your analysis is called there. <br>
90
-
Keep in mind that if you add a new file or modify CMakeList you need to use `cmake .`
90
+
Keep in mind that if you add a new file or modify CMakeList you need to use `cmake .`
91
91
Then, after building part, copy this builded file to directory with AOD file (`cp stage/bin/<your-analysis-file>`). You can skip this step (copying) when you use `ninja install` instead of `ninja` or you can use alibuild.
In the following, we will use configuration files.
121
121
122
-
### Possible errors
122
+
### Possible errors
123
123
<details><summary>Couldn't get TTree.</summary>
124
124
<p>
125
125
126
-
Sometimes you may get an error, for example:
126
+
Sometimes you may get an error, for example:
127
127
```c
128
128
[ERROR] Exception caught: Couldn't get TTree "DF_2853960297589372650/O2v0dataext from <your AOD file>"
129
129
```
130
130
It means that `v0dataext` couldn't be found in your AOD file or it has not been produced by any attached helper task.
131
131
So now you know which table is missing. There are two paths you can choose; <br>
132
-
1. **EASIEST**: follow the instructions reported in [ALICEO2 documentation- Tree not found](https://aliceo2group.github.io/analysis-framework/docs/troubleshooting/treenotfound.html). After entering [ALICE O2 documentation - helper task tables](https://aliceo2group.github.io/analysis-framework/docs/datamodel/helperTaskTables.html), you search the table that you are missing and you will find the task you need to attach as dependency.<br>
132
+
1. **EASIEST**: follow the instructions reported in [ALICEO2 documentation- Tree not found](https://aliceo2group.github.io/analysis-framework/docs/troubleshooting/treenotfound.html). After entering [ALICE O2 documentation - helper task tables](https://aliceo2group.github.io/analysis-framework/docs/datamodel/helperTaskTables.html), you search the table that you are missing and you will find the task you need to attach as dependency.<br>
133
133
2. More difficult: enter directory `alice/O2Physics` and look for the missing table. </br>
134
134
For example, if you are missing `pidtofka` table, you should type:
So you need to find the **task-name** which will correspond to the **C++ file** you've found using grep ;) <br>
148
-
149
-
148
+
149
+
150
150
</p>
151
151
</details>
152
152
<details><summary>Fatal errors with non-existing CCDB entries.</summary>
153
153
<p>
154
154
While trying to run various O2 tasks/tutorials, you can run into fatal errors with non-existing CCDB entries for specific data. <br>
155
155
The reason is often the incorrect configuration of the paramenters. For example, for some executables such as `o2-analysis-timestamp` duging the option `--isRun2MC` could solve the problem. Or, simialary, using the oprion `--isMC` for o2-analysis-event-selection. <br>
We will be using [CFTutorialTask0.cxx](https://github.com/CF-tutorials/O2Physics/blob/tutorial/PWGCF/Tutorial/CFTutorialTask0.cxx). It's an example task illustrating how to create histograms and fill them with basic information. We will also apply basic event selection.<br>
181
-
181
+
182
182
Here you can see a structure of a typical analysis task in the O2:<br>
183
183
```c
184
184
struct myTask{
@@ -197,7 +197,7 @@ _____________________________
197
197
```
198
198
Each part will be described in greater detail further on during this tutorial.<br>
199
199
200
-
The first element of the task is `init` (equivalent to *UserCreateOutputObjects* in *AliPhysics*). It looks like this:
200
+
The first element of the task is `init` (equivalent to _UserCreateOutputObjects_ in _AliPhysics_). It looks like this:
201
201
202
202
```c
203
203
void init(o2::framework::InitContext&)
@@ -218,7 +218,7 @@ The first element of the task is `init` (equivalent to *UserCreateOutputObjects*
218
218
```
219
219
`init` is used to initialise objects, e.g. histograms, which will be used later in the process.
220
220
221
-
The second element is `process`, equivalent to the *UserExec* in *AliPhysics*. It looks like this:
221
+
The second element is `process`, equivalent to the _UserExec_ in _AliPhysics_. It looks like this:
@@ -237,7 +237,7 @@ The second element is `process`, equivalent to the *UserExec* in *AliPhysics*. I
237
237
}
238
238
```
239
239
240
-
The arguments of `process` are the data *tables* that we analyse, i.e. the tables to which we *subscribe*. In the snippet above, the subscripion is to the tables of collisions and tracks.
240
+
The arguments of `process` are the data _tables_ that we analyse, i.e. the tables to which we _subscribe_. In the snippet above, the subscripion is to the tables of collisions and tracks.
241
241
242
242
Finally, `WorkflowSpec` is necessay to add the task to the DPL workflow . And it looks like:
243
243
@@ -253,7 +253,7 @@ Finally, `WorkflowSpec` is necessay to add the task to the DPL workflow . And it
253
253
## Second task
254
254
255
255
We will be using [CFTutorialTask1.cxx](https://github.com/CF-tutorials/O2Physics/blob/tutorial/PWGCF/Tutorial/CFTutorialTask1.cxx). In this part of the tutorial, we will focus on how to access information from different tables. Sets of information stored in different tables can be put together using `Join`:
256
-
256
+
257
257
```c
258
258
namespace o2::aod
259
259
{
@@ -264,7 +264,7 @@ using MyTracks = soa::Join<aod::FullTracks,
264
264
aod::pidTPCEl, aod::pidTPCMu, aod::pidTPCPi,
265
265
aod::pidTPCKa, aod::pidTPCPr, aod::pidTPCDe>;
266
266
} // namespace o2::aod
267
-
```
267
+
```
268
268
The data model provides some predifined joins, suche as `FullTracks = soa::Join<Tracks, TracksExtra>`. The complete list of predefined joins can be found in [ALICE O2 documentation - The Data Model, Joins and iterators](https://aliceo2group.github.io/analysis-framework/docs/datamodel/joinsAndIterators.html).
269
269
270
270
Joined tables can be normally used as agruments of process.
@@ -297,7 +297,7 @@ Note that configurables can be used in the definition of a filters.
297
297
298
298
We will be using [CFTutorialTask3.cxx](https://github.com/CF-tutorials/O2Physics/blob/tutorial/PWGCF/Tutorial/CFTutorialTask3.cxx). In this part of the tutorial, we will focus on how to create and use **partitions**.<br>
299
299
300
-
A `Partition` is a subset of a given table that satisfies particular requirements. In the following, a partition obtained from the table *Tracks*:
300
+
A `Partition` is a subset of a given table that satisfies particular requirements. In the following, a partition obtained from the table _Tracks_:
**WARNING**: using a `Partition` of the table `Tracks`, you are considering **ALL** the tracks (which satisfy the requirements) of **ALL** the collisions. In order to select the elements corresponding to the relevant collision, one must use `sliceByCached`, as shown in the example above.
323
+
**WARNING**: using a `Partition` of the table `Tracks`, you are considering **ALL** the tracks (which satisfy the requirements) of **ALL** the collisions. In order to select the elements corresponding to the relevant collision, one must use `sliceByCached`, as shown in the example above.
324
324
325
325
</p>
326
326
</details>
327
327
328
-
## Fifth task
328
+
## Fifth task
329
329
330
330
We will be using [CFTutorialTask4.cxx](https://github.com/CF-tutorials/O2Physics/blob/tutorial/PWGCF/Tutorial/CFTutorialTask4.cxx). In this part of the tutorial, we will focus on how to use and combine elements of different **partitions**. In the following, you can see the invariant mass of two pions, a negative one and a positive one, belonging to two different partitions.
331
331
@@ -347,7 +347,7 @@ for (auto& [pos, neg] : combinations(soa::CombinationsFullIndexPolicy(groupPosit
347
347
sumVec += negVec;
348
348
histos.fill(HIST("hInvariantMass"), sumVec.M());
349
349
}
350
-
```
350
+
```
351
351
352
352
353
353
## Sixth task
@@ -367,6 +367,6 @@ PROCESS_SWITCH(<name-of-your-structure>, processSameEvent, "Enable processing sa
The process functions can be activated using `PROCESS_SWITCH`, setting the last parameter as `true`. This parameter can be configured via command line, json file or in the hyperloop interface.
0 commit comments