56 G4cout <<
"G4RPGAntiProtonInelastic::ApplyYourself called" <<
G4endl;
58 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
69 modifiedOriginal = *originalIncident;
75 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
89 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
98 targetParticle = *originalTarget;
101 G4bool incidentHasChanged =
false;
102 G4bool targetHasChanged =
false;
103 G4bool quasiElastic =
false;
114 originalIncident, currentParticle, targetParticle,
115 incidentHasChanged, targetHasChanged, quasiElastic );
120 originalIncident, originalTarget, modifiedOriginal,
121 targetNucleus, currentParticle, targetParticle,
122 incidentHasChanged, targetHasChanged, quasiElastic );
125 currentParticle, targetParticle,
126 incidentHasChanged );
128 delete originalTarget;
139 G4bool &incidentHasChanged,
156 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
157 targetMass*targetMass +
158 2.0*targetMass*etOriginal );
159 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
162 const G4int numMul = 1200;
163 const G4int numMulA = 400;
164 const G4int numSec = 60;
170 G4int counter, nt=0, np=0, nneg=0, nz=0;
178 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
179 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
181 for (np=0; np<(numSec/3); ++np ) {
182 for (nneg=
std::max(0,np-1); nneg<=(np+1); ++nneg ) {
183 for (nz=0; nz<numSec/3; ++nz ) {
184 if (++counter < numMul ) {
186 if (nt>0 && nt<=numSec ) {
187 protmul[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
188 protnorm[nt-1] += protmul[counter];
195 for (i=0; i<numMul; ++i )neutmul[i] = 0.0;
196 for (i=0; i<numSec; ++i )neutnorm[i] = 0.0;
198 for (np=0; np<numSec/3; ++np ) {
199 for( nneg=np; nneg<=(np+2); ++nneg )
201 for( nz=0; nz<numSec/3; ++nz )
203 if( ++counter < numMul )
206 if( (nt>0) && (nt<=numSec) )
208 neutmul[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
209 neutnorm[nt-1] += neutmul[counter];
216 for (i=0; i<numSec; ++i ) {
217 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
218 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
223 for (i=0; i<numMulA; ++i )protmulA[i] = 0.0;
224 for (i=0; i<numSec; ++i )protnormA[i] = 0.0;
227 for (np=0; np<(numSec/3); ++np ) {
229 for (nz=0; nz<numSec/3; ++nz ) {
230 if ( ++counter < numMulA ) {
232 if ( nt>1 && nt<=numSec ) {
233 protmulA[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
234 protnormA[nt-1] += protmulA[counter];
240 for( i=0; i<numMulA; ++i )neutmulA[i] = 0.0;
241 for( i=0; i<numSec; ++i )neutnormA[i] = 0.0;
244 for (np=0; np<numSec/3; ++np ) {
246 for (nz=0; nz<numSec/3; ++nz ) {
247 if (++counter < numMulA ) {
249 if ( (nt>1) && (nt<=numSec) ) {
250 neutmulA[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
251 neutnormA[nt-1] += neutmulA[counter];
256 for (i=0; i<numSec; ++i) {
257 if( protnormA[i] > 0.0 )protnormA[i] = 1.0/protnormA[i];
258 if( neutnormA[i] > 0.0 )neutnormA[i] = 1.0/neutnormA[i];
272 const G4double anhl[] = {1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,0.90,
273 0.6,0.52,0.47,0.44,0.41,0.39,0.37,0.35,0.34,0.24,
274 0.19,0.15,0.12,0.10,0.09,0.07,0.06,0.05,0.0};
277 if( iplab > 9 )iplab =
G4int( pOriginal/
GeV ) + 9;
278 if( iplab > 18 )iplab =
G4int( pOriginal/
GeV/10.0 ) + 18;
279 if( iplab > 27 )iplab = 28;
281 if (availableEnergy <= aPiPlus->GetPDGMass()/
MeV ) {
286 const G4double supp[] = {0.,0.4,0.55,0.65,0.75,0.82,0.86,0.90,0.94,0.98};
305 else if( ran < wp/wt )
315 if( ran < w0/(w0+wm) )
327 for (np=0; np<numSec/3 && ran>=excs; ++np ) {
328 for (nneg=
std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg ) {
329 for (nz=0; nz<numSec/3 && ran>=excs; ++nz ) {
330 if (++counter < numMul ) {
332 if ((nt>0) && (nt<=numSec) ) {
334 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
335 if (std::fabs(dum) < 1.0 ) {
336 if( test >= 1.0
e-10 )excs += dum*test;
351 for ( np=0; np<numSec/3 && ran>=excs; ++np ) {
352 for ( nneg=np; nneg<=(np+2) && ran>=excs; ++nneg ) {
353 for ( nz=0; nz<numSec/3 && ran>=excs; ++nz ) {
354 if ( ++counter < numMul ) {
356 if ( (nt>0) && (nt<=numSec) ) {
358 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
359 if ( std::fabs(dum) < 1.0 )
361 if( test >= 1.0
e-10 )excs += dum*test;
387 incidentHasChanged =
true;
388 targetHasChanged =
true;
393 targetHasChanged =
true;
397 incidentHasChanged =
true;
408 targetHasChanged =
true;
413 incidentHasChanged =
true;
421 incidentHasChanged =
true;
422 targetHasChanged =
true;
428 if (centerofmassEnergy <= 2*aPiPlus->GetPDGMass()/
MeV ) {
441 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
444 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
446 if( ++counter < numMulA )
449 if( (nt>1) && (nt<=numSec) )
452 dum = (
pi/anpn)*nt*protmulA[counter]*protnormA[nt-1]/(2.0*n*n);
453 if( std::abs(dum) < 1.0 )
455 if( test >= 1.0
e-10 )excs += dum*test;
465 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
468 for( nz=0; (nz<numSec/3) && (ran>=excs); ++nz )
470 if( ++counter < numMulA )
473 if( (nt>1) && (nt<=numSec) )
476 dum = (
pi/anpn)*nt*neutmulA[counter]*neutnormA[nt-1]/(2.0*n*n);
477 if( std::fabs(dum) < 1.0 )
479 if( test >= 1.0
e-10 )excs += dum*test;
493 currentParticle.
SetMass( 0.0 );
499 ed <<
" While count exceeded " <<
G4endl;
500 while(np + nneg + nz < 3) {
void Initialize(G4int items)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
T max(const T t1, const T t2)
brief Return the largest of the two arguments
void SetUpChange(G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged)
std::ostringstream G4ExceptionDescription
static constexpr double MeV
static G4AntiNeutron * AntiNeutron()
G4double Cinema(G4double kineticEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
const G4String & GetParticleName() const
static G4PionPlus * PionPlus()
void GetNormalizationConstant(const G4double availableEnergy, G4double &n, G4double &anpn)
G4double GetTotalMomentum() const
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
const G4ParticleDefinition * GetDefinition() const
static G4Proton * Proton()
G4double GetTotalEnergy() const
void CalculateMomenta(G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, const G4DynamicParticle *originalTarget, G4ReactionProduct &modifiedOriginal, G4Nucleus &targetNucleus, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool quasiElastic)
G4double GetPDGMass() const
G4DynamicParticle * ReturnTargetParticle() const
void SetMass(const G4double mas)
const G4String & GetName() const
void SetEnergyChange(G4double anEnergy)
G4double Pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
void SetKineticEnergy(const G4double en)
G4double GetKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
const G4Material * GetMaterial() const
void SetUpPions(const G4int np, const G4int nm, const G4int nz, G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen)
G4ThreeVector GetMomentum() const
void SetSide(const G4int sid)
const G4LorentzVector & Get4Momentum() const
G4double GetKineticEnergy() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
const G4ParticleDefinition * GetDefinition() const
static G4Neutron * Neutron()
G4GLOB_DLL std::ostream G4cout
void Cascade(G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool &quasiElastic)
static constexpr double pi
G4double EvaporationEffects(G4double kineticEnergy)
static constexpr double GeV
G4HadFinalState theParticleChange
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void SetStatusChange(G4HadFinalStateStatus aS)