49 theOccupancies =
new G4int[theSizeOfOrbit];
50 for (
G4int index = 0; index < theSizeOfOrbit; ++index) {
51 theOccupancies[index] = 0;
54 theTotalOccupancy = 0;
61 delete[] theOccupancies;
62 theOccupancies =
nullptr;
63 theTotalOccupancy = 0;
68 theSizeOfOrbit = right.theSizeOfOrbit;
71 theOccupancies =
new G4int[theSizeOfOrbit];
72 for (
G4int index = 0; index < theSizeOfOrbit; ++index) {
73 theOccupancies[index] = right.theOccupancies[index];
76 theTotalOccupancy = right.theTotalOccupancy;
82 theSizeOfOrbit = right.theSizeOfOrbit;
85 delete[] theOccupancies;
86 theOccupancies =
new G4int[theSizeOfOrbit];
87 for (
G4int index = 0; index < theSizeOfOrbit; ++index) {
88 theOccupancies[index] = right.theOccupancies[index];
91 theTotalOccupancy = right.theTotalOccupancy;
100 if ((index < theSizeOfOrbit) && (index < right.theSizeOfOrbit)) {
101 value = value && (theOccupancies[index] == right.theOccupancies[index]);
103 else if ((index < theSizeOfOrbit) && (index >= right.theSizeOfOrbit)) {
104 value = value && (!
static_cast<G4bool>(theOccupancies[index]));
106 else if ((index >= theSizeOfOrbit) && (index < right.theSizeOfOrbit)) {
107 value = value && (!
static_cast<G4bool>(right.theOccupancies[index]));
115 return !(*
this == right);
121 for (
G4int index = 0; index < theSizeOfOrbit; ++index) {
122 G4cout <<
" " << index <<
"-th orbit " << theOccupancies[index] <<
G4endl;
129 if (orbit >= theSizeOfOrbit) {
130 std::ostringstream smsg;
131 smsg <<
"Orbit (" << orbit <<
") exceeds the maximum(" << theSizeOfOrbit - 1 <<
") ";
135 else if (orbit >= 0) {
136 theOccupancies[orbit] += number;
137 theTotalOccupancy += number;
146 if (orbit >= theSizeOfOrbit) {
147 std::ostringstream smsg;
148 smsg <<
"Orbit (" << orbit <<
") exceeds the maximum(" << theSizeOfOrbit - 1 <<
") ";
152 else if (orbit >= 0) {
153 if (theOccupancies[orbit] < number) number = theOccupancies[orbit];
154 theOccupancies[orbit] -= number;
155 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