source: trunk/source/processes/hadronic/models/rpg/src/G4RPGPionSuppression.cc @ 1337

Last change on this file since 1337 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 5.9 KB
Line 
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: G4RPGPionSuppression.cc,v 1.1 2007/07/18 21:04:20 dennis Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-01 $
28//
29 
30#include "G4RPGPionSuppression.hh"
31#include "Randomize.hh"
32#include <iostream>
33#include "G4HadReentrentException.hh"
34#include <signal.h>
35
36
37G4RPGPionSuppression::G4RPGPionSuppression()
38  : G4RPGReaction() {}
39
40
41G4bool G4RPGPionSuppression::
42ReactionStage(const G4HadProjectile* /*originalIncident*/,
43              G4ReactionProduct& modifiedOriginal,
44              G4bool& incidentHasChanged,
45              const G4DynamicParticle* /*originalTarget*/,
46              G4ReactionProduct& targetParticle,
47              G4bool& targetHasChanged,
48              const G4Nucleus& targetNucleus,
49              G4ReactionProduct& currentParticle,
50              G4FastVector<G4ReactionProduct,256>& vec,
51              G4int& vecLen,
52              G4bool /*leadFlag*/,
53              G4ReactionProduct& /*leadingStrangeParticle*/)
54{
55  // This code was originally in the fortran code TWOCLU
56  //
57  // Suppress charged pions, for various reasons
58  //
59  G4double mOriginal = modifiedOriginal.GetMass()/GeV;
60  G4double etOriginal = modifiedOriginal.GetTotalEnergy()/GeV;
61  G4double targetMass = targetParticle.GetDefinition()->GetPDGMass()/GeV;
62  G4double cmEnergy = std::sqrt( mOriginal*mOriginal + targetMass*targetMass +
63                           2.0*targetMass*etOriginal ); 
64  G4double eAvailable = cmEnergy - mOriginal - targetMass;
65  for (G4int i = 0; i < vecLen; i++) eAvailable -= vec[i]->GetMass()/GeV;
66
67  const G4double atomicWeight = targetNucleus.GetN();
68  const G4double atomicNumber = targetNucleus.GetZ();
69  const G4double pOriginal = modifiedOriginal.GetTotalMomentum()/GeV;
70   
71  G4ParticleDefinition *aPiMinus = G4PionMinus::PionMinus();
72  G4ParticleDefinition *aPiPlus = G4PionPlus::PionPlus();
73  G4ParticleDefinition* aPiZero = G4PionZero::PionZero();
74  G4ParticleDefinition *aProton = G4Proton::Proton();
75  G4ParticleDefinition *aNeutron = G4Neutron::Neutron();
76  G4double piMass = aPiPlus->GetPDGMass()/GeV;
77  G4double nucleonMass = aNeutron->GetPDGMass()/GeV;
78   
79  const G4bool antiTest =
80    modifiedOriginal.GetDefinition() != G4AntiProton::AntiProton() &&
81    modifiedOriginal.GetDefinition() != G4AntiNeutron::AntiNeutron() &&
82    modifiedOriginal.GetDefinition() != G4AntiLambda::AntiLambda() &&
83    modifiedOriginal.GetDefinition() != G4AntiSigmaPlus::AntiSigmaPlus() &&
84    modifiedOriginal.GetDefinition() != G4AntiSigmaMinus::AntiSigmaMinus() &&
85    modifiedOriginal.GetDefinition() != G4AntiXiZero::AntiXiZero() &&
86    modifiedOriginal.GetDefinition() != G4AntiXiMinus::AntiXiMinus() &&
87    modifiedOriginal.GetDefinition() != G4AntiOmegaMinus::AntiOmegaMinus();
88
89  if( antiTest && (
90        currentParticle.GetDefinition() == aPiPlus ||
91        currentParticle.GetDefinition() == aPiZero ||
92        currentParticle.GetDefinition() == aPiMinus ) &&
93      ( G4UniformRand() <= (10.0-pOriginal)/6.0 ) &&
94      ( G4UniformRand() <= atomicWeight/300.0 ) )
95  {
96    if (eAvailable > nucleonMass - piMass) {
97      if( G4UniformRand() > atomicNumber/atomicWeight )
98        currentParticle.SetDefinitionAndUpdateE( aNeutron );
99      else
100        currentParticle.SetDefinitionAndUpdateE( aProton );
101      incidentHasChanged = true;
102    }
103  }
104
105  if( antiTest && (
106        targetParticle.GetDefinition() == aPiPlus ||
107        targetParticle.GetDefinition() == aPiZero ||
108        targetParticle.GetDefinition() == aPiMinus ) &&
109      ( G4UniformRand() <= (10.0-pOriginal)/6.0 ) &&
110      ( G4UniformRand() <= atomicWeight/300.0 ) )
111  {
112    if (eAvailable > nucleonMass - piMass) {
113      if( G4UniformRand() > atomicNumber/atomicWeight )
114        targetParticle.SetDefinitionAndUpdateE( aNeutron );
115      else
116        targetParticle.SetDefinitionAndUpdateE( aProton );
117      targetHasChanged = true;
118    }
119  }
120
121  for( G4int i=0; i<vecLen; ++i )
122  {
123    if( antiTest && (
124          vec[i]->GetDefinition() == aPiPlus ||
125          vec[i]->GetDefinition() == aPiZero ||
126          vec[i]->GetDefinition() == aPiMinus ) &&
127        ( G4UniformRand() <= (10.0-pOriginal)/6.0 ) &&
128        ( G4UniformRand() <= atomicWeight/300.0 ) )
129    {
130      if (eAvailable > nucleonMass - piMass) {
131        if( G4UniformRand() > atomicNumber/atomicWeight )
132          vec[i]->SetDefinitionAndUpdateE( aNeutron );
133        else
134          vec[i]->SetDefinitionAndUpdateE( aProton );
135      }
136    }
137  }
138
139  return true;
140}
141
142 
143 /* end of file */
Note: See TracBrowser for help on using the repository browser.