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

Fix radiative splitting ao #1011

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Conversation

mainegra
Copy link
Contributor

@mainegra mainegra commented Jun 9, 2023

Initial radiative splitting implementation naively just turned ON EGSnrc internal flag nbr_split to split brems and annihilation events uniformly. However no charged particle RR was played after pair production (i_play_RR) nor were secondary photons, produced by charged particles surviving RR after bremsstrahlung, split.

This PR fixes issue #1001

Implement radiative splitting + RR

  • Now turned ON before a radiative event for a primary or a fat charged particle.
    Turned OFF after the event to avoid higher order splitting. Fluorescent fat photons,
    generated by fat charged particles (survived RR) are also split.

  • RR is turned ON using EGSnrc internal flag i_play_RR so that RR is played after pair events.
    RR can be turned OFF by entering a negative splitting number.

NOTE2: Brems events play RR intrinsically hence it can't be turned OFF.
Setting i_play_RR affects pair production ONLY.

Other minor changes:

  • Last commit to egs_dose_scoring.cpp removed the statement printing media names during dose output to the screen for dose to medium calculations. I have re-added the line.
  • First commit to egs_dose_scoring.cpp changed the header formatting when outputting media doses which misaligned it.

 Changes to be committed:
	modified:   egs++/ausgab_objects/egs_fluence_scoring/egs_fluence_scoring.h
- Added virtual methods setRussianRoulette and splitTopParticleIsotropically
  needed by the radiative splitting object.

 Changes to be committed:
	modified:   egs++/egs_application.h
- Added two new methods needed by the radiative splitting object and
  provided more information in comments.

- Turn ON/OFF EGSnrc internal radiative splitting (UBS)
  void setRadiativeSplitting( const EGS_Float &nsplit );

- Turn ON/OFF EGSnrc internal Russian Roultette + UBS
  void setRussianRoulette( const EGS_Float &iSwitchRR );

- Split particle uniformly in 4Pi
  void splitTopParticleIsotropically( const EGS_Float &fsplit );

 Changes to be committed:
	modified:   egs++/egs_advanced_application.h
- Added two new methods needed by the radiative splitting object and
  provided more information in comments.

- Turn ON/OFF EGSnrc internal radiative splitting (UBS)
  void setRadiativeSplitting( const EGS_Float &nsplit );

- Turn ON/OFF EGSnrc internal Russian Roultette + UBS
  void setRussianRoulette( const EGS_Float &iSwitchRR );

- Split particle uniformly in 4Pi
  void splitTopParticleIsotropically( const EGS_Float &fsplit );

 Changes to be committed:
	modified:   egs++/egs_advanced_application.cpp
Initial radiative splitting naively just turned ON EGSnrc internal
flag nbr_split to split brems and annihilation events uniformly.
However no charged particle RR was played after pair production (i_play_RR)
nor were secondary photons, produced by charged particles surviving RR after
bremsstrahlung, split.
--------------------
Radiative splitting:
--------------------
now turned ON before a bremsstrahlung event for a primary or a fat charged
particle. It is turned OFF after the brems event to avoid higher order
splitting. Fluorescent fat photons, generated by fat charged particles
(survived RR) are also split.

NOTE: Not done for annihilation yet! Coming up!

This time RR is turned ON using EGSnrc internal flag i_play_RR so that RR is
played after pair events. RR can be turned OFF by entering a negative splitting number.

NOTE2: Brems events play RR intrinsically hence it can't be turned OFF.
       Setting i_plpay_RR affects pair production ONLY.

 Changes to be committed:
	modified:   egs++/ausgab_objects/egs_radiative_splitting/egs_radiative_splitting.cpp
	modified:   egs++/ausgab_objects/egs_radiative_splitting/egs_radiative_splitting.h
- Split annihilation in flight and at rest events for primary and fat positrons.

/* A fat particle's weight is larger than a thin particle's max weight */
bool is_phat = (app->top_p.wt - wthin) > epsilon;
bool is_primary = app->top_p.latch == 0 ? true : false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this compatible with a phase-space from BEAMnrc where the latch is already set? E.g. it's a primary particle but the latch is non-zero due to one of the bits being set by passage.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's fine to merge this is regardless, all it will lead to is less splitting in the cases where the latch has already been set.

But it might make sense to adjust:
if the latch is 0, it's primary; if it's 1, it's secondary; if bits 24-28 are 0, it's primary

Copy link
Member

Choose a reason for hiding this comment

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

Let's resolve this. Anyone?

@ftessier ftessier modified the milestones: Release 2023a, Release 2024 Aug 8, 2023
@ftessier
Copy link
Member

ftessier commented Aug 8, 2023

@blakewalters @mainegra this pull request is in conflict with #974 (add dbs to radiative splitting). Since the latter is still a draft, I suggest that we merge and then resolve conflicts in the blake/add-dbs_to_radiative_splitting branch.

@blakewalters
Copy link
Contributor

I agree, @ftessier, let's get this merged in before worrying about DBS splitting, which shouldn't be affected by this change in any case.

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

Successfully merging this pull request may close these issues.

Split photons from RR-surviving e-/e+ in Radiation Splitting AO
4 participants