Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4RPGAntiXiMinusInelastic.cc
이 파일의 문서화 페이지로 가기
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4RPGAntiXiMinusInelastic.cc 94214 2015-11-09 08:18:05Z gcosmo $
27 //
28 //
29 // NOTE: The FORTRAN version of the cascade, CASAXM, simply called the
30 // routine for the XiMinus particle. Hence, the ApplyYourself function
31 // below is just a copy of the ApplyYourself from the XiMinus particle.
32 
34 #include "G4Exp.hh"
35 #include "G4PhysicalConstants.hh"
36 #include "G4SystemOfUnits.hh"
37 #include "Randomize.hh"
38 
41  G4Nucleus &targetNucleus )
42 {
43  const G4HadProjectile *originalIncident = &aTrack;
44  if (originalIncident->GetKineticEnergy()<= 0.1*MeV)
45  {
49  return &theParticleChange;
50  }
51 
52  // create the target particle
53 
54  G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
55 
56  if( verboseLevel > 1 )
57  {
58  const G4Material *targetMaterial = aTrack.GetMaterial();
59  G4cout << "G4RPGAntiXiMinusInelastic::ApplyYourself called" << G4endl;
60  G4cout << "kinetic energy = " << originalIncident->GetKineticEnergy()/MeV << "MeV, ";
61  G4cout << "target material = " << targetMaterial->GetName() << ", ";
62  G4cout << "target particle = " << originalTarget->GetDefinition()->GetParticleName()
63  << G4endl;
64  }
65  //
66  // Fermi motion and evaporation
67  // As of Geant3, the Fermi energy calculation had not been Done
68  //
69  G4double ek = originalIncident->GetKineticEnergy()/MeV;
70  G4double amas = originalIncident->GetDefinition()->GetPDGMass()/MeV;
71  G4ReactionProduct modifiedOriginal;
72  modifiedOriginal = *originalIncident;
73 
74  G4double tkin = targetNucleus.Cinema( ek );
75  ek += tkin;
76  modifiedOriginal.SetKineticEnergy( ek*MeV );
77  G4double et = ek + amas;
78  G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
79  G4double pp = modifiedOriginal.GetMomentum().mag()/MeV;
80  if( pp > 0.0 )
81  {
82  G4ThreeVector momentum = modifiedOriginal.GetMomentum();
83  modifiedOriginal.SetMomentum( momentum * (p/pp) );
84  }
85  //
86  // calculate black track energies
87  //
88  tkin = targetNucleus.EvaporationEffects( ek );
89  ek -= tkin;
90  modifiedOriginal.SetKineticEnergy( ek*MeV );
91  et = ek + amas;
92  p = std::sqrt( std::abs((et-amas)*(et+amas)) );
93  pp = modifiedOriginal.GetMomentum().mag()/MeV;
94  if( pp > 0.0 )
95  {
96  G4ThreeVector momentum = modifiedOriginal.GetMomentum();
97  modifiedOriginal.SetMomentum( momentum * (p/pp) );
98  }
99  G4ReactionProduct currentParticle = modifiedOriginal;
100  G4ReactionProduct targetParticle;
101  targetParticle = *originalTarget;
102  currentParticle.SetSide( 1 ); // incident always goes in forward hemisphere
103  targetParticle.SetSide( -1 ); // target always goes in backward hemisphere
104  G4bool incidentHasChanged = false;
105  G4bool targetHasChanged = false;
106  G4bool quasiElastic = false;
107  G4FastVector<G4ReactionProduct,GHADLISTSIZE> vec; // vec will contain the secondary particles
108  G4int vecLen = 0;
109  vec.Initialize( 0 );
110 
111  const G4double cutOff = 0.1;
112  const G4double anni = std::min( 1.3*currentParticle.GetTotalMomentum()/GeV, 0.4 );
113  if( (currentParticle.GetKineticEnergy()/MeV > cutOff) || (G4UniformRand() > anni) )
114  Cascade( vec, vecLen,
115  originalIncident, currentParticle, targetParticle,
116  incidentHasChanged, targetHasChanged, quasiElastic );
117 
118  CalculateMomenta( vec, vecLen,
119  originalIncident, originalTarget, modifiedOriginal,
120  targetNucleus, currentParticle, targetParticle,
121  incidentHasChanged, targetHasChanged, quasiElastic );
122 
123  SetUpChange( vec, vecLen,
124  currentParticle, targetParticle,
125  incidentHasChanged );
126 
127  delete originalTarget;
128  return &theParticleChange;
129 }
130 
131 
134  G4int& vecLen,
135  const G4HadProjectile *originalIncident,
136  G4ReactionProduct &currentParticle,
137  G4ReactionProduct &targetParticle,
138  G4bool &incidentHasChanged,
139  G4bool &targetHasChanged,
140  G4bool &quasiElastic )
141 {
142  // Derived from H. Fesefeldt's original FORTRAN code CASAXM
143  // which is just a copy of casxm (cascade for Xi-).
144  // AntiXiMinus undergoes interaction with nucleon within a nucleus. Check if it is
145  // energetically possible to produce pions/kaons. In not, assume nuclear excitation
146  // occurs and input particle is degraded in energy. No other particles are produced.
147  // If reaction is possible, find the correct number of pions/protons/neutrons
148  // produced using an interpolation to multiplicity data. Replace some pions or
149  // protons/neutrons by kaons or strange baryons according to the average
150  // multiplicity per Inelastic reaction.
151 
152  const G4double mOriginal = originalIncident->GetDefinition()->GetPDGMass()/MeV;
153  const G4double etOriginal = originalIncident->GetTotalEnergy()/MeV;
154  const G4double targetMass = targetParticle.GetMass()/MeV;
155  G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
156  targetMass*targetMass +
157  2.0*targetMass*etOriginal );
158  G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
159  if (availableEnergy <= G4PionPlus::PionPlus()->GetPDGMass()/MeV) {
160  quasiElastic = true;
161  return;
162  }
163  static G4ThreadLocal G4bool first = true;
164  const G4int numMul = 1200;
165  const G4int numSec = 60;
166  static G4ThreadLocal G4double protmul[numMul], protnorm[numSec]; // proton constants
167  static G4ThreadLocal G4double neutmul[numMul], neutnorm[numSec]; // neutron constants
168 
169  // np = number of pi+, nneg = number of pi-, nz = number of pi0
170  G4int counter, nt=0, np=0, nneg=0, nz=0;
171  G4double test;
172  const G4double c = 1.25;
173  const G4double b[] = { 0.7, 0.7 };
174  if (first) { // Computation of normalization constants will only be done once
175  first = false;
176  G4int i;
177  for( i=0; i<numMul; ++i )protmul[i] = 0.0;
178  for( i=0; i<numSec; ++i )protnorm[i] = 0.0;
179  counter = -1;
180  for( np=0; np<(numSec/3); ++np )
181  {
182  for( nneg=std::max(0,np-1); nneg<=(np+1); ++nneg )
183  {
184  for( nz=0; nz<numSec/3; ++nz )
185  {
186  if( ++counter < numMul )
187  {
188  nt = np+nneg+nz;
189  if( nt>0 && nt<=numSec )
190  {
191  protmul[counter] = Pmltpc(np,nneg,nz,nt,b[0],c);
192  protnorm[nt-1] += protmul[counter];
193  }
194  }
195  }
196  }
197  }
198  for( i=0; i<numMul; ++i )neutmul[i] = 0.0;
199  for( i=0; i<numSec; ++i )neutnorm[i] = 0.0;
200  counter = -1;
201  for( np=0; np<numSec/3; ++np )
202  {
203  for( nneg=np; nneg<=(np+2); ++nneg )
204  {
205  for( nz=0; nz<numSec/3; ++nz )
206  {
207  if( ++counter < numMul )
208  {
209  nt = np+nneg+nz;
210  if( nt>0 && nt<=numSec )
211  {
212  neutmul[counter] = Pmltpc(np,nneg,nz,nt,b[1],c);
213  neutnorm[nt-1] += neutmul[counter];
214  }
215  }
216  }
217  }
218  }
219  for( i=0; i<numSec; ++i )
220  {
221  if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
222  if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
223  }
224  } // end of initialization
225 
226  const G4double expxu = 82.; // upper bound for arg. of exp
227  const G4double expxl = -expxu; // lower bound for arg. of exp
233  //
234  // energetically possible to produce pion(s) --> inelastic scattering
235  //
236  G4double n, anpn;
237  GetNormalizationConstant( availableEnergy, n, anpn );
238  G4double ran = G4UniformRand();
239  G4double dum, excs = 0.0;
240  if( targetParticle.GetDefinition() == aProton )
241  {
242  counter = -1;
243  for( np=0; np<numSec/3 && ran>=excs; ++np )
244  {
245  for( nneg=std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg )
246  {
247  for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
248  {
249  if( ++counter < numMul )
250  {
251  nt = np+nneg+nz;
252  if( nt>0 && nt<=numSec )
253  {
254  test = G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
255  dum = (pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
256  if( std::fabs(dum) < 1.0 )
257  {
258  if( test >= 1.0e-10 )excs += dum*test;
259  }
260  else
261  excs += dum*test;
262  }
263  }
264  }
265  }
266  }
267  if( ran >= excs ) // 3 previous loops continued to the end
268  {
269  quasiElastic = true;
270  return;
271  }
272  np--; nneg--; nz--;
273  //
274  // number of secondary mesons determined by kno distribution
275  // check for total charge of final state mesons to determine
276  // the kind of baryons to be produced, taking into account
277  // charge and strangeness conservation
278  //
279  if( np < nneg )
280  {
281  if( np+1 == nneg )
282  {
283  currentParticle.SetDefinitionAndUpdateE( aXiZero );
284  incidentHasChanged = true;
285  }
286  else // charge mismatch
287  {
288  currentParticle.SetDefinitionAndUpdateE( aSigmaPlus );
289  incidentHasChanged = true;
290  //
291  // correct the strangeness by replacing a pi- by a kaon-
292  //
293  vec.Initialize( 1 );
295  p->SetDefinition( aKaonMinus );
296  (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
297  vec.SetElement( vecLen++, p );
298  --nneg;
299  }
300  }
301  else if( np == nneg )
302  {
303  if( G4UniformRand() >= 0.5 )
304  {
305  currentParticle.SetDefinitionAndUpdateE( aXiZero );
306  incidentHasChanged = true;
307  targetParticle.SetDefinitionAndUpdateE( aNeutron );
308  targetHasChanged = true;
309  }
310  }
311  else
312  {
313  targetParticle.SetDefinitionAndUpdateE( aNeutron );
314  targetHasChanged = true;
315  }
316  }
317  else // target must be a neutron
318  {
319  counter = -1;
320  for( np=0; np<numSec/3 && ran>=excs; ++np )
321  {
322  for( nneg=np; nneg<=(np+2) && ran>=excs; ++nneg )
323  {
324  for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
325  {
326  if( ++counter < numMul )
327  {
328  nt = np+nneg+nz;
329  if( nt>0 && nt<=numSec )
330  {
331  test = G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
332  dum = (pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
333  if( std::fabs(dum) < 1.0 )
334  {
335  if( test >= 1.0e-10 )excs += dum*test;
336  }
337  else
338  excs += dum*test;
339  }
340  }
341  }
342  }
343  }
344  if( ran >= excs ) // 3 previous loops continued to the end
345  {
346  quasiElastic = true;
347  return;
348  }
349  np--; nneg--; nz--;
350  if( np+1 < nneg )
351  {
352  if( np+2 == nneg )
353  {
354  currentParticle.SetDefinitionAndUpdateE( aXiZero );
355  incidentHasChanged = true;
356  targetParticle.SetDefinitionAndUpdateE( aProton );
357  targetHasChanged = true;
358  }
359  else // charge mismatch
360  {
361  currentParticle.SetDefinitionAndUpdateE( aSigmaPlus );
362  incidentHasChanged = true;
363  targetParticle.SetDefinitionAndUpdateE( aProton );
364  targetHasChanged = true;
365  //
366  // correct the strangeness by replacing a pi- by a kaon-
367  //
368  vec.Initialize( 1 );
370  p->SetDefinition( aKaonMinus );
371  (G4UniformRand() < 0.5) ? p->SetSide( -1 ) : p->SetSide( 1 );
372  vec.SetElement( vecLen++, p );
373  --nneg;
374  }
375  }
376  else if( np+1 == nneg )
377  {
378  if( G4UniformRand() < 0.5 )
379  {
380  currentParticle.SetDefinitionAndUpdateE( aXiZero );
381  incidentHasChanged = true;
382  }
383  else
384  {
385  targetParticle.SetDefinitionAndUpdateE( aProton );
386  targetHasChanged = true;
387  }
388  }
389  }
390 
391  SetUpPions(np, nneg, nz, vec, vecLen);
392  return;
393 }
394 
395  /* end of file */
396 
void Initialize(G4int items)
Definition: G4FastVector.hh:63
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
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 &currentParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged)
G4double ek
static constexpr double MeV
Definition: G4SIunits.hh:214
G4double Cinema(G4double kineticEnergy)
Definition: G4Nucleus.cc:382
void SetMomentumChange(const G4ThreeVector &aV)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4double x, const G4double y, const G4double z)
#define G4endl
Definition: G4ios.hh:61
const char * p
Definition: xmltok.h:285
static G4XiZero * XiZero()
Definition: G4XiZero.cc:106
void SetDefinitionAndUpdateE(const G4ParticleDefinition *aParticleDefinition)
const G4String & GetParticleName() const
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
void GetNormalizationConstant(const G4double availableEnergy, G4double &n, G4double &anpn)
const G4ParticleDefinition * GetDefinition() const
static G4Proton * Proton()
Definition: G4Proton.cc:93
G4double GetTotalEnergy() const
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:113
#define G4ThreadLocal
Definition: tls.hh:69
void CalculateMomenta(G4FastVector< G4ReactionProduct, 256 > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, const G4DynamicParticle *originalTarget, G4ReactionProduct &modifiedOriginal, G4Nucleus &targetNucleus, G4ReactionProduct &currentParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool quasiElastic)
G4double GetPDGMass() const
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
G4DynamicParticle * ReturnTargetParticle() const
Definition: G4Nucleus.cc:241
const G4String & GetName() const
Definition: G4Material.hh:179
static G4SigmaPlus * SigmaPlus()
Definition: G4SigmaPlus.cc:108
void SetEnergyChange(G4double anEnergy)
G4double Pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c)
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
void SetKineticEnergy(const G4double en)
G4double GetKineticEnergy() const
G4ParticleDefinition * GetDefinition() const
const G4Material * GetMaterial() const
#define G4UniformRand()
Definition: Randomize.hh:53
G4double GetTotalMomentum() 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
Hep3Vector unit() const
G4double GetKineticEnergy() const
void Cascade(G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, G4ReactionProduct &currentParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool &quasiElastic)
void SetElement(G4int anIndex, Type *anElement)
Definition: G4FastVector.hh:76
G4double GetMass() const
const G4ParticleDefinition * GetDefinition() const
double mag() const
int G4int
Definition: G4Types.hh:78
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4GLOB_DLL std::ostream G4cout
Hep3Vector vect() const
Char_t n[5]
static constexpr double pi
Definition: G4SIunits.hh:75
G4double EvaporationEffects(G4double kineticEnergy)
Definition: G4Nucleus.cc:278
static constexpr double GeV
Definition: G4SIunits.hh:217
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
void SetStatusChange(G4HadFinalStateStatus aS)