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
- Define variables for repeatedly used objects (histogram types, axes, strings, calculated values).
163
164
- 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
+
- Do not use ROOT features unnecessarily (e.g. `TMath::Abs` → `std::abs`, `Double_t` → `double`).
165
166
- Use of macros for [bit manipulations](https://root.cern/doc/master/Rtypes_8h_source.html#l00083) (`BIT`, `SETBIT`, `TESTBIT`, `CLRBIT`) is encouraged.
167
+
- Do not use `M_PI`. Instead, use `PI`, `TwoPI`, `PIHalf`, `PIThird`, `PIQuarter` from the `o2::constants::math` namespace.
168
+
- Use `LOG`, `LOGF`, `LOGP` macros for logging (instead of `Printf`, `printf`, `std::cout`).
169
+
- Use the right logging level:
170
+
-`debug` for technical information useful for debugging and development,
171
+
-`info` for information about what the code is doing that is useful to report at every execution,
172
+
-`warn` for conditions that are likely to affect the expected behaviour of the code,
173
+
-`error` for problems that lead to an unwanted behaviour of the code,
174
+
-`fatal` for critical problems that make further running of the code impossible or useless.
166
175
- Include only needed headers but do not rely on implicitly included headers.
167
176
- Organise `#include`s into groups (separated by a blank line) in the following order:
168
177
- C++
@@ -176,8 +185,10 @@ Workflow | File | Type
176
185
- Sort `#include`s alphabetically within a group.
177
186
- Avoid using hard-coded PDG codes. Use their `enum` names instead
178
187
(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).
190
+
- Use `Type const&` for table subscriptions in function arguments.
191
+
- Declare iterators in range-based `for` loops over tables with `const auto&`.
181
192
- Test your code before making a pull request.
182
193
- Check that your branch compiles without warnings.
183
194
- Propagate your changes into the [Run3Analysisvalidation](https://github.com/AliceO2Group/Run3Analysisvalidation/tree/master/codeHF#add-a-new-workflow) configuration.
@@ -210,6 +221,7 @@ Organising the code in a well defined structure makes it easier to navigate thro
210
221
-`init` function
211
222
- helper functions
212
223
-`process` function(s)
224
+
- Put one process function argument per line.
213
225
-`PROCESS_SWITCH` follows immediately after the function definition.
0 commit comments