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
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #include "G4QAtomicElectronScattering.hh"
00051 #include "G4PhysicalConstants.hh"
00052 #include "G4HadronicDeprecate.hh"
00053
00054
00055 G4QAtomicElectronScattering::G4QAtomicElectronScattering(const G4String& processName):
00056 G4VDiscreteProcess(processName, fElectromagnetic)
00057 {
00058
00059 G4HadronicDeprecate("G4QAtomicElectronScattering");
00060
00061 #ifdef debug
00062 G4cout<<"G4QAtomicElectronScattering::Constructor is called"<<G4endl;
00063 #endif
00064 if (verboseLevel>0) G4cout << GetProcessName() << " process is created "<< G4endl;
00065
00066 G4QCHIPSWorld::Get()->GetParticles(nPartCWorld);
00067 G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio);
00068 G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime);
00069 G4QEnvironment::SetParameters(SolidAngle);
00070 }
00071
00072 G4bool G4QAtomicElectronScattering::manualFlag=false;
00073 G4double G4QAtomicElectronScattering::Temperature=180.;
00074 G4double G4QAtomicElectronScattering::SSin2Gluons=0.3;
00075 G4double G4QAtomicElectronScattering::EtaEtaprime=0.3;
00076 G4double G4QAtomicElectronScattering::freeNuc=0.5;
00077 G4double G4QAtomicElectronScattering::freeDib=0.05;
00078 G4double G4QAtomicElectronScattering::clustProb=5.;
00079 G4double G4QAtomicElectronScattering::mediRatio=10.;
00080
00081
00082 G4int G4QAtomicElectronScattering::nPartCWorld=85;
00083 G4double G4QAtomicElectronScattering::SolidAngle=0.5;
00084 G4bool G4QAtomicElectronScattering::EnergyFlux=false;
00085 G4double G4QAtomicElectronScattering::PiPrThresh=141.4;
00086 G4double G4QAtomicElectronScattering::M2ShiftVir=20000.;
00087 G4double G4QAtomicElectronScattering::DiNuclMass=1880.;
00088
00089 void G4QAtomicElectronScattering::SetManual() {manualFlag=true;}
00090 void G4QAtomicElectronScattering::SetStandard() {manualFlag=false;}
00091
00092
00093 void G4QAtomicElectronScattering::SetParameters(G4double temper, G4double ssin2g,
00094 G4double etaetap, G4double fN, G4double fD,
00095 G4double cP, G4double mR, G4int nParCW,
00096 G4double solAn, G4bool efFlag,
00097 G4double piThresh, G4double mpisq,
00098 G4double dinum)
00099 {
00100 Temperature=temper;
00101 SSin2Gluons=ssin2g;
00102 EtaEtaprime=etaetap;
00103 freeNuc=fN;
00104 freeDib=fD;
00105 clustProb=cP;
00106 mediRatio=mR;
00107 nPartCWorld = nParCW;
00108 EnergyFlux=efFlag;
00109 SolidAngle=solAn;
00110 PiPrThresh=piThresh;
00111 M2ShiftVir=mpisq;
00112 DiNuclMass=dinum;
00113 G4QCHIPSWorld::Get()->GetParticles(nPartCWorld);
00114 G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio);
00115 G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime);
00116 G4QEnvironment::SetParameters(SolidAngle);
00117 }
00118
00119
00120
00121 G4QAtomicElectronScattering::~G4QAtomicElectronScattering() {}
00122
00123
00124 G4LorentzVector G4QAtomicElectronScattering::GetEnegryMomentumConservation()
00125 {
00126 return EnMomConservation;
00127 }
00128
00129 G4int G4QAtomicElectronScattering::GetNumberOfNeutronsInTarget()
00130 {
00131 return nOfNeutrons;
00132 }
00133
00134 G4double G4QAtomicElectronScattering::GetMeanFreePath(const G4Track& aTrack,
00135 G4double,G4ForceCondition* Fc)
00136 {
00137 *Fc = NotForced;
00138 const G4DynamicParticle* incidentParticle = aTrack.GetDynamicParticle();
00139 G4ParticleDefinition* incidentParticleDefinition=incidentParticle->GetDefinition();
00140 if( !IsApplicable(*incidentParticleDefinition))
00141 G4cout<<"-Wa-G4QAtElScat::GetMeanFreePath called for not implemented particle"<<G4endl;
00142
00143 G4double Momentum = incidentParticle->GetTotalMomentum();
00144 const G4Material* material = aTrack.GetMaterial();
00145 const G4double* NOfNucPerVolume = material->GetVecNbOfAtomsPerVolume();
00146 const G4ElementVector* theElementVector = material->GetElementVector();
00147 G4int nE=material->GetNumberOfElements();
00148 #ifdef debug
00149 G4cout<<"G4QAtomElectScattering::GetMeanFreePath:"<<nE<<" Elem's in theMaterial"<<G4endl;
00150 #endif
00151
00152 G4VQCrossSection* CSmanager=G4QElectronNuclearCrossSection::GetPointer();
00153 if(incidentParticleDefinition == G4Electron::Electron())
00154 {
00155 CSmanager=G4QElectronNuclearCrossSection::GetPointer();
00156
00157 }
00158 else G4cout<<"G4QAtomEScattering::GetMeanFreePath:Particle isn't known in CHIPS"<<G4endl;
00159
00160 G4QIsotope* Isotopes = G4QIsotope::Get();
00161 G4double sigma=0.;
00162 for(G4int i=0; i<nE; ++i)
00163 {
00164 G4int Z = static_cast<G4int>((*theElementVector)[i]->GetZ());
00165 std::vector<std::pair<G4int,G4double>*>* cs= Isotopes->GetCSVector(Z);
00166 G4int nIs=cs->size();
00167 if(nIs) for(G4int j=0; j<nIs; j++)
00168 {
00169 std::pair<G4int,G4double>* curIs=(*cs)[j];
00170 G4int N=curIs->first;
00171 curIs->second = CSmanager->GetCrossSection(true,Momentum,Z,N,13);
00172 }
00173 sigma+=Isotopes->GetMeanCrossSection(Z)*NOfNucPerVolume[i];
00174 }
00175
00176
00177 if(sigma > 0.) return 1./sigma;
00178 return DBL_MAX;
00179 }
00180
00181
00182 G4bool G4QAtomicElectronScattering::IsApplicable(const G4ParticleDefinition& particle)
00183 {
00184 if (particle == *( G4MuonPlus::MuonPlus() )) return true;
00185 else if (particle == *( G4MuonMinus::MuonMinus() )) return true;
00186 else if (particle == *( G4TauPlus::TauPlus() )) return true;
00187 else if (particle == *( G4TauMinus::TauMinus() )) return true;
00188 else if (particle == *( G4Electron::Electron() )) return true;
00189 else if (particle == *( G4Positron::Positron() )) return true;
00190 else if (particle == *( G4Gamma::Gamma() )) return true;
00191 else if (particle == *( G4Proton::Proton() )) return true;
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208 #ifdef debug
00209 G4cout<<"***G4QAtomElScattering::IsApplicable: PDG="<<particle.GetPDGEncoding()<<G4endl;
00210 #endif
00211 return false;
00212 }
00213
00214 G4VParticleChange* G4QAtomicElectronScattering::PostStepDoIt(const G4Track& track,
00215 const G4Step& step)
00216 {
00217 static const G4double mu=G4MuonMinus::MuonMinus()->GetPDGMass();
00218 static const G4double mu2=mu*mu;
00219
00220 static const G4double mNeut= G4QPDGCode(2112).GetMass();
00221 static const G4double mProt= G4QPDGCode(2212).GetMass();
00222 static const G4double dM=mProt+mNeut;
00223
00224
00225
00226
00227
00228
00229
00230 const G4DynamicParticle* projHadron = track.GetDynamicParticle();
00231 const G4ParticleDefinition* particle=projHadron->GetDefinition();
00232 G4LorentzVector proj4M=projHadron->Get4Momentum();
00233 G4double momentum = projHadron->GetTotalMomentum();
00234 G4double Momentum=proj4M.rho();
00235 if(std::fabs(Momentum-momentum)>.001) G4cerr<<"G4QAtElScat::PSDI P="<<Momentum<<"="
00236 <<momentum<<G4endl;
00237 #ifdef debug
00238 G4double mp=proj4M.m();
00239 G4cout<<"G4QAtomElScattering::PostStepDoIt called, P="<<Momentum<<"="<<momentum<<G4endl;
00240 #endif
00241 if (!IsApplicable(*particle))
00242 {
00243 G4cerr<<"G4QAtomElectScat::PostStepDoIt:Only gam,e+,e-,mu+,mu-,t+,t-,p are implemented"
00244 <<G4endl;
00245 return 0;
00246 }
00247 const G4Material* material = track.GetMaterial();
00248 G4int Z=0;
00249 const G4ElementVector* theElementVector = material->GetElementVector();
00250 G4int i=0;
00251 G4double sum=0.;
00252 G4int nE=material->GetNumberOfElements();
00253 #ifdef debug
00254 G4cout<<"G4QAtomElectronScat::PostStepDoIt: "<<nE<<" elements in the material."<<G4endl;
00255 #endif
00256 G4int projPDG=0;
00257
00258 if (particle == G4MuonPlus::MuonPlus() ) projPDG= -13;
00259 else if (particle == G4MuonMinus::MuonMinus() ) projPDG= 13;
00260 else if (particle == G4Electron::Electron() ) projPDG= 11;
00261 else if (particle == G4Positron::Positron() ) projPDG= -11;
00262 else if (particle == G4Gamma::Gamma() ) projPDG= 22;
00263 else if (particle == G4Proton::Proton() ) projPDG= 2212;
00264 else if (particle == G4Neutron::Neutron() ) projPDG= 2112;
00265 else if (particle == G4PionMinus::PionMinus() ) projPDG= -211;
00266 else if (particle == G4PionPlus::PionPlus() ) projPDG= 211;
00267 else if (particle == G4KaonPlus::KaonPlus() ) projPDG= 2112;
00268 else if (particle == G4KaonMinus::KaonMinus() ) projPDG= -321;
00269 else if (particle == G4KaonZeroLong::KaonZeroLong() ) projPDG= 130;
00270 else if (particle == G4KaonZeroShort::KaonZeroShort()) projPDG= 310;
00271 else if (particle == G4TauPlus::TauPlus() ) projPDG= -15;
00272 else if (particle == G4TauMinus::TauMinus() ) projPDG= 15;
00273 else if (particle == G4Lambda::Lambda() ) projPDG= 3122;
00274 else if (particle == G4SigmaPlus::SigmaPlus() ) projPDG= 3222;
00275 else if (particle == G4SigmaMinus::SigmaMinus() ) projPDG= 3112;
00276 else if (particle == G4SigmaZero::SigmaZero() ) projPDG= 3212;
00277 else if (particle == G4XiMinus::XiMinus() ) projPDG= 3312;
00278 else if (particle == G4XiZero::XiZero() ) projPDG= 3322;
00279 else if (particle == G4OmegaMinus::OmegaMinus() ) projPDG= 3334;
00280 else if (particle == G4AntiNeutron::AntiNeutron() ) projPDG=-2112;
00281 else if (particle == G4AntiProton::AntiProton() ) projPDG=-2212;
00282 #ifdef debug
00283 G4int prPDG=particle->GetPDGEncoding();
00284 G4cout<<"G4QAtomElScat::PostStepRestDoIt: projPDG="<<projPDG<<",stPDG="<<prPDG<<G4endl;
00285 #endif
00286 if(!projPDG)
00287 {
00288 G4cerr<<"-Warning-G4QAtomElScattering::PostStepDoIt:Undefined captured hadron"<<G4endl;
00289 return 0;
00290 }
00291
00292 std::vector<G4double> sumfra;
00293 for(i=0; i<nE; ++i)
00294 {
00295 G4double frac=material->GetFractionVector()[i];
00296 sum+=frac;
00297 sumfra.push_back(sum);
00298 }
00299 G4double rnd = sum*G4UniformRand();
00300 for(i=0; i<nE; ++i) if (rnd<sumfra[i]) break;
00301 G4Element* pElement=(*theElementVector)[i];
00302 Z=static_cast<G4int>(pElement->GetZ());
00303 if(Z<=0)
00304 {
00305 G4cerr<<"-Warning-G4QAtomicElectronScattering::PostStepDoIt: Element's Z="<<Z<<G4endl;
00306 if(Z<0) return 0;
00307 }
00308 G4int N = Z;
00309 G4int isoSize=0;
00310 G4IsotopeVector* isoVector=pElement->GetIsotopeVector();
00311 if(isoVector) isoSize=isoVector->size();
00312 #ifdef debug
00313 G4cout<<"G4QAtomicElectronScattering::PostStepDoIt: isovectorLength="<<isoSize<<G4endl;
00314 #endif
00315 if(isoSize)
00316 {
00317
00318 G4int curInd=G4QIsotope::Get()->GetLastIndex(Z);
00319 if(!curInd)
00320 {
00321 std::vector<std::pair<G4int,G4double>*>* newAbund =
00322 new std::vector<std::pair<G4int,G4double>*>;
00323 G4double* abuVector=pElement->GetRelativeAbundanceVector();
00324 for(G4int j=0; j<isoSize; j++)
00325 {
00326 N=pElement->GetIsotope(j)->GetN()-Z;
00327 if(pElement->GetIsotope(j)->GetZ()!=Z) G4cerr<<"*G4QCaptureAtRest::AtRestDoIt: Z="
00328 <<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
00329 G4double abund=abuVector[j];
00330 std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
00331 #ifdef debug
00332 G4cout<<"G4QAtomElScat::PostStepDoIt:pair#="<<j<<", N="<<N<<",ab="<<abund<<G4endl;
00333 #endif
00334 newAbund->push_back(pr);
00335 }
00336 #ifdef debug
00337 G4cout<<"G4QAtomElectScat::PostStepDoIt:pairVectorLength="<<newAbund->size()<<G4endl;
00338 #endif
00339 curInd=G4QIsotope::Get()->InitElement(Z,1,newAbund);
00340 for(G4int k=0; k<isoSize; k++) delete (*newAbund)[k];
00341 delete newAbund;
00342 }
00343
00344 N = G4QIsotope::Get()->GetNeutrons(Z,curInd);
00345 }
00346 else N = G4QIsotope::Get()->GetNeutrons(Z);
00347 nOfNeutrons=N;
00348 G4double dd=0.025;
00349 G4double am=Z+N;
00350 G4double value_sr=std::sqrt(am);
00351 G4double dsr=0.01*(value_sr+value_sr);
00352 if(dsr<dd)dsr=dd;
00353 if(manualFlag) G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio);
00354 else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);
00355 else if(projPDG==-211) G4QNucleus::SetParameters(.67-dsr,.32-dsr,5.,9.);
00356 #ifdef debug
00357 G4cout<<"G4QAtomElectScattering::PostStepDoIt: N="<<N<<" for element with Z="<<Z<<G4endl;
00358 #endif
00359 if(N<0)
00360 {
00361 G4cerr<<"---Warning---G4QAtomElectScat::PostStepDoIt:Element with N="<<N<< G4endl;
00362 return 0;
00363 }
00364 if(projPDG==11||projPDG==-11||projPDG==13||projPDG==-13||projPDG==15||projPDG==-15)
00365 {
00366 G4double kinEnergy= projHadron->GetKineticEnergy();
00367 G4ParticleMomentum dir = projHadron->GetMomentumDirection();
00368 G4VQCrossSection* CSmanager=G4QElectronNuclearCrossSection::GetPointer();
00369 G4int aProjPDG=std::abs(projPDG);
00370 if(aProjPDG==13) CSmanager=G4QMuonNuclearCrossSection::GetPointer();
00371 if(aProjPDG==15) CSmanager=G4QTauNuclearCrossSection::GetPointer();
00372 G4double xSec=CSmanager->GetCrossSection(false,Momentum,Z,N,13);
00373
00374 if(xSec <= 0.)
00375 {
00376
00377 aParticleChange.ProposeEnergy(kinEnergy);
00378 aParticleChange.ProposeLocalEnergyDeposit(0.);
00379 aParticleChange.ProposeMomentumDirection(dir) ;
00380 return G4VDiscreteProcess::PostStepDoIt(track,step);
00381 }
00382 G4double photonEnergy = CSmanager->GetExchangeEnergy();
00383 if( kinEnergy < photonEnergy )
00384 {
00385
00386 G4cerr<<"G4QAtomElectScat::PSDoIt: phE="<<photonEnergy<<">leptE="<<kinEnergy<<G4endl;
00387 aParticleChange.ProposeEnergy(kinEnergy);
00388 aParticleChange.ProposeLocalEnergyDeposit(0.);
00389 aParticleChange.ProposeMomentumDirection(dir) ;
00390 return G4VDiscreteProcess::PostStepDoIt(track,step);
00391 }
00392 G4double photonQ2 = CSmanager->GetExchangeQ2(photonEnergy);
00393 G4double W=photonEnergy-photonQ2/dM;
00394 if(W<0.)
00395 {
00396
00397 G4cout<<"G4QAtomElScat::PostStepDoIt:(lN) negative equivalent energy W="<<W<<G4endl;
00398 aParticleChange.ProposeEnergy(kinEnergy);
00399 aParticleChange.ProposeLocalEnergyDeposit(0.);
00400 aParticleChange.ProposeMomentumDirection(dir) ;
00401 return G4VDiscreteProcess::PostStepDoIt(track,step);
00402 }
00403
00404 G4VQCrossSection* thePhotonData=G4QPhotonNuclearCrossSection::GetPointer();
00405 G4double sigNu=thePhotonData->GetCrossSection(true,photonEnergy, Z, N);
00406 G4double sigK =thePhotonData->GetCrossSection(true, W, Z, N);
00407 G4double rndFraction = CSmanager->GetVirtualFactor(photonEnergy, photonQ2);
00408 if(sigNu*G4UniformRand()>sigK*rndFraction)
00409 {
00410
00411 G4cout<<"G4QAtomElectScat::PostStepDoIt: probability correction - DoNothing"<<G4endl;
00412 aParticleChange.ProposeEnergy(kinEnergy);
00413 aParticleChange.ProposeLocalEnergyDeposit(0.);
00414 aParticleChange.ProposeMomentumDirection(dir) ;
00415 return G4VDiscreteProcess::PostStepDoIt(track,step);
00416 }
00417 G4double iniE=kinEnergy+mu;
00418 G4double finE=iniE-photonEnergy;
00419 if(finE>0) aParticleChange.ProposeEnergy(finE) ;
00420 else
00421 {
00422 aParticleChange.ProposeEnergy(0.) ;
00423 aParticleChange.ProposeTrackStatus(fStopAndKill);
00424 }
00425
00426 G4double EEm=iniE*finE-mu2;
00427 G4double iniP=std::sqrt(iniE*iniE-mu2);
00428 G4double finP=std::sqrt(finE*finE-mu2);
00429 G4double cost=(EEm+EEm-photonQ2)/iniP/finP;
00430 if(cost>1.) cost=1.;
00431
00432 if(cost<-1.) cost=-1.;
00433
00434
00435
00436
00437
00438
00439 G4ThreeVector ort=dir.orthogonal();
00440 G4ThreeVector ortx = ort.unit();
00441 G4ThreeVector orty = dir.cross(ortx);
00442 G4double sint=std::sqrt(1.-cost*cost);
00443 G4double phi=twopi*G4UniformRand();
00444 G4double sinx=sint*std::sin(phi);
00445 G4double siny=sint*std::cos(phi);
00446 G4ThreeVector findir=cost*dir+sinx*ortx+siny*orty;
00447 aParticleChange.ProposeMomentumDirection(findir);
00448 const G4ThreeVector photon3M=iniP*dir-finP*findir;
00449 projPDG=22;
00450 proj4M=G4LorentzVector(photon3M,photon3M.mag());
00451 }
00452 G4int targPDG=90000000+Z*1000+N;
00453 G4QPDGCode targQPDG(targPDG);
00454 G4double tM=targQPDG.GetMass();
00455 EnMomConservation=proj4M+G4LorentzVector(0.,0.,0.,tM);
00456 G4QHadronVector* output=new G4QHadronVector;
00457
00458
00459
00460
00461 #ifdef debug
00462 G4cout<<"G4QAtomElScat::PostStepDoIt: projPDG="<<projPDG<<", targPDG="<<targPDG<<G4endl;
00463 #endif
00464 G4QHadron* pH = new G4QHadron(projPDG,proj4M);
00465
00466
00467 G4QHadronVector projHV;
00468 projHV.push_back(pH);
00469 G4QEnvironment* pan= new G4QEnvironment(projHV,targPDG);
00470 std::for_each(projHV.begin(), projHV.end(), DeleteQHadron());
00471 projHV.clear();
00472 #ifdef debug
00473 G4cout<<"G4QAtomElectScat::PostStepDoIt: pPDG="<<projPDG<<", mp="<<mp<<G4endl;
00474 #endif
00475 try
00476 {
00477 delete output;
00478 output = pan->Fragment();
00479 }
00480 catch (G4QException& error)
00481 {
00482
00483 G4cerr<<"**G4QAtomElectScat::PostStepDoIt:G4QE Exception is catched"<<G4endl;
00484
00485
00486 G4Exception("G4QAtomElScat::PostStepDoIt()", "HAD_CHPS_0027",
00487 FatalException, "CHIPScrash");
00488 }
00489 delete pan;
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527 aParticleChange.Initialize(track);
00528 G4double localtime = track.GetGlobalTime();
00529 G4ThreeVector position = track.GetPosition();
00530 G4TouchableHandle trTouchable = track.GetTouchableHandle();
00531
00532 G4int tNH = output->size();
00533 aParticleChange.SetNumberOfSecondaries(tNH);
00534
00535 #ifdef debug
00536 G4cout<<"G4QAtomElectronScat::PostStepDoIt: "<<tNH<<" particles are generated"<<G4endl;
00537 #endif
00538 G4int nOut=output->size();
00539 if(tNH==1) tNH=0;
00540 if(tNH==2&&2!=nOut) G4cout<<"--Warning--G4QAtomElScat::PostStepDoIt: 2 # "<<nOut<<G4endl;
00541
00542
00543 if(tNH) for(i=0; i<tNH; i++)
00544 {
00545
00546
00547
00548 G4QHadron* hadr=output->operator[](i);
00549 G4int PDGCode = hadr->GetPDGCode();
00550 G4int nFrag = hadr->GetNFragments();
00551 #ifdef pdebug
00552 G4cout<<"G4QAtomElectScat::AtRestDoIt: H#"<<i<<",PDG="<<PDGCode<<",nF="<<nFrag<<G4endl;
00553 #endif
00554 if(nFrag)
00555 {
00556 #ifdef debug
00557 G4cout<<"G4QAtomElScat::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl;
00558 #endif
00559 delete hadr;
00560 continue;
00561 }
00562 G4DynamicParticle* theSec = new G4DynamicParticle;
00563 G4ParticleDefinition* theDefinition;
00564 if (PDGCode==90000001) theDefinition = G4Neutron::Neutron();
00565 else if(PDGCode==90001000) theDefinition = G4Proton::Proton();
00566 else if(PDGCode==91000000) theDefinition = G4Lambda::Lambda();
00567 else if(PDGCode==311 || PDGCode==-311)
00568 {
00569 if(G4UniformRand()>.5) theDefinition = G4KaonZeroLong::KaonZeroLong();
00570 else theDefinition = G4KaonZeroShort::KaonZeroShort();
00571 }
00572 else if(PDGCode==91000999) theDefinition = G4SigmaPlus::SigmaPlus();
00573 else if(PDGCode==90999001) theDefinition = G4SigmaMinus::SigmaMinus();
00574 else if(PDGCode==91999000) theDefinition = G4XiMinus::XiMinus();
00575 else if(PDGCode==91999999) theDefinition = G4XiZero::XiZero();
00576 else if(PDGCode==92998999) theDefinition = G4OmegaMinus::OmegaMinus();
00577 else if(PDGCode >80000000)
00578 {
00579 G4int aZ = hadr->GetCharge();
00580 G4int aA = hadr->GetBaryonNumber();
00581 #ifdef pdebug
00582 G4cout<<"G4QAtomicElectronScattering::AtRestDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
00583 #endif
00584 theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,aA,0,aZ);
00585 }
00586
00587 else
00588 {
00589 #ifdef pdebug
00590 G4cout<<"G4QAtomElectScat::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl;
00591 #endif
00592 theDefinition = G4QPDGToG4Particle::Get()->GetParticleDefinition(PDGCode);
00593 #ifdef pdebug
00594 G4cout<<"G4QAtomElScat::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
00595 #endif
00596 }
00597 if(!theDefinition)
00598 {
00599 G4cout<<"---Warning---G4QAtomElScattering::PostStepDoIt: drop PDG="<<PDGCode<<G4endl;
00600 delete hadr;
00601 continue;
00602 }
00603 #ifdef pdebug
00604 G4cout<<"G4QAtomElScat::PostStepDoIt:Name="<<theDefinition->GetParticleName()<<G4endl;
00605 #endif
00606 theSec->SetDefinition(theDefinition);
00607 G4LorentzVector h4M=hadr->Get4Momentum();
00608 EnMomConservation-=h4M;
00609 #ifdef tdebug
00610 G4cout<<"G4QCollis::PSDI:"<<i<<","<<PDGCode<<h4M<<h4M.m()<<EnMomConservation<<G4endl;
00611 #endif
00612 #ifdef debug
00613 G4cout<<"G4QAtomElectScat::PostStepDoIt:#"<<i<<",PDG="<<PDGCode<<",4M="<<h4M<<G4endl;
00614 #endif
00615 theSec->Set4Momentum(h4M);
00616 delete hadr;
00617 #ifdef debug
00618 G4ThreeVector curD=theSec->GetMomentumDirection();
00619 G4double curM=theSec->GetMass();
00620 G4double curE=theSec->GetKineticEnergy()+curM;
00621 G4cout<<"G4QCollis::PSDoIt:p="<<curD<<curD.mag()<<",e="<<curE<<",m="<<curM<<G4endl;
00622 #endif
00623 G4Track* aNewTrack = new G4Track(theSec, localtime, position );
00624 aNewTrack->SetTouchableHandle(trTouchable);
00625 aParticleChange.AddSecondary( aNewTrack );
00626 #ifdef debug
00627 G4cout<<"G4QAtomicElectronScattering::PostStepDoIt:#"<<i<<" is done."<<G4endl;
00628 #endif
00629 }
00630 delete output;
00631 aParticleChange.ProposeTrackStatus(fStopAndKill);
00632
00633 #ifdef debug
00634 G4cout<<"G4QAtomicElectronScattering::PostStepDoIt:****PostStepDoIt done****"<<G4endl;
00635 #endif
00636 return G4VDiscreteProcess::PostStepDoIt(track, step);
00637 }