Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Checks: '
-bugprone-easily-swappable-parameters,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-unchecked-optional-access,

-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-nodiscard,
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/linux-eic-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,12 @@ jobs:
with:
platform-release: "${{ env.platform }}:${{ env.release }}"
run: |
git diff ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} --name-only | tee changed_files.txt
# reduce headers until diff is stable
while [[ ${sha:-} != $(git diff | sha256sum) ]] ; do
sha=$(git diff | sha256sum)
echo $sha
iwyu_tool.py -p build $(git diff --name-only ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }}) -- -Xiwyu --verbose=3 -Xiwyu --no_fwd_decls -Xiwyu --cxx17ns -Xiwyu --mapping_file=${{github.workspace}}/.github/iwyu.imp -Xiwyu --regex=ecmascript | tee iwyu_fixes.log
iwyu_tool.py -p build $(cat changed_files.txt | grep -E '\.(cpp|cc|cxx|c\+\+)$' | paste -sd ' ') -- -Xiwyu --verbose=3 -Xiwyu --no_fwd_decls -Xiwyu --cxx17ns -Xiwyu --mapping_file=${{github.workspace}}/.github/iwyu.imp -Xiwyu --regex=ecmascript | tee iwyu_fixes.log
fix_includes.py --blank_lines --nosafe_headers --reorder --separate_project_includes="<tld>" --keep_iwyu_namespace_format < iwyu_fixes.log
git diff | tee iwyu_fixes.patch
done
Expand Down
4 changes: 4 additions & 0 deletions src/algorithms/tracking/ActsToTracks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ void ActsToTracks::process(const Input& input, const Output& output) const {
// Get the fitted track parameter
const auto& boundParam = traj->trackParameters(trackTip);
const auto& parameter = boundParam.parameters();
if (!boundParam.covariance().has_value()) {
warning("Track parameters do not have covariance matrix, skipping track");
continue;
}
const auto& covariance = *boundParam.covariance();

auto pars = track_parameters->create();
Expand Down
12 changes: 10 additions & 2 deletions src/algorithms/tracking/TrackPropagation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,16 @@ TrackPropagation::propagate(const edm4eic::Track& /* track */,
m_log->trace(" propagation result is OK");

// Pulling results to convenient variables
auto trackStateParams = *((*result).endParameters);
const auto& parameter = trackStateParams.parameters();
if (!(*result).endParameters.has_value()) {
m_log->trace(" propagation failed (endParameters not available)");
return nullptr;
}
auto trackStateParams = *((*result).endParameters);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bugprone-unchecked-optional-access ⚠️
unchecked access to optional value

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Surely now this one remaining bugprone-unchecked-optional-access warning is a false positive.

const auto& parameter = trackStateParams.parameters();
if (!trackStateParams.covariance().has_value()) {
m_log->trace(" propagation failed (covariance not available)");
return nullptr;
}
const auto& covariance = *trackStateParams.covariance();

// Path length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ void TrackingEfficiency_processor::Process(const std::shared_ptr<const JEvent>&
if (traj->hasTrackParameters(trackTip)) {
const auto& boundParam = traj->trackParameters(trackTip);
const auto& parameter = boundParam.parameters();
if (!boundParam.covariance().has_value()) {
m_log->debug("Track parameters do not have covariance matrix");
continue;
}
const auto& covariance = *boundParam.covariance();
m_log->debug("{:>10.2f} {:>10.2f} {:>10.2f} {:>10.3f} {:>10.4f} {:>10.3f} {:>12.4e} "
"{:>12.4e} {:>12.4e} {:>8.2f}",
Expand Down
Loading