103{
104#ifdef debug
105 G4cout<<
"G4QNGamma::GetMeanFreePath: Called Fc="<<*Fc<<
G4endl;
106#endif
108#ifdef debug
109 G4cout<<
"G4QNGamma::GetMeanFreePath: Before GetDynPart"<<
G4endl;
110#endif
112#ifdef debug
113 G4cout<<
"G4QNGamma::GetMeanFreePath: Before GetDef"<<
G4endl;
114#endif
118 {
119 G4cout<<
"-W-G4QNGamma::GetMeanFreePath called for not implemented particle"<<
G4endl;
121 }
122#ifdef debug
123 G4cout<<
"G4QNGamma::GetMeanFreePath: BeforeGetMaterial P="<<Momentum<<
G4endl;
124#endif
125
126 if(Momentum > 500.)
return DBL_MAX;
127
132#ifdef debug
133 G4cout<<
"G4QNGamma::GetMeanFreePath:"<<nE<<
" Elem's in theMaterial"<<
G4endl;
134#endif
135
141 {
144#ifdef debug
145 G4cout<<
"G4QNGamma::GetMeanFreePath: CSmanager is defined for neutrons"<<
G4endl;
146#endif
147 pPDG=2112;
148 }
149 else
150 {
151 G4cout<<
"-Warning-G4QNGamma::GetMeanFreePath:Particle "
154 }
155
157 G4int IPIE=IsoProbInEl.size();
158 if(IPIE)
for(
G4int ip=0; ip<IPIE; ++ip)
159 {
160 std::vector<G4double>* SPI=IsoProbInEl[ip];
161 SPI->clear();
162 delete SPI;
163 std::vector<G4int>* IsN=ElIsoN[ip];
164 IsN->clear();
165 delete IsN;
166 }
167 ElProbInMat.clear();
168 ElementZ.clear();
169 IsoProbInEl.clear();
170 ElIsoN.clear();
171 for(
G4int i=0; i<nE; ++i)
172 {
173 G4Element* pElement=(*theElementVector)[i];
175 ElementZ.push_back(Z);
179 if(isoVector) isoSize=isoVector->size();
180#ifdef debug
181 G4cout<<
"G4QNGamma::GetMeanFreePath: isovectorLength="<<isoSize<<
G4endl;
182#endif
183 if(isoSize)
184 {
187 {
188 std::vector<std::pair<G4int,G4double>*>* newAbund =
189 new std::vector<std::pair<G4int,G4double>*>;
191 for(
G4int j=0; j<isoSize; j++)
192 {
197 std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
198#ifdef debug
199 G4cout<<
"G4QNGamma::GetMeanFreePath: p#="<<j<<
",N="<<N<<
",ab="<<abund<<
G4endl;
200#endif
201 newAbund->push_back(pr);
202 }
203#ifdef debug
204 G4cout<<
"G4QNGamma::GetMeanFreePath: pairVectLength="<<newAbund->size()<<
G4endl;
205#endif
207 for(
G4int k=0; k<isoSize; k++)
delete (*newAbund)[k];
208 delete newAbund;
209 }
210 }
211 std::vector<std::pair<G4int,G4double>*>* cs= Isotopes->
GetCSVector(Z,indEl);
212 std::vector<G4double>* SPI = new std::vector<G4double>;
213 IsoProbInEl.push_back(SPI);
214 std::vector<G4int>* IsN = new std::vector<G4int>;
215 ElIsoN.push_back(IsN);
216 G4int nIs=cs->size();
218#ifdef debug
219 G4cout<<
"G4QNGamma::GetMeanFreePath: Before Loop nIs="<<nIs<<
G4endl;
220#endif
221 if(nIs)
for(
G4int j=0; j<nIs; j++)
222 {
223 std::pair<G4int,G4double>* curIs=(*cs)[j];
224 G4int N=curIs->first;
225 IsN->push_back(N);
226#ifdef debug
227 G4cout<<
"G4QNGam::GetMeanFrP: Before CS, P="<<Momentum<<
",Z="<<Z<<
",N="<<N<<
G4endl;
228#endif
229
232#ifdef debug
233 G4cout<<
"GQC::GMF:X="<<CSI<<
",M="<<Momentum<<
",Z="<<Z<<
",N="<<N<<
",P="<<pPDG<<
G4endl;
234#endif
235 curIs->second = CSI;
236 susi+=CSI;
237 SPI->push_back(susi);
238 }
240 ElProbInMat.push_back(sigma);
241 }
242#ifdef debug
244#endif
245 if(sigma > 0.) return 1./sigma;
247}
std::vector< G4Element * > G4ElementVector
std::vector< G4Isotope * > G4IsotopeVector
G4DLLIMPORT std::ostream G4cerr
G4ParticleDefinition * GetDefinition() const
G4double GetTotalMomentum() const
G4double * GetRelativeAbundanceVector() const
const G4Isotope * GetIsotope(G4int iso) const
G4IsotopeVector * GetIsotopeVector() const
const G4ElementVector * GetElementVector() const
size_t GetNumberOfElements() const
const G4double * GetVecNbOfAtomsPerVolume() const
static G4Neutron * Neutron()
G4int GetPDGEncoding() const
std::vector< std::pair< G4int, G4double > * > * GetCSVector(G4int Z, G4int index=0)
G4bool IsDefined(G4int Z, G4int Ind)
G4double GetMeanCrossSection(G4int Z, G4int index=0)
static G4QIsotope * Get()
G4int InitElement(G4int Z, G4int index, std::vector< std::pair< G4int, G4double > * > *abund)
G4bool IsApplicable(const G4ParticleDefinition &particle)
G4double GetRatio(G4double pIU, G4int tgZ, G4int tgN)
static G4QNeutronCaptureRatio * GetPointer()
static G4VQCrossSection * GetPointer()
G4Material * GetMaterial() const
const G4DynamicParticle * GetDynamicParticle() const
virtual G4double GetCrossSection(G4bool, G4double, G4int, G4int, G4int pPDG=0)