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

#include <G4ElectronOccupancy.hh>

Public Types

enum  { MaxSizeOfOrbit = 10 }
 

Public Member Functions

 G4ElectronOccupancy (G4int sizeOrbit=MaxSizeOfOrbit)
 
 G4ElectronOccupancy (const G4ElectronOccupancy &right)
 
virtual ~G4ElectronOccupancy ()
 
void * operator new (size_t)
 
void operator delete (void *aElectronOccupancy)
 
G4ElectronOccupancyoperator= (const G4ElectronOccupancy &right)
 
G4int operator== (const G4ElectronOccupancy &right) const
 
G4int operator!= (const G4ElectronOccupancy &right) const
 
G4int GetTotalOccupancy () const
 
G4int GetOccupancy (G4int orbit) const
 
G4int AddElectron (G4int orbit, G4int number=1)
 
G4int RemoveElectron (G4int orbit, G4int number=1)
 
G4int GetSizeOfOrbit () const
 
void DumpInfo () const
 

Detailed Description

Definition at line 60 of file G4ElectronOccupancy.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MaxSizeOfOrbit 

Definition at line 63 of file G4ElectronOccupancy.hh.

Constructor & Destructor Documentation

◆ G4ElectronOccupancy() [1/2]

G4ElectronOccupancy::G4ElectronOccupancy ( G4int  sizeOrbit = MaxSizeOfOrbit)

Definition at line 44 of file G4ElectronOccupancy.cc.

44 :
45 theSizeOfOrbit(sizeOrbit)
46{
47 // check size
48 if ( (theSizeOfOrbit <1 ) || (theSizeOfOrbit > MaxSizeOfOrbit) ) {
49 theSizeOfOrbit = MaxSizeOfOrbit;
50 }
51
52 // allocate and clear the array of theOccupancies
53 theOccupancies = new G4int[theSizeOfOrbit];
54 G4int index =0;
55 for (index = 0; index < theSizeOfOrbit; index++) {
56 theOccupancies[index] =0;
57 }
58
59 theTotalOccupancy =0;
60}
int G4int
Definition: G4Types.hh:66

◆ G4ElectronOccupancy() [2/2]

G4ElectronOccupancy::G4ElectronOccupancy ( const G4ElectronOccupancy right)

Definition at line 72 of file G4ElectronOccupancy.cc.

73{
74 theSizeOfOrbit = right.theSizeOfOrbit;
75
76 // allocate and clear the array of theOccupancies
77 theOccupancies = new G4int[theSizeOfOrbit];
78 G4int index =0;
79 for (index = 0; index < theSizeOfOrbit; index++) {
80 theOccupancies[index] = right.theOccupancies[index];
81 }
82
83 theTotalOccupancy = right.theTotalOccupancy;
84}

◆ ~G4ElectronOccupancy()

G4ElectronOccupancy::~G4ElectronOccupancy ( )
virtual

Definition at line 62 of file G4ElectronOccupancy.cc.

63{
64 theSizeOfOrbit = -1;
65
66 delete [] theOccupancies;
67 theOccupancies =0;
68 theTotalOccupancy =0;
69}

Member Function Documentation

◆ AddElectron()

G4int G4ElectronOccupancy::AddElectron ( G4int  orbit,
G4int  number = 1 
)
inline

Definition at line 148 of file G4ElectronOccupancy.hh.

149{
150 G4int value =0;
151 if ((orbit >=0)&&(orbit<theSizeOfOrbit)){
152 theOccupancies[orbit] += number;
153 theTotalOccupancy += number;
154 value = number;
155 }
156 return value;
157}

Referenced by G4MolecularConfiguration::AddElectron(), G4EmDNAPhysicsChemistry::ConstructDecayChannels(), G4MolecularConfiguration::ExciteMolecule(), G4Molecule::G4Molecule(), and G4MoleculeDefinition::SetLevelOccupation().

◆ DumpInfo()

void G4ElectronOccupancy::DumpInfo ( ) const

Definition at line 127 of file G4ElectronOccupancy.cc.

128{
129 G4cout << " -- Electron Occupancy -- " << G4endl;
130 G4int index;
131 for (index = 0; index < theSizeOfOrbit; index++) {
132 G4cout << " " << index << "-th orbit "
133 << theOccupancies[index] << G4endl;
134 }
135}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by G4DNAMolecularDecay::DecayIt(), and G4MolecularConfiguration::PrintState().

◆ GetOccupancy()

G4int G4ElectronOccupancy::GetOccupancy ( G4int  orbit) const
inline

Definition at line 138 of file G4ElectronOccupancy.hh.

139{
140 G4int value = 0;
141 if ((orbit >=0)&&(orbit<theSizeOfOrbit)){
142 value = theOccupancies[orbit];
143 }
144 return value;
145}

Referenced by G4MolecularConfiguration::IonizeMolecule(), comparator::operator()(), eOccComp::operator()(), G4MolecularConfiguration::RemoveElectron(), and G4MoleculeDefinition::SetLevelOccupation().

◆ GetSizeOfOrbit()

G4int G4ElectronOccupancy::GetSizeOfOrbit ( ) const
inline

Definition at line 126 of file G4ElectronOccupancy.hh.

127{
128 return theSizeOfOrbit;
129}

Referenced by comparator::operator()(), and eOccComp::operator()().

◆ GetTotalOccupancy()

G4int G4ElectronOccupancy::GetTotalOccupancy ( ) const
inline

◆ operator delete()

void G4ElectronOccupancy::operator delete ( void *  aElectronOccupancy)
inline

Definition at line 120 of file G4ElectronOccupancy.hh.

121{
122 aElectronOccupancyAllocator.FreeSingle((G4ElectronOccupancy *) aElectronOccupancy);
123}
G4DLLIMPORT G4Allocator< G4ElectronOccupancy > aElectronOccupancyAllocator

◆ operator new()

void * G4ElectronOccupancy::operator new ( size_t  )
inline

Definition at line 113 of file G4ElectronOccupancy.hh.

114{
115 void * aElectronOccupancy;
116 aElectronOccupancy = (void *) aElectronOccupancyAllocator.MallocSingle();
117 return aElectronOccupancy;
118}

◆ operator!=()

G4int G4ElectronOccupancy::operator!= ( const G4ElectronOccupancy right) const

Definition at line 121 of file G4ElectronOccupancy.cc.

122{
123 return !(*this == right);
124}

◆ operator=()

G4ElectronOccupancy & G4ElectronOccupancy::operator= ( const G4ElectronOccupancy right)

Definition at line 86 of file G4ElectronOccupancy.cc.

87{
88 if ( this != &right) {
89 theSizeOfOrbit = right.theSizeOfOrbit;
90
91 // allocate and clear the array of theOccupancies
92 if ( theOccupancies != 0 ) delete [] theOccupancies;
93 theOccupancies = new G4int[theSizeOfOrbit];
94 G4int index =0;
95 for (index = 0; index < theSizeOfOrbit; index++) {
96 theOccupancies[index] = right.theOccupancies[index];
97 }
98
99 theTotalOccupancy = right.theTotalOccupancy;
100 }
101 return *this;
102}

◆ operator==()

G4int G4ElectronOccupancy::operator== ( const G4ElectronOccupancy right) const

Definition at line 104 of file G4ElectronOccupancy.cc.

105{
106 G4int index;
107 G4bool value = true;
108 for (index = 0; index < MaxSizeOfOrbit; index++) {
109 if ( (index < theSizeOfOrbit ) && ( index < right.theSizeOfOrbit) ) {
110 value = value &&
111 (theOccupancies[index] == right.theOccupancies[index]) ;
112 } else if ((index < theSizeOfOrbit ) && ( index >= right.theSizeOfOrbit)) {
113 value = value && (theOccupancies[index] == 0);
114 } else if ((index >= theSizeOfOrbit ) && ( index <right.theSizeOfOrbit)) {
115 value = value && (right.theOccupancies[index] == 0);
116 }
117 }
118 return value;
119}
bool G4bool
Definition: G4Types.hh:67

◆ RemoveElectron()

G4int G4ElectronOccupancy::RemoveElectron ( G4int  orbit,
G4int  number = 1 
)
inline

Definition at line 160 of file G4ElectronOccupancy.hh.

161{
162 G4int value =0;
163 if ((orbit >=0)&&(orbit<theSizeOfOrbit) ){
164 if ( theOccupancies[orbit] < number ) number = theOccupancies[orbit];
165 theOccupancies[orbit] -= number;
166 theTotalOccupancy -= number;
167 value = number;
168 }
169 return value;
170}

Referenced by G4EmDNAPhysicsChemistry::ConstructDecayChannels(), G4MolecularConfiguration::ExciteMolecule(), G4Molecule::G4Molecule(), G4VGammaDeexcitation::GenerateGamma(), G4MolecularConfiguration::IonizeMolecule(), G4MolecularConfiguration::RemoveElectron(), and G4MoleculeDefinition::SetLevelOccupation().


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