Skip to content

Conversation

@mt82
Copy link
Contributor

@mt82 mt82 commented Dec 23, 2025

Default initialization values have been introduced for all CRTHit data members. This change ensures that variables are properly initialized at object creation, reducing the risk of undefined behavior and improving code reliability.

@mt82 mt82 linked an issue Dec 23, 2025 that may be closed by this pull request
@mt82 mt82 changed the title added initialization added initialization to CRTHit data members Dec 23, 2025
Copy link
Contributor

@kjplows kjplows left a comment

Choose a reason for hiding this comment

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

Looks good to me thanks! I'll let @PetrilloAtWork decide if using flavours of 0 is better than calling on std::numeric_limits<T> here; my one comment is if any CRT variables are expected to be 0 physically (looking at ts0_ns, x_pos etc) probably std::numeric_limits::lowest() is easier to interpret as nonsense.

Copy link
Member

@PetrilloAtWork PetrilloAtWork left a comment

Choose a reason for hiding this comment

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

Stupid GitHub ate my comment.

Which boiled down to: agree with @kjplows, define static constexpr double kInvalidD = std::numeric_limits<double>::lowest(); and kInvalidF for float, use those to initialise, and use -1 as plane value.

"Stupid GitHub" was an euphemism, by the way.

Copy link
Member

@PetrilloAtWork PetrilloAtWork left a comment

Choose a reason for hiding this comment

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

Stupid GitHub ate my comment.

Which boiled down to: agree with @kjplows, define static constexpr double kInvalidD = std::numeric_limits<double>::lowest(); and kInvalidF for float, use those to initialise, and use -1 as plane value.

"Stupid GitHub" was an euphemism, by the way.

…: plain -1 for integer-like variables and std::numeric_limits<>::lowest() for the others
@mt82 mt82 requested a review from PetrilloAtWork January 9, 2026 09:11
Copy link
Member

@PetrilloAtWork PetrilloAtWork left a comment

Choose a reason for hiding this comment

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

Approved, with my thanks.

@mt82 mt82 moved this from Partially reviewed to To merge in SBN software development Jan 15, 2026
@kjplows kjplows moved this from To merge to Testing in SBN software development Jan 15, 2026
@kjplows
Copy link
Contributor

kjplows commented Jan 15, 2026

trigger build ci_ref=v10_14_00_01 LArSoft/larpandoracontent@LARSOFT_SUITE_v10_14_02_01 LArSoft/larpandora@LARSOFT_SUITE_v10_14_02_01 LArSoft/larreco@LARSOFT_SUITE_v10_14_02_01 LArSoft/larrecodnn@LARSOFT_SUITE_v10_14_02_01 LArSoft/larana@LARSOFT_SUITE_v10_14_02_01 LArSoft/lareventdisplay@LARSOFT_SUITE_v10_14_02_01 LArSoft/larsoft@LARSOFT_SUITE_v10_14_02_01 LArSoft/lar*@LARSOFT_SUITE_v10_14_02 SBNSoftware/sbndaq-artdaq-core@v1_10_06 SBNSoftware/sbn*@SBN_SUITE_v10_14_02

@FNALbuild
Copy link

✔️ CI build for LArSoft Succeeded on slf7 for e26:prof -- details available through the CI dashboard

@FNALbuild
Copy link

✔️ CI build for LArSoft Succeeded on slf7 for c14:prof -- details available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for SBND Failed at phase build SBND on slf7 for e26:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for ICARUS Failed at phase build ICARUS on slf7 for e26:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build ICARUS phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for SBND Failed at phase build SBND on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for ICARUS Failed at phase build ICARUS on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build ICARUS phase logs

parent CI build details are available through the CI dashboard

@kjplows
Copy link
Contributor

kjplows commented Jan 16, 2026

trigger build LArSoft/lar*@LARSOFT_SUITE_v10_14_02 SBNSoftware/sbncode@v10_14_02 SBNSoftware/sbn*@SBN_SUITE_v10_14_02

@FNALbuild
Copy link

✔️ CI build for LArSoft Succeeded on slf7 for c14:prof -- details available through the CI dashboard

@FNALbuild
Copy link

✔️ CI build for LArSoft Succeeded on slf7 for e26:prof -- details available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for ICARUS Failed at phase build ICARUS on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build ICARUS phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for SBND Failed at phase build SBND on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for ICARUS Failed at phase build ICARUS on slf7 for e26:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build ICARUS phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link

❌ CI build for SBND Failed at phase build SBND on slf7 for e26:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

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

Projects

Status: Testing

Development

Successfully merging this pull request may close these issues.

CRTHit struct members not initialized

5 participants