-
Notifications
You must be signed in to change notification settings - Fork 32
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
WIP: Add simple test to compute photon energy deposition #794
WIP: Add simple test to compute photon energy deposition #794
Conversation
… in StepCollectorTestBase since we only want to initialise once (otherwise results are the same for each batch in CaloTestBase::run)
@@ -51,8 +51,13 @@ class MctruthTestBase : virtual public StepCollectorTestBase | |||
RunResult run(size_type num_tracks, size_type num_steps); | |||
|
|||
protected: | |||
virtual void gather_batch_results(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
virtual void gather_batch_results(); | |
void gather_batch_results() override; |
FYI I ran the test built with both ORANGE:
and VecGeom:
The ORANGE results are consistent with the expected results currently in the test, and the actual value in the failing test matches the VecGeom value, so this should explain the difference in the results. |
Oh thanks for this @amandalund ! How could I enforce using either ORANGE or VecGeom? |
If VecGeom is configured in CMake it should be the default. You can make 100% sure by setting the cmake variable |
It is already set to this value, and
is set in celeritas_config_h. |
Hmm, that's odd... could you try building with both VecGeom and ORANGE and print out the test results for each? |
Closing for now but will use this as a foundation for completing #809l |
Still WIP - one test is failing depending on which system I run it on.
Purpose
Ultimately the goal is to enable photon energy deposition tallies in Celeritas. The addition of this test is a step towards that goal.
New features
TestPhotonCaloTest
(inherits fromCaloTest
) to StepCollector.test.cc.num_batches
, to perform a loop over several batches of tracks.StepCollectorTestBase
which are called inrun_impl
. This is because the Stepper initialisation should only occur once, and thus the loop over batches needs to be performed insiderun_impl
. However, accumulation of results needs to occur between batches, so this is now handled bygenerate_batch_results
, with intialization and finalization of results occuring ininitialize
andfinalize
respectively.Other changes
StepCollectorTestBase
was the need to add additional state attributes and refactor the run methods within the other tests that inherit from this class (e.g. RunResults is now a member variable).