Skip to content

Add parameters needed for 6.3 lattice and magnet visualization. #890

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

simonge
Copy link
Contributor

@simonge simonge commented Jun 18, 2025

Briefly, what does this PR introduce?

Moves the code and visualization changes from #838 so that it will reflect the minimal differences required to update the lattice.

Mostly this adds parameters which are set to 0 in the current configuration but need to be set in the update.

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • 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

@simonge simonge requested review from wdconinc and a team June 18, 2025 20:22
wdconinc
wdconinc previously approved these changes Jun 18, 2025
Copy link
Contributor

@wdconinc wdconinc 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. Have not done a one to one comparison with capybara.

Question: what is the element id for the yoke for? Do you intend to make that sensitive for some reason?

@nat93
Copy link
Contributor

nat93 commented Jun 19, 2025

Hi, I have created a PR for reference, so everyone is aware of the upcoming updates to the IR: #893
Related to this PR as well.

@simonge
Copy link
Contributor Author

simonge commented Jun 19, 2025

Question: what is the element id for the yoke for? Do you intend to make that sensitive for some reason?

It was a while ago I added that so not entirely sure. I believe the visualization wasn't working correctly without a detector element and the detector element didn't work without an id. Some/all of what has been added might be unnecessary.

@simonge
Copy link
Contributor Author

simonge commented Jun 19, 2025

Looks good to me. Have not done a one to one comparison with capybara.

What was the problem with publishing the capybara here as is done in EICRecon? I didn't follow why it was added then reverted.

@wdconinc
Copy link
Contributor

Looks good to me. Have not done a one to one comparison with capybara.

What was the problem with publishing the capybara here as is done in EICRecon? I didn't follow why it was added then reverted.

There were errors in running it due to the different structure of other artifacts (different directory), so it always failed the pipelines. It wasn't immediately clear how to fix it, so we reverted to avoid blocking work. I haven't found the time to get back to that. #859 was supposed to fix it and includes a link to https://github.com/eic/epic/actions/runs/14817178151/job/41749142343#step:7:7 that shows how it failed.

@simonge simonge requested a review from wdconinc June 20, 2025 19:28
Comment on lines 54 to 56
DetElement yoke_de(sdet, name, id);
yoke_de.setPlacement(yoke_pv);
yoke_de.setAttributes(description, v_yoke, x_det.regionStr(), x_det.limitsStr(), vis_name);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd still like to avoid this, if we can. We only have 255 detector IDs in our 8-bit field for segmentations, and less than half are left. If we start giving IDs to all magnets, we're going to run out quickly.

Note that you can add regions and limits to volumes too:

DDCore/include/DD4hep/Volumes.h:
    const Volume& setAttributes(const Detector& description, const std::string& region, const std::string& limits,
                                const std::string& vis) const;

Can you verify that visualization is not affected when avoiding the ID for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed the DetElement and recovered the visualization using setAttributes. The physical volume ID is still required to give the volume a unique identifier in the tree but shouldn't count towards the detector IDs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants