483{
486
487
488
490
491 size_t it = 0;
492
493 while(it < theZ.size() && Z > theZ[it]) it++;
494
495
496
497
498 if( it == theZ.size() )
499 {
500
501 const G4bool isHeavyElementAllowed =
true;
502 if ( isHeavyElementAllowed ) {
503 it--;
504 G4int zz = (Z > 100) ? 100 : Z;
505
506
507
508
509
510
511
512
513 const std::vector<G4double> vecScaling{ 0.996756,
514 1.018756,
515 1.015623,
516 1.028136,
517 1.028136,
518 1.040598,
519 1.043706,
520 1.059199 };
521 result = vecScaling[zz-93] * thePimData[it]->ReactionXSection( kineticEnergy );
522 fTotalXsc = vecScaling[zz-93] * thePimData[it]->TotalXSection( kineticEnergy );
523 fElasticXsc = std::max(fTotalXsc - result, 0.0);
524 return result;
525 } else {
527 ed << "This cross section not applicable to Z= " << Z << " projectile: "
529 G4Exception(
"G4PiNuclearCrossSection::GetElementCrossSection",
"had001",
531 }
532 }
535 if( charge < 0 )
536 {
537 if( theZ[it] == Z )
538 {
539 result = thePimData[it]->ReactionXSection(kineticEnergy);
540 fTotalXsc = thePimData[it]->TotalXSection(kineticEnergy);
541
542
543
544
545 }
546 else
547 {
548 x1 = thePimData[it-1]->ReactionXSection(kineticEnergy);
549 xt1 = thePimData[it-1]->TotalXSection(kineticEnergy);
550 Z1 = theZ[it-1];
551 x2 = thePimData[it]->ReactionXSection(kineticEnergy);
552 xt2 = thePimData[it]->TotalXSection(kineticEnergy);
553 Z2 = theZ[it];
554
555 result = Interpolate(Z1, Z2, Z, x1, x2);
556 fTotalXsc = Interpolate(Z1, Z2, Z, xt1, xt2);
557
558
559
560
561
562
563
564
565
566
567 }
568 }
569 else
570 {
571 if(theZ[it]==Z)
572 {
573
574 std::vector<G4PiData *> * theData = &thePimData;
575 if(thePipData[it]->AppliesTo(kineticEnergy))
576 {
577 theData = &thePipData;
578 }
579 result = theData->operator[](it)->ReactionXSection(kineticEnergy);
580 fTotalXsc = theData->operator[](it)->TotalXSection(kineticEnergy);
581
582
583
584
585 }
586 else
587 {
588 std::vector<G4PiData *> * theLData = &thePimData;
589 if(thePipData[it-1]->AppliesTo(kineticEnergy))
590 {
591 theLData = &thePipData;
592 }
593 std::vector<G4PiData *> * theHData = &thePimData;
594 if(thePipData[it]->AppliesTo(kineticEnergy))
595 {
596 theHData = &thePipData;
597 }
598 x1 = theLData->operator[](it-1)->ReactionXSection(kineticEnergy);
599 xt1 = theLData->operator[](it-1)->TotalXSection(kineticEnergy);
600 Z1 = theZ[it-1];
601 x2 = theHData->operator[](it)->ReactionXSection(kineticEnergy);
602 xt2 = theHData->operator[](it)->TotalXSection(kineticEnergy);
603 Z2 = theZ[it];
604
605 result = Interpolate(Z1, Z2, Z, x1, x2);
606 fTotalXsc = Interpolate(Z1, Z2, Z, xt1, xt2);
607
608
609
610
611
612
613
614
615
616
617 }
618 }
619
620
621 fElasticXsc = fTotalXsc - result;
622 if( fElasticXsc < 0.) fElasticXsc = 0.;
623
624 return result;
625}
const G4ParticleDefinition * GetParticleDefinition() const
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4double GetPDGCharge() const