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

Coin sorter V2 corrected with tests #652

Merged
merged 21 commits into from
Feb 18, 2025
Merged

Conversation

kochebina
Copy link
Collaborator

@tbaudier @nkrah @dsarrut

I don't know what happened to the prev. PR for CoinSorter... but here it the new one.
The corrected version of it is in this PR.
It is ready!

The ref data to be copied to opengate/tests/data/output_ref/test072 is here:
https://doi.org/10.6084/m9.figshare.28063244.v1

@tbaudier
Copy link
Contributor

Hello @kochebina

I integrated the data but the tests are failling. For example:

(venv) (base) tbaudier@eq4-tb-693 src % python test072_coinc_sorter_2keep_all.py
Opening /Users/tbaudier/Software/GatePython/opengate/opengate/tests/output/test072_coinc_sorter/test72_output_1.root ...
There are 7685 singles
{'EventID': 'int32_t', 'PostPosition_X': 'double', 'PostPosition_Y': 'double', 'PostPosition_Z': 'double', 'TotalEnergyDeposit': 'double', 'PreStepUniqueVolumeID': 'char*', 'GlobalTime': 'double'}
Traceback (most recent call last):
  File "/Users/tbaudier/Software/GatePython/opengate/opengate/tests/src/test072_coinc_sorter_2keep_all.py", line 69, in <module>
    main()
  File "/Users/tbaudier/Software/GatePython/opengate/opengate/tests/src/test072_coinc_sorter_2keep_all.py", line 48, in main
    coincidences = coincidences_sorter(
TypeError: coincidences_sorter() missing 1 required positional argument: 'maxDistanceZ'

@kochebina
Copy link
Collaborator Author

Hello @tbaudier,

I removed the old tests that are failing. Sorry for this oversight.

Cheers,
Olga

Hello @kochebina

I integrated the data but the tests are failling. For example:

(venv) (base) tbaudier@eq4-tb-693 src % python test072_coinc_sorter_2keep_all.py
Opening /Users/tbaudier/Software/GatePython/opengate/opengate/tests/output/test072_coinc_sorter/test72_output_1.root ...
There are 7685 singles
{'EventID': 'int32_t', 'PostPosition_X': 'double', 'PostPosition_Y': 'double', 'PostPosition_Z': 'double', 'TotalEnergyDeposit': 'double', 'PreStepUniqueVolumeID': 'char*', 'GlobalTime': 'double'}
Traceback (most recent call last):
  File "/Users/tbaudier/Software/GatePython/opengate/opengate/tests/src/test072_coinc_sorter_2keep_all.py", line 69, in <module>
    main()
  File "/Users/tbaudier/Software/GatePython/opengate/opengate/tests/src/test072_coinc_sorter_2keep_all.py", line 48, in main
    coincidences = coincidences_sorter(
TypeError: coincidences_sorter() missing 1 required positional argument: 'maxDistanceZ'

@kochebina
Copy link
Collaborator Author

kochebina commented Jan 8, 2025 via email

@kochebina
Copy link
Collaborator Author

For commit d091b94
the data should be used from here:
https://figshare.com/s/32013fc0f390238acbbb


if abs(time - time_window_open) <= time_window:

# remove if in the same volume
# Remove if in the same volume
if (
singles[i]["PreStepUniqueVolumeID"]
== singles[j]["PreStepUniqueVolumeID"]
):
break
Copy link
Contributor

Choose a reason for hiding this comment

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

@kochebina I wonder if this should be continue instead of break, because break finishes the inner loop in j and in this way, other coincidences in the same time window might be skipped.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good point! Thank you @gertvanhoey

@tbaudier
Copy link
Contributor

test085 are failing dur to modification of the data in that PR: #685

@dsarrut
Copy link
Contributor

dsarrut commented Feb 18, 2025

thanks !

@dsarrut dsarrut merged commit 6f5968c into OpenGATE:master Feb 18, 2025
31 checks passed
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

Successfully merging this pull request may close these issues.

4 participants