Skip to content
Snippets Groups Projects

Allow duplication of GeoAlignableTransforms for alignable elements

Closed Nicholas Styles requested to merge nstyles/GeoModel:GeoAlignableTranformFix into main
2 unresolved threads

Change to try and address Issue #116. The same GeoAlignableTransform was being used for multiple elements to be aligned because the de-duplication already found a transformation with that name, so it returned that instead of creating a new one.

@rbianchi and @jojungge may want to comment on whether they are happy with this fix or it should be addressed in a different way.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
30 30
31 31 GeoIntrusivePtr<RCBase> item{nullptr};
32 32 EntryMap::iterator entry;
33 if (name.empty()) { // Unnamed item; cannot store in the map; make a new one
33 if (name.empty() || allowDuplication) { // Unnamed item or an item that can be duplicated; cannot store in the map; make a new one
34 34 item = make(element, gmxUtil);
35 35 } else if ((entry = m_map.find(name)) == m_map.end()) { // Not in; make a new one
36 36 item = make(element, gmxUtil);
37 37 m_map[name] = item; // And put it in the map
  • Suggested change
    37 m_map[name] = item; // And put it in the map
    37 if (!dynamic_pointer_cast<GeoAlignableTransform>(item))
    38 m_map[name] = item; // And put it in the map

    wouldn't that be a 1-line solution?

  • Yes, this would also be an option - I just wonder if putting this kind of special handling of a specific type of object in a single place quite deep in the code might end up being a bit obscure? It might want a bit of signposting somehow?

  • Please register or sign in to reply
    • I guess the compilation failure in GeoModelATLAS is expected given the interface changes.

      As for the geomodel_athena issues, hopefully, things will improve once the next nightly build of the Athena main becomes available. This is true for all other recent GeoModel MRs as well.

    • I guess the compilation failure in GeoModelATLAS is expected given the interface changes.

      Looks to me rather like an authentication issue?

      git clone https://${EOS_ACCOUNT_USERNAME}:${GEOMODEL_READ_ACCESS}@gitlab.cern.ch/atlas/geomodelatlas/GeoModelATLAS.git
      Cloning into 'GeoModelATLAS'...
      remote: HTTP Basic: Access denied. If a password was provided for Git authentication, the password was incorrect or you're required to use a token instead of a password. If a token was provided, it was either incorrect, expired, or improperly scoped. See https://gitlab.cern.ch/help/topics/git/troubleshooting_git.md#error-on-git-fetch-http-basic-access-denied
      fatal: Authentication failed for 'https://gitlab.cern.ch/atlas/geomodelatlas/GeoModelATLAS.git/'

      As for the geomodel_athena issues, hopefully, things will improve once the next nightly build of the Athena main becomes available. This is true for all other recent GeoModel MRs as well

      I had this problem with all my GeoModel MRs for some time...

      ================================================================================
                         Rebase the GeoModel code base w.r.t. main
      ================================================================================
      CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
      fatal: ambiguous argument 'origin/main': unknown revision or path not in the working tree.

      Why is it suspected that this is due to the Athena nightly?

    • Hi @nstyles, sorry I should have looked at the logs before writing that post. I've seen similar problems in the past when I was opening MRs from my private fork. We certainly need to investigate and fix them. In the meantime, a quick solution would be to push your changes to a feature branch in the GeoModel repo and open an MR from there.

      Edited by Vakhtang Tsulaia
    • OK, I'll open a new MR from the other repo

    • Actually, I'm not sure if I have permission to do that? I don't seem to be able to create or push to a branch in the main repo...

    • OK, someone gave me developer rights, so I'll close this one and we can follow up in !397 (merged)

      Edited by Nicholas Styles
    • Please register or sign in to reply
  • Nicholas Styles mentioned in merge request !397 (merged)

    mentioned in merge request !397 (merged)

  • Please register or sign in to reply
    Loading