57 G4int G4QDiffraction::nPartCWorld=85;
58 std::vector<G4int> G4QDiffraction::ElementZ;
59 std::vector<G4double> G4QDiffraction::ElProbInMat;
60 std::vector<std::vector<G4int>*> G4QDiffraction::ElIsoN;
61 std::vector<std::vector<G4double>*>G4QDiffraction::IsoProbInEl;
70 G4cout<<
"G4QDiffraction::Constructor is called processName="<<processName<<
G4endl;
93 G4cout<<
"-Warning-G4QDiffraction::GetMeanFreePath for notImplemented Particle"<<
G4endl;
98 G4cout<<
"G4QDiffraction::GetMeanFreePath:Prpj, kinE="<<KinEn<<
", Mom="<<Momentum<<
G4endl;
105 G4cout<<
"G4QDiffraction::GetMeanFreePath:"<<nE<<
" Elems in Material="<<*material<<
G4endl;
111 else G4cout<<
"G4QDiffraction::GetMeanFreePath: only nA & pA are implemented"<<
G4endl;
115 G4int IPIE=IsoProbInEl.size();
116 if(IPIE)
for(
G4int ip=0; ip<IPIE; ++ip)
118 std::vector<G4double>* SPI=IsoProbInEl[ip];
121 std::vector<G4int>* IsN=ElIsoN[ip];
129 for(
G4int i=0; i<nE; ++i)
131 G4Element* pElement=(*theElementVector)[i];
133 ElementZ.push_back(Z);
137 if(isoVector) isoSize=isoVector->size();
139 G4cout<<
"G4QDiffraction::GetMeanFreePath: isovector Length="<<isoSize<<
G4endl;
149 std::vector<std::pair<G4int,G4double>*>* newAbund =
150 new std::vector<std::pair<G4int,G4double>*>;
152 for(
G4int j=0; j<isoSize; j++)
158 std::pair<G4int,G4double>*
pr=
new std::pair<G4int,G4double>(
N,abund);
160 G4cout<<
"G4QDiffract::GetMeanFreePath:pair#"<<j<<
",N="<<N<<
",ab="<<abund<<
G4endl;
162 newAbund->push_back(pr);
165 G4cout<<
"G4QDiffract::GetMeanFreePath:pairVectorLength="<<newAbund->size()<<
G4endl;
168 for(
G4int k=0; k<isoSize; k++)
delete (*newAbund)[k];
172 std::vector<std::pair<G4int,G4double>*>* cs= Isotopes->
GetCSVector(Z,indEl);
173 std::vector<G4double>* SPI =
new std::vector<G4double>;
174 IsoProbInEl.push_back(SPI);
175 std::vector<G4int>* IsN =
new std::vector<G4int>;
176 ElIsoN.push_back(IsN);
177 G4int nIs=cs->size();
179 G4cout<<
"G4QDiffract::GetMFP:=***=>,#isot="<<nIs<<
", Z="<<Z<<
", indEl="<<indEl<<
G4endl;
182 if(nIs)
for(
G4int j=0; j<nIs; j++)
184 std::pair<G4int,G4double>* curIs=(*cs)[j];
188 G4cout<<
"G4Q::GMFP:j="<<j<<
",P="<<Momentum<<
",Z="<<Z<<
",N="<<N<<
",PD="<<pPDG<<
G4endl;
190 G4double CSI=CalculateXS(Momentum, Z, N, pPDG);
193 G4cout<<
"G4QDiffraction::GetMeanFreePath: jI="<<j<<
", Zt="<<Z<<
", Nt="<<N<<
", Mom="
198 SPI->push_back(susi);
205 ElProbInMat.push_back(sigma);
209 G4cout<<
"G4QDiffraction::GetMeanFreePath: MeanFreePath="<<1./sigma<<
G4endl;
211 if(sigma > 0.)
return 1./sigma;
257 static G4bool CWinit =
true;
268 G4cout<<
"G4QDiffraction::PostStepDoIt: Before the GetMeanFreePath is called In4M="
275 G4cout<<
"G4QDiffraction::PostStepDoIt: After GetMeanFreePath is called"<<
G4endl;
280 if(std::fabs(Momentum-momentum)>.000001)
281 G4cerr<<
"-Warning-G4QDiffraction::PostStepDoIt:P_IU="<<Momentum<<
"#"<<momentum<<
G4endl;
283 G4cout<<
"G4QDiffraction::PostStepDoIt: pP(IU)="<<Momentum<<
"="<<momentum
284 <<
",proj4M="<<proj4M<<
", projM="<<proj4M.
m()<<
G4endl;
288 G4cerr<<
"G4QDiffraction::PostStepDoIt: Only NA is implemented."<<
G4endl;
296 G4cout<<
"G4QDiffraction::PostStepDoIt: "<<nE<<
" elements in the material."<<
G4endl;
332 G4cout<<
"G4QDiffraction::PostStepDoIt: projPDG="<<projPDG<<
", stPDG="<<prPDG<<
G4endl;
336 G4cerr<<
"-Warning-G4QDiffraction::PostStepDoIt:UndefProjHadron(PDG=0) ->ret 0"<<
G4endl;
342 if(projPDG==2112) pM=mProt;
344 G4int EPIM=ElProbInMat.size();
346 G4cout<<
"G4QDiffra::PostStDoIt: m="<<EPIM<<
",n="<<nE<<
",T="<<ElProbInMat[EPIM-1]<<
G4endl;
355 G4cout<<
"G4QDiffra::PostStepDoIt: EPM["<<i<<
"]="<<ElProbInMat[i]<<
",r="<<rnd<<
G4endl;
357 if (rnd<ElProbInMat[i])
break;
361 G4Element* pElement=(*theElementVector)[i];
364 G4cout<<
"G4QDiffraction::PostStepDoIt: i="<<i<<
", Z(element)="<<Z<<
G4endl;
368 G4cerr<<
"-Warning-G4QDiffraction::PostStepDoIt: Element with Z="<<Z<<
G4endl;
371 std::vector<G4double>* SPI = IsoProbInEl[i];
372 std::vector<G4int>* IsN = ElIsoN[i];
373 G4int nofIsot=SPI->size();
375 G4cout<<
"G4QDiffraction::PostStepDoIt: nI="<<nofIsot<<
", T="<<(*SPI)[nofIsot-1]<<
G4endl;
381 for(j=0; j<nofIsot; ++j)
384 G4cout<<
"G4QDiffraction::PostStepDoIt: SP["<<j<<
"]="<<(*SPI)[j]<<
",r="<<rndI<<
G4endl;
386 if(rndI < (*SPI)[j])
break;
388 if(j>=nofIsot) j=nofIsot-1;
392 G4cout<<
"G4QDiffraction::PostStepDoIt: j="<<i<<
", N(isotope)="<<N<<
", MeV="<<
MeV<<
G4endl;
396 G4cerr<<
"-Warning-G4QDiffraction::PostStepDoIt: Isotope Z="<<Z<<
" has 0>N="<<N<<
G4endl;
401 G4cout<<
"G4QDiffraction::PostStepDoIt: N="<<N<<
" for element with Z="<<Z<<
G4endl;
405 G4cerr<<
"*Warning*G4QDiffraction::PostStepDoIt:Element with N="<<N<<
G4endl;
410 G4cout<<
"G4QDiffraction::PostStepDoIt: track is initialized"<<
G4endl;
416 G4cout<<
"G4QDiffraction::PostStepDoIt: before Touchable extraction"<<
G4endl;
420 G4cout<<
"G4QDiffraction::PostStepDoIt: Touchable is extracted"<<
G4endl;
422 G4int targPDG=90000000+Z*1000+
N;
429 G4cout<<
"G4QDiffraction::PostStepDoIt: tM="<<tM<<
",p4M="<<proj4M<<
",t4M="<<tot4M<<
G4endl;
431 EnMomConservation=tot4M;
434 G4cout<<
"G4QDiff::PSDI:false,P="<<Momentum<<
",Z="<<Z<<
",N="<<N<<
",PDG="<<projPDG<<
G4endl;
436 G4double xSec=CalculateXS(Momentum, Z, N, projPDG);
441 if(xSec>0. || xSec<0. || xSec==0);
448 G4cerr<<
"*Warning*G4QDiffraction::PSDoIt:*Zero cross-section* PDG="<<projPDG
449 <<
",tPDG="<<targPDG<<
",P="<<Momentum<<
G4endl;
458 if(totCMMass < mPion+pM+tM)
461 G4cerr<<
"*Warning*G4QDiffraction::PSDoIt:*Below Diffraction Threshold* cmM="<<totCMMass
462 <<
">pM="<<pM<<
"+tM="<<tM<<
"+pi0="<<mPion<<
"=="<<pM+tM+mPion<<
G4endl;
473 G4int nSec=out->size();
475 G4LorentzVector dif4M(0.,0.,0.,0.);
479 G4cout<<
"G4QDiffraction::PostStepDoIt: =---=found=---= nSecondaries="<<nSec<<
G4endl;
481 for(i=0; i<nSec; i++)
494 else if(difPDG== 130 || difPDG==-311 || difPDG==89000001)
496 else if(difPDG== 310 || difPDG== 311 || difPDG==90999999)
523 if(S||Z>B||Z<0)
G4cout<<
"-Warning-G4QDif::PoStDoIt:Z="<<Z<<
",A="<<B<<
",S="<<S<<
G4endl;
526 G4cout<<
"G4QDiffraction::PoStDoIt:Ion,Z="<<Z<<
",A="<<B<<
",D="<<theDefinition<<
G4endl;
534 EnMomConservation-=dif4M;
541 G4cout<<
"G4QDiffraction::PostStepDoIt: Filled 4M="<<dif4M<<
", PDG="<<difPDG<<
G4endl;
544 else G4cout<<
"-Warning-G4QDif::PSDI: Lost PDG="<<difPDG<<
", Z="<<difQH->
GetCharge()
550 G4cout<<
"G4QDiffraction::PostStepDoIt:*** PostStepDoIt is done ***"<<
G4endl;
572 G4cout<<
"G4QDiff::CXS:p="<<p<<
",Z="<<Z<<
",N="<<N<<
",C="<<PDG<<
",XS="<<xs_value<<
G4endl;