42 #define MAX_SECONDARIES 100
46 G4AntiNeutronAnnihilationAtRest::G4AntiNeutronAnnihilationAtRest(
const G4String& processName,
76 globalTime = targetAtomicMass = targetCharge = evapEnergy1
107 return ( &particle == pdefAntiNeutron );
140 G4cout <<
"G4AntiNeutronAnnihilationAtRestProcess::AtRestGetPhysicalInteractionLength ";
177 for (
G4int i1=0; i1 < numberOfElements; i1++ )
179 normalization += theAtomicNumberDensity[i1] ;
184 for (
G4int i2=0; i2 < numberOfElements; i2++ )
186 runningSum += theAtomicNumberDensity[i2];
188 if (random<=runningSum)
190 targetCharge =
G4double( ((*theElementVector)[i2])->GetZ());
191 targetAtomicMass = (*theElementVector)[i2]->GetN();
194 if (random>runningSum)
196 targetCharge =
G4double( ((*theElementVector)[numberOfElements-1])->GetZ());
197 targetAtomicMass = (*theElementVector)[numberOfElements-1]->GetN();
201 G4cout <<
"G4AntiNeutronAnnihilationAtRest::AtRestDoIt is invoked " <<
G4endl;
209 GenerateSecondaries();
213 for (
G4int isec = 0; isec < ngkine; isec++ ) {
218 localtime = globalTime + gkin[isec].
GetTOF();
220 G4Track* aNewTrack =
new G4Track( aNewParticle, localtime*
s, position );
239 void G4AntiNeutronAnnihilationAtRest::GenerateSecondaries()
255 result.
SetMass( massAntiNeutron );
262 AntiNeutronAnnihilation(&nopt);
281 for (l = 1; l <= ntot; ++l) {
287 gkin[ngkine] = eve[index];
288 gkin[ngkine].
SetTOF( eve[index].GetTOF() * 5e-11 );
307 void G4AntiNeutronAnnihilationAtRest::Poisso(
G4float xav,
G4int *iran)
322 ran1 = xav + ran1 * std::sqrt(xav);
336 for (i = 1; i <= fivex; ++i) {
382 G4int G4AntiNeutronAnnihilationAtRest::NFac(
G4int n)
397 for (i = 2; i <= j; ++i) {
406 void G4AntiNeutronAnnihilationAtRest::Normal(
G4float *ran)
414 for (i = 1; i <= 12; ++i) {
421 void G4AntiNeutronAnnihilationAtRest::AntiNeutronAnnihilation(
G4int *nopt)
453 pv[1].
SetMass( massAntiNeutron );
472 rmnve1 = massPionPlus;
473 rmnve2 = massPionMinus;
475 rmnve1 = massPionZero;
478 rmnve2 = massPionZero;
481 rmnve2 = massPionZero;
489 ek = massNeutron + massAntiNeutron - rmnve1 - rmnve2;
496 en = ek + (rmnve1 + rmnve2) /
G4float(2.);
497 r__1 = en * en - rmnve1 * rmnve2;
498 pcm = r__1 > 0 ? std::sqrt(r__1) : 0;
509 pv[3].
SetEnergy( std::sqrt(pv[3].GetMass()*pv[3].GetMass()+pcm*pcm) );
510 pv[3].
SetMomentumAndUpdate( -pv[2].GetMomentum().x(), -pv[2].GetMomentum().y(), -pv[2].GetMomentum().z() );
533 if (targetAtomicMass >=
G4float(1.5)) {
540 black = (targ *
G4float(1.25) +
541 G4float(1.5)) * evapEnergy1 / (evapEnergy1 + evapEnergy3);
544 nbl =
G4int(targetAtomicMass - targ);
552 for (i = 1; i <= nbl; ++i) {
569 ekin1 = tex - (ekin2 - ekin1);
575 pnrat =
G4float(1.) - targetCharge / targetAtomicMass;
597 for (i = 1; i <= nt; ++i) {
599 if (pv[ii].GetParticleDef() != pdefProton) {
619 (evapEnergy1 + evapEnergy3);
627 for (i = 1; i <= nbl; ++i) {
644 ekin1 = tex - (ekin2 - ekin1);
671 for (i = 3; i <= nt; ++i) {
695 if (targetAtomicMass >=
G4float(1.5)) {
709 cfa =
G4float(.13043478260869565);
715 atno3 = targetAtomicMass;
727 gfa = (targetAtomicMass -
G4float(1.)) /
730 evapEnergy1 = ret_val * fpdiv;
731 evapEnergy3 = ret_val - evapEnergy1;
738 evapEnergy1 *= ran1 * gfa +
G4float(1.);
739 if (evapEnergy1 <
G4float(0.)) {
742 evapEnergy3 *= ran2 * gfa +
G4float(1.);
743 if (evapEnergy3 <
G4float(0.)) {
748 while ((ret_val = evapEnergy1 + evapEnergy3) >= ek1) {
G4double condition(const G4ErrorSymMatrix &m)
static G4Pow * GetInstance()
void DeRegisterExtraProcess(G4VProcess *)
G4double GetMeanLifeTime(const G4Track &, G4ForceCondition *)
void SetParticleDef(G4ParticleDefinition *c)
void SetMomentum(const G4ThreeVector &momentum)
G4double powN(G4double x, G4int n) const
std::vector< G4Element * > G4ElementVector
static G4HadronicProcessStore * Instance()
const G4DynamicParticle * GetDynamicParticle() const
~G4AntiNeutronAnnihilationAtRest()
G4ParticleDefinition * GetParticleDef()
const G4String & GetName() const
const G4ThreeVector & GetPosition() const
void DumpInfo(G4int mode=0) const
G4GHEKinematicsVector * GetSecondaryKinematics()
G4double theNumberOfInteractionLengthLeft
void SetTouchableHandle(const G4TouchableHandle &apValue)
void BuildPhysicsTable(const G4ParticleDefinition &)
virtual void ResetNumberOfInteractionLengthLeft()
#define G4HadronicDeprecate(name)
const G4ElementVector * GetElementVector() const
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetKineticEnergyAndUpdate(G4double ekin)
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
void RegisterParticleForExtraProcess(G4VProcess *, const G4ParticleDefinition *)
G4GLOB_DLL std::ostream G4cout
G4int GetNumberOfSecondaries()
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
G4double currentInteractionLength
void SetProcessSubType(G4int)
G4double GetGlobalTime() const
const G4String & GetProcessName() const
const G4double * GetAtomicNumDensityVector() const
const G4TouchableHandle & GetTouchableHandle() const
G4Material * GetMaterial() const
void SetEnergyAndUpdate(G4double e)
void RegisterExtraProcess(G4VProcess *)
G4bool IsApplicable(const G4ParticleDefinition &)
G4double G4Log(G4double x)
void PreparePhysicsTable(const G4ParticleDefinition &)
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
virtual void Initialize(const G4Track &)
void SetEnergy(G4double e)
void SetMomentumAndUpdate(G4ParticleMomentum mom)
void SetNumberOfSecondaries(G4int totSecondaries)
G4ParticleChange aParticleChange
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
static constexpr double GeV
void SetMass(G4double mas)
void AddSecondary(G4Track *aSecondary)
size_t GetNumberOfElements() const
void ProposeTrackStatus(G4TrackStatus status)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void PrintInfo(const G4ParticleDefinition *)