#include <G4ElectronOccupancy.hh>
Public Types | |
MaxSizeOfOrbit = 10 | |
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) |
G4ElectronOccupancy & | operator= (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 |
Definition at line 60 of file G4ElectronOccupancy.hh.
anonymous enum |
G4ElectronOccupancy::G4ElectronOccupancy | ( | G4int | sizeOrbit = MaxSizeOfOrbit |
) |
Definition at line 44 of file G4ElectronOccupancy.cc.
References MaxSizeOfOrbit.
00044 : 00045 theSizeOfOrbit(sizeOrbit) 00046 { 00047 // check size 00048 if ( (theSizeOfOrbit <1 ) || (theSizeOfOrbit > MaxSizeOfOrbit) ) { 00049 theSizeOfOrbit = MaxSizeOfOrbit; 00050 } 00051 00052 // allocate and clear the array of theOccupancies 00053 theOccupancies = new G4int[theSizeOfOrbit]; 00054 G4int index =0; 00055 for (index = 0; index < theSizeOfOrbit; index++) { 00056 theOccupancies[index] =0; 00057 } 00058 00059 theTotalOccupancy =0; 00060 }
G4ElectronOccupancy::G4ElectronOccupancy | ( | const G4ElectronOccupancy & | right | ) |
Definition at line 72 of file G4ElectronOccupancy.cc.
References theOccupancies, theSizeOfOrbit, and theTotalOccupancy.
00073 { 00074 theSizeOfOrbit = right.theSizeOfOrbit; 00075 00076 // allocate and clear the array of theOccupancies 00077 theOccupancies = new G4int[theSizeOfOrbit]; 00078 G4int index =0; 00079 for (index = 0; index < theSizeOfOrbit; index++) { 00080 theOccupancies[index] = right.theOccupancies[index]; 00081 } 00082 00083 theTotalOccupancy = right.theTotalOccupancy; 00084 }
G4ElectronOccupancy::~G4ElectronOccupancy | ( | ) | [virtual] |
Definition at line 62 of file G4ElectronOccupancy.cc.
00063 { 00064 theSizeOfOrbit = -1; 00065 00066 delete [] theOccupancies; 00067 theOccupancies =0; 00068 theTotalOccupancy =0; 00069 }
Definition at line 148 of file G4ElectronOccupancy.hh.
Referenced by G4MolecularConfiguration::AddElectron(), G4DynamicParticle::AddElectron(), G4EmDNAPhysicsChemistry::ConstructDecayChannels(), G4MolecularConfiguration::ExciteMolecule(), and G4MoleculeDefinition::SetLevelOccupation().
00149 { 00150 G4int value =0; 00151 if ((orbit >=0)&&(orbit<theSizeOfOrbit)){ 00152 theOccupancies[orbit] += number; 00153 theTotalOccupancy += number; 00154 value = number; 00155 } 00156 return value; 00157 }
void G4ElectronOccupancy::DumpInfo | ( | ) | const |
Definition at line 127 of file G4ElectronOccupancy.cc.
References G4cout, and G4endl.
Referenced by G4DNAMolecularDecay::DecayIt(), and G4MolecularConfiguration::PrintState().
00128 { 00129 G4cout << " -- Electron Occupancy -- " << G4endl; 00130 G4int index; 00131 for (index = 0; index < theSizeOfOrbit; index++) { 00132 G4cout << " " << index << "-th orbit " 00133 << theOccupancies[index] << G4endl; 00134 } 00135 }
Definition at line 138 of file G4ElectronOccupancy.hh.
Referenced by G4DynamicParticle::GetOccupancy(), G4MolecularConfiguration::IonizeMolecule(), eOccComp::operator()(), comparator::operator()(), G4MolecularConfiguration::RemoveElectron(), and G4MoleculeDefinition::SetLevelOccupation().
00139 { 00140 G4int value = 0; 00141 if ((orbit >=0)&&(orbit<theSizeOfOrbit)){ 00142 value = theOccupancies[orbit]; 00143 } 00144 return value; 00145 }
G4int G4ElectronOccupancy::GetSizeOfOrbit | ( | ) | const [inline] |
Definition at line 126 of file G4ElectronOccupancy.hh.
Referenced by eOccComp::operator()(), and comparator::operator()().
G4int G4ElectronOccupancy::GetTotalOccupancy | ( | ) | const [inline] |
Definition at line 132 of file G4ElectronOccupancy.hh.
Referenced by G4MolecularConfiguration::G4MolecularConfiguration(), G4MolecularConfiguration::GetNbElectrons(), G4DynamicParticle::GetTotalOccupancy(), eOccComp::operator()(), and comparator::operator()().
void G4ElectronOccupancy::operator delete | ( | void * | aElectronOccupancy | ) | [inline] |
Definition at line 120 of file G4ElectronOccupancy.hh.
References aElectronOccupancyAllocator.
00121 { 00122 aElectronOccupancyAllocator.FreeSingle((G4ElectronOccupancy *) aElectronOccupancy); 00123 }
void * G4ElectronOccupancy::operator new | ( | size_t | ) | [inline] |
Definition at line 113 of file G4ElectronOccupancy.hh.
References aElectronOccupancyAllocator.
00114 { 00115 void * aElectronOccupancy; 00116 aElectronOccupancy = (void *) aElectronOccupancyAllocator.MallocSingle(); 00117 return aElectronOccupancy; 00118 }
G4int G4ElectronOccupancy::operator!= | ( | const G4ElectronOccupancy & | right | ) | const |
G4ElectronOccupancy & G4ElectronOccupancy::operator= | ( | const G4ElectronOccupancy & | right | ) |
Definition at line 86 of file G4ElectronOccupancy.cc.
References theOccupancies, theSizeOfOrbit, and theTotalOccupancy.
00087 { 00088 if ( this != &right) { 00089 theSizeOfOrbit = right.theSizeOfOrbit; 00090 00091 // allocate and clear the array of theOccupancies 00092 if ( theOccupancies != 0 ) delete [] theOccupancies; 00093 theOccupancies = new G4int[theSizeOfOrbit]; 00094 G4int index =0; 00095 for (index = 0; index < theSizeOfOrbit; index++) { 00096 theOccupancies[index] = right.theOccupancies[index]; 00097 } 00098 00099 theTotalOccupancy = right.theTotalOccupancy; 00100 } 00101 return *this; 00102 }
G4int G4ElectronOccupancy::operator== | ( | const G4ElectronOccupancy & | right | ) | const |
Definition at line 104 of file G4ElectronOccupancy.cc.
References MaxSizeOfOrbit, theOccupancies, and theSizeOfOrbit.
00105 { 00106 G4int index; 00107 G4bool value = true; 00108 for (index = 0; index < MaxSizeOfOrbit; index++) { 00109 if ( (index < theSizeOfOrbit ) && ( index < right.theSizeOfOrbit) ) { 00110 value = value && 00111 (theOccupancies[index] == right.theOccupancies[index]) ; 00112 } else if ((index < theSizeOfOrbit ) && ( index >= right.theSizeOfOrbit)) { 00113 value = value && (theOccupancies[index] == 0); 00114 } else if ((index >= theSizeOfOrbit ) && ( index <right.theSizeOfOrbit)) { 00115 value = value && (right.theOccupancies[index] == 0); 00116 } 00117 } 00118 return value; 00119 }
Definition at line 160 of file G4ElectronOccupancy.hh.
Referenced by G4EmDNAPhysicsChemistry::ConstructDecayChannels(), G4MolecularConfiguration::ExciteMolecule(), G4VGammaDeexcitation::GenerateGamma(), G4MolecularConfiguration::IonizeMolecule(), G4MolecularConfiguration::RemoveElectron(), G4DynamicParticle::RemoveElectron(), and G4MoleculeDefinition::SetLevelOccupation().
00161 { 00162 G4int value =0; 00163 if ((orbit >=0)&&(orbit<theSizeOfOrbit) ){ 00164 if ( theOccupancies[orbit] < number ) number = theOccupancies[orbit]; 00165 theOccupancies[orbit] -= number; 00166 theTotalOccupancy -= number; 00167 value = number; 00168 } 00169 return value; 00170 }