47 G4cout <<
"G4RPGAntiKZeroInelastic::ApplyYourself called" <<
G4endl;
49 G4cout <<
"target material = " << targetMaterial->
GetName() <<
", ";
60 modifiedOriginal = *originalIncident;
66 G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
80 p = std::sqrt( std::abs((et-amas)*(et+amas)) );
89 targetParticle = *originalTarget;
92 G4bool incidentHasChanged =
false;
93 G4bool targetHasChanged =
false;
94 G4bool quasiElastic =
false;
101 Cascade( vec, vecLen,
102 originalIncident, currentParticle, targetParticle,
103 incidentHasChanged, targetHasChanged, quasiElastic );
108 originalIncident, originalTarget, modifiedOriginal,
109 targetNucleus, currentParticle, targetParticle,
110 incidentHasChanged, targetHasChanged, quasiElastic );
118 currentParticle, targetParticle,
119 incidentHasChanged );
121 delete originalTarget;
125void G4RPGAntiKZeroInelastic::Cascade(
131 G4bool &incidentHasChanged,
149 G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
150 targetMass*targetMass +
151 2.0*targetMass*etOriginal );
152 G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
155 const G4int numMul = 1200;
156 const G4int numSec = 60;
162 G4int counter, nt=0, np=0, nneg=0, nz=0;
169 for( i=0; i<numMul; ++i )protmul[i] = 0.0;
170 for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
172 for( np=0; np<numSec/3; ++np )
174 for( nneg=std::max(0,np-2); nneg<=np; ++nneg )
176 for( nz=0; nz<numSec/3; ++nz )
178 if( ++counter < numMul )
181 if( nt>0 && nt<=numSec )
183 protmul[counter] =
Pmltpc(np,nneg,nz,nt,b[0],c);
184 protnorm[nt-1] += protmul[counter];
190 for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
191 for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
193 for( np=0; np<(numSec/3); ++np )
195 for( nneg=std::max(0,np-1); nneg<=(np+1); ++nneg )
197 for( nz=0; nz<numSec/3; ++nz )
199 if( ++counter < numMul )
202 if( nt>0 && nt<=numSec )
204 neutmul[counter] =
Pmltpc(np,nneg,nz,nt,b[1],c);
205 neutnorm[nt-1] += neutmul[counter];
211 for( i=0; i<numSec; ++i )
213 if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
214 if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
232 const G4double cech[] = {1.,1.,1.,0.70,0.60,0.55,0.35,0.25,0.18,0.15};
233 G4int iplab =
G4int(std::min( 9.0, 5.0*pOriginal*MeV/GeV ));
235 if ((pOriginal*MeV/GeV <= 2.0) && (
G4UniformRand() < cech[iplab]) ) {
236 np = nneg = nz = nt = 0;
237 iplab =
G4int(std::min( 19.0, pOriginal*MeV/GeV*10.0 ));
238 const G4double cnk0[] = {0.17,0.18,0.17,0.24,0.26,0.20,0.22,0.21,0.34,0.45,
239 0.58,0.55,0.36,0.29,0.29,0.32,0.32,0.33,0.33,0.33};
246 incidentHasChanged =
true;
247 targetHasChanged =
true;
249 }
else if( ran < 0.50 ) {
255 incidentHasChanged =
true;
256 targetHasChanged =
true;
257 }
else if( ran < 0.75 ) {
262 incidentHasChanged =
true;
263 targetHasChanged =
true;
271 incidentHasChanged =
true;
272 targetHasChanged =
true;
279 incidentHasChanged =
true;
280 targetHasChanged =
true;
284 if (availableEnergy < aPiPlus->GetPDGMass()/MeV) {
294 for( np=0; (np<numSec/3) && (ran>=excs); ++np )
296 for( nneg=std::max(0,np-2); nneg<=np && ran>=excs; ++nneg )
298 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
300 if( ++counter < numMul )
303 if( nt>0 && nt<=numSec )
305 test =
G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
306 dum = (
pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
307 if( std::fabs(dum) < 1.0 )
309 if( test >= 1.0e-10 )excs += dum*test;
330 incidentHasChanged =
true;
335 targetHasChanged =
true;
342 incidentHasChanged =
true;
343 targetHasChanged =
true;
350 for( np=0; np<numSec/3 && ran>=excs; ++np )
352 for( nneg=std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg )
354 for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
356 if( ++counter < numMul )
359 if( nt>0 && nt<=numSec )
361 test =
G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
362 dum = (
pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
363 if( std::fabs(dum) < 1.0 )
365 if( test >= 1.0e-10 )excs += dum*test;
385 incidentHasChanged =
true;
386 targetHasChanged =
true;
390 incidentHasChanged =
true;
394 targetHasChanged =
true;
409 else if( ran < 0.84 )
430 else if( ran < 0.84 )
449 else if( ran < 0.78 )
454 else if( ran < 0.89 )
465 incidentHasChanged =
true;
466 targetHasChanged =
true;
474 incidentHasChanged =
true;
482 targetHasChanged =
true;
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
G4GLOB_DLL std::ostream G4cout
G4ParticleDefinition * GetDefinition() const
void Initialize(G4int items)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
void Report(std::ostream &aS)
G4HadFinalState theParticleChange
static G4KaonMinus * KaonMinus()
static G4KaonZeroLong * KaonZeroLong()
static G4KaonZeroShort * KaonZeroShort()
static G4Lambda * Lambda()
const G4String & GetName() const
static G4Neutron * Neutron()
G4double EvaporationEffects(G4double kineticEnergy)
G4double Cinema(G4double kineticEnergy)
G4DynamicParticle * ReturnTargetParticle() const
G4double GetPDGMass() const
const G4String & GetParticleName() const
static G4PionMinus * PionMinus()
static G4PionPlus * PionPlus()
static G4PionZero * PionZero()
static G4Proton * Proton()
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
void SetUpPions(const G4int np, const G4int nm, const G4int nz, G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen)
void GetNormalizationConstant(const G4double availableEnergy, G4double &n, G4double &anpn)
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)
void SetUpChange(G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, G4ReactionProduct ¤tParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged)
G4double Pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetKineticEnergy() const
const G4ParticleDefinition * GetDefinition() const
G4ThreeVector GetMomentum() const
void SetSide(const G4int sid)
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
static G4SigmaMinus * SigmaMinus()
static G4SigmaPlus * SigmaPlus()
static G4SigmaZero * SigmaZero()