EGS Brachy
An egs++ user code for rapid brachytherapy calculations
Loading...
Searching...
No Matches
Latch Class Reference

A class for handling latch bits relevant to egs_brachy. The Latch class listens for particle events and sets/unsets latch bits on the particle based on the event type. More...

#include <latch.h>

Inheritance diagram for Latch:
Collaboration diagram for Latch:

Public Member Functions

void update (EB_Message message, void *particle)
 listen to events and delegate to appropriate handler
Public Member Functions inherited from Subscriber
virtual ~Subscriber ()

Static Public Member Functions

static bool hasEscaped (EGS_Particle *p)
 True if particle is currently in a source.
static void setFlag (Flag flag, EGS_Particle *p)
 Set flag on input particle p.
static void setFlag (Flag flag, int &latch)
 Set flag on input latch.
static void unsetFlag (Flag flag, EGS_Particle *p)
 Unset flag on input particle p.
static void unsetFlag (Flag flag, int &latch)
 Unset flag on input latch p.
static bool checkFlag (Flag flag, EGS_Particle *p)
 Check whether flag is set on particle p.
static bool checkFlag (Flag flag, int latch)
 Check whether flag is set on latch.
static void addScatter (EGS_Particle *p)
static void addScatter (int &latch)
static void setPrimary (int &latch)
static void setPrimary (EGS_Particle *p)
static bool isPrimary (int latch)
static bool isPrimary (EGS_Particle *p)
static bool isSingleScat (int latch)
static bool isSingleScat (EGS_Particle *p)
static bool isMultScat (int latch)
static bool isMultScat (EGS_Particle *p)

Private Types

enum  Flag {
  IN_SOURCE , ESCAPED_SOURCE , PRIM_PARTICLE , SSCAT_PARTICLE ,
  MSCAT_PARTICLE
}

Detailed Description

A class for handling latch bits relevant to egs_brachy. The Latch class listens for particle events and sets/unsets latch bits on the particle based on the event type.

Definition at line 51 of file latch.h.

Member Enumeration Documentation

◆ Flag

enum Latch::Flag
private
Enumerator
IN_SOURCE 

a particle is in the source (either hasn't escaped yet, or has re-entered)

ESCAPED_SOURCE 

an initial particle has escaped the source (this bit will still be set on particles which ave re-entered a source geometry)

PRIM_PARTICLE 
SSCAT_PARTICLE 
MSCAT_PARTICLE 

Definition at line 53 of file latch.h.

Member Function Documentation

◆ addScatter() [1/2]

void Latch::addScatter ( EGS_Particle * p)
static

Definition at line 80 of file latch.cpp.

◆ addScatter() [2/2]

void Latch::addScatter ( int & latch)
static

Definition at line 92 of file latch.cpp.

◆ checkFlag() [1/2]

bool Latch::checkFlag ( Flag flag,
EGS_Particle * p )
static

Check whether flag is set on particle p.

Definition at line 62 of file latch.cpp.

◆ checkFlag() [2/2]

bool Latch::checkFlag ( Flag flag,
int latch )
static

Check whether flag is set on latch.

Definition at line 66 of file latch.cpp.

◆ hasEscaped()

bool Latch::hasEscaped ( EGS_Particle * p)
static

True if particle is currently in a source.

True if particle has escaped a source

Definition at line 134 of file latch.cpp.

◆ isMultScat() [1/2]

bool Latch::isMultScat ( EGS_Particle * p)
static

Definition at line 125 of file latch.cpp.

◆ isMultScat() [2/2]

bool Latch::isMultScat ( int latch)
static

Definition at line 121 of file latch.cpp.

◆ isPrimary() [1/2]

bool Latch::isPrimary ( EGS_Particle * p)
static

Definition at line 109 of file latch.cpp.

◆ isPrimary() [2/2]

bool Latch::isPrimary ( int latch)
static

Definition at line 105 of file latch.cpp.

◆ isSingleScat() [1/2]

bool Latch::isSingleScat ( EGS_Particle * p)
static

Definition at line 117 of file latch.cpp.

◆ isSingleScat() [2/2]

bool Latch::isSingleScat ( int latch)
static

Definition at line 113 of file latch.cpp.

◆ setFlag() [1/2]

void Latch::setFlag ( Flag flag,
EGS_Particle * p )
static

Set flag on input particle p.

Definition at line 46 of file latch.cpp.

◆ setFlag() [2/2]

void Latch::setFlag ( Flag flag,
int & latch )
static

Set flag on input latch.

Definition at line 50 of file latch.cpp.

◆ setPrimary() [1/2]

void Latch::setPrimary ( EGS_Particle * p)
static

Definition at line 84 of file latch.cpp.

◆ setPrimary() [2/2]

void Latch::setPrimary ( int & latch)
static

Definition at line 88 of file latch.cpp.

◆ unsetFlag() [1/2]

void Latch::unsetFlag ( Flag flag,
EGS_Particle * p )
static

Unset flag on input particle p.

Definition at line 54 of file latch.cpp.

◆ unsetFlag() [2/2]

void Latch::unsetFlag ( Flag flag,
int & latch )
static

Unset flag on input latch p.

Definition at line 58 of file latch.cpp.

◆ update()

void Latch::update ( EB_Message message,
void * particle )
virtual

listen to events and delegate to appropriate handler

Implements Subscriber.

Definition at line 70 of file latch.cpp.


The documentation for this class was generated from the following files: