Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4RPGAntiOmegaMinusInelastic.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: G4RPGAntiOmegaMinusInelastic.cc 94214 2015-11-09 08:18:05Z gcosmo $
27 //
28 //
29 // NOTE: The FORTRAN version of the cascade, CASAOM, simply called the
30 // routine for the OmegaMinus particle. Hence, the Cascade function
31 // below is just a copy of the Cascade from the OmegaMinus 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 << "kinetic energy = " << originalIncident->GetKineticEnergy()/MeV << "MeV, ";
60  G4cout << "target material = " << targetMaterial->GetName() << ", ";
61  G4cout << "target particle = " << originalTarget->GetDefinition()->GetParticleName()
62  << G4endl;
63  }
64  //
65  // Fermi motion and evaporation
66  // As of Geant3, the Fermi energy calculation had not been Done
67  //
68  G4double ek = originalIncident->GetKineticEnergy()/MeV;
69  G4double amas = originalIncident->GetDefinition()->GetPDGMass()/MeV;
70  G4ReactionProduct modifiedOriginal;
71  modifiedOriginal = *originalIncident;
72 
73  G4double tkin = targetNucleus.Cinema( ek );
74  ek += tkin;
75  modifiedOriginal.SetKineticEnergy( ek*MeV );
76  G4double et = ek + amas;
77  G4double p = std::sqrt( std::abs((et-amas)*(et+amas)) );
78  G4double pp = modifiedOriginal.GetMomentum().mag()/MeV;
79  if( pp > 0.0 )
80  {
81  G4ThreeVector momentum = modifiedOriginal.GetMomentum();
82  modifiedOriginal.SetMomentum( momentum * (p/pp) );
83  }
84  //
85  // calculate black track energies
86  //
87  tkin = targetNucleus.EvaporationEffects( ek );
88  ek -= tkin;
89  modifiedOriginal.SetKineticEnergy( ek*MeV );
90  et = ek + amas;
91  p = std::sqrt( std::abs((et-amas)*(et+amas)) );
92  pp = modifiedOriginal.GetMomentum().mag()/MeV;
93  if( pp > 0.0 )
94  {
95  G4ThreeVector momentum = modifiedOriginal.GetMomentum();
96  modifiedOriginal.SetMomentum( momentum * (p/pp) );
97  }
98  G4ReactionProduct currentParticle = modifiedOriginal;
99  G4ReactionProduct targetParticle;
100  targetParticle = *originalTarget;
101  currentParticle.SetSide( 1 ); // incident always goes in forward hemisphere
102  targetParticle.SetSide( -1 ); // target always goes in backward hemisphere
103  G4bool incidentHasChanged = false;
104  G4bool targetHasChanged = false;
105  G4bool quasiElastic = false;
106  G4FastVector<G4ReactionProduct,GHADLISTSIZE> vec; // vec will contain the secondary particles
107  G4int vecLen = 0;
108  vec.Initialize( 0 );
109 
110  const G4double cutOff = 0.1;
111  const G4double anni = std::min( 1.3*currentParticle.GetTotalMomentum()/GeV, 0.4 );
112 
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 
132 void
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 CASOM
143  // AntiOmegaMinus undergoes interaction with nucleon within a nucleus. Check if it is
144  // energetically possible to produce pions/kaons. In not, assume nuclear excitation
145  // occurs and input particle is degraded in energy. No other particles are produced.
146  // If reaction is possible, find the correct number of pions/protons/neutrons
147  // produced using an interpolation to multiplicity data. Replace some pions or
148  // protons/neutrons by kaons or strange baryons according to the average
149  // multiplicity per Inelastic reaction.
150 
151  const G4double mOriginal = originalIncident->GetDefinition()->GetPDGMass()/MeV;
152  const G4double etOriginal = originalIncident->GetTotalEnergy()/MeV;
153  const G4double targetMass = targetParticle.GetMass()/MeV;
154  G4double centerofmassEnergy = std::sqrt( mOriginal*mOriginal +
155  targetMass*targetMass +
156  2.0*targetMass*etOriginal );
157  G4double availableEnergy = centerofmassEnergy-(targetMass+mOriginal);
158  if (availableEnergy <= G4PionPlus::PionPlus()->GetPDGMass()/MeV) {
159  // not energetically possible to produce pion(s)
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  G4double n, anpn;
234  GetNormalizationConstant( availableEnergy, n, anpn );
235  G4double ran = G4UniformRand();
236  G4double dum, excs = 0.0;
237  G4int nvefix = 0;
238  if( targetParticle.GetDefinition() == aProton )
239  {
240  counter = -1;
241  for( np=0; np<numSec/3 && ran>=excs; ++np )
242  {
243  for( nneg=std::max(0,np-1); nneg<=(np+1) && ran>=excs; ++nneg )
244  {
245  for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
246  {
247  if( ++counter < numMul )
248  {
249  nt = np+nneg+nz;
250  if( nt>0 && nt<=numSec )
251  {
252  test = G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
253  dum = (pi/anpn)*nt*protmul[counter]*protnorm[nt-1]/(2.0*n*n);
254  if( std::fabs(dum) < 1.0 )
255  {
256  if( test >= 1.0e-10 )excs += dum*test;
257  }
258  else
259  excs += dum*test;
260  }
261  }
262  }
263  }
264  }
265  if( ran >= excs ) // 3 previous loops continued to the end
266  {
267  quasiElastic = true;
268  return;
269  }
270  np--; nneg--; nz--;
271  //
272  // number of secondary mesons determined by kno distribution
273  // check for total charge of final state mesons to determine
274  // the kind of baryons to be produced, taking into account
275  // charge and strangeness conservation
276  //
277  if( np < nneg )
278  {
279  if( np+1 == nneg )
280  {
281  currentParticle.SetDefinitionAndUpdateE( aXiZero );
282  incidentHasChanged = true;
283  nvefix = 1;
284  }
285  else // charge mismatch
286  {
287  currentParticle.SetDefinitionAndUpdateE( aSigmaPlus );
288  incidentHasChanged = true;
289  nvefix = 2;
290  }
291  }
292  else if( np > nneg )
293  {
294  targetParticle.SetDefinitionAndUpdateE( aNeutron );
295  targetHasChanged = true;
296  }
297  }
298  else // target must be a neutron
299  {
300  counter = -1;
301  for( np=0; np<numSec/3 && ran>=excs; ++np )
302  {
303  for( nneg=np; nneg<=(np+2) && ran>=excs; ++nneg )
304  {
305  for( nz=0; nz<numSec/3 && ran>=excs; ++nz )
306  {
307  if( ++counter < numMul )
308  {
309  nt = np+nneg+nz;
310  if( nt>0 && nt<=numSec )
311  {
312  test = G4Exp( std::min( expxu, std::max( expxl, -(pi/4.0)*(nt*nt)/(n*n) ) ) );
313  dum = (pi/anpn)*nt*neutmul[counter]*neutnorm[nt-1]/(2.0*n*n);
314  if( std::fabs(dum) < 1.0 )
315  {
316  if( test >= 1.0e-10 )excs += dum*test;
317  }
318  else
319  excs += dum*test;
320  }
321  }
322  }
323  }
324  }
325  if( ran >= excs ) // 3 previous loops continued to the end
326  {
327  quasiElastic = true;
328  return;
329  }
330  np--; nneg--; nz--;
331  if( np+1 < nneg )
332  {
333  if( np+2 == nneg )
334  {
335  currentParticle.SetDefinitionAndUpdateE( aXiZero );
336  incidentHasChanged = true;
337  nvefix = 1;
338  }
339  else // charge mismatch
340  {
341  currentParticle.SetDefinitionAndUpdateE( aSigmaPlus );
342  incidentHasChanged = true;
343  nvefix = 2;
344  }
345  targetParticle.SetDefinitionAndUpdateE( aProton );
346  targetHasChanged = true;
347  }
348  else if( np+1 == nneg )
349  {
350  targetParticle.SetDefinitionAndUpdateE( aProton );
351  targetHasChanged = true;
352  }
353  }
354 
355  SetUpPions(np, nneg, nz, vec, vecLen);
356  for (G4int i = 0; i < vecLen && nvefix > 0; ++i) {
357  if (vec[i]->GetDefinition() == G4PionMinus::PionMinus() ) {
358  // correct the strangeness by replacing a pi- by a kaon-
359  if( nvefix >= 1 )vec[i]->SetDefinitionAndUpdateE( aKaonMinus );
360  --nvefix;
361  }
362  }
363 
364  return;
365 }
366 
367  /* end of file */
368 
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:98
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 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
void Cascade(G4FastVector< G4ReactionProduct, GHADLISTSIZE > &vec, G4int &vecLen, const G4HadProjectile *originalIncident, G4ReactionProduct &currentParticle, G4ReactionProduct &targetParticle, G4bool &incidentHasChanged, G4bool &targetHasChanged, G4bool &quasiElastic)
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
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)
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)