Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous overloads for Vector3f operators in edm4hep and edm4eic #56

Open
wdconinc opened this issue Oct 8, 2023 · 0 comments
Open

Comments

@wdconinc
Copy link
Contributor

wdconinc commented Oct 8, 2023

Environment: (where does this bug occur, have you tried other environments)

  • Which branch (often main for latest released): 3.0.1
  • Which version (or HEAD for the most recent on git): 3.0.1
  • Any specific OS or system where the issue occurs? on my local system
  • Any special versions of ROOT or Geant4? nothing special, edm4hep-0.9, edm4eic-3.0.1, no modifications

Steps to reproduce: (give a step by step account of how to trigger the bug)

  1. Attempt to compile EICrecon

Expected Result: (what do you expect when you execute the steps above)

Compilation should not fail due to ambiguous overloads in the data models.

Actual Result: (what do you get when you execute the steps above)

/home/wdconinc/git/EICrecon/src/algorithms/pid/ParticlesWithPID.cc: In member function ‘bool eicrecon::ParticlesWithPID::linkCherenkovPID(edm4eic::MutableReconstructedParticle&, const edm4eic::CherenkovParticleIDCollection&, edm4hep::ParticleIDCollection&)’:
/home/wdconinc/git/EICrecon/src/algorithms/pid/ParticlesWithPID.cc:263:69: error: ambiguous overload for ‘operator/’ (operand types are ‘const edm4hep::Vector3f’ and ‘std::size_t’ {aka ‘long unsigned int’})
  263 |                 in_track_p = in_track_p + ( in_track_point.momentum / in_track.points_size() );
      |                                             ~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
      |                                                            |                              |
      |                                                            const edm4hep::Vector3f        std::size_t {aka long unsigned int}
In file included from /home/wdconinc/git/EICrecon/src/algorithms/pid/ParticlesWithPID.cc:6:
/opt/local/include/edm4eic/vector_utils.h:153:34: note: candidate: ‘V operator/(const V&, double) [with V = edm4hep::Vector3f]’
  153 | template <edm4eic::VectorND V> V operator/(const V& v, const double d) {
      |                                  ^~~~~~~~
In file included from /home/wdconinc/git/EICrecon/src/algorithms/pid/ParticlesWithPID.cc:7:
/opt/local/include/edm4hep/utils/vector_utils.h:266:20: note: candidate: ‘constexpr V edm4hep::operator/(const V&, double) [with V = Vector3f]’
  266 | inline constexpr V operator/(const V& v, const double d) {
      |                    ^~~~~~~~

Additional Context

I consider this a bug on the edm4eic side, since we should be able to reuse the edm4hep vector utils. I also wonder why this suddenly doesn't work anymore (I'm experimenting with c++20 support, so maybe template resolution rules are slightly different such that constexpr is now treated as different from non-constexpr).

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

No branches or pull requests

1 participant