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
- 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.
185
177
- Avoid using hard-coded PDG codes. Use their `enum` names instead
186
178
(from [`PDG_t`](https://root.cern/doc/master/TPDGCode_8h.html) or
See also [Magic numbers](https://rawgit.com/AliceO2Group/CodingGuidelines/master/coding_guidelines.html?showone=Magic_numbers#Magic_numbers).
189
181
- 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.
192
184
- Check that your code works and runs without errors and warnings.
193
185
- 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).
195
187
- Make sure your tasks can be fully configured from Run3Analysisvalidation and AliHyperloop.
196
188
197
189
#### `struct` members
@@ -209,12 +201,14 @@ Organising the code in a well defined structure makes it easier to navigate thro
209
201
- other members (constants, objects)
210
202
-`using` declarations
211
203
-`Filter`
204
+
-`Preslice`
212
205
-`Partition`
213
206
-`ConfigurableAxis`
214
207
-`AxisSpec`
215
208
-`HistogramRegistry`
216
209
- output declarations (`OutputObj`,...)
217
210
-`init` function
211
+
- helper functions
218
212
-`process` function(s)
219
213
-`PROCESS_SWITCH` follows immediately after the function definition.
220
214
@@ -241,7 +235,8 @@ Organising the code in a well defined structure makes it easier to navigate thro
241
235
-`RecBg` - reconstruction level quantity of a reconstructed background candidate
242
236
243
237
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>
Copy file name to clipboardExpand all lines: docs/gettingstarted/contributingtocode.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,7 @@ In order to contribute new code to the central repository, please follow these s
26
26
- Add the workflow compilation instructions in the `CMakeLists.txt` (you can clone one of the existing `o2physics_add_dpl_workflow` blocks).
27
27
Follow the `kebab-case` naming convention of the executables (i.e. lowercase words separated by hyphens).
28
28
-[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.
29
30
- 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.
30
31
- Test your code.
31
32
- 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
97
98
- Do not amend, squash or rebase existing commits in the PR (unless asked to do so by the code owners)!
98
99
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.
99
100
- 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).
100
103
- If you need more time to implement further changes in your PR,
101
104
[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)
102
105
to avoid unnecessary compilation tests and mark it as ready for review again when you're done.
0 commit comments