Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4BlockingList Class Reference

G4BlockingList is an utility class responsible for (efficiently) maintaining a list of blocked volume numbers, with rapid 'reset' operations. More...

#include <G4BlockingList.hh>

Public Member Functions

 G4BlockingList (G4int maxDefault=kBlockingListMaxDefault, G4int stride=kBlockingListStride)
 ~G4BlockingList ()=default
void Reset ()
void FullyReset ()
void Enlarge (const G4int nv)
std::size_t Length () const
void BlockVolume (const G4int v)
G4bool IsBlocked (const G4int v) const

Detailed Description

G4BlockingList is an utility class responsible for (efficiently) maintaining a list of blocked volume numbers, with rapid 'reset' operations.

Definition at line 58 of file G4BlockingList.hh.

Constructor & Destructor Documentation

◆ G4BlockingList()

G4BlockingList::G4BlockingList ( G4int maxDefault = kBlockingListMaxDefault,
G4int stride = kBlockingListStride )

Constructor for G4BlockingList. Creates empty blocking list of default size and 'stride' resize count.

Parameters
[in]maxDefaultMaximum list size.
[in]strideStride resize count.

Definition at line 33 of file G4BlockingList.cc.

34 : fStride(stride), fBlockingList(maxDefault,0)
35{
36}

◆ ~G4BlockingList()

G4BlockingList::~G4BlockingList ( )
default

Default Destructor.

Member Function Documentation

◆ BlockVolume()

void G4BlockingList::BlockVolume ( const G4int v)
inline

Blocks the volume number 'v'. Requires: 0<=v<Length().

◆ Enlarge()

void G4BlockingList::Enlarge ( const G4int nv)
inline

Enlarges the blocking list if current size less than 'nv', in units of stride. Clears the new part of the list.

◆ FullyReset()

void G4BlockingList::FullyReset ( )

Clears the blocking list and resets the tag value [slow].

Definition at line 40 of file G4BlockingList.cc.

41{
42 fBlockTagNo = 1;
43 for ( auto i=G4long(fBlockingList.size()-1); i>=0; --i )
44 {
45 fBlockingList[i] = 0;
46 }
47}
long G4long
Definition G4Types.hh:87

◆ IsBlocked()

G4bool G4BlockingList::IsBlocked ( const G4int v) const
inline

Returns true if the volume number 'v' is blocked, else false. Requires: 0 <= v < Length().

◆ Length()

std::size_t G4BlockingList::Length ( ) const
inline

Returns the current length of the list. A length of 16 means volumes of indices between 0 & 15 inclusive may be blocked.

◆ Reset()

void G4BlockingList::Reset ( )
inline

Efficiently resets the blocking list, so that no volumes are blocked. Advances tag number and only fully clears the list if tag max is reached.


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