Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VMoleculeCounter Class Referenceabstract

#include <G4VMoleculeCounter.hh>

+ Inheritance diagram for G4VMoleculeCounter:

Public Types

using Reactant = const G4MolecularConfiguration
 

Public Member Functions

void Use (G4bool flag=true)
 
G4bool InUse ()
 
virtual void Initialize ()=0
 
virtual void ResetCounter ()=0
 
virtual void AddAMoleculeAtTime (Reactant *, G4double time, const G4ThreeVector *position=nullptr, int number=1)=0
 
virtual void RemoveAMoleculeAtTime (Reactant *, G4double time, const G4ThreeVector *position=nullptr, int number=1)=0
 
virtual void DontRegister (const G4MoleculeDefinition *)
 
virtual bool IsRegistered (const G4MoleculeDefinition *)
 
virtual void RegisterAll ()
 

Static Public Member Functions

static void SetInstance (G4VMoleculeCounter *)
 
static void DeleteInstance ()
 
static G4VMoleculeCounterInstance ()
 
static void InitializeInstance ()
 

Protected Member Functions

 G4VMoleculeCounter ()=default
 
virtual ~G4VMoleculeCounter ()=default
 

Protected Attributes

G4bool fUse = false
 

Static Protected Attributes

static G4ThreadLocal G4VMoleculeCounterfpInstance = nullptr
 

Detailed Description

Definition at line 43 of file G4VMoleculeCounter.hh.

Member Typedef Documentation

◆ Reactant

Constructor & Destructor Documentation

◆ G4VMoleculeCounter()

G4VMoleculeCounter::G4VMoleculeCounter ( )
protecteddefault

◆ ~G4VMoleculeCounter()

virtual G4VMoleculeCounter::~G4VMoleculeCounter ( )
protectedvirtualdefault

Member Function Documentation

◆ AddAMoleculeAtTime()

virtual void G4VMoleculeCounter::AddAMoleculeAtTime ( Reactant ,
G4double  time,
const G4ThreeVector position = nullptr,
int  number = 1 
)
pure virtual

Implemented in G4MoleculeCounter.

◆ DeleteInstance()

void G4VMoleculeCounter::DeleteInstance ( )
static

Definition at line 76 of file G4VMoleculeCounter.cc.

77{
78 if (fpInstance != nullptr)
79 {
80 delete fpInstance;
81 fpInstance = nullptr;
82 }
83}
static G4ThreadLocal G4VMoleculeCounter * fpInstance

Referenced by G4DNAChemistryManager::Clear().

◆ DontRegister()

virtual void G4VMoleculeCounter::DontRegister ( const G4MoleculeDefinition )
inlinevirtual

Reimplemented in G4MoleculeCounter.

Definition at line 94 of file G4VMoleculeCounter.hh.

95 {
96 }

◆ Initialize()

virtual void G4VMoleculeCounter::Initialize ( )
pure virtual

Implemented in G4MoleculeCounter.

Referenced by InitializeInstance().

◆ InitializeInstance()

void G4VMoleculeCounter::InitializeInstance ( )
static

Definition at line 87 of file G4VMoleculeCounter.cc.

88{
89 if (fpInstance)
90 {
92 }
93}
virtual void Initialize()=0

Referenced by G4DNAChemistryManager::InitializeThread().

◆ Instance()

G4VMoleculeCounter * G4VMoleculeCounter::Instance ( )
static

◆ InUse()

G4bool G4VMoleculeCounter::InUse ( )

Definition at line 104 of file G4VMoleculeCounter.cc.

105{
106 return fUse;
107}

◆ IsRegistered()

virtual bool G4VMoleculeCounter::IsRegistered ( const G4MoleculeDefinition )
inlinevirtual

Reimplemented in G4MoleculeCounter.

Definition at line 98 of file G4VMoleculeCounter.hh.

99 {
100 return false;
101 }

◆ RegisterAll()

virtual void G4VMoleculeCounter::RegisterAll ( )
inlinevirtual

Reimplemented in G4MoleculeCounter.

Definition at line 103 of file G4VMoleculeCounter.hh.

104 {
105 }

◆ RemoveAMoleculeAtTime()

virtual void G4VMoleculeCounter::RemoveAMoleculeAtTime ( Reactant ,
G4double  time,
const G4ThreeVector position = nullptr,
int  number = 1 
)
pure virtual

Implemented in G4MoleculeCounter.

◆ ResetCounter()

virtual void G4VMoleculeCounter::ResetCounter ( )
pure virtual

Implemented in G4MoleculeCounter.

Referenced by G4DNAChemistryManager::Run().

◆ SetInstance()

void G4VMoleculeCounter::SetInstance ( G4VMoleculeCounter pCounterInstance)
static

Definition at line 41 of file G4VMoleculeCounter.cc.

42{
43 if (fpInstance != nullptr)
44 {
46 errMsg << "The G4MoleculeCounter was already initialized." << G4endl
47 << "The previous instance will be deleted in order to use yours." << G4endl
48 << "However this can generate conflicts. Make sure you call G4MoleculeCounter::SetInstance"
49 "at the beginning of your application."
50 << "A good place would be ActionInitialization::Build & BuildForMaster"
51 << G4endl;
52
53 G4Exception("G4MoleculeCounter::SetInstance",
54 "SINGLETON_ALREADY_INITIALIZED",
55 JustWarning, errMsg);
56 delete fpInstance;
57 fpInstance = nullptr;
58 }
59
60 fpInstance = pCounterInstance;
61}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
#define G4endl
Definition: G4ios.hh:57

◆ Use()

void G4VMoleculeCounter::Use ( G4bool  flag = true)

Definition at line 97 of file G4VMoleculeCounter.cc.

98{
99 fUse = flag;
100}

Referenced by G4DNAEventScheduler::ClearAndReChargeCounter().

Member Data Documentation

◆ fpInstance

G4ThreadLocal G4VMoleculeCounter * G4VMoleculeCounter::fpInstance = nullptr
staticprotected

◆ fUse

G4bool G4VMoleculeCounter::fUse = false
protected

Definition at line 47 of file G4VMoleculeCounter.hh.

Referenced by InUse(), and Use().


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