212 for ( std::vector<G4PhysicsTable*>::iterator it =
fBankT.begin();
213 it !=
fBankT.end(); ++it ) {
214 if ( (*it) ) (*it)->clearAndDestroy();
256 G4int iTkin, jTransfer;
258 G4double t1, t2, dt, delta = 0., sum = 0.;
274 plab = std::sqrt( Tkin*( Tkin + 2*
fMassProj ) );
283 if( tMax > 15.*
GeV*
GeV ) tMax = 15.*GeV*
GeV;
291 for( jTransfer =
fBinT-1; jTransfer >= 1; jTransfer--)
293 t1 = dt*(jTransfer-1);
307 vectorT->
PutValue( jTransfer-1, t1, sum );
325 G4int iTkin, iTransfer;
327 G4double Tkin = std::sqrt(m1*m1+p*p) - m1;
345 if ( delta < deltaMax ) iTkin =
fInTkin;
350 if( Tkin < fEnergyVector->GetLowEdgeEnergy(iTkin) )
break;
354 if ( iTkin < 0 ) iTkin = 0;
365 for(iTransfer = 0; iTransfer <
fBinT-1; iTransfer++)
367 if( position >= (*(*
fTableT)(iTkin))(iTransfer) )
break;
369 if (iTransfer >= fBinT-1) iTransfer = fBinT-2;
384 for(iTransfer = 0; iTransfer <
fBinT-1; iTransfer++)
387 if( position >= (*(*
fTableT)(iTkin))(iTransfer) )
break;
389 if (iTransfer >= fBinT-1) iTransfer = fBinT-2;
441 G4int iTkin, iTransfer;
443 G4double Tkin = std::sqrt(m1*m1+p*p) - m1;
460 if ( delta < deltaMax ) iTkin =
fInTkin;
465 if( Tkin < fEnergyVector->GetLowEdgeEnergy(iTkin) )
break;
469 if ( iTkin < 0 ) iTkin = 0;
478 for(iTransfer = 0; iTransfer <
fBinT-1; iTransfer++)
480 if( position >= (*(*
fTableT)(iTkin))(iTransfer) )
break;
482 if (iTransfer >= fBinT-1) iTransfer = fBinT-2;
491 position = (*(*fTableT)(iTkin))(0)*rand;
495 G4int sTransfer = 0, fTransfer =
fBinT - 2, dTransfer = fTransfer - sTransfer;
498 for( iTransfer = 0; iTransfer <
fBinT - 1; iTransfer++ )
503 y2 = (*(*fTableT)(iTkin))( sTransfer + dTransfer );
505 if( y2 > position ) sTransfer += dTransfer;
508 if( dTransfer < 1 )
break;
510 t = (*fTableT)(iTkin)->GetLowEdgeEnergy(sTransfer);
524 G4double t1, t2, dt, delta = 0., sum = 0. ;
537 if( tMax > 15.*
GeV*
GeV ) tMax = 15.*GeV*
GeV;
546 G4cout<<
"s = "<<std::sqrt(
fSpp)/GeV<<
" GeV; fPcms = "<<fPcms/GeV
547 <<
" GeV; qMax = "<<tMax/GeV/GeV<<
" GeV2; dt = "<<dt/GeV/GeV<<
" GeV2"<<
G4endl;
552 for( jTransfer =
fBinT-1; jTransfer >= 1; jTransfer-- )
554 t1 = dt*(jTransfer-1);
557 if( fMassProj > 900.*
MeV )
576 vectorT->
PutValue( jTransfer-1, t1, sum );
595 G4int iTkin, iTransfer, iTmin;
602 for(iTransfer = 0; iTransfer <
fBinT-1; iTransfer++)
605 if( tMin <= (*
fTableT)(iTkin)->GetLowEdgeEnergy(iTransfer) )
break;
608 if(iTmin < 0 ) iTmin = 0;
612 for( iTmin = 0; iTransfer < fBinT-1; iTransfer++)
614 if( position > (*(*
fTableT)(iTkin))(iTransfer) )
break;
616 if (iTransfer >= fBinT-1) iTransfer = fBinT-2;
631 G4double x1, x2, y1, y2, randTransfer, delta, mean, epsilon = 1.e-6;
635 randTransfer = (*fTableT)(iTkin)->GetLowEdgeEnergy(iTransfer);
640 if ( iTransfer >=
G4int((*
fTableT)(iTkin)->GetVectorLength()) )
642 iTransfer = (*fTableT)(iTkin)->GetVectorLength() - 1;
644 y1 = (*(*fTableT)(iTkin))(iTransfer-1);
645 y2 = (*(*fTableT)(iTkin))(iTransfer);
647 x1 = (*fTableT)(iTkin)->GetLowEdgeEnergy(iTransfer-1);
648 x2 = (*fTableT)(iTkin)->GetLowEdgeEnergy(iTransfer);
653 if ( x1 == x2 ) randTransfer = x2;
657 if ( delta < epsilon*mean )
659 else randTransfer = x1 + ( position - y1 )*( x2 - x1 )/delta;
669 { 2.76754, 4.8, 4.8, 0.05, 0.742441, 10.5 },
670 { 3.07744, 5.4, 5.4, 0.02, 0.83818, 6.5 },
671 { 3.36305, 5.2, 5.2, 0.02, 0.838893, 7.5 },
672 { 4.32941, 6, 6, 0.03, 0.769389, 7.5 },
673 { 4.62126, 6, 6, 0.03, 0.770111, 6.5 },
675 { 5.47416, 4.5, 4.5, 0.03, 0.813185, 7.5 },
676 { 6.15088, 6.5, 6.5, 0.02, 0.799539, 6.5 },
677 { 6.77474, 5.2, 5.2, 0.03, 0.784901, 7.5 },
678 { 9.77775, 7, 7, 0.03, 0.742531, 6.5 },
680 { 10.4728, 5.2, 5.2, 0.03, 0.780439, 7.5 },
682 { 13.7631, 7, 7, 0.008, 0.8664, 5.0 },
683 { 19.4184, 6.8, 6.8, 0.009, 0.861337, 2.5 },
684 { 23.5, 6.8, 6.8, 0.007, 0.878112, 1.5 },
686 { 24.1362, 7.2, 7.2, 0.008, 0.864745, 5.5 },
687 { 52.8, 6.8, 6.8, 0.008, 0.871929, 1.5 },
689 { 546, 7.4, 7.4, 0.013, 0.845877, 5.5 },
690 { 1960, 7.8, 7.8, 0.022, 0.809062, 7.5 },
691 { 7000, 8, 8, 0.024, 0.820441, 5.5 }
701 { 2.5627, 3.8, 3.3, 0.22, 0.222, 1.5 },
702 { 2.93928, 4.3, 3.8, 0.2, 0.250601, 1.3 },
703 { 3.22326, 4.8, 4.3, 0.13, 0.32751, 2.5 },
704 { 7.80704, 5.5, 5, 0.13, 0.340631, 2.5 },
705 { 9.7328, 5, 4.5, 0.05, 0.416319, 5.5 },
707 { 13.7315, 5.3, 4.8, 0.05, 0.418426, 5.5 },
708 { 16.6359, 6.3, 5.8, 0.05, 0.423817, 5.5 },
709 { 19.3961, 5, 4.5, 0.05, 0.413477, 3.5 }
G4double Legendre10(T &typeT, F f, G4double a, G4double b)
void SetParametersCMS(G4double plab)
G4ParticleDefinition * thePionMinus
void PutValue(size_t binNumber, G4double binValue, G4double dataValue)
G4PhysicsLogVector * fEnergyVector
static const G4double theNuclNuclData[18][6]
G4double lowEnergyRecoilLimit
G4double GetLowEdgeEnergy(size_t binNumber) const
G4double lowestEnergyLimit
G4ParticleDefinition * theProton
static G4KaonMinus * KaonMinus()
void BuildTableT(G4ParticleDefinition *target, G4ParticleDefinition *projectile)
std::vector< G4PhysicsTable * > fBankT
void SetMinEnergy(G4double anEnergy)
void BuildTableTest(G4ParticleDefinition *target, G4ParticleDefinition *projectile, G4double plab)
G4GLOB_DLL std::ostream G4cout
G4double GetTransfer(G4int iMomentum, G4int iTransfer, G4double position)
G4double lowEnergyLimitHE
G4HadronNucleonXsc * fHadrNuclXsc
static G4Proton * Proton()
static G4PionPlus * PionPlus()
G4double GetdsdtF123qQgG(G4double q)
G4double GetdsdtF123(G4double q)
G4ParticleDefinition * fProjectile
static G4Neutron * Neutron()
G4double SampleInvariantT(const G4ParticleDefinition *p, G4double plab, G4int, G4int)
G4double GetPDGMass() const
G4double SampleBisectionalT(const G4ParticleDefinition *p, G4double plab)
static G4PionMinus * PionMinus()
void insertAt(size_t, G4PhysicsVector *)
void SetMaxEnergy(const G4double anEnergy)
G4ParticleDefinition * thePionPlus
static const G4double thePiKaNuclData[8][6]
static G4KaonPlus * KaonPlus()
G4ParticleDefinition * fTarget
G4ParticleDefinition * theNeutron
G4double SampleTest(G4double tMin)