Skip to content

[PWGJE] Use const& and std::move to avoid copies - #17710

Merged
nzardosh merged 1 commit into
AliceO2Group:masterfrom
vkucera:const-PWGJE
Sep 7, 2026
Merged

[PWGJE] Use const& and std::move to avoid copies#17710
nzardosh merged 1 commit into
AliceO2Group:masterfrom
vkucera:const-PWGJE

Conversation

@vkucera

@vkucera vkucera commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Mostly done automatically by Clang-Tidy.

Mostly done automatically by Clang-Tidy.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 575 errors, ⚠️ 701 warnings, 🔕 5 disabled

@github-actions github-actions Bot changed the title Use const& and std::move to avoid copies [PWGJE] Use const& and std::move to avoid copies Sep 1, 2026
@vkucera
vkucera marked this pull request as ready for review September 1, 2026 15:54
@alibuild

alibuild commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for e5fc55e at 2026-09-07 13:14:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

alibuild commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for e5fc55e at 2026-09-05 21:07:

## sw/BUILD/O2Physics-latest/log
c++: fatal error: Killed signal terminated program cc1plus
c++: fatal error: Killed signal terminated program cc1plus
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

alibuild commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for e5fc55e at 2026-09-06 15:17:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 83 errors and 570 warnings.'
Found 83 errors and 570 warnings.
++ [[ 83 -gt 0 ]]
++ cat /sw/BUILD/55419fd529c5aa495cd6d756a7c5374a2a43fc9e/O2Physics-code-check/errors.txt
PWGJE/Core/JetDerivedDataUtilities.h:743:10: error: variable 'end' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGJE/Core/JetFindingUtilities.h:346:82: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGJE/Core/MlResponseHfTagging.h:45:9: error: function-like macro 'CHECK_AND_FILL_VEC_BTAG_FULL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGJE/Core/MlResponseHfTagging.h:47:5: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGJE/Core/MlResponseHfTagging.h:47:25: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGJE/Core/MlResponseHfTagging.h:53:9: error: function-like macro 'CHECK_AND_FILL_VEC_BTAG' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGJE/Core/MlResponseHfTagging.h:55:5: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGJE/Core/MlResponseHfTagging.h:55:25: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGJE/Core/MlResponseHfTagging.h:401:9: error: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:32:8: error: constructor does not initialize these fields: algorithm [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:51:5: error: 'algorithm' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:52:5: error: 'storageID' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:53:5: error: 'selectedCellType' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:54:5: error: 'name' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:55:5: error: 'seedEnergy' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:56:5: error: 'minCellEnergy' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:57:5: error: 'timeMin' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:58:5: error: 'timeMax' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:59:5: error: 'timeDiff' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:60:5: error: 'doGradientCut' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:61:5: error: 'gradientCut' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/DataModel/EMCALClusterDefinition.h:62:5: error: 'recalcShowerShape5x5' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/TableProducer/derivedDataProducer.cxx:76:8: error: constructor does not initialize these fields: ccdb, lut, pdgDatabase, runNumber, hadronicRate, withCollisionAssociator [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGJE/TableProducer/derivedDataProducer.cxx:491:11: error: variable 'sigmaDCAXYZ2' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGJE/TableProducer/derivedDataProducer.cxx:519:17: error: variable 'sigmaDCAXYZ2' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGJE/TableProducer/derivedDataProducer.cxx:540:17: error: variable 'sigmaDCAXYZ' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGJE/TableProducer/derivedDataWriter.cxx:50:8: error: constructor does not initialize these fields: precisionPositionMask, precisionMomentumMask [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGJE/TableProducer/derivedDataWriter.cxx:487:11: error: no header providing "SETBIT" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGJE/TableProducer/mcOutlierRejector.cxx:79:34: error: unchecked access to optional value [bugprone-unchecked-optional-access,-warnings-as-errors]
PWGJE/Tasks/emcalGammaGammaBcWise.cxx:85:84: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGJE/Tasks/emcalGammaGammaBcWise.cxx:131:8: error: constructor does not initialize these fields: emcalGeom [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:146:3: error: constructor does not initialize these fields: row, col, supermodulecategory [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:148:5: error: 'eta' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:149:5: error: 'phi' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:150:5: error: 'energy' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:151:5: error: 'theta' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:157:5: error: 'clusterid' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:158:5: error: 'cellid' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:195:8: error: constructor does not initialize these fields: NAcceptanceCategories [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:368:9: error: variable 'row' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:368:14: error: variable 'col' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx:405:9: error: variable 'row' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
[0 more errors; see full log]

Full log here.

@vkucera

vkucera commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Ping

@nzardosh
nzardosh enabled auto-merge (squash) September 7, 2026 08:00
@nzardosh

nzardosh commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

there is an error in the o2 build

@nzardosh
nzardosh merged commit e292500 into AliceO2Group:master Sep 7, 2026
12 of 15 checks passed
@vkucera
vkucera deleted the const-PWGJE branch September 7, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants