Skip to content

Conversation

@PetrilloAtWork
Copy link
Member

This branch provides two different, unrelated maintenance changes:

  1. removed dependency of sbnobj::Common_CRT from larcorealg::Geometry
  2. initialisation of sbn::crt::CRTPMTMatching data members

Explanations follow.

This PR is based on develop of sbnobj. It is also needed by ICARUS, which is not up to date with this sbnobj version (around v10_11_00, while ICARUS develop is stuck at v10_06_xx).

Reviewers:

Dependency of sbnobj::Common_CRT from larcorealg::Geometry

sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh used to include on larcorealg/Geometry/GeometryCore.h for no reason, and, accordingly, the sbnobj::Common_CRT library was linked to larcorealg::Geometry.
Whenever ROOT (interactive) is requested a CRT data class (sbn::crt::CRTHit, sbn::crt::CRTHitT0TaggingInfo... anything in that library), it loads sbnobj::Common_CRT library, then loads larcorealg::Geometry and its header GeometryCore.h.
Currently ROOT is not able to load that header, with the error:

  module "span" {
         ^
/cvmfs/larsoft.opensciencegrid.org/products/range/v3_0_12_0/include/range/v3/range/concepts.hpp:25:10: note: submodule of top-level module 'std' implicitly imported here
#include <span>
         ^
/cvmfs/larsoft.opensciencegrid.org/products/root/v6_28_12/Linux64bit+3.10-2.17-e26-p3915-prof/etc/cling/std.modulemap:312:10: error: module 'std.span' requires feature 'cplusplus20'
  module "span" {
         ^
/cvmfs/larsoft.opensciencegrid.org/products/range/v3_0_12_0/include/range/v3/range/access.hpp:27:10: note: submodule of top-level module 'std' implicitly imported here
#include <span>
         ^

and therefore fails to load the sbn::crt class.
This inclusion and link is likely a residual from earlier versions of the class, but it is superfluous now.

So I removed it.

Initialisation of sbn::crt::CRTPMTMatching

For an unknown reason, the inline initialisation of the data members of sbn::crt::CRTPMTMatching was commented out during the move from icaruscode to sbnobj.
I am restoring them, since we do not want uninitialised data wandering across our data files.
I am calling for a review by @aheggest, who led the move in 2023, in case she remembers a rationale behind that choice.

@PetrilloAtWork PetrilloAtWork added the bug Something isn't working label Oct 23, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Removes unnecessary dependency between sbnobj::Common_CRT and larcorealg::Geometry that was causing ROOT loading failures, and restores inline initialization of data members in sbn::crt::CRTPMTMatching to prevent uninitialized data.

  • Removed unused larcorealg/Geometry/GeometryCore.h include from CRTHitT0TaggingInfo.hh
  • Replaced larcorealg::Geometry library dependency with larcoreobj::headers in CMakeLists.txt
  • Restored inline initialization for all data members in MatchedCRT and CRTPMTMatching structs

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh Removed unused GeometryCore.h include that was causing ROOT loading failures
sbnobj/Common/CRT/CMakeLists.txt Updated library dependencies to remove larcorealg::Geometry and use larcoreobj::headers instead
sbnobj/Common/CRT/CRTPMTMatching.hh Restored inline initialization for all data members in MatchedCRT and CRTPMTMatching structs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@francescopoppi
Copy link
Contributor

Ouch! The initialized variables might explain the differences we saw!

Thanks Gianluca for this huge bug fix!

Copy link
Contributor

@francescopoppi francescopoppi left a comment

Choose a reason for hiding this comment

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

needless to say! Uninitialized variables are probably the culprits for the very reason we found the dependency issues!

@kjplows
Copy link
Contributor

kjplows commented Nov 4, 2025

trigger build LArSoft/lar*@LARSOFT_SUITE_v10_11_01

@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 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

@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

@kjplows
Copy link
Contributor

kjplows commented Nov 5, 2025

@PetrilloAtWork , got this failure on the SBND CI:

4338: FAILED: sbnobj/sbnobj/Common/CRT/CMakeFiles/sbnobj_Common_CRT_dict.dir/sbnobj_Common_CRT_dict.cpp.o 
4339: /cvmfs/larsoft.opensciencegrid.org/products/gcc/v12_1_0/Linux64bit+3.10-2.17/bin/g++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DNDEBUG -Dsbnobj_Common_CRT_dict_EXPORTS -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/srcs/sbnobj -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/build_slf7.x86_64/sbnobj -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/srcs/sbnanaobj -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/build_slf7.x86_64/sbnanaobj -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/srcs/sbnalg -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/build_slf7.x86_64/sbnalg -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/srcs/sbndaq_artdaq_core -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/build_slf7.x86_64/sbndaq_artdaq_core -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/srcs/sbncode -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/build_slf7.x86_64/sbncode -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/srcs/sbndutil -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/build_slf7.x86_64/sbndutil -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/srcs/sbndcode -I/scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/build_slf7.x86_64/sbndcode -isystem /cvmfs/larsoft.opensciencegrid.org/products/canvas/v3_16_04/include -isystem /cvmfs/larsoft.opensciencegrid.org/products/fhiclcpp/v4_18_04/include -isystem /cvmfs/larsoft.opensciencegrid.org/products/cetlib/v3_18_02/slf7.x86_64.e26.prof/include -isystem /cvmfs/larsoft.opensciencegrid.org/products/boost/v1_82_0/Linux64bit+3.10-2.17-e26-prof/include -isystem /cvmfs/larsoft.opensciencegrid.org/products/cetlib_except/v1_09_01/include -isystem /cvmfs/larsoft-ib.opensciencegrid.org/LArSoft/LArSoft_custom_slf7_e26_prof_20251104_104342/localProducts_LArSoft_LArSoft_lar_ci_e26_prof/larcoreobj/v10_00_00/include -isystem /cvmfs/larsoft-ib.opensciencegrid.org/LArSoft/LArSoft_custom_slf7_e26_prof_20251104_104342/localProducts_LArSoft_LArSoft_lar_ci_e26_prof/lardataobj/v10_03_00/include -isystem /cvmfs/larsoft.opensciencegrid.org/products/root/v6_28_12/Linux64bit+3.10-2.17-e26-p3915-prof/include -g -O3 -fno-omit-frame-pointer -DNDEBUG -std=c++17 -fPIC -Werror -frecord-gcc-switches -grecord-gcc-switches -Wall -Werror=return-type -pedantic -Wno-unused-local-typedefs -MD -MT sbnobj/sbnobj/Common/CRT/CMakeFiles/sbnobj_Common_CRT_dict.dir/sbnobj_Common_CRT_dict.cpp.o -MF sbnobj/sbnobj/Common/CRT/CMakeFiles/sbnobj_Common_CRT_dict.dir/sbnobj_Common_CRT_dict.cpp.o.d -o sbnobj/sbnobj/Common/CRT/CMakeFiles/sbnobj_Common_CRT_dict.dir/sbnobj_Common_CRT_dict.cpp.o -c /scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/build_slf7.x86_64/sbnobj/sbnobj/Common/CRT/sbnobj_Common_CRT_dict.cpp
4340: In file included from /cvmfs/larsoft-ib.opensciencegrid.org/LArSoft/LArSoft_custom_slf7_e26_prof_20251104_104342/localProducts_LArSoft_LArSoft_lar_ci_e26_prof/lardataobj/v10_03_00/include/lardataobj/RecoBase/Trajectory.h:18,
4341:                  from /cvmfs/larsoft-ib.opensciencegrid.org/LArSoft/LArSoft_custom_slf7_e26_prof_20251104_104342/localProducts_LArSoft_LArSoft_lar_ci_e26_prof/lardataobj/v10_03_00/include/lardataobj/RecoBase/TrackTrajectory.h:19,
4342:                  from /cvmfs/larsoft-ib.opensciencegrid.org/LArSoft/LArSoft_custom_slf7_e26_prof_20251104_104342/localProducts_LArSoft_LArSoft_lar_ci_e26_prof/lardataobj/v10_03_00/include/lardataobj/RecoBase/Track.h:13,
4343:                  from /scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/srcs/sbnobj/sbnobj/Common/CRT/classes.h:3,
4344:                  from /scratch/workspace/sbnd_ci/label_exp/swarm/label_exp2/swarm/SBND/build_slf7.x86_64/sbnobj/sbnobj/Common/CRT/sbnobj_Common_CRT_dict.cpp:38:
4345: /cvmfs/larsoft-ib.opensciencegrid.org/LArSoft/LArSoft_custom_slf7_e26_prof_20251104_104342/localProducts_LArSoft_LArSoft_lar_ci_e26_prof/lardataobj/v10_03_00/include/lardataobj/RecoBase/TrackingTypes.h:5:10: fatal error: larcorealg/Geometry/geo_vectors_utils.h: No such file or directory
4346:     5 | #include "larcorealg/Geometry/geo_vectors_utils.h"
4347:       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4348: compilation terminated.

I tried adding the following line to sbnobj/Common/CRT/CMakeLists.txt , and sbnobj compiles -- but sbndcode fails to compile. Error stack:

/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbndcode/sbndcode/CRT/CRTReco/CRTTrackProducer_module.cc: In member function ‘std::vector<std::pair<sbnd::crt::CRTTrack, std::set<unsigned int> > > sbnd::crt::CRTTrackProducer::CreateTrackCandidates(const std::vector<art::Ptr<sbnd::crt::CRTSpacePoint> >&, const art::FindOneP<sbnd::crt::CRTCluster>&)’:
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbndcode/sbndcode/CRT/CRTReco/CRTTrackProducer_module.cc:249:111: error: no matching function for call to ‘sbnd::crt::CRTTrack::CRTTrack(<brace-enclosed initializer list>, double&, double&, double&, double&, const double&, const double&, const std::vector<sbnd::crt::CRTTagger>&)’
  249 |                       const CRTTrack track({fitStart, fitMid, fitEnd}, t0, et0, t1, et1, pe, tof, used_taggers);
      |                                                                                                               ^
In file included from /exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbndcode/sbndcode/CRT/CRTReco/CRTTrackProducer_module.cc:27:
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:40:5: note: candidate: ‘sbnd::crt::CRTTrack::CRTTrack(const std::vector<ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<double>, ROOT::Math::GlobalCoordinateSystemTag> >&, const double&, const double&, const double&, const double&, const double&, const double&, const std::set<sbnd::crt::CRTTagger>&)’
   40 |     CRTTrack(const std::vector<geo::Point_t> &_points, const double &_ts0, const double &_ets0,
      |     ^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:42:41: note:   no known conversion for argument 8 from ‘const std::vector<sbnd::crt::CRTTagger>’ to ‘const std::set<sbnd::crt::CRTTagger>&’
   42 |              const std::set<CRTTagger> &_taggers);
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:36:5: note: candidate: ‘sbnd::crt::CRTTrack::CRTTrack(const geo::Point_t&, const geo::Point_t&, const double&, const double&, const double&, const double&, const double&, const double&, const std::set<sbnd::crt::CRTTagger>&)’
   36 |     CRTTrack(const geo::Point_t &_start, const geo::Point_t &_end, const double &_ts0, const double &_ets0,
      |     ^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:36:5: note:   candidate expects 9 arguments, 8 provided
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:34:5: note: candidate: ‘sbnd::crt::CRTTrack::CRTTrack()’
   34 |     CRTTrack();
      |     ^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:34:5: note:   candidate expects 0 arguments, 8 provided
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:21:9: note: candidate: ‘sbnd::crt::CRTTrack::CRTTrack(const sbnd::crt::CRTTrack&)’
   21 |   class CRTTrack {
      |         ^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:21:9: note:   candidate expects 1 argument, 8 provided
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbndcode/sbndcode/CRT/CRTReco/CRTTrackProducer_module.cc:269:83: error: no matching function for call to ‘sbnd::crt::CRTTrack::CRTTrack(const geo::Point_t&, const geo::Point_t&, double&, double&, double&, double&, const double&, const double&, const std::vector<sbnd::crt::CRTTagger>&)’
  269 |           const CRTTrack track(start, end, t0, et0, t1, et1, pe, tof, used_taggers);
      |                                                                                   ^
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:40:5: note: candidate: ‘sbnd::crt::CRTTrack::CRTTrack(const std::vector<ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<double>, ROOT::Math::GlobalCoordinateSystemTag> >&, const double&, const double&, const double&, const double&, const double&, const double&, const std::set<sbnd::crt::CRTTagger>&)’
   40 |     CRTTrack(const std::vector<geo::Point_t> &_points, const double &_ts0, const double &_ets0,
      |     ^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:40:5: note:   candidate expects 8 arguments, 9 provided
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:36:5: note: candidate: ‘sbnd::crt::CRTTrack::CRTTrack(const geo::Point_t&, const geo::Point_t&, const double&, const double&, const double&, const double&, const double&, const double&, const std::set<sbnd::crt::CRTTagger>&)’
   36 |     CRTTrack(const geo::Point_t &_start, const geo::Point_t &_end, const double &_ts0, const double &_ets0,
      |     ^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:38:41: note:   no known conversion for argument 9 from ‘const std::vector<sbnd::crt::CRTTagger>’ to ‘const std::set<sbnd::crt::CRTTagger>&’
   38 |              const std::set<CRTTagger> &_taggers);
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:34:5: note: candidate: ‘sbnd::crt::CRTTrack::CRTTrack()’
   34 |     CRTTrack();
      |     ^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:34:5: note:   candidate expects 0 arguments, 9 provided
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:21:9: note: candidate: ‘sbnd::crt::CRTTrack::CRTTrack(const sbnd::crt::CRTTrack&)’
   21 |   class CRTTrack {
      |         ^~~~~~~~
/exp/sbnd/app/users/kplows/sbncode_releases/sbnbuild/BuildAreas/v10_11_01_sbn_04.11.2025_101157/srcs/sbnobj/sbnobj/SBND/CRT/CRTTrack.hh:21:9: note:   candidate expects 1 argument, 9 provided

-- summoning @henrylay97 to comment on this?

@henrylay97
Copy link
Member

Odd one this, @kjplows could you clarify what line you added to sbnobj/Common/CRT/CMakeLists.txt? I couldn't reproduce the SBND failure you show above.

The original compile error is odd though because it is complaining about a header in lardataobj that should already have the right libraries.

I was able to fix this by adding larcorealg::geo_vectors_utils to sbnobj/Common/CRT/CMakeLists.txt. @PetrilloAtWork can probably comment on the appropriateness of this as a solution, I just know it works 😆

@kjplows
Copy link
Contributor

kjplows commented Nov 5, 2025

Ah, sorry! Perils of late-night comments..
I added larcorealg::headers to the CMakeLists.

Copy link
Contributor

@aheggest aheggest left a comment

Choose a reason for hiding this comment

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

Thanks @PetrilloAtWork for catching that these variables were left uninitialized! I approve these changes.

@kjplows
Copy link
Contributor

kjplows commented Nov 21, 2025

trigger build LArSoft/lar*@LARSOFT_SUITE_v10_12_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 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 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

@kjplows
Copy link
Contributor

kjplows commented Nov 21, 2025

@PetrilloAtWork , would Henry's fix be appropriate?

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

Labels

bug Something isn't working

Projects

Status: Testing

Development

Successfully merging this pull request may close these issues.

6 participants