00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "G4MoleculeDefinition.hh"
00037 #include "G4MolecularConfiguration.hh"
00038
00039 using namespace std;
00040
00041
00042
00043
00044
00045 G4MoleculeDefinition::G4MoleculeDefinition(const G4String& name,
00046 G4double mass,
00047 G4int electronsNumber,
00048 G4int electronicLevels,
00049 G4double diffCoeff,
00050 G4int atomsNumber,
00051 G4double radius,
00052 G4double lifetime,
00053 G4String aType ,
00054 G4MoleculeID ID
00055 ):
00056 G4ParticleDefinition(name, mass, 0., 0., 0, 0, 0, 0, 0, 0, "Molecule",
00057 0, 0, ID, false, lifetime, NULL, false, aType, 0, 0.0),
00058 fMass(mass),
00059 fNbOfElectrons(electronsNumber), fNbOfMolecularShells(electronicLevels), fDiffusionCoefficient(diffCoeff),
00060 fAtomsNb(atomsNumber), fVanDerVaalsRadius(radius)
00061
00062 {
00063 fElectronOccupancy = new G4ElectronOccupancy(fNbOfMolecularShells);
00064 fDecayTable = NULL;
00065 }
00066
00067 G4MoleculeDefinition::~G4MoleculeDefinition()
00068 {
00069 if (fElectronOccupancy)
00070 {
00071 delete fElectronOccupancy;
00072 fElectronOccupancy = 0;
00073 }
00074 if (fDecayTable)
00075 {
00076 delete fDecayTable;
00077 fDecayTable = 0;
00078 }
00079
00080 }
00081
00082 void G4MoleculeDefinition::AddeConfToExcitedState(const G4String& exStId,
00083 const G4ElectronOccupancy& conf,
00084 double decayTime)
00085 {
00086 if (!fDecayTable)
00087 {
00088 fDecayTable = new G4MolecularDecayTable();
00089 }
00090 fDecayTable->AddeConfToExcitedState(exStId, conf);
00091 G4MolecularConfiguration::GetMolecularConfiguration(this,conf)->SetDecayTime(decayTime);
00092 }
00093
00094 void G4MoleculeDefinition::SetLevelOccupation(G4int shell, G4int eNb)
00095 {
00096 G4int levelOccupancy = fElectronOccupancy->GetOccupancy(shell);
00097
00098 if (levelOccupancy)
00099 {
00100
00101 fElectronOccupancy->RemoveElectron(shell, levelOccupancy);
00102 }
00103
00104 fElectronOccupancy->AddElectron(shell,eNb);
00105
00106 }
00107
00108 void G4MoleculeDefinition::AddExcitedState(const G4String& val)
00109 {
00110 if (!fDecayTable)
00111 {
00112 fDecayTable = new G4MolecularDecayTable();
00113 }
00114
00115 fDecayTable->AddExcitedState(val);
00116
00117 }
00118
00119 const G4String& G4MoleculeDefinition::GetExcitedState(const G4ElectronOccupancy* occ) const
00120 {
00121 if (fDecayTable)
00122 {
00123 return fDecayTable->GetExcitedState(occ);
00124 }
00125 else
00126 {
00127 G4String const errMsg = ": no Excited States and Decays for"+ GetName() + " are defined.";
00128 G4Exception("G4MoleculeDefinition::GetExcitedState","",FatalErrorInArgument,errMsg);
00129 }
00130 return *(new G4String(""));
00131 }
00132
00133 void G4MoleculeDefinition::AddDecayChannel(const G4String& chanId,
00134 const G4MolecularDecayChannel* chan)
00135 {
00136 if (!fDecayTable)
00137 {
00138 fDecayTable = new G4MolecularDecayTable();
00139 }
00140 fDecayTable->AddDecayChannel(chanId, chan);
00141 }
00142
00143 const vector<const G4MolecularDecayChannel*>* G4MoleculeDefinition::GetDecayChannels(const G4String& ExState) const
00144 {
00145 if (fDecayTable)
00146 {
00147 const vector<const G4MolecularDecayChannel*>* output = fDecayTable->GetDecayChannels(ExState);
00148 return output;
00149 }
00150 else
00151 {
00152 G4String const errMsg = ": no Excited States and Decays for"+ GetName() + " are defined.";
00153 G4Exception("G4MoleculeDefinition::GetDecayChannels","",FatalErrorInArgument,errMsg);
00154 }
00155 return 0;
00156 }
00157
00158 const vector<const G4MolecularDecayChannel*>* G4MoleculeDefinition::GetDecayChannels(const G4ElectronOccupancy* occ) const
00159 {
00160 if (fDecayTable)
00161 {
00162 const vector<const G4MolecularDecayChannel*>* output = fDecayTable->GetDecayChannels(occ);
00163 return output;
00164 }
00165 else
00166 {
00167 G4String const errMsg = ": no Excited States and Decays for"+ GetName() + " are defined.";
00168 G4Exception("G4MoleculeDefinition::GetDecayChannels","",FatalErrorInArgument,errMsg);
00169 }
00170 return 0;
00171 }
00172
00174
00176
00177 G4MoleculeDefinition::G4MoleculeDefinition(const G4MoleculeDefinition& right):
00178 G4ParticleDefinition((const G4ParticleDefinition &)right),
00179 fMass(right.fMass),
00180 fNbOfElectrons (right.fNbOfElectrons),
00181 fNbOfMolecularShells(right.fNbOfMolecularShells),
00182 fDiffusionCoefficient( right.fDiffusionCoefficient),
00183 fAtomsNb( right.fAtomsNb),
00184 fVanDerVaalsRadius (right.fVanDerVaalsRadius)
00185 {
00186 if(right.fElectronOccupancy!=0)
00187 {
00188 fElectronOccupancy= new G4ElectronOccupancy(*(right.fElectronOccupancy));
00189 }
00190 else fElectronOccupancy = 0;
00191
00192 if(right.fDecayTable!=0)
00193 {
00194 fDecayTable = new G4MolecularDecayTable(*(right.fDecayTable));
00195 }
00196 else fDecayTable =0;
00197 }
00198
00199
00200
00201 const G4MoleculeDefinition & G4MoleculeDefinition::operator=(const G4MoleculeDefinition &right)
00202 {
00203 if (this != &right) {
00204 }
00205 return *this;
00206 }