Skip to content

Commit eaa6ad0

Browse files
authored
Merge pull request #231 from vkucera/hf
PWGHF, Getting started: Update links, simplify lists of workflows, extend contribution instructions
2 parents a862f7a + 6cdd59c commit eaa6ad0

File tree

2 files changed

+56
-58
lines changed

2 files changed

+56
-58
lines changed

docs/advanced-specifics/pwghf.md

Lines changed: 53 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ title: PWG-HF
1313
- See the [presentation on HF vertexing and analysis](https://indico.cern.ch/event/1200252/timetable/#10-hf-vertexing-and-analysis)
1414
and the [HF analysis example](https://indico.cern.ch/event/1200252/timetable/#23-hands-on-session-4-analysis)
1515
from the [O2 Analysis Tutorial](https://indico.cern.ch/event/1200252/) (13–14 Oct 2022).
16+
- See the [HF hands-on session](https://indico.cern.ch/event/1267433/timetable/#b-504545-parallel-hands-on-pwg)
17+
from the [O2 Analysis Tutorial 2.0](https://indico.cern.ch/event/1267433/) (17-28 Apr 2023).
1618

1719
## Contact
1820

1921
Coordinators: Francesco Prino, Vít Kučera
2022

21-
Mattermost channel: [hf-o2-analysis-challenge](https://mattermost.web.cern.ch/alice/channels/hf-o2-analysis-challenge)
23+
Mattermost channel: [hf-o2-analysis](https://mattermost.web.cern.ch/alice/channels/hf-o2-analysis)
2224

2325
## Code
2426

@@ -36,15 +38,18 @@ Mattermost channel: [hf-o2-analysis-challenge](https://mattermost.web.cern.ch/al
3638
[`RecoDecay`](https://github.com/AliceO2Group/O2Physics/blob/master/Common/Core/RecoDecay.h) class.
3739
- Selection of tracks based on the particle identification (PID) detectors is performed via the
3840
[`TrackSelectorPID`](https://github.com/AliceO2Group/O2Physics/blob/master/Common/Core/TrackSelectorPID.h) class.
39-
- Code for easy running of the HF tasks and output processing can be found in the
41+
- Code for easy local running of the HF tasks and output processing can be found in the
4042
[Run3Analysisvalidation](https://github.com/AliceO2Group/Run3Analysisvalidation) repository.
4143
- Analysis code for postprocessing of the task output is collected in the
4244
[`FirstAnalysis`](https://github.com/AliceO2Group/Run3Analysisvalidation/tree/master/FirstAnalysis) directory.
4345

4446
## AliHyperloop
4547

46-
[JIRA tickets](https://alice.its.cern.ch/jira/browse/PWGHF-269?jql=project%20%3D%20PWGHF%20AND%20issuetype%20%3D%20Analysis%20AND%20component%20%3D%20PWG-HF)
47-
of the HF analyses on <!-- markdown-link-check-disable -->[AliHyperloop](https://alimonitor.cern.ch/hyperloop/)<!-- markdown-link-check-enable -->
48+
<!-- markdown-link-check-disable -->
49+
[AliHyperloop analyses](https://alimonitor.cern.ch/hyperloop/all-analyses)
50+
<!-- markdown-link-check-enable -->
51+
(Type "PWGHF" in the field "JIRA" to filter.)<br>
52+
Corresponding [JIRA tickets](https://alice.its.cern.ch/jira/issues/?jql=project%20%3D%20PWGHF%20AND%20%22Run%203%20analysis%22%20%3D%20Yes)
4853

4954
## Framework structure
5055

@@ -59,9 +64,8 @@ Individual components are described in the next section below.
5964

6065
### Track index skimming
6166

62-
Workflow | File | Type
63-
------------------------------------------|-----------------------------|------------------------------------
64-
`o2-analysis-hf-track-index-skim-creator` | `trackIndexSkimCreator.cxx` | direct 2/3-prong and cascade decays
67+
Workflow: `o2-analysis-hf-track-index-skim-creator`<br>
68+
File: [`trackIndexSkimCreator.cxx`](https://github.com/AliceO2Group/O2Physics/blob/master/PWGHF/TableProducer/trackIndexSkimCreator.cxx)
6569

6670
#### Track and event selection
6771

@@ -81,14 +85,9 @@ together with a flag indicating for which decay channel(s) the candidate was sel
8185

8286
### Candidate creation and MC matching
8387

84-
Workflow | File | Type
85-
-------------------------------------------|-------------------------------|------------------------------------------------------------------------
86-
`o2-analysis-hf-candidate-creator-2prong` | `candidateCreator2Prong.cxx` | direct 2-prong decays
87-
`o2-analysis-hf-candidate-creator-3prong` | `candidateCreator3Prong.cxx` | direct 3-prong decays
88-
`o2-analysis-hf-candidate-creator-cascade` | `candidateCreatorCascade.cxx` | cascade decays with V<sup>0</sup> daughters (Λ<sub>c</sub><sup>±</sup>)
89-
`o2-analysis-hf-candidate-creator-xicc` | `candidateCreatorXicc.cxx` | Ξ<sub>cc</sub><sup>±±</sup> → Ξ<sub>c</sub><sup>±</sup> π<sup>±</sup>
90-
`o2-analysis-hf-candidate-creator-x` | `candidateCreatorX.cxx` | X(3872) → J/ψ π<sup>±</sup> π<sup>∓</sup>
91-
`o2-analysis-hf-candidate-creator-bplus` | `candidateCreatorBplus.cxx` | B<sup>±</sup> → D<sup>0</sup>(bar) π<sup>±</sup>
88+
Workflows: `o2-analysis-hf-candidate-creator-<particle|decay>`<br>
89+
Files: `candidateCreator<Particle|Decay>.cxx`<br>
90+
Directories: [`PWGHF/TableProducer`](https://github.com/AliceO2Group/O2Physics/tree/master/PWGHF/TableProducer), `PWGHF/*/TableProducer`
9291

9392
#### Candidate creation
9493

@@ -111,17 +110,9 @@ Derived tables with MC flags used for the estimation of the signal efficiencies
111110

112111
### Candidate selection
113112

114-
Workflow | File | Type
115-
------------------------------------------------------|-------------------------------------|----------------------------------------------------------------------
116-
`o2-analysis-hf-candidate-selector-d0` | `candidateSelectorD0.cxx` | D<sup>0</sup>(bar) → π<sup>±</sup> K<sup>∓</sup>
117-
`o2-analysis-hf-candidate-selector-jpsi` | `candidateSelectorJpsi.cxx` | J/ψ → e<sup>+</sup> e<sup>−</sup>/μ<sup>+</sup> μ<sup>−</sup>
118-
`o2-analysis-hf-candidate-selector-x-to-jpsi-pi-pi` | `candidateSelectorXToJpsiPiPi.cxx` | X(3872) → J/ψ π<sup>±</sup> π<sup>∓</sup>
119-
`o2-analysis-hf-candidate-selector-dplus-to-pi-k-pi` | `candidateSelectorDplusToPiKPi.cxx` | D<sup>±</sup> → π<sup>±</sup> K<sup>∓</sup> π<sup>±</sup>
120-
`o2-analysis-hf-candidate-selector-lc` | `candidateSelectorLc.cxx` | Λ<sub>c</sub><sup>±</sup> → p(bar) K<sup>∓</sup> π<sup>±</sup>
121-
`o2-analysis-hf-candidate-selector-lc-to-k0s-p` | `candidateSelectorLcToK0sP.cxx` | Λ<sub>c</sub><sup>±</sup> → p(bar) K<sub>S</sub><sup>0</sup>
122-
`o2-analysis-hf-candidate-selector-xic-to-p-k-pi` | `candidateSelectorXicToPKPi.cxx` | Ξ<sub>c</sub><sup>±</sup> → p(bar) K<sup>∓</sup> π<sup>±</sup>
123-
`o2-analysis-hf-candidate-selector-xicc-to-p-k-pi-pi` | `candidateSelectorXiccToPKPiPi.cxx` | Ξ<sub>cc</sub><sup>±±</sup> → Ξ<sub>c</sub><sup>±</sup> π<sup>±</sup>
124-
`o2-analysis-hf-candidate-selector-bplus-to-d0-pi` | `candidateSelectorBplusToD0Pi.cxx` | B<sup>±</sup> → D<sup>0</sup>(bar) π<sup>±</sup>
113+
Workflows: `o2-analysis-hf-candidate-selector-<particle|decay>`<br>
114+
Files: `candidateSelector<Particle|Decay>.cxx`<br>
115+
Directories: [`PWGHF/TableProducer`](https://github.com/AliceO2Group/O2Physics/tree/master/PWGHF/TableProducer), `PWGHF/*/TableProducer`
125116

126117
In a dedicated selector task, tailored for each decay channel, accurate analysis level selection criteria
127118
based on decay topology and PID are applied to the reconstructed candidates.
@@ -130,20 +121,9 @@ The selection results are stored in a column of a new dedicated table that is la
130121

131122
### Analysis tasks
132123

133-
Workflow | File | Type
134-
-----------------------------------------|-----------------------------|-------------------------------------------------------------------------
135-
`o2-analysis-hf-task-d0` | `taskD0.cxx` | D<sup>0</sup>(bar) → π<sup>±</sup> K<sup>∓</sup>
136-
`o2-analysis-hf-task-jpsi` | `taskJpsi.cxx` | J/ψ → e<sup>+</sup> e<sup>−</sup>/μ<sup>+</sup> μ<sup>−</sup>
137-
`o2-analysis-hf-task-dplus` | `taskDplus.cxx` | D<sup>±</sup> → π<sup>±</sup> K<sup>∓</sup> π<sup>±</sup>
138-
`o2-analysis-hf-task-lc` | `taskLc.cxx` | Λ<sub>c</sub><sup>±</sup> → p(bar) K<sup>∓</sup> π<sup>±</sup>
139-
`o2-analysis-hf-task-lc-to-k0s-p` | `taskLcToK0sP.cxx` | Λ<sub>c</sub><sup>±</sup> → p(bar) K<sub>S</sub><sup>0</sup>
140-
`o2-analysis-hf-task-xic` | `taskXic.cxx` | Ξ<sub>c</sub><sup>±</sup> → p(bar) K<sup>∓</sup> π<sup>±</sup>
141-
`o2-analysis-hf-task-xicc` | `taskXicc.cxx` | Ξ<sub>cc</sub><sup>±±</sup> → Ξ<sub>c</sub><sup>±</sup> π<sup>±</sup>
142-
`o2-analysis-hf-task-bplus` | `taskBplus.cxx` | B<sup>±</sup> → D<sup>0</sup>(bar) π<sup>±</sup>
143-
`o2-analysis-hf-task-x` | `taskX.cxx` | X(3872) → J/ψ π<sup>±</sup> π<sup>∓</sup>
144-
`o2-analysis-hf-correlator-d0-d0bar` | `correlatorD0D0bar.cxx` | D<sup>0</sup>–D<sup>0</sup>bar correlations
145-
`o2-analysis-hf-correlator-dplus-dminus` | `correlatorDplusDminus.cxx` | D<sup>+</sup>–D<sup>−</sup> correlations
146-
`o2-analysis-hf-task-correlation-d-dbar` | `taskCorrelationDDbar.cxx` | D<sup>0</sup>–D<sup>0</sup>bar, D<sup>+</sup>–D<sup>−</sup> correlations
124+
Workflows: `o2-analysis-hf-task-<particle|decay>`<br>
125+
Files: `task<Particle|Decay>.cxx`<br>
126+
Directories: [`PWGHF/Tasks`](https://github.com/AliceO2Group/O2Physics/tree/master/PWGHF/Tasks), `PWGHF/*/Tasks`
147127

148128
#### Real-data analysis
149129

@@ -153,45 +133,57 @@ In the user analysis task, histograms needed for the analysis are filled with pr
153133

154134
For MC events, histograms with quantities of generated MC particles and MC-matched candidates are produced.
155135

136+
### Tree creation
137+
138+
Candidate tables and other related derived tables are exported to disk as ROOT trees for
139+
post-processing with external tools, e.g. for optimisation with Machine Learning techniques.
140+
141+
Workflows: `o2-analysis-hf-tree-creator-<particle|decay>`<br>
142+
Files: `treeCreator<Particle|Decay>.cxx`<br>
143+
Directories: [`PWGHF/TableProducer`](https://github.com/AliceO2Group/O2Physics/tree/master/PWGHF/TableProducer), `PWGHF/*/TableProducer`
144+
156145
### QA and helper workflows
157146

158147
Workflow | File | Type
159148
---------------------------------------|---------------------------|----------------------------------------------------------------------------
160149
`o2-analysis-hf-task-mc-validation` | `taskMcValidation.cxx` | validation of HF MC distributions
161-
`o2-analysis-task-qa-pid-rejection` | `taskQaPidRejection.cxx` | PID selection performance
162150
`o2-analysis-hf-task-sel-optimisation` | `taskSelOptimisation.cxx` | preselection optimisation
163151
`o2-analysis-hf-refit-pv-dummy` | `refitPvDummy.cxx` | creation of a dummy table with primary-vertex position (for converted data)
164152

165-
### Tree creation
166-
167-
Candidate tables and other related derived tables are exported to disk as ROOT trees for
168-
post-processing with external tools, e.g. for optimisation with Machine Learning techniques.
169-
170-
Workflow | File | Type
171-
------------------------------------------------|-------------------------------|----------------------------------------------------------------------
172-
`o2-analysis-hf-tree-creator-d0-to-k-pi` | `treeCreatorD0ToKPi.cxx` | D<sup>0</sup>(bar) → π<sup>±</sup> K<sup>∓</sup>
173-
`o2-analysis-hf-tree-creator-lc-to-p-k-pi` | `treeCreatorLcToPKPi.cxx` | Λ<sub>c</sub><sup>±</sup> → p(bar) K<sup>∓</sup> π<sup>±</sup>
174-
`o2-analysis-hf-tree-creator-x-to-jpsi-pi-pi` | `treeCreatorXToJpsiPiPi.cxx` | X(3872) → J/ψ π<sup>±</sup> π<sup>∓</sup>
175-
`o2-analysis-hf-tree-creator-xicc-to-p-k-pi-pi` | `treeCreatorXiccToPKPiPi.cxx` | Ξ<sub>cc</sub><sup>±±</sup> → Ξ<sub>c</sub><sup>±</sup> π<sup>±</sup>
176-
177153
## Contribute
178154

179155
### Code development guidelines
180156

181157
- Follow the [O2 coding guidelines](https://github.com/AliceO2Group/CodingGuidelines)
182158
(especially the [naming](https://rawgit.com/AliceO2Group/CodingGuidelines/master/naming_formatting.html)
183159
and [commenting](https://rawgit.com/AliceO2Group/CodingGuidelines/master/comments_guidelines.html) rules).
184-
- Sort O2Physics `#include`s alphabetically and keep `PWGHF/...` at the end.
160+
- Respect the alphabetic order and groups in `CMakeLists.txt` when adding a new workflow.
161+
- Link only necessary libraries in `CMakeLists.txt`.
162+
- Avoid code duplication and reuse existing code (e.g. `RecoDecay`, table columns, constants).
163+
- Explicitly state when using the `std` namespace (e.g. `std::abs`, `std::array`, `std::vector`).
164+
- Do not use ROOT features unnecessarily (e.g. `TMath::Abs``std::abs`).
165+
- Use of macros for [bit manipulations](https://root.cern/doc/master/Rtypes_8h_source.html#l00083) (`BIT`, `SETBIT`, `TESTBIT`, `CLRBIT`) is encouraged.
166+
- Include only needed headers but do not rely on implicitly included headers.
167+
- Organise `#include`s into groups (separated by a blank line) in the following order:
168+
- C++
169+
- other external headers
170+
- ROOT
171+
- O2
172+
- O2Physics
173+
- PWG other than HF
174+
- PWGHF
175+
- Put PAG headers after the common ones.
176+
- Sort `#include`s alphabetically within a group.
185177
- Avoid using hard-coded PDG codes. Use their `enum` names instead
186178
(from [`PDG_t`](https://root.cern/doc/master/TPDGCode_8h.html) or
187179
[`o2::analysis::pdg::Code`](https://github.com/AliceO2Group/O2Physics/blob/master/PWGHF/Core/SelectorCuts.h)).
188180
See also [Magic numbers](https://rawgit.com/AliceO2Group/CodingGuidelines/master/coding_guidelines.html?showone=Magic_numbers#Magic_numbers).
189181
- Test your code before making a pull request.
190-
- Propagate your changes into the Run3Analysisvalidation configuration.
191-
- Check that your branch compiles.
182+
- Check that your branch compiles without warnings.
183+
- Propagate your changes into the [Run3Analysisvalidation](https://github.com/AliceO2Group/Run3Analysisvalidation/tree/master/codeHF#add-a-new-workflow) configuration.
192184
- Check that your code works and runs without errors and warnings.
193185
- Make sure your code is compatible with the expected input (Run 2/3/5, real/MC data, p–p/Pb–Pb).
194-
- Check that your changes do not alter unexpectedly the control plots produced by the validation framework.
186+
- Check that your changes do not alter unexpectedly the control plots produced by the [validation framework](https://github.com/AliceO2Group/Run3Analysisvalidation/tree/master/codeHF#run-the-example).
195187
- Make sure your tasks can be fully configured from Run3Analysisvalidation and AliHyperloop.
196188

197189
#### `struct` members
@@ -209,12 +201,14 @@ Organising the code in a well defined structure makes it easier to navigate thro
209201
- other members (constants, objects)
210202
- `using` declarations
211203
- `Filter`
204+
- `Preslice`
212205
- `Partition`
213206
- `ConfigurableAxis`
214207
- `AxisSpec`
215208
- `HistogramRegistry`
216209
- output declarations (`OutputObj`,...)
217210
- `init` function
211+
- helper functions
218212
- `process` function(s)
219213
- `PROCESS_SWITCH` follows immediately after the function definition.
220214

@@ -241,7 +235,8 @@ Organising the code in a well defined structure makes it easier to navigate thro
241235
- `RecBg` - reconstruction level quantity of a reconstructed background candidate
242236

243237
The names of the source file, the executable and the task(s) should match.<br>
244-
Note: The device name of a task is automatically generated from the name of the corresponding `struct` by replacing uppercase letters with lowercase letters preceded with a hyphen unless defined explicitly using `TaskName`, which should be avoided if not necessary.<br>
238+
Note: The device name of a task is automatically generated from the name of the corresponding `struct` by replacing uppercase letters with lowercase letters preceded with a hyphen.
239+
The device name can be explicitly defined using `TaskName` only when several instances of a templated task need to be defined.<br>
245240
Example:
246241

247242
- source file name: `taskXY.cxx`

docs/gettingstarted/contributingtocode.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ In order to contribute new code to the central repository, please follow these s
2626
- Add the workflow compilation instructions in the `CMakeLists.txt` (you can clone one of the existing `o2physics_add_dpl_workflow` blocks).
2727
Follow the `kebab-case` naming convention of the executables (i.e. lowercase words separated by hyphens).
2828
- [Compile O2Physics](installing.md#building-partially-for-development-using-ninja) with your changes.
29+
- Make sure the compilation of your code does not produce any errors or warnings.
2930
- In case you added a new workflow, the newly created executable will have the name you specified on the `o2physics_add_dpl_workflow` line, prefixed with `o2-analysis-<xx>-`, where `<xx>` corresponds to the `PWG<XX>` folder your file is in.
3031
- Test your code.
3132
- Commit your changes and push them to your remote fork repository on GitHub.
@@ -97,6 +98,8 @@ When you implement changes during the review, push them into your branch as addi
9798
- Do not amend, squash or rebase existing commits in the PR (unless asked to do so by the code owners)!
9899
You would have to force the push to update your branch which would overwrite the commit history, break the links between the code and the review comments and make the PR review more messy.
99100
- If you need to update your branch with the changes in the main branch while the PR is under review, use `git merge upstream/master` (instead of rebasing) to preserve the commit history.
101+
- Do not mark someone else's review comments as resolved. It is up to the reviewer who made the comment to judge whether the comment has been addressed.
102+
If you think you have addressed the comment, say so in a reply (e.g. comment “Done” or give a thumb-up reaction).
100103
- If you need more time to implement further changes in your PR,
101104
[convert it to a draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft)
102105
to avoid unnecessary compilation tests and mark it as ready for review again when you're done.

0 commit comments

Comments
 (0)