46 : theSizeOfOrbit(sizeOrbit)
54 theOccupancies =
new G4int[theSizeOfOrbit];
56 for (index = 0; index < theSizeOfOrbit; index++) {
57 theOccupancies[index] =0;
67 delete [] theOccupancies;
74 theSizeOfOrbit = right.theSizeOfOrbit;
77 theOccupancies =
new G4int[theSizeOfOrbit];
79 for (index = 0; index < theSizeOfOrbit; index++) {
80 theOccupancies[index] = right.theOccupancies[index];
83 theTotalOccupancy = right.theTotalOccupancy;
88 if (
this != &right) {
89 theSizeOfOrbit = right.theSizeOfOrbit;
92 if ( theOccupancies != 0 )
delete [] theOccupancies;
93 theOccupancies =
new G4int[theSizeOfOrbit];
95 for (index = 0; index < theSizeOfOrbit; index++) {
96 theOccupancies[index] = right.theOccupancies[index];
99 theTotalOccupancy = right.theTotalOccupancy;
109 if ( (index < theSizeOfOrbit ) && ( index < right.theSizeOfOrbit) ) {
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);
123 return !(*
this ==
right);
130 for (index = 0; index < theSizeOfOrbit; index++) {
131 G4cout <<
" " << index <<
"-th orbit "
132 << theOccupancies[index] <<
G4endl;
139 if (orbit>=theSizeOfOrbit){
140 std::ostringstream smsg;
141 smsg<<
"Orbit (" << orbit
142 <<
") exceeds the maximum("
143 <<theSizeOfOrbit-1<<
") ";
145 G4Exception(
"G4ElectronOccupancy::AddElectron()",
"PART131",
147 }
else if (orbit >=0) {
148 theOccupancies[orbit] += number;
149 theTotalOccupancy += number;
158 if (orbit>=theSizeOfOrbit){
159 std::ostringstream smsg;
160 smsg<<
"Orbit (" << orbit
161 <<
") exceeds the maximum("
162 <<theSizeOfOrbit-1 <<
") ";
164 G4Exception(
"G4ElectronOccupancy::RemoveElectron()",
"PART131",
166 }
else if (orbit >=0) {
167 if ( theOccupancies[orbit] < number ) number = theOccupancies[orbit];
168 theOccupancies[orbit] -= number;
169 theTotalOccupancy -= number;
virtual ~G4ElectronOccupancy()
G4ElectronOccupancy(G4int sizeOrbit=MaxSizeOfOrbit)
G4int operator==(const G4ElectronOccupancy &right) const
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
G4int AddElectron(G4int orbit, G4int number=1)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4PART_DLL G4ThreadLocal G4Allocator< G4ElectronOccupancy > * aElectronOccupancyAllocator
G4int operator!=(const G4ElectronOccupancy &right) const
G4ElectronOccupancy & operator=(const G4ElectronOccupancy &right)
G4int RemoveElectron(G4int orbit, G4int number=1)