Skip to content

Conversation

wdconinc
Copy link
Contributor

@wdconinc wdconinc commented Oct 7, 2025

Briefly, what does this PR introduce?

This PR applies clang-tidy readability-redundant-casting check fixes from main.

What kind of change does this PR introduce?

  • Bug fix (issue: code base should satisfy PR clang-tidy requirements)
  • New feature (issue #__)
  • Documentation update
  • Other: __

Please check if this PR fulfills the following:

  • Tests for the changes have been added
  • Documentation has been added / updated
  • Changes have been communicated to collaborators

Does this PR introduce breaking changes? What changes might users need to make to their code?

No.

Does this PR change default behavior?

No.

@wdconinc wdconinc enabled auto-merge October 7, 2025 23:54
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/2)


t_fEMC_towers_cellE[iCell] = (float)input_tower_recSav.at(iCell).energy;
t_fEMC_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time;
t_fEMC_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wut?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see what's going on there...

t_fEMC_towers_cellE[iCell] = (float)input_tower_recSav.at(iCell).energy;
t_fEMC_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time;
t_fEMC_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy;
t_fEMC_towers_cellT[iCell] = input_tower_recSav.at(iCell).time;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_fEMC_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time;
t_fEMC_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy;
t_fEMC_towers_cellT[iCell] = input_tower_recSav.at(iCell).time;
t_fEMC_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_fEMC_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy;
t_fEMC_towers_cellT[iCell] = input_tower_recSav.at(iCell).time;
t_fEMC_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx;
t_fEMC_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_fEMC_towers_cellT[iCell] = input_tower_recSav.at(iCell).time;
t_fEMC_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx;
t_fEMC_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy;
t_fEMC_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_fEMC_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx;
t_fEMC_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy;
t_fEMC_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA;
t_fEMC_towers_clusterIDB[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDB;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_fEMC_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA;
t_fEMC_towers_clusterIDB[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDB;
t_fEMC_towers_cellTrueID[iCell] = (int)input_tower_recSav.at(iCell).tower_trueID;
t_fEMC_towers_cellTrueID[iCell] = input_tower_recSav.at(iCell).tower_trueID;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

for (const auto cluster : fEMCClustersF) {
if (iECl < maxNCluster && enableTreeCluster) {
t_fEMC_cluster_E[iECl] = (float)cluster.getEnergy();
t_fEMC_cluster_E[iECl] = cluster.getEnergy();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

if (iECl < maxNCluster && enableTreeCluster) {
t_fEMC_cluster_E[iECl] = (float)cluster.getEnergy();
t_fEMC_cluster_E[iECl] = cluster.getEnergy();
t_fEMC_cluster_NCells[iECl] = (int)cluster.getNhits();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_fEMC_cluster_Eta[iECl] =
(-1.) * std::log(std::tan((float)cluster.getIntrinsicTheta() / 2.));
t_fEMC_cluster_Phi[iECl] = (float)cluster.getIntrinsicPhi();
t_fEMC_cluster_Eta[iECl] = (-1.) * std::log(std::tan(cluster.getIntrinsicTheta() / 2.));
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (2/2)

(-1.) * std::log(std::tan((float)cluster.getIntrinsicTheta() / 2.));
t_fEMC_cluster_Phi[iECl] = (float)cluster.getIntrinsicPhi();
t_fEMC_cluster_Eta[iECl] = (-1.) * std::log(std::tan(cluster.getIntrinsicTheta() / 2.));
t_fEMC_cluster_Phi[iECl] = cluster.getIntrinsicPhi();
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic


t_lFHCal_towers_cellE[iCell] = (float)input_tower_recSav.at(iCell).energy;
t_lFHCal_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time;
t_lFHCal_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_lFHCal_towers_cellE[iCell] = (float)input_tower_recSav.at(iCell).energy;
t_lFHCal_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time;
t_lFHCal_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy;
t_lFHCal_towers_cellT[iCell] = input_tower_recSav.at(iCell).time;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_lFHCal_towers_cellT[iCell] = (float)input_tower_recSav.at(iCell).time;
t_lFHCal_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy;
t_lFHCal_towers_cellT[iCell] = input_tower_recSav.at(iCell).time;
t_lFHCal_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_lFHCal_towers_cellE[iCell] = input_tower_recSav.at(iCell).energy;
t_lFHCal_towers_cellT[iCell] = input_tower_recSav.at(iCell).time;
t_lFHCal_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx;
t_lFHCal_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_lFHCal_towers_cellT[iCell] = input_tower_recSav.at(iCell).time;
t_lFHCal_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx;
t_lFHCal_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy;
t_lFHCal_towers_cellIDz[iCell] = (short)input_tower_recSav.at(iCell).cellIDz;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_lFHCal_towers_cellIDx[iCell] = (short)input_tower_recSav.at(iCell).cellIDx;
t_lFHCal_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy;
t_lFHCal_towers_cellIDz[iCell] = (short)input_tower_recSav.at(iCell).cellIDz;
t_lFHCal_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_lFHCal_towers_cellIDy[iCell] = (short)input_tower_recSav.at(iCell).cellIDy;
t_lFHCal_towers_cellIDz[iCell] = (short)input_tower_recSav.at(iCell).cellIDz;
t_lFHCal_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA;
t_lFHCal_towers_clusterIDB[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDB;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

t_lFHCal_towers_clusterIDA[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDA;
t_lFHCal_towers_clusterIDB[iCell] = (short)input_tower_recSav.at(iCell).tower_clusterIDB;
t_lFHCal_towers_cellTrueID[iCell] = (int)input_tower_recSav.at(iCell).tower_trueID;
t_lFHCal_towers_cellTrueID[iCell] = input_tower_recSav.at(iCell).tower_trueID;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ cppcoreguidelines-pro-bounds-pointer-arithmetic ⚠️
do not use pointer arithmetic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant