41 : theSizeOfOrbit(sizeOrbit)
50 theOccupancies =
new G4int[theSizeOfOrbit];
51 for (
G4int index = 0; index < theSizeOfOrbit; ++index)
53 theOccupancies[index] = 0;
56 theTotalOccupancy = 0;
63 delete [] theOccupancies;
64 theOccupancies =
nullptr;
65 theTotalOccupancy = 0;
70 theSizeOfOrbit = right.theSizeOfOrbit;
73 theOccupancies =
new G4int[theSizeOfOrbit];
74 for (
G4int index = 0; index < theSizeOfOrbit; ++index)
76 theOccupancies[index] = right.theOccupancies[index];
79 theTotalOccupancy = right.theTotalOccupancy;
87 theSizeOfOrbit = right.theSizeOfOrbit;
90 if ( theOccupancies !=
nullptr )
delete [] theOccupancies;
91 theOccupancies =
new G4int[theSizeOfOrbit];
92 for (
G4int index = 0; index < theSizeOfOrbit; ++index)
94 theOccupancies[index] = right.theOccupancies[index];
97 theTotalOccupancy = right.theTotalOccupancy;
107 if ( (index < theSizeOfOrbit ) && ( index < right.theSizeOfOrbit) )
110 (theOccupancies[index] == right.theOccupancies[index]) ;
112 else if ((index < theSizeOfOrbit ) && ( index >= right.theSizeOfOrbit))
114 value = value && (theOccupancies[index] ==
false);
116 else if ((index >= theSizeOfOrbit ) && ( index <right.theSizeOfOrbit))
118 value = value && (right.theOccupancies[index] ==
false);
126 return !(*
this == right);
132 for (
G4int index = 0; index < theSizeOfOrbit; ++index)
134 G4cout <<
" " << index <<
"-th orbit "
135 << theOccupancies[index] <<
G4endl;
142 if (orbit>=theSizeOfOrbit)
144 std::ostringstream smsg;
145 smsg<<
"Orbit (" << orbit
146 <<
") exceeds the maximum("
147 <<theSizeOfOrbit-1<<
") ";
149 G4Exception(
"G4ElectronOccupancy::AddElectron()",
"PART131",
154 theOccupancies[orbit] += number;
155 theTotalOccupancy += number;
164 if (orbit>=theSizeOfOrbit)
166 std::ostringstream smsg;
167 smsg<<
"Orbit (" << orbit
168 <<
") exceeds the maximum("
169 <<theSizeOfOrbit-1 <<
") ";
171 G4Exception(
"G4ElectronOccupancy::RemoveElectron()",
"PART131",
176 if ( theOccupancies[orbit] < number ) number = theOccupancies[orbit];
177 theOccupancies[orbit] -= number;
178 theTotalOccupancy -= number;
G4Allocator< G4ElectronOccupancy > *& aElectronOccupancyAllocator()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
G4bool operator!=(const G4ElectronOccupancy &right) const
G4int AddElectron(G4int orbit, G4int number=1)
G4int RemoveElectron(G4int orbit, G4int number=1)
G4bool operator==(const G4ElectronOccupancy &right) const
G4ElectronOccupancy(G4int sizeOrbit=MaxSizeOfOrbit)
virtual ~G4ElectronOccupancy()
G4ElectronOccupancy & operator=(const G4ElectronOccupancy &right)
#define G4ThreadLocalStatic