68 G4int G4QCoherentChargeExchange::nPartCWorld=85;
69 std::vector<G4int> G4QCoherentChargeExchange::ElementZ;
70 std::vector<G4double> G4QCoherentChargeExchange::ElProbInMat;
71 std::vector<std::vector<G4int>*> G4QCoherentChargeExchange::ElIsoN;
72 std::vector<std::vector<G4double>*>G4QCoherentChargeExchange::IsoProbInEl;
81 G4cout<<
"G4QCohChargeEx::Constructor is called processName="<<processName<<
G4endl;
92 {
return EnMomConservation;}
106 G4cout<<
"*W*G4QCohChargeEx::GetMeanFreePath called for notImplementedParticle"<<
G4endl;
111 G4cout<<
"G4QCohChEx::GetMeanFreePath: kinE="<<KinEn<<
",Mom="<<Momentum<<
G4endl;
118 G4cout<<
"G4QCohChargeExchange::GetMeanFreePath:"<<nE<<
" Elem's in theMaterial"<<
G4endl;
124 else G4cout<<
"G4QCohChargeEx::GetMeanFreePath: only nA & pA are implemented"<<
G4endl;
128 G4int IPIE=IsoProbInEl.size();
129 if(IPIE)
for(
G4int ip=0; ip<IPIE; ++ip)
131 std::vector<G4double>* SPI=IsoProbInEl[ip];
134 std::vector<G4int>* IsN=ElIsoN[ip];
142 for(
G4int i=0; i<nE; ++i)
144 G4Element* pElement=(*theElementVector)[i];
146 ElementZ.push_back(Z);
150 if(isoVector) isoSize=isoVector->size();
152 G4cout<<
"G4QCoherentChargeExchange::GetMeanFreePath:isovectorLength="<<isoSize<<
G4endl;
162 std::vector<std::pair<G4int,G4double>*>* newAbund =
163 new std::vector<std::pair<G4int,G4double>*>;
165 for(
G4int j=0; j<isoSize; j++)
171 std::pair<G4int,G4double>*
pr=
new std::pair<G4int,G4double>(
N,abund);
173 G4cout<<
"G4QCohChEx::GetMeanFreePath:pair#="<<j<<
",N="<<N<<
",ab="<<abund<<
G4endl;
175 newAbund->push_back(pr);
178 G4cout<<
"G4QCohChEx::GetMeanFreePath: pairVectorLength="<<newAbund->size()<<
G4endl;
181 for(
G4int k=0; k<isoSize; k++)
delete (*newAbund)[k];
185 std::vector<std::pair<G4int,G4double>*>* cs= Isotopes->
GetCSVector(Z,indEl);
186 std::vector<G4double>* SPI =
new std::vector<G4double>;
187 IsoProbInEl.push_back(SPI);
188 std::vector<G4int>* IsN =
new std::vector<G4int>;
189 ElIsoN.push_back(IsN);
190 G4int nIs=cs->size();
192 G4cout<<
"G4QCohChargEx::GMFP:=***=>,#isot="<<nIs<<
", Z="<<Z<<
", indEl="<<indEl<<
G4endl;
195 if(nIs)
for(
G4int j=0; j<nIs; j++)
197 std::pair<G4int,G4double>* curIs=(*cs)[j];
201 G4cout<<
"G4QCCX::GMFP:true, P="<<Momentum<<
",Z="<<Z<<
",N="<<N<<
",PDG="<<pPDG<<
G4endl;
204 if(Q==-27.) ccsf=
false;
206 G4cout<<
"G4QCoherentChargeExchange::GMFP: GetCS #1 j="<<j<<
G4endl;
208 G4double CSI=CalculateXSt(ccsf,
true, Momentum, Z, N, pPDG);
211 G4cout<<
"G4QCohChEx::GetMeanFreePath:jI="<<j<<
",Zt="<<Z<<
",Nt="<<N<<
",Mom="<<Momentum
216 SPI->push_back(susi);
223 ElProbInMat.push_back(sigma);
227 G4cout<<
"G4QCoherentChargeExchange::GetMeanFreePath: MeanFreePath="<<1./sigma<<
G4endl;
229 if(sigma > 0.)
return 1./sigma;
274 static G4bool CWinit =
true;
284 G4cout<<
"G4QCohChargeExchange::PostStepDoIt: Before the GetMeanFreePath is called In4M="
291 G4cout<<
"G4QCohChargeExchange::PostStepDoIt: After GetMeanFreePath is called"<<
G4endl;
296 if(std::fabs(Momentum-momentum)>.000001)
297 G4cerr<<
"*Warning*G4QCohChEx::PostStepDoIt:P(IU)="<<Momentum<<
"#"<<momentum<<
G4endl;
299 G4cout<<
"G4QCoherentChargeExchange::PostStepDoIt: pP(IU)="<<Momentum<<
"="<<momentum
300 <<
",pM="<<pM<<
",proj4M="<<proj4M<<proj4M.
m()<<
G4endl;
304 G4cerr<<
"G4QCoherentChargeExchange::PostStepDoIt: Only NA is implemented."<<
G4endl;
312 G4cout<<
"G4QCohChargeExchange::PostStepDoIt: "<<nE<<
" elements in the material."<<
G4endl;
348 G4cout<<
"G4QCohChrgExchange::PostStepDoIt: projPDG="<<projPDG<<
", stPDG="<<prPDG<<
G4endl;
352 G4cerr<<
"*Warning*G4QCoherentChargeExchange::PostStepDoIt:UndefinedProjHadron"<<
G4endl;
358 if(projPDG==2112) pM=mProt;
361 G4int EPIM=ElProbInMat.size();
363 G4cout<<
"G4QCohChEx::PostStDoIt:m="<<EPIM<<
",n="<<nE<<
",T="<<ElProbInMat[EPIM-1]<<
G4endl;
372 G4cout<<
"G4QCohChEx::PostStepDoIt:EPM["<<i<<
"]="<<ElProbInMat[i]<<
",r="<<rnd<<
G4endl;
374 if (rnd<ElProbInMat[i])
break;
378 G4Element* pElement=(*theElementVector)[i];
381 G4cout<<
"G4QCoherentChargeExchange::PostStepDoIt: i="<<i<<
", Z(element)="<<Z<<
G4endl;
385 G4cerr<<
"-Warning-G4QCoherentChargeExchange::PostStepDoIt: Element with Z="<<Z<<
G4endl;
388 std::vector<G4double>* SPI = IsoProbInEl[i];
389 std::vector<G4int>* IsN = ElIsoN[i];
390 G4int nofIsot=SPI->size();
392 G4cout<<
"G4QCohChargeExchange::PosStDoIt:nI="<<nofIsot<<
",T="<<(*SPI)[nofIsot-1]<<
G4endl;
398 for(j=0; j<nofIsot; ++j)
401 G4cout<<
"G4QCohChargEx::PostStepDoIt: SP["<<j<<
"]="<<(*SPI)[j]<<
", r="<<rndI<<
G4endl;
403 if(rndI < (*SPI)[j])
break;
405 if(j>=nofIsot) j=nofIsot-1;
409 G4cout<<
"G4QCohChargeEx::PostStepDoIt: j="<<i<<
", N(isotope)="<<N<<
", MeV="<<
MeV<<
G4endl;
413 G4cerr<<
"*Warning*G4QCohChEx::PostStepDoIt: Isotope with Z="<<Z<<
", 0>N="<<N<<
G4endl;
418 G4cout<<
"G4QCohChargeExchange::PostStepDoIt: N="<<N<<
" for element with Z="<<Z<<
G4endl;
422 G4cerr<<
"*Warning*G4QCoherentChargeExchange::PostStepDoIt:Element with N="<<N<<
G4endl;
427 G4cout<<
"G4QCoherentChargeExchange::PostStepDoIt: track is initialized"<<
G4endl;
433 G4cout<<
"G4QCoherentChargeExchange::PostStepDoIt: before Touchable extraction"<<
G4endl;
437 G4cout<<
"G4QCoherentChargeExchange::PostStepDoIt: Touchable is extracted"<<
G4endl;
440 G4int targPDG=90000000+Z*1000+
N;
441 if(projPDG==2212) targPDG+=999;
442 else if(projPDG==2112) targPDG-=999;
449 G4cout<<
"G4QCohChrgEx::PostStepDoIt: tM="<<tM<<
", p4M="<<proj4M<<
", t4M="<<tot4M<<
G4endl;
451 EnMomConservation=tot4M;
454 G4cout<<
"G4QCCX::PSDI:false, P="<<Momentum<<
",Z="<<Z<<
",N="<<N<<
",PDG="<<projPDG<<
G4endl;
456 G4double xSec=CalculateXSt(
false,
true, Momentum, Z, N, projPDG);
461 if(xSec>0. || xSec<0. || xSec==0);
468 G4cerr<<
"*Warning*G4QCoherentChargeExchange::PSDoIt:*Zero cross-section* PDG="<<projPDG
469 <<
",tPDG="<<targPDG<<
",P="<<Momentum<<
G4endl;
477 G4double mint=CalculateXSt(
false,
false, Momentum, Z, N, projPDG);
479 G4cout<<
"G4QCohChEx::PoStDoIt:pPDG="<<projPDG<<
",tPDG="<<targPDG<<
",P="<<Momentum<<
",CS="
480 <<xSec<<
",-t="<<mint<<
G4endl;
484 else G4cout<<
"*Warning*G4QCoherentChargeExchange::PostStDoIt:-t="<<mint<<
G4endl;
486 G4double maxt=CalculateXSt(
true,
false, Momentum, Z, N, projPDG);
487 if(maxt<=0.) maxt=1.e-27;
491 G4cout<<
"G4QCoherentChargeExchange::PoStDoIt:t="<<mint<<
",dpcm2="<<maxt
492 <<
",Ek="<<kinEnergy<<
",tM="<<tM<<
",pM="<<pM<<
",cost="<<cost<<
G4endl;
494 if(cost>1. || cost<-1. || !(cost>-1. || cost<1.))
496 if(cost>1.000001 || cost<-1.000001 || !(cost>-1. || cost<1.))
501 G4double twop2cm=(tM2+tM2)*(pEn*pEn-pM2)/sM;
502 G4cout<<
"*Warning*G4QCohChEx::PostStepDoIt:cos="<<cost<<
",t="<<mint<<
",T="<<kinEnergy
503 <<
",tM="<<tM<<
",tmax="<<2*kinEnergy*tM<<
",p="<<projPDG<<
",t="<<targPDG<<
G4endl;
504 G4cout<<
"..G4QCohChEx::PoStDoI: dpcm2="<<twop2cm<<
"="<<maxt<<
G4endl;
506 if (cost>1.) cost=1.;
507 else if(cost<-1.) cost=-1.;
511 G4LorentzVector dir4M=tot4M-
G4LorentzVector(0.,0.,0.,(tot4M.
e()-tM-pM)*.01);
512 if(!
G4QHadron(tot4M).RelDecayIn2(scat4M, reco4M, dir4M, cost, cost))
514 G4cerr<<
"G4QCohChEx::PSDI:t4M="<<tot4M<<
",pM="<<pM<<
",tM="<<tM<<
",cost="<<cost<<
G4endl;
518 G4cout<<
"G4QCohChEx::PoStDoIt:s4M="<<scat4M<<
"+r4M="<<reco4M<<
"="<<scat4M+reco4M<<
G4endl;
519 G4cout<<
"G4QCohChEx::PoStDoIt: scatE="<<scat4M.
e()-pM<<
", recoE="<<reco4M.
e()-tM<<
",d4M="
520 <<tot4M-scat4M-reco4M<<
G4endl;
529 EnMomConservation-=scat4M;
539 G4cout<<
"G4QCoherentChargeExchange::PostStepDoIt: Ion Z="<<Z<<
", A="<<aA<<
G4endl;
542 if(!theDefinition)
G4cout<<
"*Warning*G4QCohChEx::PostStepDoIt:drop PDG="<<targPDG<<
G4endl;
547 EnMomConservation-=reco4M;
549 G4cout<<
"G4QCohChEx::PostSDoIt:"<<targPDG<<reco4M<<reco4M.
m()<<EnMomConservation<<
G4endl;
556 G4cout<<
"G4QCohChEx::PostStpDoIt:p="<<curD<<curD.
mag()<<
",e="<<curE<<
",m="<<curM<<
G4endl;
559 aNewTrack =
new G4Track(theSec, localtime, position );
564 G4cout<<
"G4QCoherentChargeExchange::PostStepDoIt:*** PostStepDoIt is done ***"<<
G4endl;
611 else G4cout<<
"*Warning*G4QCohChrgExchange::CalculateXSt: NotInitiatedScattering"<<
G4endl;