216{
219
222 static const G4double dM=mProt+mNeut;
223
224
225
226
227
228
229
235 if(std::fabs(Momentum-momentum)>.001)
G4cerr<<
"G4QAtElScat::PSDI P="<<Momentum<<
"="
237#ifdef debug
239 G4cout<<
"G4QAtomElScattering::PostStepDoIt called, P="<<Momentum<<
"="<<momentum<<
G4endl;
240#endif
242 {
243 G4cerr<<
"G4QAtomElectScat::PostStepDoIt:Only gam,e+,e-,mu+,mu-,t+,t-,p are implemented"
245 return 0;
246 }
253#ifdef debug
254 G4cout<<
"G4QAtomElectronScat::PostStepDoIt: "<<nE<<
" elements in the material."<<
G4endl;
255#endif
257
282#ifdef debug
284 G4cout<<
"G4QAtomElScat::PostStepRestDoIt: projPDG="<<projPDG<<
",stPDG="<<prPDG<<
G4endl;
285#endif
286 if(!projPDG)
287 {
288 G4cerr<<
"-Warning-G4QAtomElScattering::PostStepDoIt:Undefined captured hadron"<<
G4endl;
289 return 0;
290 }
291
292 std::vector<G4double> sumfra;
293 for(i=0; i<nE; ++i)
294 {
296 sum+=frac;
297 sumfra.push_back(sum);
298 }
300 for(i=0; i<nE; ++i) if (rnd<sumfra[i]) break;
301 G4Element* pElement=(*theElementVector)[i];
303 if(Z<=0)
304 {
305 G4cerr<<
"-Warning-G4QAtomicElectronScattering::PostStepDoIt: Element's Z="<<Z<<
G4endl;
306 if(Z<0) return 0;
307 }
311 if(isoVector) isoSize=isoVector->size();
312#ifdef debug
313 G4cout<<
"G4QAtomicElectronScattering::PostStepDoIt: isovectorLength="<<isoSize<<
G4endl;
314#endif
315 if(isoSize)
316 {
317
319 if(!curInd)
320 {
321 std::vector<std::pair<G4int,G4double>*>* newAbund =
322 new std::vector<std::pair<G4int,G4double>*>;
324 for(
G4int j=0; j<isoSize; j++)
325 {
330 std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
331#ifdef debug
332 G4cout<<
"G4QAtomElScat::PostStepDoIt:pair#="<<j<<
", N="<<N<<
",ab="<<abund<<
G4endl;
333#endif
334 newAbund->push_back(pr);
335 }
336#ifdef debug
337 G4cout<<
"G4QAtomElectScat::PostStepDoIt:pairVectorLength="<<newAbund->size()<<
G4endl;
338#endif
340 for(
G4int k=0; k<isoSize; k++)
delete (*newAbund)[k];
341 delete newAbund;
342 }
343
345 }
347 nOfNeutrons=N;
351 G4double dsr=0.01*(value_sr+value_sr);
352 if(dsr<dd)dsr=dd;
356#ifdef debug
357 G4cout<<
"G4QAtomElectScattering::PostStepDoIt: N="<<N<<
" for element with Z="<<Z<<
G4endl;
358#endif
359 if(N<0)
360 {
361 G4cerr<<
"---Warning---G4QAtomElectScat::PostStepDoIt:Element with N="<<N<<
G4endl;
362 return 0;
363 }
364 if(projPDG==11||projPDG==-11||projPDG==13||projPDG==-13||projPDG==15||projPDG==-15)
365 {
369 G4int aProjPDG=std::abs(projPDG);
373
374 if(xSec <= 0.)
375 {
376
381 }
383 if( kinEnergy < photonEnergy )
384 {
385
386 G4cerr<<
"G4QAtomElectScat::PSDoIt: phE="<<photonEnergy<<
">leptE="<<kinEnergy<<
G4endl;
391 }
393 G4double W=photonEnergy-photonQ2/dM;
394 if(W<0.)
395 {
396
397 G4cout<<
"G4QAtomElScat::PostStepDoIt:(lN) negative equivalent energy W="<<W<<
G4endl;
402 }
403
409 {
410
411 G4cout<<
"G4QAtomElectScat::PostStepDoIt: probability correction - DoNothing"<<
G4endl;
416 }
420 else
421 {
424 }
425
427 G4double iniP=std::sqrt(iniE*iniE-mu2);
428 G4double finP=std::sqrt(finE*finE-mu2);
429 G4double cost=(EEm+EEm-photonQ2)/iniP/finP;
430 if(cost>1.) cost=1.;
431
432 if(cost<-1.) cost=-1.;
433
434
435
436
437
438
442 G4double sint=std::sqrt(1.-cost*cost);
449 projPDG=22;
451 }
452 G4int targPDG=90000000+Z*1000+N;
457
458
459
460
461#ifdef debug
462 G4cout<<
"G4QAtomElScat::PostStepDoIt: projPDG="<<projPDG<<
", targPDG="<<targPDG<<
G4endl;
463#endif
465
466
468 projHV.push_back(pH);
470 std::for_each(projHV.begin(), projHV.end(),
DeleteQHadron());
471 projHV.clear();
472#ifdef debug
473 G4cout<<
"G4QAtomElectScat::PostStepDoIt: pPDG="<<projPDG<<
", mp="<<mp<<
G4endl;
474#endif
475 try
476 {
477 delete output;
479 }
481 {
482
483 G4cerr<<
"**G4QAtomElectScat::PostStepDoIt:G4QE Exception is catched"<<
G4endl;
484
485
486 G4Exception(
"G4QAtomElScat::PostStepDoIt()",
"HAD_CHPS_0027",
488 }
489 delete pan;
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
528 G4double localtime = track.GetGlobalTime();
531
532 G4int tNH = output->size();
534
535#ifdef debug
536 G4cout<<
"G4QAtomElectronScat::PostStepDoIt: "<<tNH<<
" particles are generated"<<
G4endl;
537#endif
538 G4int nOut=output->size();
539 if(tNH==1) tNH=0;
540 if(tNH==2&&2!=nOut)
G4cout<<
"--Warning--G4QAtomElScat::PostStepDoIt: 2 # "<<nOut<<
G4endl;
541
542
543 if(tNH) for(i=0; i<tNH; i++)
544 {
545
546
547
551#ifdef pdebug
552 G4cout<<
"G4QAtomElectScat::AtRestDoIt: H#"<<i<<
",PDG="<<PDGCode<<
",nF="<<nFrag<<
G4endl;
553#endif
554 if(nFrag)
555 {
556#ifdef debug
557 G4cout<<
"G4QAtomElScat::PostStepDoIt: Intermediate particle is found i="<<i<<
G4endl;
558#endif
559 delete hadr;
560 continue;
561 }
567 else if(PDGCode==311 || PDGCode==-311)
568 {
571 }
577 else if(PDGCode >80000000)
578 {
581#ifdef pdebug
582 G4cout<<
"G4QAtomicElectronScattering::AtRestDoIt:Ion Z="<<aZ<<
", A="<<aA<<
G4endl;
583#endif
585 }
586
587 else
588 {
589#ifdef pdebug
590 G4cout<<
"G4QAtomElectScat::PostStepDoIt:Define particle with PDG="<<PDGCode<<
G4endl;
591#endif
593#ifdef pdebug
594 G4cout<<
"G4QAtomElScat::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<
G4endl;
595#endif
596 }
597 if(!theDefinition)
598 {
599 G4cout<<
"---Warning---G4QAtomElScattering::PostStepDoIt: drop PDG="<<PDGCode<<
G4endl;
600 delete hadr;
601 continue;
602 }
603#ifdef pdebug
605#endif
608 EnMomConservation-=h4M;
609#ifdef tdebug
610 G4cout<<
"G4QCollis::PSDI:"<<i<<
","<<PDGCode<<h4M<<h4M.
m()<<EnMomConservation<<
G4endl;
611#endif
612#ifdef debug
613 G4cout<<
"G4QAtomElectScat::PostStepDoIt:#"<<i<<
",PDG="<<PDGCode<<
",4M="<<h4M<<
G4endl;
614#endif
616 delete hadr;
617#ifdef debug
621 G4cout<<
"G4QCollis::PSDoIt:p="<<curD<<curD.
mag()<<
",e="<<curE<<
",m="<<curM<<
G4endl;
622#endif
626#ifdef debug
627 G4cout<<
"G4QAtomicElectronScattering::PostStepDoIt:#"<<i<<
" is done."<<
G4endl;
628#endif
629 }
630 delete output;
632
633#ifdef debug
634 G4cout<<
"G4QAtomicElectronScattering::PostStepDoIt:****PostStepDoIt done****"<<
G4endl;
635#endif
637}
std::vector< G4Isotope * > G4IsotopeVector
CLHEP::HepLorentzVector G4LorentzVector
std::vector< G4QHadron * > G4QHadronVector
G4DLLIMPORT std::ostream G4cerr
Hep3Vector orthogonal() const
Hep3Vector cross(const Hep3Vector &) const
static G4AntiNeutron * AntiNeutron()
static G4AntiProton * AntiProton()
const G4ThreeVector & GetMomentumDirection() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4LorentzVector Get4Momentum() const
G4double GetKineticEnergy() const
void Set4Momentum(const G4LorentzVector &momentum)
G4double * GetRelativeAbundanceVector() const
const G4Isotope * GetIsotope(G4int iso) const
G4IsotopeVector * GetIsotopeVector() const
static G4KaonMinus * KaonMinus()
static G4KaonPlus * KaonPlus()
static G4KaonZeroLong * KaonZeroLong()
static G4KaonZeroShort * KaonZeroShort()
static G4Lambda * Lambda()
const G4double * GetFractionVector() const
static G4Material * GetMaterial(const G4String &name, G4bool warning=true)
static G4Neutron * Neutron()
static G4OmegaMinus * OmegaMinus()
void AddSecondary(G4Track *aSecondary)
void ProposeEnergy(G4double finalEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
virtual void Initialize(const G4Track &)
G4double GetPDGMass() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
static G4ParticleTable * GetParticleTable()
static G4PionMinus * PionMinus()
static G4PionPlus * PionPlus()
G4QHadronVector * Fragment()
G4LorentzVector Get4Momentum() const
G4int GetBaryonNumber() const
G4int GetNFragments() const
G4int GetLastIndex(G4int Z)
G4int GetNeutrons(G4int Z, G4int index=0)
G4int InitElement(G4int Z, G4int index, std::vector< std::pair< G4int, G4double > * > *abund)
static G4VQCrossSection * GetPointer()
G4ParticleDefinition * GetParticleDefinition(G4int PDGCode)
static G4QPDGToG4Particle * Get()
static G4VQCrossSection * GetPointer()
static G4VQCrossSection * GetPointer()
static G4SigmaMinus * SigmaMinus()
static G4SigmaPlus * SigmaPlus()
static G4SigmaZero * SigmaZero()
void SetTouchableHandle(const G4TouchableHandle &apValue)
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
virtual G4double GetExchangeEnergy()
virtual G4double GetVirtualFactor(G4double nu, G4double Q2)
virtual G4double GetExchangeQ2(G4double nu=0)
static G4XiMinus * XiMinus()
static G4XiZero * XiZero()
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)