Skip to content

fix: avoid geoManager->GetCurrentMatrix in LGADChargeSharing::_global2Local #1811

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 2 commits into
base: main
Choose a base branch
from

Conversation

wdconinc
Copy link
Contributor

Briefly, what does this PR introduce?

This PR avoids a thread-unsafe geoManager->GetCurrentMatrix() call which relies on cached state in the geoManager object.

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.

@github-actions github-actions bot added the topic: far-forward Far forward reconstruction label Apr 17, 2025
@wdconinc wdconinc requested a review from veprbl April 17, 2025 18:57
@wdconinc wdconinc force-pushed the LGADChargeSharing_global2Local branch from d77347d to 6749de4 Compare April 18, 2025 02:39
@wdconinc wdconinc enabled auto-merge April 18, 2025 02:43
@@ -163,18 +163,18 @@ double LGADChargeSharing::_integralGaus(double mean, double sd, double low_lim,
}

dd4hep::Position LGADChargeSharing::_cell2LocalPosition(const dd4hep::rec::CellID& cell) const {
Copy link
Member

Choose a reason for hiding this comment

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

@ssedd1123 Did this and _global2Local come from some other place?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean if I use _global2Local in any other classes? I don't think so. If you are asking where I get the inspiration for these codes, I get it by imitating the source code of CellIDPositionConverter.

Line 97 - 101 of https://github.com/AIDASoft/DD4hep/blob/ccb7365d16c219c18a2b345551bf8d02f5797662/DDRec/src/CellIDPositionConverter.cpp#L101 is where I learn how to convert between local and global coordinates.

Copy link
Member

Choose a reason for hiding this comment

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

If it was taken from somewhere else, we'd want to have it fixed there as well. It looks like we can remove these functions and just use CellIDPositionConverter::positionNominal?

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