Geant4 10.7.0
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

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 ()
 
static void Use (G4bool flag=true)
 
static G4bool InUse ()
 

Protected Member Functions

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

Static Protected Attributes

static G4ThreadLocal G4VMoleculeCounterfpInstance = nullptr
 
static G4bool fUse = false
 

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 78 of file G4VMoleculeCounter.cc.

79{
80 if (fpInstance != nullptr)
81 {
82 delete fpInstance;
83 fpInstance = nullptr;
84 }
85}
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 89 of file G4VMoleculeCounter.cc.

90{
91 if (fpInstance)
92 {
94 }
95}
virtual void Initialize()=0

Referenced by G4DNAChemistryManager::InitializeThread().

◆ Instance()

G4VMoleculeCounter * G4VMoleculeCounter::Instance ( )
static

Definition at line 67 of file G4VMoleculeCounter.cc.

68{
69 if (fpInstance == nullptr)
70 {
72 }
73 return fpInstance;
74}

Referenced by G4Molecule::BuildTrack(), G4DNAChemistryManager::Run(), and G4Molecule::~G4Molecule().

◆ InUse()

G4bool G4VMoleculeCounter::InUse ( )
static

Definition at line 106 of file G4VMoleculeCounter.cc.

107{
108 return fUse;
109}

Referenced by G4Molecule::BuildTrack().

◆ 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 43 of file G4VMoleculeCounter.cc.

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

◆ Use()

void G4VMoleculeCounter::Use ( G4bool  flag = true)
static

Definition at line 99 of file G4VMoleculeCounter.cc.

100{
101 fUse = flag;
102}

Member Data Documentation

◆ fpInstance

G4ThreadLocal G4VMoleculeCounter * G4VMoleculeCounter::fpInstance = nullptr
staticprotected

◆ fUse

G4bool G4VMoleculeCounter::fUse = false
staticprotected

Definition at line 47 of file G4VMoleculeCounter.hh.

Referenced by InUse(), and Use().


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