Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (15 years ago)
Author:
garnier
Message:

geant4 tag 9.4

Location:
trunk/source/processes/hadronic/models/high_energy/src
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiKaonZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiKaonZeroInelastic.cc,v 1.16 2010/02/09 22:02:04 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiKaonZeroInelastic.cc,v 1.18 2010/11/27 00:06:50 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
     35// and the low energy two-body model. Not included is the low energy stuff like
    3936// nuclear reactions, nuclear fission without any cascading and all processes for
    4037// particles at rest. 
     
    4542#include "G4HEAntiKaonZeroInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiKaonZeroInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiKaonZeroInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiKaonZeroInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
     44G4HadFinalState*
     45G4HEAntiKaonZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                         G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiKaonZeroInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiKaonZeroInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
    7772   
    78     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8277   
    83     incidentKineticEnergy -= inelasticity;
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9489           << excitationEnergyDTA << G4endl;             
    9590
    9691
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     92  incidentKineticEnergy -= excitation;
     93  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     94  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     95                                    *(incidentTotalEnergy+incidentMass));
     96
     97  G4HEVector targetParticle;
     98  if (G4UniformRand() < atomicNumber/atomicWeight) {
     99    targetParticle.setDefinition("Proton");
     100  } else {
     101    targetParticle.setDefinition("Neutron");
     102  }
     103
     104  G4double targetMass = targetParticle.getMass();
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                         + targetMass*targetMass
     107                                         + 2.0*targetMass*incidentTotalEnergy);
     108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     109
     110  vecLength = 0;           
    128111       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     112  if (verboseLevel > 1)
     113    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131114           << incidentCode << G4endl;
    132115
    133     G4bool successful = false;
    134    
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
    138                                   incidentParticle, targetParticle );
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
    183              << G4endl;
    184 
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     116  G4bool successful = false;
     117
     118  G4bool inElastic = true;
     119  FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
     120                            incidentParticle, targetParticle );
     121
     122  if (verboseLevel > 1)
     123    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     124
     125  if ((vecLength > 0) && (availableEnergy > 1.))
     126    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     127                                  pv, vecLength,
     128                                  incidentParticle, targetParticle);
     129  HighEnergyCascading(successful, pv, vecLength,
     130                      excitationEnergyGNP, excitationEnergyDTA,
     131                      incidentParticle, targetParticle,
     132                      atomicWeight, atomicNumber);
     133  if (!successful)
     134    HighEnergyClusterProduction(successful, pv, vecLength,
     135                                excitationEnergyGNP, excitationEnergyDTA,
     136                                incidentParticle, targetParticle,
     137                                atomicWeight, atomicNumber);
     138  if (!successful)
     139    MediumEnergyCascading(successful, pv, vecLength,
     140                          excitationEnergyGNP, excitationEnergyDTA,
     141                          incidentParticle, targetParticle,
     142                          atomicWeight, atomicNumber);
     143  if (!successful)
     144    MediumEnergyClusterProduction(successful, pv, vecLength,
     145                                  excitationEnergyGNP, excitationEnergyDTA,       
     146                                  incidentParticle, targetParticle,
     147                                  atomicWeight, atomicNumber);
     148  if (!successful)
     149    QuasiElasticScattering(successful, pv, vecLength,
     150                           excitationEnergyGNP, excitationEnergyDTA,
     151                           incidentParticle, targetParticle,
     152                           atomicWeight, atomicNumber);
     153  if (!successful)
     154    ElasticScattering(successful, pv, vecLength,
     155                      incidentParticle,   
     156                      atomicWeight, atomicNumber);
     157
     158  if (!successful)
     159    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     160           << G4endl;
     161
     162  FillParticleChange(pv,  vecLength);
     163  delete [] pv;
     164  theParticleChange.SetStatusChange(stopAndKill);
     165  return &theParticleChange;
     166}
     167
    190168
    191169void
    192 G4HEAntiKaonZeroInelastic::FirstIntInCasAntiKaonZero( G4bool &inElastic,
    193                                                       const G4double availableEnergy,
    194                                                       G4HEVector pv[],
    195                                                       G4int &vecLen,
    196                                                       G4HEVector incidentParticle,
    197                                                       G4HEVector targetParticle )
    198 
    199 // AntiKaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
    200 // energetically possible to produce pions/kaons.  In not, assume nuclear excitation
    201 // occurs and input particle is degraded in energy. No other particles are produced.
     170G4HEAntiKaonZeroInelastic::FirstIntInCasAntiKaonZero(G4bool& inElastic,
     171                                                     const G4double availableEnergy,
     172                                                     G4HEVector pv[],
     173                                                     G4int &vecLen,
     174                                                     const G4HEVector& incidentParticle,
     175                                                     const G4HEVector& targetParticle)
     176
     177// AntiKaon0 undergoes interaction with nucleon within a nucleus.  Check if it
     178// is energetically possible to produce pions/kaons.  In not, assume nuclear
     179// excitation occurs and input particle is degraded in energy.  No other
     180// particles are produced.
    202181// If reaction is possible, find the correct number of pions/protons/neutrons
    203182// produced using an interpolation to multiplicity data.  Replace some pions or
    204183// protons/neutrons by kaons or strange baryons according to the average
    205184// multiplicity per inelastic reaction.
    206 
    207  {
    208    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    209    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    210 
    211    static const G4double protb = 0.7;
    212    static const G4double neutb = 0.7;
    213    static const G4double     c = 1.25;
    214 
    215    static const G4int   numMul = 1200;
    216    static const G4int   numSec = 60;
    217 
    218    G4int              neutronCode = Neutron.getCode();
    219    G4int               protonCode = Proton.getCode();
    220    G4int            kaonMinusCode = KaonMinus.getCode();
    221    G4int             kaonZeroCode = KaonZero.getCode();
    222    G4int         antiKaonZeroCode = AntiKaonZero.getCode(); 
    223 
    224    G4int               targetCode = targetParticle.getCode();
    225 //   G4double          incidentMass = incidentParticle.getMass();
    226 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    227    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    228 
    229    static G4bool first = true;
    230    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    231    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    232 
    233 //                                misc. local variables
    234 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    235 
    236    G4int i, counter, nt, np, nm, nz;
     185{
     186  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     187  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     188
     189  static const G4double protb = 0.7;
     190  static const G4double neutb = 0.7;
     191  static const G4double     c = 1.25;
     192
     193  static const G4int numMul = 1200;
     194  static const G4int numSec = 60;
     195
     196  G4int neutronCode = Neutron.getCode();
     197  G4int protonCode = Proton.getCode();
     198  G4int kaonMinusCode = KaonMinus.getCode();
     199  G4int kaonZeroCode = KaonZero.getCode();
     200  G4int antiKaonZeroCode = AntiKaonZero.getCode(); 
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     207  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     208
     209  // misc. local variables
     210  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    237213
    238214   if( first )
    239      {                         // compute normalization constants, this will only be done once
     215     {                   // compute normalization constants, this will only be done once
    240216       first = false;
    241217       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiLambdaInelastic.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEAntiLambdaInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     27// $Id: G4HEAntiLambdaInelastic.cc,v 1.17 2010/11/27 02:00:07 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3029//
    3130
     
    3332#include "G4ios.hh"
    3433
    35 //
    3634// G4 Process: Gheisha High Energy Collision model.
    3735// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     36// and the low energy two-body model. Not included are the low energy stuff
     37// like nuclear reactions, nuclear fission without any cascading and all
     38// processes for particles at rest. 
    4139// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4240// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4543#include "G4HEAntiLambdaInelastic.hh"
    4644
    47 G4HadFinalState *  G4HEAntiLambdaInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiLambdaInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiLambdaInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
    77 
    78     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     45
     46G4HadFinalState*
     47G4HEAntiLambdaInelastic::ApplyYourself(const G4HadProjectile &aTrack,
     48                                       G4Nucleus &targetNucleus)
     49{
     50  G4HEVector * pv = new G4HEVector[MAXPART];
     51  const G4HadProjectile *aParticle = &aTrack;
     52  const G4double atomicWeight = targetNucleus.GetN();
     53  const G4double atomicNumber = targetNucleus.GetZ();
     54  G4HEVector incidentParticle(aParticle);
     55
     56  G4int incidentCode = incidentParticle.getCode();
     57  G4double incidentMass = incidentParticle.getMass();
     58  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     59  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     60  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     61
     62  if (incidentKineticEnergy < 1.)
     63    G4cout << "GHEAntiLambdaInelastic: incident energy < 1 GeV" << G4endl;
     64
     65  if (verboseLevel > 1) {
     66    G4cout << "G4HEAntiLambdaInelastic::ApplyYourself" << G4endl;
     67    G4cout << "incident particle " << incidentParticle.getName()
     68           << "mass "              << incidentMass
     69           << "kinetic energy "    << incidentKineticEnergy
     70           << G4endl;
     71    G4cout << "target material with (A,Z) = ("
     72           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     73  }
     74
     75  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     76                                              atomicWeight, atomicNumber);
     77  if (verboseLevel > 1)
     78    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8279   
    83     incidentKineticEnergy -= inelasticity;
     80  incidentKineticEnergy -= inelasticity;
    8481   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     82  G4double excitationEnergyGNP = 0.;
     83  G4double excitationEnergyDTA = 0.;
     84
     85  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     86                                          atomicWeight, atomicNumber,
     87                                          excitationEnergyGNP,
     88                                          excitationEnergyDTA);
     89  if (verboseLevel > 1)
     90    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9491           << excitationEnergyDTA << G4endl;             
    9592
    96 
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     93  incidentKineticEnergy -= excitation;
     94  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     95  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     96                         *(incidentTotalEnergy+incidentMass));
     97
     98  G4HEVector targetParticle;
     99  if (G4UniformRand() < atomicNumber/atomicWeight) {
     100    targetParticle.setDefinition("Proton");
     101  } else {
     102    targetParticle.setDefinition("Neutron");
     103  }
     104
     105  G4double targetMass = targetParticle.getMass();
     106  G4double centerOfMassEnergy =
     107       std::sqrt( incidentMass*incidentMass + targetMass*targetMass
     108       + 2.0*targetMass*incidentTotalEnergy);
     109  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     110
     111  G4bool inElastic = true;
     112  vecLength = 0;           
    128113       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     114  if (verboseLevel > 1)
     115    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131116           << incidentCode << G4endl;
    132117
    133     G4bool successful = false;
     118  G4bool successful = false;
    134119   
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiLambda(inElastic, availableEnergy, pv, vecLength,
    138                                 incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     120  FirstIntInCasAntiLambda(inElastic, availableEnergy, pv, vecLength,
     121                          incidentParticle, targetParticle, atomicWeight);
     122
     123  if (verboseLevel > 1)
     124    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
     125
     126  if ((vecLength > 0) && (availableEnergy > 1.))
     127    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     128                                  pv, vecLength,
     129                                  incidentParticle, targetParticle);
     130  HighEnergyCascading(successful, pv, vecLength,
     131                      excitationEnergyGNP, excitationEnergyDTA,
     132                      incidentParticle, targetParticle,
     133                      atomicWeight, atomicNumber);
     134  if (!successful)
     135    HighEnergyClusterProduction(successful, pv, vecLength,
     136                                excitationEnergyGNP, excitationEnergyDTA,
     137                                incidentParticle, targetParticle,
     138                                atomicWeight, atomicNumber);
     139  if (!successful)
     140    MediumEnergyCascading(successful, pv, vecLength,
     141                          excitationEnergyGNP, excitationEnergyDTA,
     142                          incidentParticle, targetParticle,
     143                          atomicWeight, atomicNumber);
     144
     145  if (!successful)
     146    MediumEnergyClusterProduction(successful, pv, vecLength,
     147                                  excitationEnergyGNP, excitationEnergyDTA,       
     148                                  incidentParticle, targetParticle,
     149                                  atomicWeight, atomicNumber);
     150  if (!successful)
     151    QuasiElasticScattering(successful, pv, vecLength,
     152                           excitationEnergyGNP, excitationEnergyDTA,
     153                           incidentParticle, targetParticle,
     154                           atomicWeight, atomicNumber);
     155  if (!successful)
     156    ElasticScattering(successful, pv, vecLength,
     157                      incidentParticle,   
     158                      atomicWeight, atomicNumber);
     159
     160  if (!successful)
     161    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     162           << G4endl;
     163
     164  FillParticleChange(pv, vecLength);
     165  delete [] pv;
     166  theParticleChange.SetStatusChange(stopAndKill);
     167  return & theParticleChange;
     168}
     169
    190170
    191171void
    192 G4HEAntiLambdaInelastic::FirstIntInCasAntiLambda( G4bool &inElastic,
    193                                                   const G4double availableEnergy,
    194                                                   G4HEVector pv[],
    195                                                   G4int &vecLen,
    196                                                   G4HEVector incidentParticle,
    197                                                   G4HEVector targetParticle,
    198                                                   const G4double atomicWeight)
    199 
    200 // AntiLambda undergoes interaction with nucleon within a nucleus.  Check if it is
    201 // energetically possible to produce pions/kaons.  In not, assume nuclear excitation
    202 // occurs and input particle is degraded in energy. No other particles are produced.
     172G4HEAntiLambdaInelastic::FirstIntInCasAntiLambda(G4bool& inElastic,
     173                                                 const G4double availableEnergy,
     174                                                 G4HEVector pv[],
     175                                                 G4int &vecLen,
     176                                                 const G4HEVector& incidentParticle,
     177                                                 const G4HEVector& targetParticle,
     178                                                 const G4double atomicWeight)
     179
     180// AntiLambda undergoes interaction with nucleon within a nucleus.
     181// Check if it is energetically possible to produce pions/kaons.  If not,
     182// assume nuclear excitation occurs and input particle is degraded in
     183// energy. No other particles are produced.
    203184// If reaction is possible, find the correct number of pions/protons/neutrons
    204185// produced using an interpolation to multiplicity data.  Replace some pions or
    205186// protons/neutrons by kaons or strange baryons according to the average
    206187// multiplicity per inelastic reaction.
    207 
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220 //   G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     188{
     189  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     190  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     191
     192  static const G4double protb = 0.7;
     193  static const G4double neutb = 0.7;
     194  static const G4double     c = 1.25;
     195
     196  static const G4int   numMul   = 1200;
     197  static const G4int   numMulAn = 400;
     198  static const G4int   numSec   = 60;
     199
     200  G4int protonCode = Proton.getCode();
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     207  static G4double protmulAn[numMulAn],protnormAn[numSec];
     208  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     209  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     210
     211  //  misc. local variables
     212  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     213
     214  G4int i, counter, nt, np, nm, nz;
    238215
    239216   if( first )
    240      {                         // compute normalization constants, this will only be done once
     217     {                 // compute normalization constants, this will only be done once
    241218       first = false;
    242219       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiNeutronInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiNeutronInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiNeutronInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model.  Not included is the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiNeutronInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiNeutronInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiNeutronInelastic: incident energy < 1 GeV" << G4endl;;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiNeutronInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
    77 
    78     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     44G4HadFinalState*
     45G4HEAntiNeutronInelastic::ApplyYourself(const G4HadProjectile &aTrack,
     46                                        G4Nucleus &targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiNeutronInelastic: incident energy < 1 GeV" << G4endl;;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiNeutronInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
     72
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8277   
    83     incidentKineticEnergy -= inelasticity;
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9489           << excitationEnergyDTA << G4endl;             
    9590
    96 
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     91  incidentKineticEnergy -= excitation;
     92  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     93  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     94                                    *(incidentTotalEnergy+incidentMass));
     95
     96  G4HEVector targetParticle;
     97  if (G4UniformRand() < atomicNumber/atomicWeight) {
     98    targetParticle.setDefinition("Proton");
     99  } else {
     100    targetParticle.setDefinition("Neutron");
     101  }
     102
     103  G4double targetMass = targetParticle.getMass();
     104  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     105                                        + targetMass*targetMass
     106                                        + 2.0*targetMass*incidentTotalEnergy);
     107  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     108
     109  G4bool inElastic = true;
     110  vecLength = 0;           
    128111       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     112  if (verboseLevel > 1)
     113    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131114           << incidentCode << G4endl;
    132115
    133     G4bool successful = false;
     116  G4bool successful = false;
    134117   
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiNeutron(inElastic, availableEnergy, pv, vecLength,
    138                                  incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     118  FirstIntInCasAntiNeutron(inElastic, availableEnergy, pv, vecLength,
     119                           incidentParticle, targetParticle, atomicWeight);
     120
     121  if (verboseLevel > 1)
     122    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     123
     124  if ((vecLength > 0) && (availableEnergy > 1.))
     125    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     126                                  pv, vecLength,
     127                                  incidentParticle, targetParticle);
     128  HighEnergyCascading(successful, pv, vecLength,
     129                      excitationEnergyGNP, excitationEnergyDTA,
     130                      incidentParticle, targetParticle,
     131                      atomicWeight, atomicNumber);
     132  if (!successful)
     133    HighEnergyClusterProduction(successful, pv, vecLength,
     134                                excitationEnergyGNP, excitationEnergyDTA,
     135                                incidentParticle, targetParticle,
     136                                atomicWeight, atomicNumber);
     137  if (!successful)
     138    MediumEnergyCascading(successful, pv, vecLength,
     139                          excitationEnergyGNP, excitationEnergyDTA,
     140                          incidentParticle, targetParticle,
     141                          atomicWeight, atomicNumber);
     142
     143  if (!successful)
     144    MediumEnergyClusterProduction(successful, pv, vecLength,
     145                                  excitationEnergyGNP, excitationEnergyDTA,       
     146                                  incidentParticle, targetParticle,
     147                                  atomicWeight, atomicNumber);
     148  if (!successful)
     149    QuasiElasticScattering(successful, pv, vecLength,
     150                           excitationEnergyGNP, excitationEnergyDTA,
     151                           incidentParticle, targetParticle,
     152                           atomicWeight, atomicNumber);
     153  if (!successful)
     154    ElasticScattering(successful, pv, vecLength,
     155                      incidentParticle,   
     156                      atomicWeight, atomicNumber);
     157
     158  if (!successful)
     159    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     160           << G4endl;
     161
     162  FillParticleChange(pv,  vecLength);
     163  delete [] pv;
     164  theParticleChange.SetStatusChange(stopAndKill);
     165  return &theParticleChange;
     166}
     167
    190168
    191169void
    192   G4HEAntiNeutronInelastic::FirstIntInCasAntiNeutron( G4bool &inElastic,
    193                                                       const G4double availableEnergy,
    194                                                       G4HEVector pv[],
    195                                                       G4int &vecLen,
    196                                                       G4HEVector incidentParticle,
    197                                                       G4HEVector targetParticle,
    198                                                       const G4double atomicWeight)
    199 
    200 // AntiNeutron undergoes interaction with nucleon within a nucleus.  Check if it is
    201 // energetically possible to produce pions/kaons.  In not, assume nuclear excitation
    202 // occurs and input particle is degraded in energy. No other particles are produced.
     170G4HEAntiNeutronInelastic::FirstIntInCasAntiNeutron(G4bool& inElastic,
     171                                                   const G4double availableEnergy,
     172                                                   G4HEVector pv[],
     173                                                   G4int& vecLen,
     174                                                   const G4HEVector& incidentParticle,
     175                                                   const G4HEVector& targetParticle,
     176                                                   const G4double atomicWeight)
     177
     178// AntiNeutron undergoes interaction with nucleon within a nucleus.  Check if
     179// it is energetically possible to produce pions/kaons.  If not, assume
     180// nuclear excitation occurs and input particle is degraded in energy.  No
     181// other particles are produced.
    203182// If reaction is possible, find the correct number of pions/protons/neutrons
    204183// produced using an interpolation to multiplicity data.  Replace some pions or
    205184// protons/neutrons by kaons or strange baryons according to the average
    206185// multiplicity per inelastic reaction.
    207 
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220    G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     186{
     187  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     188  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     189
     190  static const G4double protb = 0.7;
     191  static const G4double neutb = 0.7;
     192  static const G4double     c = 1.25;
     193
     194  static const G4int numMul   = 1200;
     195  static const G4int numMulAn = 400;
     196  static const G4int numSec   = 60;
     197
     198  G4int neutronCode = Neutron.getCode();
     199  G4int protonCode = Proton.getCode();
     200
     201  G4int targetCode = targetParticle.getCode();
     202  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     203
     204  static G4bool first = true;
     205  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     206  static G4double protmulAn[numMulAn],protnormAn[numSec];
     207  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     208  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     209
     210  //  misc. local variables
     211  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     212
     213  G4int i, counter, nt, np, nm, nz;
    238214
    239215   if( first )
    240      {                         // compute normalization constants, this will only be done once
     216     {                 // compute normalization constants, this will only be done once
    241217       first = false;
    242218       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiOmegaMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiOmegaMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiOmegaMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model.  Not included is the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiOmegaMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiOmegaMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiOmegaMinusInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
     44G4HadFinalState*
     45G4HEAntiOmegaMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                           G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiOmegaMinusInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
    6964        G4cout << "G4HEAntiOmegaMinusInelastic::ApplyYourself" << G4endl;
    7065        G4cout << "incident particle " << incidentParticle.getName()
     
    7469        G4cout << "target material with (A,Z) = ("
    7570             << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
     71  }
    7772   
    78     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8277   
    83     incidentKineticEnergy -= inelasticity;
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9489           << excitationEnergyDTA << G4endl;             
    9590
    9691
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     92  incidentKineticEnergy -= excitation;
     93  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     94  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     95                                    *(incidentTotalEnergy+incidentMass));
     96
     97  G4HEVector targetParticle;
     98  if (G4UniformRand() < atomicNumber/atomicWeight) {
     99    targetParticle.setDefinition("Proton");
     100  } else {
     101    targetParticle.setDefinition("Neutron");
     102  }
     103
     104  G4double targetMass = targetParticle.getMass();
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                        + targetMass*targetMass
     107                                        + 2.0*targetMass*incidentTotalEnergy);
     108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     109
     110  G4bool inElastic = true;
     111  vecLength = 0;           
    128112       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     113  if (verboseLevel > 1)
     114    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131115           << incidentCode << G4endl;
    132116
    133     G4bool successful = false;
     117  G4bool successful = false;
    134118   
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiOmegaMinus(inElastic, availableEnergy, pv, vecLength,
    138                                     incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     119  FirstIntInCasAntiOmegaMinus(inElastic, availableEnergy, pv, vecLength,
     120                              incidentParticle, targetParticle, atomicWeight);
     121
     122  if (verboseLevel > 1)
     123    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
     124
     125  if ((vecLength > 0) && (availableEnergy > 1.))
     126    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     127                                  pv, vecLength,
     128                                  incidentParticle, targetParticle);
     129  HighEnergyCascading(successful, pv, vecLength,
     130                      excitationEnergyGNP, excitationEnergyDTA,
     131                      incidentParticle, targetParticle,
     132                      atomicWeight, atomicNumber);
     133  if (!successful)
     134    HighEnergyClusterProduction(successful, pv, vecLength,
     135                                excitationEnergyGNP, excitationEnergyDTA,
     136                                incidentParticle, targetParticle,
     137                                atomicWeight, atomicNumber);
     138  if (!successful)
     139    MediumEnergyCascading(successful, pv, vecLength,
     140                          excitationEnergyGNP, excitationEnergyDTA,
     141                          incidentParticle, targetParticle,
     142                          atomicWeight, atomicNumber);
     143
     144  if (!successful)
     145    MediumEnergyClusterProduction(successful, pv, vecLength,
     146                                  excitationEnergyGNP, excitationEnergyDTA,       
     147                                  incidentParticle, targetParticle,
     148                                  atomicWeight, atomicNumber);
     149  if (!successful)
     150    QuasiElasticScattering(successful, pv, vecLength,
     151                           excitationEnergyGNP, excitationEnergyDTA,
     152                           incidentParticle, targetParticle,
     153                           atomicWeight, atomicNumber);
     154  if (!successful)
     155    ElasticScattering(successful, pv, vecLength,
     156                      incidentParticle,   
     157                      atomicWeight, atomicNumber);
     158
     159  if (!successful)
     160    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     161           << G4endl;
     162
     163  FillParticleChange(pv,  vecLength);
     164  delete [] pv;
     165  theParticleChange.SetStatusChange(stopAndKill);
     166  return &theParticleChange;
     167}
     168
    190169
    191170void
    192 G4HEAntiOmegaMinusInelastic::FirstIntInCasAntiOmegaMinus( G4bool &inElastic,
    193                                                           const G4double availableEnergy,
    194                                                           G4HEVector pv[],
    195                                                           G4int &vecLen,
    196                                                           G4HEVector incidentParticle,
    197                                                           G4HEVector targetParticle,
    198                                                           const G4double atomicWeight )
     171G4HEAntiOmegaMinusInelastic::FirstIntInCasAntiOmegaMinus(G4bool& inElastic,
     172                                                         const G4double availableEnergy,
     173                                                         G4HEVector pv[],
     174                                                         G4int& vecLen,
     175                                                         const G4HEVector& incidentParticle,
     176                                                         const G4HEVector& targetParticle,
     177                                                         const G4double atomicWeight)
    199178
    200179// AntiOmega undergoes interaction with nucleon within a nucleus. 
    201180// As in Geant3, we think that this routine has absolutely no influence
    202181// on the whole performance of the program. Take AntiLambda instaed.
    203 
    204  {
    205    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    206    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    207 
    208    static const G4double protb = 0.7;
    209    static const G4double neutb = 0.7;
    210    static const G4double     c = 1.25;
    211 
    212    static const G4int   numMul   = 1200;
    213    static const G4int   numMulAn = 400;
    214    static const G4int   numSec   = 60;
    215 
    216 //   G4int              neutronCode = Neutron.getCode();
    217    G4int              protonCode  = Proton.getCode();
    218 
    219    G4int               targetCode = targetParticle.getCode();
    220 //   G4double          incidentMass = incidentParticle.getMass();
    221 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    222    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    223 
    224    static G4bool first = true;
    225    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    226    static G4double protmulAn[numMulAn],protnormAn[numSec];
    227    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    228    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    229 
    230                               //  misc. local variables
    231                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     182{
     183  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     184  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     185
     186  static const G4double protb = 0.7;
     187  static const G4double neutb = 0.7;
     188  static const G4double     c = 1.25;
     189
     190  static const G4int numMul   = 1200;
     191  static const G4int numMulAn = 400;
     192  static const G4int numSec   = 60;
     193
     194  G4int protonCode = Proton.getCode();
     195
     196  G4int targetCode = targetParticle.getCode();
     197  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     198
     199  static G4bool first = true;
     200  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     201  static G4double protmulAn[numMulAn],protnormAn[numSec];
     202  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     203  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     204
     205  //  misc. local variables
     206  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    232207
    233208   G4int i, counter, nt, np, nm, nz;
    234209
    235210   if( first )
    236      {                         // compute normalization constants, this will only be done once
     211     {             // compute normalization constants, this will only be done once
    237212       first = false;
    238213       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiProtonInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiProtonInelastic.cc,v 1.14 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiProtonInelastic.cc,v 1.16 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiProtonInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiProtonInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy  = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiProtonInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiProtonInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
    77 
    78     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     44G4HadFinalState*
     45G4HEAntiProtonInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                       G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiProtonInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiProtonInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
     72
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     77
     78  incidentKineticEnergy -= inelasticity;
    8279   
    83 
    84     incidentKineticEnergy -= inelasticity;
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     89           << excitationEnergyDTA << G4endl;             
     90
     91
     92  incidentKineticEnergy -= excitation;
     93  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     94  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     95                                    *(incidentTotalEnergy+incidentMass));
     96
     97  G4HEVector targetParticle;
     98  if (G4UniformRand() < atomicNumber/atomicWeight) {
     99    targetParticle.setDefinition("Proton");
     100  } else {
     101    targetParticle.setDefinition("Neutron");
     102  }
     103
     104  G4double targetMass = targetParticle.getMass();
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                        + targetMass*targetMass
     107                                        + 2.0*targetMass*incidentTotalEnergy);
     108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     109
     110  G4bool inElastic = true;
     111  vecLength = 0;   
     112       
     113  if (verboseLevel > 1)
     114    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115           << incidentCode << G4endl;
     116
     117  G4bool successful = false;
    85118   
    86     G4double excitationEnergyGNP = 0.;
    87     G4double excitationEnergyDTA = 0.;
    88 
    89     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    90                                                atomicWeight, atomicNumber,
    91                                                excitationEnergyGNP,
    92                                                excitationEnergyDTA);
    93     if(verboseLevel > 1)
    94       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    95            << excitationEnergyDTA << G4endl;             
    96 
    97 
    98     incidentKineticEnergy -= excitation;
    99     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    100     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    101                                   *(incidentTotalEnergy+incidentMass));
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength  = 0;           
    128        
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131            << incidentCode << G4endl;
    132 
    133     G4bool successful = false;
    134    
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiProton(inElastic, availableEnergy, pv, vecLength,
    138                                 incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     119  FirstIntInCasAntiProton(inElastic, availableEnergy, pv, vecLength,
     120                          incidentParticle, targetParticle, atomicWeight);
     121
     122  if (verboseLevel > 1)
     123    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
     124
     125  if ((vecLength > 0) && (availableEnergy > 1.))
     126    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     127                                  pv, vecLength,
     128                                  incidentParticle, targetParticle);
     129  HighEnergyCascading(successful, pv, vecLength,
     130                      excitationEnergyGNP, excitationEnergyDTA,
     131                      incidentParticle, targetParticle,
     132                      atomicWeight, atomicNumber);
     133  if (!successful)
     134    HighEnergyClusterProduction(successful, pv, vecLength,
     135                                excitationEnergyGNP, excitationEnergyDTA,
     136                                incidentParticle, targetParticle,
     137                                atomicWeight, atomicNumber);
     138  if (!successful)
     139    MediumEnergyCascading(successful, pv, vecLength,
     140                          excitationEnergyGNP, excitationEnergyDTA,
     141                          incidentParticle, targetParticle,
     142                          atomicWeight, atomicNumber);
     143
     144  if (!successful)
     145    MediumEnergyClusterProduction(successful, pv, vecLength,
     146                                  excitationEnergyGNP, excitationEnergyDTA,       
     147                                  incidentParticle, targetParticle,
     148                                  atomicWeight, atomicNumber);
     149  if (!successful)
     150    QuasiElasticScattering(successful, pv, vecLength,
     151                           excitationEnergyGNP, excitationEnergyDTA,
     152                           incidentParticle, targetParticle,
     153                           atomicWeight, atomicNumber);
     154  if (!successful)
     155    ElasticScattering(successful, pv, vecLength,
     156                      incidentParticle,   
     157                      atomicWeight, atomicNumber);
     158
     159  if (!successful)
     160    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     161           << G4endl;
     162
     163  FillParticleChange(pv,  vecLength);
     164  delete [] pv;
     165  theParticleChange.SetStatusChange(stopAndKill);
     166  return & theParticleChange;
     167}
     168
    190169
    191170void
    192 G4HEAntiProtonInelastic::FirstIntInCasAntiProton( G4bool &inElastic,
    193                                                   const G4double availableEnergy,
    194                                                   G4HEVector pv[],
    195                                                   G4int &vecLen,
    196                                                   G4HEVector incidentParticle,
    197                                                   G4HEVector targetParticle,
    198                                                   const G4double atomicWeight)
     171G4HEAntiProtonInelastic::FirstIntInCasAntiProton(G4bool& inElastic,
     172                                                 const G4double availableEnergy,
     173                                                 G4HEVector pv[],
     174                                                 G4int& vecLen,
     175                                                 const G4HEVector& incidentParticle,
     176                                                 const G4HEVector& targetParticle,
     177                                                 const G4double atomicWeight)
    199178
    200179// AntiProton undergoes interaction with nucleon within a nucleus.  Check if it is
     
    205184// protons/neutrons by kaons or strange baryons according to the average
    206185// multiplicity per inelastic reaction.
    207 
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220    G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     186{
     187  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     188  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     189
     190  static const G4double protb = 0.7;
     191  static const G4double neutb = 0.7;
     192  static const G4double     c = 1.25;
     193
     194  static const G4int numMul   = 1200;
     195  static const G4int numMulAn = 400;
     196  static const G4int numSec   = 60;
     197
     198  G4int neutronCode = Neutron.getCode();
     199  G4int protonCode  = Proton.getCode();
     200
     201  G4int targetCode = targetParticle.getCode();
     202  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     203
     204  static G4bool first = true;
     205  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     206  static G4double protmulAn[numMulAn],protnormAn[numSec];
     207  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     208  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     209
     210  //  misc. local variables
     211  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     212
     213  G4int i, counter, nt, np, nm, nz;
    238214
    239215   if( first )
    240      {                         // compute normalization constants, this will only be done once
     216     {             // compute normalization constants, this will only be done once
    241217       first = false;
    242218       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiSigmaMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiSigmaMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiSigmaMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiSigmaMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiSigmaMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiSigmaMinusInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiSigmaMinusInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
     44G4HadFinalState*
     45G4HEAntiSigmaMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                           G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiSigmaMinusInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiSigmaMinusInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
    7772   
    78     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8277   
    83     incidentKineticEnergy -= inelasticity;
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    94            << excitationEnergyDTA << G4endl;             
    95 
    96 
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102     G4HEVector targetParticle;
    103     if(G4UniformRand() < atomicNumber/atomicWeight)
    104       {
    105         targetParticle.setDefinition("Proton");
    106       }
    107     else
    108       {
    109         targetParticle.setDefinition("Neutron");
    110       }
    111 
    112     G4double targetMass         = targetParticle.getMass();
    113     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    114                                        + 2.0*targetMass*incidentTotalEnergy);
    115     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    116 
    117                                                                 // this was the meaning of inElastic in the
    118                                                                 // original Gheisha stand-alone version.
    119 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    120 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    121                                                                 // by unknown reasons, it has been replaced
    122                                                                 // to the following code in Geant???
    123     G4bool inElastic = true;
    124 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    125 
    126     vecLength  = 0;           
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87 if (verboseLevel > 1)
     88   G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     89          << excitationEnergyDTA << G4endl;             
     90
     91  incidentKineticEnergy -= excitation;
     92  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     93  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     94                                    *(incidentTotalEnergy+incidentMass));
     95
     96  G4HEVector targetParticle;
     97  if (G4UniformRand() < atomicNumber/atomicWeight) {
     98    targetParticle.setDefinition("Proton");
     99  } else {
     100    targetParticle.setDefinition("Neutron");
     101  }
     102
     103  G4double targetMass = targetParticle.getMass();
     104  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     105                                        + targetMass*targetMass
     106                                        + 2.0*targetMass*incidentTotalEnergy);
     107  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     108
     109  G4bool inElastic = true;
     110  vecLength  = 0;           
    127111       
    128     if(verboseLevel > 1)
    129       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     112  if (verboseLevel > 1)
     113    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    130114           << incidentCode << G4endl;
    131115
    132     G4bool successful = false;
     116  G4bool successful = false;
    133117   
    134     if(inElastic || (!inElastic && atomicWeight < 1.5))
    135       {
    136         FirstIntInCasAntiSigmaMinus(inElastic, availableEnergy, pv, vecLength,
    137                                     incidentParticle, targetParticle, atomicWeight);
    138 
    139         if(verboseLevel > 1)
    140            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    141 
    142 
    143         if ((vecLength > 0) && (availableEnergy > 1.))
    144                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    145                                                   pv, vecLength,
    146                                                   incidentParticle, targetParticle);
    147             HighEnergyCascading( successful, pv, vecLength,
    148                                  excitationEnergyGNP, excitationEnergyDTA,
    149                                  incidentParticle, targetParticle,
    150                                  atomicWeight, atomicNumber);
    151         if (!successful)
    152             HighEnergyClusterProduction( successful, pv, vecLength,
    153                                          excitationEnergyGNP, excitationEnergyDTA,
    154                                          incidentParticle, targetParticle,
    155                                          atomicWeight, atomicNumber);
    156         if (!successful)
    157             MediumEnergyCascading( successful, pv, vecLength,
    158                                    excitationEnergyGNP, excitationEnergyDTA,
    159                                    incidentParticle, targetParticle,
    160                                    atomicWeight, atomicNumber);
    161 
    162         if (!successful)
    163             MediumEnergyClusterProduction( successful, pv, vecLength,
    164                                            excitationEnergyGNP, excitationEnergyDTA,       
    165                                            incidentParticle, targetParticle,
    166                                            atomicWeight, atomicNumber);
    167         if (!successful)
    168             QuasiElasticScattering( successful, pv, vecLength,
    169                                     excitationEnergyGNP, excitationEnergyDTA,
    170                                     incidentParticle, targetParticle,
    171                                     atomicWeight, atomicNumber);
    172       }
    173     if (!successful)
    174       {
    175             ElasticScattering( successful, pv, vecLength,
    176                                incidentParticle,   
    177                                atomicWeight, atomicNumber);
    178       }
    179 
    180     if (!successful)
    181       {
    182          G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    183       }
    184       FillParticleChange(pv,  vecLength);
    185       delete [] pv;
    186       theParticleChange.SetStatusChange(stopAndKill);
    187       return & theParticleChange;
    188   }
     118  FirstIntInCasAntiSigmaMinus(inElastic, availableEnergy, pv, vecLength,
     119                              incidentParticle, targetParticle, atomicWeight);
     120
     121  if (verboseLevel > 1)
     122    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     123
     124  if ((vecLength > 0) && (availableEnergy > 1.))
     125    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     126                                  pv, vecLength,
     127                                  incidentParticle, targetParticle);
     128  HighEnergyCascading(successful, pv, vecLength,
     129                      excitationEnergyGNP, excitationEnergyDTA,
     130                      incidentParticle, targetParticle,
     131                      atomicWeight, atomicNumber);
     132  if (!successful)
     133    HighEnergyClusterProduction(successful, pv, vecLength,
     134                                excitationEnergyGNP, excitationEnergyDTA,
     135                                incidentParticle, targetParticle,
     136                                atomicWeight, atomicNumber);
     137  if (!successful)
     138    MediumEnergyCascading(successful, pv, vecLength,
     139                          excitationEnergyGNP, excitationEnergyDTA,
     140                          incidentParticle, targetParticle,
     141                          atomicWeight, atomicNumber);
     142
     143  if (!successful)
     144    MediumEnergyClusterProduction(successful, pv, vecLength,
     145                                  excitationEnergyGNP, excitationEnergyDTA,       
     146                                  incidentParticle, targetParticle,
     147                                  atomicWeight, atomicNumber);
     148  if (!successful)
     149    QuasiElasticScattering(successful, pv, vecLength,
     150                           excitationEnergyGNP, excitationEnergyDTA,
     151                           incidentParticle, targetParticle,
     152                           atomicWeight, atomicNumber);
     153  if (!successful)
     154    ElasticScattering(successful, pv, vecLength,
     155                      incidentParticle,   
     156                      atomicWeight, atomicNumber);
     157
     158  if (!successful)
     159    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     160           << G4endl;
     161  FillParticleChange(pv,  vecLength);
     162  delete [] pv;
     163  theParticleChange.SetStatusChange(stopAndKill);
     164  return &theParticleChange;
     165}
     166
    189167
    190168void
    191 G4HEAntiSigmaMinusInelastic::FirstIntInCasAntiSigmaMinus( G4bool &inElastic,
    192                                                           const G4double availableEnergy,
    193                                                           G4HEVector pv[],
    194                                                           G4int &vecLen,
    195                                                           G4HEVector incidentParticle,
    196                                                           G4HEVector targetParticle,
    197                                                           const G4double atomicWeight)
     169G4HEAntiSigmaMinusInelastic::FirstIntInCasAntiSigmaMinus(G4bool& inElastic,
     170                                                         const G4double availableEnergy,
     171                                                         G4HEVector pv[],
     172                                                         G4int& vecLen,
     173                                                         const G4HEVector& incidentParticle,
     174                                                         const G4HEVector& targetParticle,
     175                                                         const G4double atomicWeight)
    198176
    199177// AntiSigma- undergoes interaction with nucleon within a nucleus.  Check if it is
     
    204182// protons/neutrons by kaons or strange baryons according to the average
    205183// multiplicity per inelastic reaction.
    206 
    207  {
    208    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    209    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    210 
    211    static const G4double protb = 0.7;
    212    static const G4double neutb = 0.7;
    213    static const G4double     c = 1.25;
    214 
    215    static const G4int   numMul   = 1200;
    216    static const G4int   numMulAn = 400;
    217    static const G4int   numSec   = 60;
    218 
    219    G4int              neutronCode = Neutron.getCode();
    220    G4int              protonCode  = Proton.getCode();
    221 
    222    G4int               targetCode = targetParticle.getCode();
    223 //   G4double          incidentMass = incidentParticle.getMass();
    224 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    225    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    226 
    227    static G4bool first = true;
    228    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    229    static G4double protmulAn[numMulAn],protnormAn[numSec];
    230    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    231    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    232 
    233                               //  misc. local variables
    234                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    235 
    236    G4int i, counter, nt, np, nm, nz;
     184{
     185  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     186  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     187
     188  static const G4double protb = 0.7;
     189  static const G4double neutb = 0.7;
     190  static const G4double     c = 1.25;
     191
     192  static const G4int numMul   = 1200;
     193  static const G4int numMulAn = 400;
     194  static const G4int numSec   = 60;
     195
     196  G4int neutronCode = Neutron.getCode();
     197  G4int protonCode  = Proton.getCode();
     198
     199  G4int targetCode = targetParticle.getCode();
     200  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     201
     202  static G4bool first = true;
     203  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     204  static G4double protmulAn[numMulAn],protnormAn[numSec];
     205  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     206  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     207
     208  //  misc. local variables
     209  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     210
     211  G4int i, counter, nt, np, nm, nz;
    237212
    238213   if( first )
    239      {                         // compute normalization constants, this will only be done once
     214     {               // compute normalization constants, this will only be done once
    240215       first = false;
    241216       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiSigmaPlusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiSigmaPlusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiSigmaPlusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiSigmaPlusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiSigmaPlusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double atomicWeight = targetNucleus.GetN();
    54     const G4double atomicNumber = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
    56 
    57     G4int    incidentCode          = incidentParticle.getCode();
    58     G4double incidentMass          = incidentParticle.getMass();
    59     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    62 
    63     if(incidentKineticEnergy < 1.)
    64       {
    65         G4cout << "GHEAntiSigmaPlusInelastic: incident energy < 1 GeV" << G4endl;
    66       }
    67     if(verboseLevel > 1)
    68       {
    69         G4cout << "G4HEAntiSigmaPlusInelastic::ApplyYourself" << G4endl;
    70         G4cout << "incident particle " << incidentParticle.getName()
    71              << "mass "              << incidentMass
    72              << "kinetic energy "    << incidentKineticEnergy
    73              << G4endl;
    74         G4cout << "target material with (A,Z) = ("
    75              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    76       }
    77 
    78     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    79                                                  atomicWeight, atomicNumber);
    80     if(verboseLevel > 1)
    81         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    82 
    83     incidentKineticEnergy -= inelasticity;
     44G4HadFinalState*
     45G4HEAntiSigmaPlusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                          G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double atomicWeight = targetNucleus.GetN();
     51  const G4double atomicNumber = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
     53
     54  G4int incidentCode = incidentParticle.getCode();
     55  G4double incidentMass = incidentParticle.getMass();
     56  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     59
     60  if (incidentKineticEnergy < 1.)
     61    G4cout << "GHEAntiSigmaPlusInelastic: incident energy < 1 GeV" << G4endl;
     62
     63  if (verboseLevel > 1) {
     64    G4cout << "G4HEAntiSigmaPlusInelastic::ApplyYourself" << G4endl;
     65    G4cout << "incident particle " << incidentParticle.getName()
     66           << "mass "              << incidentMass
     67           << "kinetic energy "    << incidentKineticEnergy
     68           << G4endl;
     69    G4cout << "target material with (A,Z) = ("
     70           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     71  }
     72
     73  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     74                                              atomicWeight, atomicNumber);
     75  if (verboseLevel > 1)
     76    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     77
     78  incidentKineticEnergy -= inelasticity;
    8479   
    85     G4double excitationEnergyGNP = 0.;
    86     G4double excitationEnergyDTA = 0.;
    87 
    88     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    89                                                atomicWeight, atomicNumber,
    90                                                excitationEnergyGNP,
    91                                                excitationEnergyDTA);
    92     if(verboseLevel > 1)
    93       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     80  G4double excitationEnergyGNP = 0.;
     81  G4double excitationEnergyDTA = 0.;
     82
     83  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     84                                          atomicWeight, atomicNumber,
     85                                          excitationEnergyGNP,
     86                                          excitationEnergyDTA);
     87  if (verboseLevel > 1)
     88    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9489           << excitationEnergyDTA << G4endl;             
    9590
    96 
    97     incidentKineticEnergy -= excitation;
    98     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    99     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    100                                   *(incidentTotalEnergy+incidentMass));
    101 
    102 
    103     G4HEVector targetParticle;
    104     if(G4UniformRand() < atomicNumber/atomicWeight)
    105       {
    106         targetParticle.setDefinition("Proton");
    107       }
    108     else
    109       {
    110         targetParticle.setDefinition("Neutron");
    111       }
    112 
    113     G4double targetMass         = targetParticle.getMass();
    114     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    115                                        + 2.0*targetMass*incidentTotalEnergy);
    116     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    117 
    118                                                                 // this was the meaning of inElastic in the
    119                                                                 // original Gheisha stand-alone version.
    120 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    121 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    122                                                                 // by unknown reasons, it has been replaced
    123                                                                 // to the following code in Geant???
    124     G4bool inElastic = true;
    125 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    126 
    127     vecLength = 0;           
     91  incidentKineticEnergy -= excitation;
     92  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     93  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     94                                    *(incidentTotalEnergy+incidentMass));
     95
     96  G4HEVector targetParticle;
     97  if (G4UniformRand() < atomicNumber/atomicWeight) {
     98    targetParticle.setDefinition("Proton");
     99  } else {
     100    targetParticle.setDefinition("Neutron");
     101  }
     102
     103  G4double targetMass = targetParticle.getMass();
     104  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     105                                        + targetMass*targetMass
     106                                        + 2.0*targetMass*incidentTotalEnergy);
     107  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     108
     109  G4bool inElastic = true;
     110  vecLength = 0;
    128111       
    129     if(verboseLevel > 1)
    130       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     112  if (verboseLevel > 1)
     113    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    131114           << incidentCode << G4endl;
    132115
    133     G4bool successful = false;
     116  G4bool successful = false;
    134117   
    135     if(inElastic || (!inElastic && atomicWeight < 1.5))
    136       {
    137         FirstIntInCasAntiSigmaPlus(inElastic, availableEnergy, pv, vecLength,
    138                                    incidentParticle, targetParticle, atomicWeight);
    139 
    140         if(verboseLevel > 1)
    141            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    142 
    143 
    144         if ((vecLength > 0) && (availableEnergy > 1.))
    145                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    146                                                   pv, vecLength,
    147                                                   incidentParticle, targetParticle);
    148             HighEnergyCascading( successful, pv, vecLength,
    149                                  excitationEnergyGNP, excitationEnergyDTA,
    150                                  incidentParticle, targetParticle,
    151                                  atomicWeight, atomicNumber);
    152         if (!successful)
    153             HighEnergyClusterProduction( successful, pv, vecLength,
    154                                          excitationEnergyGNP, excitationEnergyDTA,
    155                                          incidentParticle, targetParticle,
    156                                          atomicWeight, atomicNumber);
    157         if (!successful)
    158             MediumEnergyCascading( successful, pv, vecLength,
    159                                    excitationEnergyGNP, excitationEnergyDTA,
    160                                    incidentParticle, targetParticle,
    161                                    atomicWeight, atomicNumber);
    162 
    163         if (!successful)
    164             MediumEnergyClusterProduction( successful, pv, vecLength,
    165                                            excitationEnergyGNP, excitationEnergyDTA,       
    166                                            incidentParticle, targetParticle,
    167                                            atomicWeight, atomicNumber);
    168         if (!successful)
    169             QuasiElasticScattering( successful, pv, vecLength,
    170                                     excitationEnergyGNP, excitationEnergyDTA,
    171                                     incidentParticle, targetParticle,
    172                                     atomicWeight, atomicNumber);
    173       }
    174     if (!successful)
    175       {
    176             ElasticScattering( successful, pv, vecLength,
    177                                incidentParticle,   
    178                                atomicWeight, atomicNumber);
    179       }
    180 
    181     if (!successful)
    182       {
    183         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    184       }
    185       FillParticleChange(pv,  vecLength);
    186       delete [] pv;
    187       theParticleChange.SetStatusChange(stopAndKill);
    188       return & theParticleChange;
    189   }
     118  FirstIntInCasAntiSigmaPlus(inElastic, availableEnergy, pv, vecLength,
     119                             incidentParticle, targetParticle, atomicWeight);
     120
     121  if (verboseLevel > 1)
     122    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     123
     124  if ((vecLength > 0) && (availableEnergy > 1.))
     125    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     126                                  pv, vecLength,
     127                                  incidentParticle, targetParticle);
     128
     129  HighEnergyCascading(successful, pv, vecLength,
     130                      excitationEnergyGNP, excitationEnergyDTA,
     131                      incidentParticle, targetParticle,
     132                      atomicWeight, atomicNumber);
     133  if (!successful)
     134    HighEnergyClusterProduction(successful, pv, vecLength,
     135                                excitationEnergyGNP, excitationEnergyDTA,
     136                                incidentParticle, targetParticle,
     137                                atomicWeight, atomicNumber);
     138  if (!successful)
     139    MediumEnergyCascading(successful, pv, vecLength,
     140                          excitationEnergyGNP, excitationEnergyDTA,
     141                          incidentParticle, targetParticle,
     142                          atomicWeight, atomicNumber);
     143
     144  if (!successful)
     145    MediumEnergyClusterProduction(successful, pv, vecLength,
     146                                  excitationEnergyGNP, excitationEnergyDTA,       
     147                                  incidentParticle, targetParticle,
     148                                  atomicWeight, atomicNumber);
     149  if (!successful)
     150    QuasiElasticScattering(successful, pv, vecLength,
     151                           excitationEnergyGNP, excitationEnergyDTA,
     152                           incidentParticle, targetParticle,
     153                           atomicWeight, atomicNumber);
     154  if (!successful)
     155    ElasticScattering(successful, pv, vecLength,
     156                      incidentParticle,   
     157                      atomicWeight, atomicNumber);
     158
     159  if (!successful)
     160    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     161           << G4endl;
     162
     163  FillParticleChange(pv,  vecLength);
     164  delete [] pv;
     165  theParticleChange.SetStatusChange(stopAndKill);
     166  return &theParticleChange;
     167}
     168
    190169
    191170void
    192 G4HEAntiSigmaPlusInelastic::FirstIntInCasAntiSigmaPlus( G4bool &inElastic,
    193                                                         const G4double availableEnergy,
    194                                                         G4HEVector pv[],
    195                                                         G4int &vecLen,
    196                                                         G4HEVector incidentParticle,
    197                                                         G4HEVector targetParticle,
    198                                                         const G4double atomicWeight)
     171G4HEAntiSigmaPlusInelastic::FirstIntInCasAntiSigmaPlus(G4bool& inElastic,
     172                                                       const G4double availableEnergy,
     173                                                       G4HEVector pv[],
     174                                                       G4int& vecLen,
     175                                                       const G4HEVector& incidentParticle,
     176                                                       const G4HEVector& targetParticle,
     177                                                       const G4double atomicWeight)
    199178
    200179// AntiSigma+ undergoes interaction with nucleon within a nucleus.  Check if it is
     
    205184// protons/neutrons by kaons or strange baryons according to the average
    206185// multiplicity per inelastic reaction.
    207 
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220 //   G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     186{
     187  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     188  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     189
     190  static const G4double protb = 0.7;
     191  static const G4double neutb = 0.7;
     192  static const G4double     c = 1.25;
     193
     194  static const G4int numMul   = 1200;
     195  static const G4int numMulAn = 400;
     196  static const G4int numSec   = 60;
     197
     198  G4int protonCode  = Proton.getCode();
     199
     200  G4int targetCode = targetParticle.getCode();
     201  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     202
     203  static G4bool first = true;
     204  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     205  static G4double protmulAn[numMulAn],protnormAn[numSec];
     206  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     207  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     208
     209  //  misc. local variables
     210  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    238213
    239214   if( first )
    240      {                         // compute normalization constants, this will only be done once
     215     {         // compute normalization constants, this will only be done once
    241216       first = false;
    242217       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiSigmaZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiSigmaZeroInelastic.cc,v 1.10 2006/06/29 20:30:08 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiSigmaZeroInelastic.cc,v 1.11 2010/11/20 04:01:33 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model.  Not included is the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4643#include "G4Gamma.hh"
    4744
    48 G4HadFinalState *  G4HEAntiSigmaZeroInelastic::
    49 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    50   {
    51     G4HEVector * pv = new G4HEVector[MAXPART];
    52     const G4HadProjectile *aParticle = &aTrack;
    53     G4HEVector incidentParticle(aParticle);
    54     G4HEAntiLambdaInelastic theAntiLambdaInelastic;
    55     theAntiLambdaInelastic.SetMaxNumberOfSecondaries(MAXPART);
    56     theAntiLambdaInelastic.SetVerboseLevel(verboseLevel);
     45G4HadFinalState*
     46G4HEAntiSigmaZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     47                                          G4Nucleus& targetNucleus)
     48{
     49  G4HEVector* pv = new G4HEVector[MAXPART];
     50  const G4HadProjectile *aParticle = &aTrack;
     51  G4HEVector incidentParticle(aParticle);
     52  G4HEAntiLambdaInelastic theAntiLambdaInelastic;
     53  theAntiLambdaInelastic.SetMaxNumberOfSecondaries(MAXPART);
     54  theAntiLambdaInelastic.SetVerboseLevel(verboseLevel);
    5755   
    58     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    59     G4double pgam = G4UniformRand()*incidentTotalMomentum*0.75;
    60     G4HEVector incidentAntiLambda;
    61     incidentAntiLambda.SmulAndUpdate( incidentParticle,
    62                                      (incidentTotalMomentum - pgam)/incidentTotalMomentum);                   
    63     G4DynamicParticle * aLambda = new G4DynamicParticle();
    64     aLambda->SetDefinition(G4AntiLambda::AntiLambda());
    65     aLambda->SetMomentum(incidentAntiLambda.getMomentum());
    66     G4HadProjectile aLambdaTrack(*aLambda);
    67     G4HadFinalState * result = theAntiLambdaInelastic.ApplyYourself(aLambdaTrack, targetNucleus);               
    68     vecLength = theAntiLambdaInelastic.GetNumberOfSecondaries();
    69     pv[vecLength] = Gamma;
    70     pv[vecLength].setMomentum(incidentParticle.getMomentum());
    71     pv[vecLength].SmulAndUpdate( pv[vecLength],pgam/incidentTotalMomentum);
    72     G4DynamicParticle * aPhoton = new G4DynamicParticle();
    73     aPhoton->SetDefinition(G4Gamma::Gamma());
    74     aPhoton->SetMomentum(pv[vecLength].getMomentum());
    75     result->AddSecondary(aPhoton);
    76       delete [] pv;
    77     return result;
    78   }
    79        
     56  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     57  G4double pgam = G4UniformRand()*incidentTotalMomentum*0.75;
     58  G4HEVector incidentAntiLambda;
     59  incidentAntiLambda.SmulAndUpdate(incidentParticle,
     60                                   (incidentTotalMomentum - pgam)/incidentTotalMomentum);                   
     61  G4DynamicParticle* aLambda = new G4DynamicParticle();
     62  aLambda->SetDefinition(G4AntiLambda::AntiLambda());
     63  aLambda->SetMomentum(incidentAntiLambda.getMomentum());
     64  G4HadProjectile aLambdaTrack(*aLambda);
     65  G4HadFinalState* result = theAntiLambdaInelastic.ApplyYourself(aLambdaTrack, targetNucleus);         
     66  vecLength = theAntiLambdaInelastic.GetNumberOfSecondaries();
     67  pv[vecLength] = Gamma;
     68  pv[vecLength].setMomentum(incidentParticle.getMomentum());
     69  pv[vecLength].SmulAndUpdate( pv[vecLength],pgam/incidentTotalMomentum);
     70  G4DynamicParticle * aPhoton = new G4DynamicParticle();
     71  aPhoton->SetDefinition(G4Gamma::Gamma());
     72  aPhoton->SetMomentum(pv[vecLength].getMomentum());
     73  result->AddSecondary(aPhoton);
     74  delete [] pv;
     75  return result;
     76}
    8077
    81 
    82 
    83 
    84 
    85 
    86 
    87 
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiXiMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiXiMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiXiMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiXiMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiXiMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEAntiXiMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                        G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEAntiXiMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEAntiXiMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEAntiXiMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEAntiXiMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    97            << excitationEnergyDTA << G4endl;             
    98 
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     92           << excitationEnergyDTA << G4endl;
     93
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasAntiXiMinus(inElastic, availableEnergy, pv, vecLength,
    141                                  incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles";
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasAntiXiMinus(inElastic, availableEnergy, pv, vecLength,
     122                           incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131  HighEnergyCascading(successful, pv, vecLength,
     132                      excitationEnergyGNP, excitationEnergyDTA,
     133                      incidentParticle, targetParticle,
     134                      atomicWeight, atomicNumber);
     135  if (!successful)
     136    HighEnergyClusterProduction(successful, pv, vecLength,
     137                                excitationEnergyGNP, excitationEnergyDTA,
     138                                incidentParticle, targetParticle,
     139                                atomicWeight, atomicNumber);
     140  if (!successful)
     141    MediumEnergyCascading(successful, pv, vecLength,
     142                          excitationEnergyGNP, excitationEnergyDTA,
     143                          incidentParticle, targetParticle,
     144                          atomicWeight, atomicNumber);
     145
     146  if (!successful)
     147    MediumEnergyClusterProduction(successful, pv, vecLength,
     148                                  excitationEnergyGNP, excitationEnergyDTA,       
     149                                  incidentParticle, targetParticle,
     150                                  atomicWeight, atomicNumber);
     151  if (!successful)
     152    QuasiElasticScattering(successful, pv, vecLength,
     153                           excitationEnergyGNP, excitationEnergyDTA,
     154                           incidentParticle, targetParticle,
     155                           atomicWeight, atomicNumber);
     156  if (!successful)
     157    ElasticScattering(successful, pv, vecLength,
     158                      incidentParticle,   
     159                      atomicWeight, atomicNumber);
     160
     161  if (!successful)
     162    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     163           << G4endl;
     164
     165  FillParticleChange(pv, vecLength);
     166  delete [] pv;
     167  theParticleChange.SetStatusChange(stopAndKill);
     168  return &theParticleChange;
     169}
     170
    193171
    194172void
    195 G4HEAntiXiMinusInelastic::FirstIntInCasAntiXiMinus( G4bool &inElastic,
    196                                                     const G4double availableEnergy,
    197                                                     G4HEVector pv[],
    198                                                     G4int &vecLen,
    199                                                     G4HEVector incidentParticle,
    200                                                     G4HEVector targetParticle,
    201                                                     const G4double atomicWeight)
     173G4HEAntiXiMinusInelastic::FirstIntInCasAntiXiMinus(G4bool& inElastic,
     174                                                   const G4double availableEnergy,
     175                                                   G4HEVector pv[],
     176                                                   G4int& vecLen,
     177                                                   const G4HEVector& incidentParticle,
     178                                                   const G4HEVector& targetParticle,
     179                                                   const G4double atomicWeight)
    202180
    203181// AntiXi- undergoes interaction with nucleon within a nucleus. 
    204182// As in Geant3, we think that this routine has absolutely no influence
    205183// on the whole performance of the program. Take AntiLambda instaed.
    206 
    207  {
    208    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    209    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    210 
    211    static const G4double protb = 0.7;
    212    static const G4double neutb = 0.7;
    213    static const G4double     c = 1.25;
    214 
    215    static const G4int   numMul   = 1200;
    216    static const G4int   numMulAn = 400;
    217    static const G4int   numSec   = 60;
    218 
    219 //   G4int              neutronCode = Neutron.getCode();
    220    G4int              protonCode  = Proton.getCode();
    221 
    222    G4int               targetCode = targetParticle.getCode();
    223 //   G4double          incidentMass = incidentParticle.getMass();
    224 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    225    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    226 
    227    static G4bool first = true;
    228    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    229    static G4double protmulAn[numMulAn],protnormAn[numSec];
    230    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    231    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    232 
    233                               //  misc. local variables
    234                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    235 
    236    G4int i, counter, nt, np, nm, nz;
     184{
     185  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     186  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     187
     188  static const G4double protb = 0.7;
     189  static const G4double neutb = 0.7;
     190  static const G4double     c = 1.25;
     191
     192  static const G4int numMul   = 1200;
     193  static const G4int numMulAn = 400;
     194  static const G4int numSec   = 60;
     195
     196  G4int protonCode = Proton.getCode();
     197
     198  G4int targetCode = targetParticle.getCode();
     199  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     200
     201  static G4bool first = true;
     202  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     203  static G4double protmulAn[numMulAn],protnormAn[numSec];
     204  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     205  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     206
     207  //  misc. local variables
     208  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     209
     210  G4int i, counter, nt, np, nm, nz;
    237211
    238212   if( first )
    239      {                         // compute normalization constants, this will only be done once
     213     {           // compute normalization constants, this will only be done once
    240214       first = false;
    241215       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiXiZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEAntiXiZeroInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEAntiXiZeroInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEAntiXiZeroInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEAntiXiZeroInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEAntiXiZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                       G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEAntiXiZeroInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEAntiXiZeroInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEAntiXiZeroInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEAntiXiZeroInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8075   
    81     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt((incidentTotalEnergy-incidentMass)                   
     97                                   *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;           
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasAntiXiZero(inElastic, availableEnergy, pv, vecLength,
    141                                 incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151 
    152             HighEnergyCascading( successful, pv, vecLength,
    153                                  excitationEnergyGNP, excitationEnergyDTA,
    154                                  incidentParticle, targetParticle,
    155                                  atomicWeight, atomicNumber);
    156         if (!successful)
    157             HighEnergyClusterProduction( successful, pv, vecLength,
    158                                          excitationEnergyGNP, excitationEnergyDTA,
    159                                          incidentParticle, targetParticle,
    160                                          atomicWeight, atomicNumber);
    161         if (!successful)
    162             MediumEnergyCascading( successful, pv, vecLength,
    163                                    excitationEnergyGNP, excitationEnergyDTA,
    164                                    incidentParticle, targetParticle,
    165                                    atomicWeight, atomicNumber);
    166 
    167         if (!successful)
    168             MediumEnergyClusterProduction( successful, pv, vecLength,
    169                                            excitationEnergyGNP, excitationEnergyDTA,       
    170                                            incidentParticle, targetParticle,
    171                                            atomicWeight, atomicNumber);
    172         if (!successful)
    173             QuasiElasticScattering( successful, pv, vecLength,
    174                                     excitationEnergyGNP, excitationEnergyDTA,
    175                                     incidentParticle, targetParticle,
    176                                     atomicWeight, atomicNumber);
    177       }
    178     if (!successful)
    179       {
    180             ElasticScattering( successful, pv, vecLength,
    181                                incidentParticle,   
    182                                atomicWeight, atomicNumber);
    183       }
    184 
    185     if (!successful)
    186       {
    187         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    188       }
    189       FillParticleChange(pv,  vecLength);
    190       delete [] pv;
    191       theParticleChange.SetStatusChange(stopAndKill);
    192       return & theParticleChange;
    193   }
     121  FirstIntInCasAntiXiZero(inElastic, availableEnergy, pv, vecLength,
     122                          incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161  if (!successful)
     162    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     163           << G4endl;
     164
     165  FillParticleChange(pv, vecLength);
     166  delete [] pv;
     167  theParticleChange.SetStatusChange(stopAndKill);
     168  return &theParticleChange;
     169}
     170
    194171
    195172void
    196 G4HEAntiXiZeroInelastic::FirstIntInCasAntiXiZero( G4bool &inElastic,
    197                                                   const G4double availableEnergy,
    198                                                   G4HEVector pv[],
    199                                                   G4int &vecLen,
    200                                                   G4HEVector incidentParticle,
    201                                                   G4HEVector targetParticle,
    202                                                   const G4double atomicWeight)
     173G4HEAntiXiZeroInelastic::FirstIntInCasAntiXiZero(G4bool& inElastic,
     174                                                 const G4double availableEnergy,
     175                                                 G4HEVector pv[],
     176                                                 G4int& vecLen,
     177                                                 const G4HEVector& incidentParticle,
     178                                                 const G4HEVector& targetParticle,
     179                                                 const G4double atomicWeight)
    203180
    204181// AntiXi0 undergoes interaction with nucleon within a nucleus. 
     
    206183// on the whole performance of the program. Take AntiLambda instaed.
    207184// ( decay Xi0 -> L Pi > 99 % )
    208  {
    209    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    210    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    211 
    212    static const G4double protb = 0.7;
    213    static const G4double neutb = 0.7;
    214    static const G4double     c = 1.25;
    215 
    216    static const G4int   numMul   = 1200;
    217    static const G4int   numMulAn = 400;
    218    static const G4int   numSec   = 60;
    219 
    220 //   G4int              neutronCode = Neutron.getCode();
    221    G4int              protonCode  = Proton.getCode();
    222 
    223    G4int               targetCode = targetParticle.getCode();
    224 //   G4double          incidentMass = incidentParticle.getMass();
    225 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    226    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    227 
    228    static G4bool first = true;
    229    static G4double protmul[numMul],  protnorm[numSec];   // proton constants
    230    static G4double protmulAn[numMulAn],protnormAn[numSec];
    231    static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
    232    static G4double neutmulAn[numMulAn],neutnormAn[numSec];
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     185{
     186  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     187  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     188
     189  static const G4double protb = 0.7;
     190  static const G4double neutb = 0.7;
     191  static const G4double     c = 1.25;
     192
     193  static const G4int numMul   = 1200;
     194  static const G4int numMulAn = 400;
     195  static const G4int numSec   = 60;
     196
     197  G4int protonCode  = Proton.getCode();
     198
     199  G4int targetCode = targetParticle.getCode();
     200  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     201
     202  static G4bool first = true;
     203  static G4double protmul[numMul],  protnorm[numSec];   // proton constants
     204  static G4double protmulAn[numMulAn],protnormAn[numSec];
     205  static G4double neutmul[numMul],  neutnorm[numSec];   // neutron constants
     206  static G4double neutmulAn[numMulAn],neutnormAn[numSec];
     207
     208  //  misc. local variables
     209  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     210
     211  G4int i, counter, nt, np, nm, nz;
    238212
    239213   if( first )
    240      {                         // compute normalization constants, this will only be done once
     214     {           // compute normalization constants, this will only be done once
    241215       first = false;
    242216       for( i=0; i<numMul  ; i++ ) protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEInelastic.cc

    r962 r1347  
    2525//
    2626//
    27 //
    2827
    2928#include "globals.hh"
     
    5554#include "G4Alpha.hh"
    5655
    57 void  G4HEInelastic::FillParticleChange(G4HEVector pv[], G4int aVecLength)
     56void G4HEInelastic::FillParticleChange(G4HEVector pv[], G4int aVecLength)
    5857{
    5958  theParticleChange.Clear();
     
    7776    aParticle->SetMomentum(pv[i].getMomentum()*GeV);
    7877    theParticleChange.AddSecondary(aParticle);
    79     G4ParticleDefinition * dummy = G4KaonZero::KaonZero();
    80     dummy = G4AntiKaonZero::AntiKaonZero();
    8178  }
    8279}
    8380
    84 void
    85 G4HEInelastic::SetParticles()
    86   {
    87     PionPlus.setDefinition("PionPlus");
    88     PionZero.setDefinition("PionZero");
    89     PionMinus.setDefinition("PionMinus");
    90     KaonPlus.setDefinition("KaonPlus");
    91     KaonZero.setDefinition("KaonZero");
    92     AntiKaonZero.setDefinition("AntiKaonZero");
    93     KaonMinus.setDefinition("KaonMinus");
    94     KaonZeroShort.setDefinition("KaonZeroShort");
    95     KaonZeroLong.setDefinition("KaonZeroLong");
    96     Proton.setDefinition("Proton");
    97     AntiProton.setDefinition("AntiProton");
    98     Neutron.setDefinition("Neutron");
    99     AntiNeutron.setDefinition("AntiNeutron");
    100     Lambda.setDefinition("Lambda");
    101     AntiLambda.setDefinition("AntiLambda");
    102     SigmaPlus.setDefinition("SigmaPlus");
    103     SigmaZero.setDefinition("SigmaZero");
    104     SigmaMinus.setDefinition("SigmaMinus");
    105     AntiSigmaPlus.setDefinition("AntiSigmaPlus");
    106     AntiSigmaZero.setDefinition("AntiSigmaZero");
    107     AntiSigmaMinus.setDefinition("AntiSigmaMinus");
    108     XiZero.setDefinition("XiZero");
    109     XiMinus.setDefinition("XiMinus");
    110     AntiXiZero.setDefinition("AntiXiZero");
    111     AntiXiMinus.setDefinition("AntiXiMinus");
    112     OmegaMinus.setDefinition("OmegaMinus");
    113     AntiOmegaMinus.setDefinition("AntiOmegaMinus");
    114     Deuteron.setDefinition("Deuteron");
    115     Triton.setDefinition("Triton");
    116     Alpha.setDefinition("Alpha");
    117     Gamma.setDefinition("Gamma");
    118     return;
    119   }
     81void G4HEInelastic::SetParticles()
     82{
     83  PionPlus.setDefinition("PionPlus");
     84  PionZero.setDefinition("PionZero");
     85  PionMinus.setDefinition("PionMinus");
     86  KaonPlus.setDefinition("KaonPlus");
     87  KaonZero.setDefinition("KaonZero");
     88  AntiKaonZero.setDefinition("AntiKaonZero");
     89  KaonMinus.setDefinition("KaonMinus");
     90  KaonZeroShort.setDefinition("KaonZeroShort");
     91  KaonZeroLong.setDefinition("KaonZeroLong");
     92  Proton.setDefinition("Proton");
     93  AntiProton.setDefinition("AntiProton");
     94  Neutron.setDefinition("Neutron");
     95  AntiNeutron.setDefinition("AntiNeutron");
     96  Lambda.setDefinition("Lambda");
     97  AntiLambda.setDefinition("AntiLambda");
     98  SigmaPlus.setDefinition("SigmaPlus");
     99  SigmaZero.setDefinition("SigmaZero");
     100  SigmaMinus.setDefinition("SigmaMinus");
     101  AntiSigmaPlus.setDefinition("AntiSigmaPlus");
     102  AntiSigmaZero.setDefinition("AntiSigmaZero");
     103  AntiSigmaMinus.setDefinition("AntiSigmaMinus");
     104  XiZero.setDefinition("XiZero");
     105  XiMinus.setDefinition("XiMinus");
     106  AntiXiZero.setDefinition("AntiXiZero");
     107  AntiXiMinus.setDefinition("AntiXiMinus");
     108  OmegaMinus.setDefinition("OmegaMinus");
     109  AntiOmegaMinus.setDefinition("AntiOmegaMinus");
     110  Deuteron.setDefinition("Deuteron");
     111  Triton.setDefinition("Triton");
     112  Alpha.setDefinition("Alpha");
     113  Gamma.setDefinition("Gamma");
     114  return;
     115}
    120116 
    121 G4double
    122 G4HEInelastic::Amin(G4double a, G4double b)
    123   {
    124     G4double c = a;
    125     if(b < a) c = b;
    126     return c;
    127   }
    128 G4double
    129 G4HEInelastic::Amax(G4double a, G4double b)
    130   {
    131     G4double c = a;
    132     if(b > a) c = b;
    133     return c;
    134   }
     117G4double G4HEInelastic::Amin(G4double a, G4double b)
     118{
     119  G4double c = a;
     120  if(b < a) c = b;
     121  return c;
     122}
     123
     124G4double G4HEInelastic::Amax(G4double a, G4double b)
     125{
     126  G4double c = a;
     127  if(b > a) c = b;
     128  return c;
     129}
     130 
    135131G4int
    136132G4HEInelastic::Imin(G4int a, G4int b)
     
    338334                       G4HEVector pv[],
    339335                       G4int &vecLen,
    340                        G4HEVector incidentParticle,
    341                        G4HEVector targetParticle )
     336                       const G4HEVector& incidentParticle,
     337                       const G4HEVector& targetParticle)
    342338
    343339   // Choose charge combinations K+ K-, K+ K0, K0 K0, K0 K-,
     
    602598
    603599void
    604 G4HEInelastic::HighEnergyCascading(G4bool &successful,
     600G4HEInelastic::HighEnergyCascading(G4bool& successful,
    605601                                   G4HEVector pv[],
    606                                    G4int &vecLen,       
    607                                    G4double &excitationEnergyGNP,
    608                                    G4double &excitationEnergyDTA,
    609                                    G4HEVector incidentParticle,
    610                                    G4HEVector targetParticle,
     602                                   G4int& vecLen,       
     603                                   G4double& excitationEnergyGNP,
     604                                   G4double& excitationEnergyDTA,
     605                                   const G4HEVector& incidentParticle,
     606                                   const G4HEVector& targetParticle,
    611607                                   G4double atomicWeight,
    612608                                   G4double atomicNumber)
    613  {   
    614 //
    615 //  The multiplicity of particles produced in the first interaction has been
    616 //  calculated in one of the FirstIntInNuc.... routines. The nuclear
    617 //  cascading particles are parameterized from experimental data.
    618 //  A simple single variable description E D3S/DP3= F(Q) with
    619 //  Q^2 = (M*X)^2 + PT^2 is used. Final state kinematics are produced
    620 //  by an FF-type iterative cascade method.
    621 //  Nuclear evaporation particles are added at the end of the routine.
    622 
    623 //  All quantities in the G4HEVector Array pv are in GeV- units.
    624 //  The method is a copy of MediumEnergyCascading with some special tuning
    625 //  for high energy interactions.
    626 
    627 
    628    G4int protonCode       = Proton.getCode();
    629    G4double protonMass    = Proton.getMass();
    630    G4int neutronCode      = Neutron.getCode();
    631    G4double neutronMass   = Neutron.getMass();
    632    G4double kaonPlusMass  = KaonPlus.getMass();
    633    G4int kaonPlusCode     = KaonPlus.getCode();   
    634    G4int kaonMinusCode    = KaonMinus.getCode();
    635    G4int kaonZeroSCode    = KaonZeroShort.getCode();
    636    G4int kaonZeroLCode    = KaonZeroLong.getCode();
    637    G4int kaonZeroCode     = KaonZero.getCode();
    638    G4int antiKaonZeroCode = AntiKaonZero.getCode();
    639    G4int pionPlusCode     = PionPlus.getCode();   
    640    G4int pionZeroCode     = PionZero.getCode();   
    641    G4int pionMinusCode    = PionMinus.getCode();
    642    G4String mesonType     = PionPlus.getType();
    643    G4String baryonType    = Proton.getType();
    644    G4String antiBaryonType= AntiProton.getType();
    645 
    646    G4double targetMass   = targetParticle.getMass();
    647 
    648    G4int    incidentCode          = incidentParticle.getCode();
    649    G4double incidentMass          = incidentParticle.getMass();
    650    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    651    G4double incidentEnergy        = incidentParticle.getEnergy();
    652    G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    653    G4String incidentType          = incidentParticle.getType();
     609{   
     610  //  The multiplicity of particles produced in the first interaction has been
     611  //  calculated in one of the FirstIntInNuc.... routines. The nuclear
     612  //  cascading particles are parameterized from experimental data.
     613  //  A simple single variable description E D3S/DP3= F(Q) with
     614  //  Q^2 = (M*X)^2 + PT^2 is used. Final state kinematics are produced
     615  //  by an FF-type iterative cascade method.
     616  //  Nuclear evaporation particles are added at the end of the routine.
     617
     618  //  All quantities in the G4HEVector Array pv are in GeV- units.
     619  //  The method is a copy of MediumEnergyCascading with some special tuning
     620  //  for high energy interactions.
     621
     622  G4int protonCode = Proton.getCode();
     623  G4double protonMass = Proton.getMass();
     624  G4int neutronCode = Neutron.getCode();
     625  G4double neutronMass = Neutron.getMass();
     626  G4double kaonPlusMass = KaonPlus.getMass();
     627  G4int kaonPlusCode = KaonPlus.getCode();   
     628  G4int kaonMinusCode = KaonMinus.getCode();
     629  G4int kaonZeroSCode = KaonZeroShort.getCode();
     630  G4int kaonZeroLCode = KaonZeroLong.getCode();
     631  G4int kaonZeroCode = KaonZero.getCode();
     632  G4int antiKaonZeroCode = AntiKaonZero.getCode();
     633  G4int pionPlusCode = PionPlus.getCode();   
     634  G4int pionZeroCode = PionZero.getCode();   
     635  G4int pionMinusCode = PionMinus.getCode();
     636  G4String mesonType = PionPlus.getType();
     637  G4String baryonType = Proton.getType();
     638  G4String antiBaryonType = AntiProton.getType();
     639
     640  G4double targetMass = targetParticle.getMass();
     641
     642  G4int incidentCode = incidentParticle.getCode();
     643  G4double incidentMass = incidentParticle.getMass();
     644  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     645  G4double incidentEnergy = incidentParticle.getEnergy();
     646  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     647  G4String incidentType = incidentParticle.getType();
    654648//   G4double incidentTOF           = incidentParticle.getTOF();   
    655    G4double incidentTOF          = 0.;
    656    
    657      // some local variables
    658 
    659    G4int i, j, l;
    660 
    661    if (verboseLevel > 1)
    662             G4cout << " G4HEInelastic::HighEnergyCascading " << G4endl;
    663    successful = false;
    664    if(incidentTotalMomentum < 25. + G4UniformRand()*25.) return;
     649  G4double incidentTOF = 0.;
     650   
     651  // some local variables
     652
     653  G4int i, j, l;
     654
     655  if (verboseLevel > 1) G4cout << " G4HEInelastic::HighEnergyCascading "
     656                              << G4endl;
     657  successful = false;
     658  if (incidentTotalMomentum < 25. + G4UniformRand()*25.) return;
    665659 
    666      // define annihilation channels.
     660  // define annihilation channels.
    667661                                 
    668    G4bool annihilation = false;
    669    if (incidentCode < 0 && incidentType == antiBaryonType &&
    670        pv[0].getType() != antiBaryonType &&
    671        pv[1].getType() != antiBaryonType   )
    672          {
    673            annihilation = true;
    674          }   
    675      
    676 
    677 
    678    G4double twsup[] = { 1., 1., 0.7, 0.5, 0.3, 0.2, 0.1, 0.0 };
    679 
    680    if( annihilation ) goto start;
    681    if( vecLen >= 8)   goto start;
    682    if( incidentKineticEnergy < 1.) return;
    683    if(   (   incidentCode == kaonPlusCode  || incidentCode == kaonMinusCode
    684           || incidentCode == kaonZeroCode  || incidentCode == antiKaonZeroCode
    685           || incidentCode == kaonZeroSCode || incidentCode == kaonZeroLCode )
    686       && (   G4UniformRand() < 0.5) ) goto start;
    687    if( G4UniformRand() > twsup[vecLen-1]) goto start;
    688    if( incidentKineticEnergy > (G4UniformRand()*200 + 50.) ) goto start;
    689    return;
    690    
    691    start:
    692 
    693    if (annihilation)
    694       {                  // do some corrections of incident particle kinematic
    695         G4double ekcor = Amax( 1., 1./incidentKineticEnergy);
    696         incidentKineticEnergy = 2*targetMass + incidentKineticEnergy*(1.+ekcor/atomicWeight);
    697         G4double excitation = NuclearExcitation(incidentKineticEnergy,
    698                                                 atomicWeight,
    699                                                 atomicNumber,
    700                                                 excitationEnergyGNP,
    701                                                 excitationEnergyDTA);
    702         incidentKineticEnergy -= excitation;
    703         if (incidentKineticEnergy < excitationEnergyDTA) incidentKineticEnergy = 0.;
    704         incidentEnergy = incidentKineticEnergy + incidentMass;
    705         incidentTotalMomentum =
    706                  std::sqrt( Amax(0., incidentEnergy*incidentEnergy - incidentMass*incidentMass));
    707       } 
     662  G4bool annihilation = false;
     663  if (incidentCode < 0 && incidentType == antiBaryonType &&
     664      pv[0].getType() != antiBaryonType &&
     665      pv[1].getType() != antiBaryonType) {
     666    annihilation = true;
     667  }   
     668
     669  G4double twsup[] = { 1., 1., 0.7, 0.5, 0.3, 0.2, 0.1, 0.0 };
     670
     671  if (annihilation) goto start;
     672  if (vecLen >= 8)   goto start;
     673  if( incidentKineticEnergy < 1.) return;
     674  if(   (   incidentCode == kaonPlusCode  || incidentCode == kaonMinusCode
     675         || incidentCode == kaonZeroCode  || incidentCode == antiKaonZeroCode
     676         || incidentCode == kaonZeroSCode || incidentCode == kaonZeroLCode )
     677     && (   G4UniformRand() < 0.5) ) goto start;
     678  if( G4UniformRand() > twsup[vecLen-1]) goto start;
     679  if( incidentKineticEnergy > (G4UniformRand()*200 + 50.) ) goto start;
     680  return;
     681   
     682  start:
     683
     684  if (annihilation) {
     685    // do some corrections of incident particle kinematic
     686    G4double ekcor = Amax( 1., 1./incidentKineticEnergy);
     687    incidentKineticEnergy = 2*targetMass + incidentKineticEnergy*(1.+ekcor/atomicWeight);
     688    G4double excitation = NuclearExcitation(incidentKineticEnergy,
     689                                            atomicWeight,
     690                                            atomicNumber,
     691                                            excitationEnergyGNP,
     692                                            excitationEnergyDTA);
     693    incidentKineticEnergy -= excitation;
     694    if (incidentKineticEnergy < excitationEnergyDTA) incidentKineticEnergy = 0.;
     695    incidentEnergy = incidentKineticEnergy + incidentMass;
     696    incidentTotalMomentum =
     697         std::sqrt( Amax(0., incidentEnergy*incidentEnergy - incidentMass*incidentMass));
     698  }
    708699   
    709    G4HEVector pTemp;
    710    for (i = 2; i<vecLen; i++)
    711      {
    712        j = Imin( vecLen-1, (G4int)(2. + G4UniformRand()*(vecLen - 2)));
    713        pTemp = pv[j];
    714        pv[j] = pv[i];
    715        pv[i] = pTemp;
    716      }                         
    717          // randomize the first two leading particles
    718          // for kaon induced reactions only
    719          // (need from experimental data)
     700  G4HEVector pTemp;
     701  for (i = 2; i < vecLen; i++) {
     702    j = Imin( vecLen-1, (G4int)(2. + G4UniformRand()*(vecLen - 2)));
     703    pTemp = pv[j];
     704    pv[j] = pv[i];
     705    pv[i] = pTemp;
     706  }
     707  // randomize the first two leading particles
     708  // for kaon induced reactions only
     709  // (need from experimental data)
    720710
    721711   if(   (incidentCode==kaonPlusCode  || incidentCode==kaonMinusCode    ||
     
    760750         }
    761751
    762      // Distribute particles in forward and backward hemispheres in center
    763      // of mass system.  Incident particle goes in forward hemisphere.
    764    
    765    G4HEVector pvI = incidentParticle;  // for the incident particle
    766    pvI.setSide( 1 );
    767 
    768    G4HEVector pvT = targetParticle;   // for the target particle
    769    pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    770    pvT.setSide( -1 );
    771    pvT.setTOF( -1.);
    772 
    773 
    774    G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass)+sqr(targetMass)
     752  // Distribute particles in forward and backward hemispheres in center
     753  // of mass system.  Incident particle goes in forward hemisphere.
     754   
     755  G4HEVector pvI = incidentParticle;  // for the incident particle
     756  pvI.setSide( 1 );
     757
     758  G4HEVector pvT = targetParticle;   // for the target particle
     759  pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     760  pvT.setSide( -1 );
     761  pvT.setTOF( -1.);
     762
     763  G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass)+sqr(targetMass)
    775764                                      +2.0*targetMass*incidentEnergy );
    776 //   G4double availableEnergy    = centerOfMassEnergy - ( targetMass + incidentMass );
    777 
    778    G4double tavai1      = centerOfMassEnergy/2.0 - incidentMass;
    779    G4double tavai2      = centerOfMassEnergy/2.0 - targetMass;           
    780    
    781     // define G4HEVector- array for kinematic manipulations,
    782     // with a one by one correspondence to the pv-Array.
    783    
    784    G4int ntb = 1;
    785    for( i=0; i < vecLen; i++ )
    786       {
    787         if      (i == 0) pv[i].setSide(  1 );
    788         else if (i == 1) pv[i].setSide( -1 );
    789         else 
    790            { if( G4UniformRand() < 0.5 )
    791                {
    792                  pv[i].setSide( -1 );
    793                  ntb++;
    794                 }
    795              else
    796                  pv[i].setSide( 1 );
    797            }
    798         pv[i].setTOF(    incidentTOF);
    799       }
    800    G4double tb = 2. * ntb;
    801    if (centerOfMassEnergy < (2. + G4UniformRand()))
    802        tb = (2. * ntb + vecLen)/2.;     
    803 
    804    if (verboseLevel > 1)
    805       { G4cout << " pv Vector after Randomization " << vecLen << G4endl;
    806         pvI.Print(-1);
    807         pvT.Print(-1);
    808         for (i=0; i < vecLen ; i++) pv[i].Print(i);
    809       }
    810 
    811     // Add particles from intranuclear cascade
    812     // nuclearCascadeCount = number of new secondaries produced by nuclear
    813     // cascading.
    814     // extraCount = number of nucleons within these new secondaries
     765//  G4double availableEnergy    = centerOfMassEnergy - ( targetMass + incidentMass );
     766
     767  G4double tavai1 = centerOfMassEnergy/2.0 - incidentMass;
     768  G4double tavai2 = centerOfMassEnergy/2.0 - targetMass;           
     769   
     770  // define G4HEVector- array for kinematic manipulations,
     771  // with a one by one correspondence to the pv-Array.
     772   
     773  G4int ntb = 1;
     774  for (i = 0; i < vecLen; i++) {
     775    if (i == 0) pv[i].setSide(1);
     776    else if (i == 1) pv[i].setSide(-1);
     777    else {
     778      if (G4UniformRand() < 0.5) {
     779        pv[i].setSide(-1);
     780        ntb++;
     781      } else {
     782        pv[i].setSide(1);
     783      }
     784    }
     785    pv[i].setTOF(incidentTOF);
     786  }
     787
     788  G4double tb = 2. * ntb;
     789  if (centerOfMassEnergy < (2. + G4UniformRand()))
     790    tb = (2. * ntb + vecLen)/2.;     
     791
     792  if (verboseLevel > 1) {
     793    G4cout << " pv Vector after Randomization " << vecLen << G4endl;
     794    pvI.Print(-1);
     795    pvT.Print(-1);
     796    for (i = 0; i < vecLen; i++) pv[i].Print(i);
     797  }
     798
     799  // Add particles from intranuclear cascade
     800  // nuclearCascadeCount = number of new secondaries produced by nuclear
     801  // cascading.
     802  // extraCount = number of nucleons within these new secondaries
    815803
    816804   G4double s, xtarg, ran;
     
    928916     }
    929917                                         
    930      //  assume conservation of kinetic energy
    931      //  in forward & backward hemispheres
    932 
    933    G4int is, iskip, iavai1;
    934    if(vecLen <= 1) return;
    935 
    936    tavai1 = centerOfMassEnergy/2.;
    937    iavai1 = 0;
     918  //  assume conservation of kinetic energy
     919  //  in forward & backward hemispheres
     920
     921  G4int is, iskip, iavai1;
     922  if (vecLen <= 1) return;
     923
     924  tavai1 = centerOfMassEnergy/2.;
     925  iavai1 = 0;
    938926 
    939    for (i = 0; i < vecLen; i++)
     927  for (i = 0; i < vecLen; i++)
    940928       {
    941929         if (pv[i].getSide() > 0)
     
    945933            }   
    946934       }
    947    if ( iavai1 == 0) return;
    948 
    949    while( tavai1 <= 0.0 )
    950         {                   // must eliminate a particle from the forward side
    951            iskip = G4int(G4UniformRand()*iavai1) + 1;
    952            is = 0; 
    953            for( i=vecLen-1; i>=0; i-- )
    954               {
    955                 if( pv[i].getSide() > 0 )
    956                   {
    957                     if (++is == iskip)
    958                         {
    959                            tavai1 += pv[i].getMass();
    960                            iavai1--;           
    961                            if ( i != vecLen-1)
    962                               {
    963                                  for( j=i; j<vecLen; j++ )
    964                                     {         
    965                                        pv[j] = pv[j+1];
    966                                     }
    967                               }
    968                            if( --vecLen == 0 ) return;     // all the secondaries except of the
    969                            break;            // --+
    970                         }                    //   |
    971                   }                          //   v
    972               }                              // break goes down to here
    973         }                                    // to the end of the for- loop.
    974                                        
    975 
    976      tavai2 = (targ+1)*centerOfMassEnergy/2.;
    977      G4int iavai2 = 0;
     935  if ( iavai1 == 0) return;
     936
     937  while (tavai1 <= 0.0) {
     938    // must eliminate a particle from the forward side
     939    iskip = G4int(G4UniformRand()*iavai1) + 1;
     940    is = 0; 
     941    for (i = vecLen-1; i >= 0; i--) {
     942      if (pv[i].getSide() > 0) {
     943        if (++is == iskip) {
     944          tavai1 += pv[i].getMass();
     945          iavai1--;           
     946          if (i != vecLen-1) {
     947            for (j = i; j < vecLen; j++) pv[j] = pv[j+1];
     948          }
     949          if (--vecLen == 0) return;  // all the secondaries except the
     950          break;                 // --+
     951        }                        //   |
     952      }                          //   v
     953    }                            // break goes down to here
     954  }                              // to the end of the for- loop.                         
     955
     956  tavai2 = (targ+1)*centerOfMassEnergy/2.;
     957  G4int iavai2 = 0;
    978958
    979959     for (i = 0; i < vecLen; i++)
     
    1014994        }
    1015995
    1016    if (verboseLevel > 1)
    1017       { G4cout << " pv Vector after Energy checks "
    1018              << vecLen << " " << tavai1 << " " << iavai1 << " " << tavai2
    1019              << " " <<  iavai2 << " " << ntarg << G4endl;
    1020         pvI.Print(-1);
    1021         pvT.Print(-1);
    1022         for (i=0; i < vecLen ; i++) pv[i].Print(i);
    1023       }
    1024    
    1025     //  define some vectors for Lorentz transformations
    1026    
    1027    G4HEVector* pvmx = new G4HEVector [10];
    1028    
    1029    pvmx[0].setMass( incidentMass );
    1030    pvmx[0].setMomentumAndUpdate( 0.0, 0.0, incidentTotalMomentum );
    1031    pvmx[1].setMass( protonMass);
    1032    pvmx[1].setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    1033    pvmx[3].setMass( protonMass*(1+targ));
    1034    pvmx[3].setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    1035    pvmx[4].setZero();
    1036    pvmx[5].setZero();
    1037    pvmx[7].setZero();
    1038    pvmx[8].setZero();
    1039    pvmx[8].setMomentum( 1.0, 0.0 );
    1040    pvmx[2].Add( pvmx[0], pvmx[1] );
    1041    pvmx[3].Add( pvmx[3], pvmx[0] );
    1042    pvmx[0].Lor( pvmx[0], pvmx[2] );
    1043    pvmx[1].Lor( pvmx[1], pvmx[2] );
    1044 
    1045    if (verboseLevel > 1)
    1046      { G4cout << " General Vectors after Definition " << G4endl;
    1047        for (i=0; i<10; i++) pvmx[i].Print(i);
    1048      }
    1049 
    1050    // Main loop for 4-momentum generation - see Pitha-report (Aachen)
    1051    // for a detailed description of the method.
    1052    // Process the secondary particles in reverse order.
    1053 
    1054    G4double dndl[20];
    1055    G4double binl[20];
    1056    G4double pvMass(0), pvEnergy(0);
    1057    G4int    pvCode;
    1058    G4double aspar, pt, phi, et, xval;
    1059    G4double ekin  = 0.;
    1060    G4double ekin1 = 0.;
    1061    G4double ekin2 = 0.;
    1062    G4int npg   = 0;
    1063    G4double rmg0 = 0.;
    1064    G4int targ1 = 0;                // No fragmentation model for nucleons from
    1065    phi = G4UniformRand()*twopi;
    1066    for( i=vecLen-1; i>=0; i-- )    // the intranuclear cascade. Mark them with
    1067       {                            // -3 and leave the loop
     996  if (verboseLevel > 1) {
     997    G4cout << " pv Vector after Energy checks "
     998           << vecLen << " " << tavai1 << " " << iavai1 << " " << tavai2
     999           << " " <<  iavai2 << " " << ntarg << G4endl;
     1000    pvI.Print(-1);
     1001    pvT.Print(-1);
     1002    for (i=0; i < vecLen ; i++) pv[i].Print(i);
     1003  }
     1004   
     1005  //  define some vectors for Lorentz transformations
     1006   
     1007  G4HEVector* pvmx = new G4HEVector [10];
     1008   
     1009  pvmx[0].setMass( incidentMass );
     1010  pvmx[0].setMomentumAndUpdate( 0.0, 0.0, incidentTotalMomentum );
     1011  pvmx[1].setMass( protonMass);
     1012  pvmx[1].setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     1013  pvmx[3].setMass( protonMass*(1+targ));
     1014  pvmx[3].setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     1015  pvmx[4].setZero();
     1016  pvmx[5].setZero();
     1017  pvmx[7].setZero();
     1018  pvmx[8].setZero();
     1019  pvmx[8].setMomentum( 1.0, 0.0 );
     1020  pvmx[2].Add( pvmx[0], pvmx[1] );
     1021  pvmx[3].Add( pvmx[3], pvmx[0] );
     1022  pvmx[0].Lor( pvmx[0], pvmx[2] );
     1023  pvmx[1].Lor( pvmx[1], pvmx[2] );
     1024
     1025  if (verboseLevel > 1) {
     1026    G4cout << " General Vectors after Definition " << G4endl;
     1027    for (i=0; i<10; i++) pvmx[i].Print(i);
     1028  }
     1029
     1030  // Main loop for 4-momentum generation - see Pitha-report (Aachen)
     1031  // for a detailed description of the method.
     1032  // Process the secondary particles in reverse order.
     1033
     1034  G4double dndl[20];
     1035  G4double binl[20];
     1036  G4double pvMass(0), pvEnergy(0);
     1037  G4int pvCode;
     1038  G4double aspar, pt, phi, et, xval;
     1039  G4double ekin  = 0.;
     1040  G4double ekin1 = 0.;
     1041  G4double ekin2 = 0.;
     1042  G4int npg   = 0;
     1043  G4double rmg0 = 0.;
     1044  G4int targ1 = 0;                // No fragmentation model for nucleons from
     1045  phi = G4UniformRand()*twopi;
     1046
     1047  for (i = vecLen-1; i >= 0; i--) {
     1048        // Intranuclear cascade: mark them with -3 and leave the loop
    10681049        if( i == 1)
    10691050          {
     
    12771258             }                                  // closes outer iteration
    12781259
    1279         if( eliminateThisParticle )             // not enough energy,
    1280           {                                     // eliminate this particle
    1281             if (verboseLevel > 1) {
    1282                   G4cout << " Eliminate particle index " << i << G4endl;
    1283                   pv[i].Print(i);
    1284             }
    1285             if(i != vecLen-1)
    1286                {
    1287                  for( j=i; j < vecLen-1; j++ )
    1288                    {                            // shift down
    1289                      pv[j] = pv[j+1];
    1290                    }
    1291                }
    1292             vecLen--;
    1293             if(vecLen < 2) return;
    1294             i++;
    1295             pvmx[6].Add( pvmx[4], pvmx[5] );
    1296             pvmx[6].setMomentum( 0.0 );          // set z-momentum
    1297           }
    1298       }                                          // closes main for loop
    1299    if (verboseLevel > 1)
    1300       { G4cout << " pv Vector after lambda fragmentation " << vecLen << G4endl;
    1301         pvI.Print(-1);
    1302         pvT.Print(-1);
    1303         for (i=0; i < vecLen ; i++) pv[i].Print(i);
    1304         for (i=0; i < 10; i++) pvmx[i].Print(i);
    1305       }
    1306    
    1307    
    1308    // Backward nucleons produced with a cluster model
    1309 
    1310    G4double gpar[] = {2.6, 2.6, 1.80, 1.30, 1.20};
    1311    G4double cpar[] = {0.6, 0.6, 0.35, 0.15, 0.10};
     1260    if (eliminateThisParticle) {
     1261      // Not enough energy - eliminate this particle
     1262      if (verboseLevel > 1) {
     1263        G4cout << " Eliminate particle index " << i << G4endl;
     1264        pv[i].Print(i);
     1265      }
     1266      if (i != vecLen-1) {
     1267        // shift down
     1268        for (j = i; j < vecLen-1; j++) pv[j] = pv[j+1];
     1269      }
     1270      vecLen--;
     1271
     1272      if (vecLen < 2) {
     1273        delete [] pvmx;
     1274        return;
     1275      }
     1276      i++;
     1277      pvmx[6].Add( pvmx[4], pvmx[5] );
     1278      pvmx[6].setMomentum( 0.0 );          // set z-momentum
     1279    }
     1280  }                                   // closes main for loop
     1281
     1282  if (verboseLevel > 1) {
     1283    G4cout << " pv Vector after lambda fragmentation " << vecLen << G4endl;
     1284    pvI.Print(-1);
     1285    pvT.Print(-1);
     1286    for (i=0; i < vecLen ; i++) pv[i].Print(i);
     1287    for (i=0; i < 10; i++) pvmx[i].Print(i);
     1288  }
     1289
     1290  // Backward nucleons produced with a cluster model
     1291
     1292  G4double gpar[] = {2.6, 2.6, 1.80, 1.30, 1.20};
     1293  G4double cpar[] = {0.6, 0.6, 0.35, 0.15, 0.10};
    13121294 
    1313    if (npg > 0)
    1314      {
    1315        G4double rmg = rmg0;
    1316        if (npg > 1)
    1317           {
    1318             G4int npg1 = npg-1;
    1319             if (npg1 >4) npg1 = 4;
    1320             rmg += std::pow( -std::log(1.-G4UniformRand()), cpar[npg1])/gpar[npg1];
    1321           }
    1322        G4double ga = 1.2;
    1323        G4double ekit1 = 0.04, ekit2 = 0.6;
    1324        if(incidentKineticEnergy < 5.)
    1325          {
    1326            ekit1 *= sqr(incidentKineticEnergy)/25.;
    1327            ekit2 *= sqr(incidentKineticEnergy)/25.;
    1328          }
    1329        G4double avalue = (1.-ga)/(std::pow(ekit2,1.-ga)-std::pow(ekit1,1.-ga));
    1330        for (i = 0; i < vecLen; i++)
    1331           {
    1332             if (pv[i].getSide() == -3)
    1333               {
    1334                 G4double ekit = std::pow(G4UniformRand()*(1.-ga)/avalue + std::pow(ekit1,1.-ga), 1./(1.-ga) );
    1335                 G4double cost = Amax(-1., Amin(1., std::log(2.23*G4UniformRand()+0.383)/0.96));
    1336                 G4double sint = std::sqrt(1. - cost*cost);
    1337                 G4double phi  = twopi*G4UniformRand();
    1338                 G4double pp   = std::sqrt(ekit*(ekit+2*pv[i].getMass()));
    1339                 pv[i].setMomentum( pp*sint*std::sin(phi),
    1340                                    pp*sint*std::cos(phi),
    1341                                    pp*cost          );
    1342                 pv[i].Lor( pv[i], pvmx[2] );
    1343                 pvmx[5].Add( pvmx[5], pv[i] );
    1344               }
    1345           }
    1346      }
     1295  if (npg > 0) {
     1296    G4double rmg = rmg0;
     1297    if (npg > 1) {
     1298      G4int npg1 = npg-1;
     1299      if (npg1 >4) npg1 = 4;
     1300      rmg += std::pow( -std::log(1.-G4UniformRand()), cpar[npg1])/gpar[npg1];
     1301    }
     1302    G4double ga = 1.2;
     1303    G4double ekit1 = 0.04, ekit2 = 0.6;
     1304    if (incidentKineticEnergy < 5.) {
     1305      ekit1 *= sqr(incidentKineticEnergy)/25.;
     1306      ekit2 *= sqr(incidentKineticEnergy)/25.;
     1307    }
     1308    G4double avalue = (1.-ga)/(std::pow(ekit2,1.-ga)-std::pow(ekit1,1.-ga));
     1309    for (i = 0; i < vecLen; i++) {
     1310      if (pv[i].getSide() == -3) {
     1311        G4double ekit = std::pow(G4UniformRand()*(1.-ga)/avalue + std::pow(ekit1,1.-ga), 1./(1.-ga) );
     1312        G4double cost = Amax(-1., Amin(1., std::log(2.23*G4UniformRand()+0.383)/0.96));
     1313        G4double sint = std::sqrt(1. - cost*cost);
     1314        G4double phi  = twopi*G4UniformRand();
     1315        G4double pp   = std::sqrt(ekit*(ekit+2*pv[i].getMass()));
     1316        pv[i].setMomentum(pp*sint*std::sin(phi),
     1317                          pp*sint*std::cos(phi),
     1318                          pp*cost);
     1319        pv[i].Lor( pv[i], pvmx[2] );
     1320        pvmx[5].Add( pvmx[5], pv[i] );
     1321      }
     1322    }
     1323  }
    13471324       
    1348    if (vecLen <= 2) {
    1349      successful = false;
    1350      return;
    1351    } 
    1352 
    1353    // Lorentz transformation in lab system
     1325  if (vecLen <= 2) {
     1326    successful = false;
     1327    delete [] pvmx;
     1328    return;
     1329  } 
     1330
     1331  // Lorentz transformation in lab system
    13541332
    13551333   targ = 0;
     
    13981376     }
    13991377
    1400    pvmx[3].setMass( incidentMass);
    1401    pvmx[3].setMomentumAndUpdate( 0.0, 0.0, incidentTotalMomentum );
    1402    
    1403    G4double ekin0 = pvmx[3].getKineticEnergy();
    1404    
    1405    pvmx[4].setMass( protonMass * targ);
    1406    pvmx[4].setEnergy( protonMass * targ);
    1407    pvmx[4].setKineticEnergy(0.);
    1408    pvmx[4].setMomentum(0., 0., 0.);
    1409    ekin = pvmx[3].getEnergy() + pvmx[4].getEnergy();
     1378  pvmx[3].setMass( incidentMass);
     1379  pvmx[3].setMomentumAndUpdate( 0.0, 0.0, incidentTotalMomentum );
     1380   
     1381  G4double ekin0 = pvmx[3].getKineticEnergy();
     1382   
     1383  pvmx[4].setMass( protonMass * targ);
     1384  pvmx[4].setEnergy( protonMass * targ);
     1385  pvmx[4].setKineticEnergy(0.);
     1386  pvmx[4].setMomentum(0., 0., 0.);
     1387  ekin = pvmx[3].getEnergy() + pvmx[4].getEnergy();
    14101388
    14111389   pvmx[5].Add( pvmx[3], pvmx[4] );
     
    14711449     }
    14721450
    1473    // Do some smearing in the transverse direction due to Fermi motion
     1451  // Do some smearing in the transverse direction due to Fermi motion
    14741452   
    14751453   G4double ry   = G4UniformRand();
     
    14911469   }
    14921470
    1493    // Rotate in the direction of the primary particle momentum (z-axis).
    1494    // This does disturb our inclusive distributions somewhat, but it is
    1495    // necessary for momentum conservation
    1496 
    1497    // Also subtract binding energies and make some further corrections
    1498    // if required
    1499 
    1500    G4double dekin = 0.0;
    1501    G4int npions = 0;   
    1502    G4double ek1 = 0.0;
    1503    G4double alekw, xxh;
    1504    G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
    1505    G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.00};
    1506    G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65,  0.70};
    1507    
    1508    if (verboseLevel > 1)
    1509      G4cout << " Rotation in Direction  of primary particle (Defs1)" << G4endl;
    1510 
    1511    for (i = 0; i < vecLen; i++)
    1512       {
    1513         if(verboseLevel > 1) pv[i].Print(i);
    1514         pv[i].Defs1( pv[i], pvI );
    1515         if(verboseLevel > 1) pv[i].Print(i);
    1516         if (atomicWeight > 1.5)
    1517            {
    1518              ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
    1519              alekw = std::log( incidentKineticEnergy );
    1520              xxh   = 1.;
    1521              if(incidentCode == pionPlusCode || incidentCode == pionMinusCode)
    1522                {
    1523                  if(pv[i].getCode() == pionZeroCode)
    1524                    {
    1525                      if(G4UniformRand() < std::log(atomicWeight))
    1526                        {
    1527                          if (alekw > alem[0])
    1528                            {
    1529                               for (j = 1; j < 8; j++)
    1530                                  {
    1531                                     if(alekw < alem[j]) break;
    1532                                  }
    1533                               xxh =   (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alekw
    1534                                      + val0[j-1] - (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alem[j-1];
    1535                               xxh = 1. - xxh;
    1536                            }
    1537                        }     
    1538                     }
    1539                } 
    1540              dekin += ekin*(1.-xxh);
    1541              ekin *= xxh;
    1542              pv[i].setKineticEnergyAndUpdate( ekin );
    1543              pvCode = pv[i].getCode();
    1544              if ((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    1545                 {
    1546                   npions += 1;
    1547                   ek1 += ekin;
     1471  // Rotate in the direction of the primary particle momentum (z-axis).
     1472  // This does disturb our inclusive distributions somewhat, but it is
     1473  // necessary for momentum conservation
     1474
     1475  // Also subtract binding energies and make some further corrections
     1476  // if required
     1477
     1478  G4double dekin = 0.0;
     1479  G4int npions = 0;   
     1480  G4double ek1 = 0.0;
     1481  G4double alekw, xxh;
     1482  G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
     1483  G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.00};
     1484  G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65,  0.70};
     1485   
     1486  if (verboseLevel > 1)
     1487    G4cout << " Rotation in Direction  of primary particle (Defs1)" << G4endl;
     1488
     1489  for (i = 0; i < vecLen; i++) {
     1490    if(verboseLevel > 1) pv[i].Print(i);
     1491    pv[i].Defs1( pv[i], pvI );
     1492    if(verboseLevel > 1) pv[i].Print(i);
     1493    if (atomicWeight > 1.5) {
     1494      ekin = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
     1495      alekw = std::log( incidentKineticEnergy );
     1496      xxh = 1.;
     1497      if (incidentCode == pionPlusCode || incidentCode == pionMinusCode) {
     1498        if (pv[i].getCode() == pionZeroCode) {
     1499          if (G4UniformRand() < std::log(atomicWeight)) {
     1500            if (alekw > alem[0]) {
     1501              G4int jmax = 1;
     1502              for (j = 1; j < 8; j++) {
     1503                if (alekw < alem[j]) {
     1504                  jmax = j;
     1505                  break;
    15481506                }
    1549            }
    1550       }
    1551    if( (ek1 > 0.0) && (npions > 0) )
    1552       {
    1553         dekin = 1.+dekin/ek1;
    1554         for (i = 0; i < vecLen; i++)
    1555           {
    1556             pvCode = pv[i].getCode();
    1557             if((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    1558               {
    1559                 ekin = Amax( 1.0e-6, pv[i].getKineticEnergy() * dekin );
    1560                 pv[i].setKineticEnergyAndUpdate( ekin );
    15611507              }
    1562           }
    1563       }
    1564    if (verboseLevel > 1)
    1565       { G4cout << " Lab-System " <<  ek1 << " " << npions << G4endl;
    1566         incidentParticle.Print(0);
    1567         targetParticle.Print(1);
    1568         for (i=0; i<vecLen; i++) pv[i].Print(i);
    1569       }
    1570 
    1571    // Add black track particles
    1572    // the total number of particles produced is restricted to 198
    1573    // this may have influence on very high energies
     1508              xxh = (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alekw
     1509                   + val0[jmax-1] - (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alem[jmax-1];
     1510              xxh = 1. - xxh;
     1511            }
     1512          }     
     1513        }
     1514      }
     1515      dekin += ekin*(1.-xxh);
     1516      ekin *= xxh;
     1517      pv[i].setKineticEnergyAndUpdate( ekin );
     1518      pvCode = pv[i].getCode();
     1519      if ((pvCode == pionPlusCode) ||
     1520          (pvCode == pionMinusCode) ||
     1521          (pvCode == pionZeroCode)) {
     1522        npions += 1;
     1523        ek1 += ekin;
     1524      }
     1525    }
     1526  }
     1527
     1528  if ( (ek1 > 0.0) && (npions > 0) ) {
     1529    dekin = 1.+dekin/ek1;
     1530    for (i = 0; i < vecLen; i++) {
     1531      pvCode = pv[i].getCode();
     1532      if ((pvCode == pionPlusCode) ||
     1533          (pvCode == pionMinusCode) ||
     1534          (pvCode == pionZeroCode)) {
     1535        ekin = Amax(1.0e-6, pv[i].getKineticEnergy() * dekin);
     1536        pv[i].setKineticEnergyAndUpdate( ekin );
     1537      }
     1538    }
     1539  }
     1540
     1541  if (verboseLevel > 1) {
     1542    G4cout << " Lab-System " <<  ek1 << " " << npions << G4endl;
     1543    incidentParticle.Print(0);
     1544    targetParticle.Print(1);
     1545    for (i = 0; i < vecLen; i++) pv[i].Print(i);
     1546  }
     1547
     1548  // Add black track particles
     1549  // the total number of particles produced is restricted to 198
     1550  // this may have influence on very high energies
    15741551
    15751552   if (verboseLevel > 1)
     
    17811758   }
    17821759   
    1783    return;
    1784  }
     1760  return;
     1761}
    17851762
    17861763void
    17871764G4HEInelastic::TuningOfHighEnergyCascading(G4HEVector pv[],
    1788                                            G4int &vecLen,
    1789                                            G4HEVector incidentParticle,
    1790                                            G4HEVector targetParticle,
     1765                                           G4int& vecLen,
     1766                                           const G4HEVector& incidentParticle,
     1767                                           const G4HEVector& targetParticle,
    17911768                                           G4double atomicWeight,
    17921769                                           G4double atomicNumber)
     
    21272104
    21282105void
    2129 G4HEInelastic::HighEnergyClusterProduction(G4bool &successful,
     2106G4HEInelastic::HighEnergyClusterProduction(G4bool& successful,
    21302107                                           G4HEVector pv[],
    2131                                            G4int &vecLen,       
    2132                                            G4double &excitationEnergyGNP,
    2133                                            G4double &excitationEnergyDTA,
    2134                                            G4HEVector incidentParticle,
    2135                                            G4HEVector targetParticle,
     2108                                           G4int& vecLen,       
     2109                                           G4double& excitationEnergyGNP,
     2110                                           G4double& excitationEnergyDTA,
     2111                                           const G4HEVector& incidentParticle,
     2112                                           const G4HEVector& targetParticle,
    21362113                                           G4double atomicWeight,
    21372114                                           G4double atomicNumber)
    2138  {   
     2115{   
    21392116// For low multiplicity in the first intranuclear interaction the cascading process
    21402117// as described in G4HEInelastic::MediumEnergyCascading does not work
     
    21442121//  All quantities on the G4HEVector Array pv are in GeV- units.
    21452122
    2146    G4int protonCode       = Proton.getCode();
    2147    G4double protonMass    = Proton.getMass();
    2148    G4int neutronCode      = Neutron.getCode();
    2149    G4double kaonPlusMass  = KaonPlus.getMass();
    2150    G4int pionPlusCode     = PionPlus.getCode();   
    2151    G4int pionZeroCode     = PionZero.getCode();   
    2152    G4int pionMinusCode    = PionMinus.getCode();
    2153    G4String mesonType    = PionPlus.getType();
    2154    G4String baryonType    = Proton.getType();
    2155    G4String antiBaryonType= AntiProton.getType();
     2123  G4int protonCode       = Proton.getCode();
     2124  G4double protonMass    = Proton.getMass();
     2125  G4int neutronCode      = Neutron.getCode();
     2126  G4double kaonPlusMass  = KaonPlus.getMass();
     2127  G4int pionPlusCode     = PionPlus.getCode();   
     2128  G4int pionZeroCode     = PionZero.getCode();   
     2129  G4int pionMinusCode    = PionMinus.getCode();
     2130  G4String mesonType = PionPlus.getType();
     2131  G4String baryonType = Proton.getType();
     2132  G4String antiBaryonType = AntiProton.getType();
    21562133 
    2157    G4double targetMass  = targetParticle.getMass();
     2134  G4double targetMass = targetParticle.getMass();
    21582135
    21592136   G4int    incidentCode          = incidentParticle.getCode();
     
    21662143   G4double incidentTOF           = 0.;
    21672144   
    2168                                                               // some local variables
    2169 
    2170    G4int i, j;
    2171    
    2172    if(verboseLevel > 1) G4cout << " G4HEInelastic::HighEnergyClusterProduction " << G4endl;
    2173 
    2174    successful = false;
    2175    if(incidentTotalMomentum < 25. + G4UniformRand()*25.) return;
    2176 
    2177    G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
    2178                                        +2.*targetMass*incidentEnergy);
    2179 
    2180    G4HEVector pvI = incidentParticle;  // for the incident particle
    2181    pvI.setSide( 1 );
    2182 
    2183    G4HEVector pvT = targetParticle;   // for the target particle
    2184    pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    2185    pvT.setSide( -1 );
    2186    pvT.setTOF( -1.);
    2187                               // distribute particles in forward and backward
    2188                               // hemispheres. Note that only low multiplicity
    2189                               // events from FirstIntInNuc.... should go into
    2190                               // this routine.
    2191    G4int targ  = 0; 
    2192    G4int ifor  = 0;
    2193    G4int iback = 0;
    2194    G4int pvCode;
    2195    G4double pvMass, pvEnergy;
    2196 
    2197    pv[0].setSide(  1 );
    2198    pv[1].setSide( -1 );
    2199    for(i = 0; i < vecLen; i++)
    2200       {
    2201         if (i > 1)
    2202            {
    2203               if( G4UniformRand() < 0.5)
    2204                 {
    2205                   pv[i].setSide( 1 );
    2206                   if (++ifor > 18)
    2207                      {
    2208                        pv[i].setSide( -1 );
    2209                        ifor--;
    2210                        iback++;
    2211                      }
    2212                 }
    2213               else
    2214                 {
    2215                   pv[i].setSide( -1 );
    2216                   if (++iback > 18)
    2217                      {
    2218                        pv[i].setSide( 1 );
    2219                        ifor++;
    2220                        iback--;
    2221                      }
    2222                 }
    2223            }
    2224 
    2225         pvCode = pv[i].getCode();
    2226 
    2227         if (   (    (incidentCode == protonCode) || (incidentCode == neutronCode)
    2228                  || (incidentType == mesonType) )
    2229             && (    (pvCode == pionPlusCode) || (pvCode == pionMinusCode) )
    2230             && (    (G4UniformRand() < (10.-incidentTotalMomentum)/6.) )
    2231             && (    (G4UniformRand() < atomicWeight/300.) ) )
    2232            {
    2233                if (G4UniformRand() > atomicNumber/atomicWeight)
    2234                   pv[i].setDefinition( "Neutron" );
    2235                else
    2236                   pv[i].setDefinition( "Proton" );
    2237                targ++;
    2238            }   
    2239         pv[i].setTOF( incidentTOF );                 
    2240       }   
    2241    G4double tb = 2. * iback;
    2242    if (centerOfMassEnergy < (2+G4UniformRand())) tb = (2.*iback + vecLen)/2.;
    2243    
    2244    G4double nucsup[] = { 1.0, 0.7, 0.5, 0.4, 0.35, 0.3};
    2245    G4double  psup[]   = { 3. , 6. , 20., 50., 100.,1000.};   
    2246    G4double s = centerOfMassEnergy*centerOfMassEnergy;
    2247 
    2248    G4double xtarg = Amax(0.01, Amin(0.50, 0.312+0.2*std::log(std::log(s))+std::pow(s,1.5)/6000.)
     2145  // some local variables
     2146  G4int i, j;
     2147   
     2148  if (verboseLevel > 1)
     2149    G4cout << " G4HEInelastic::HighEnergyClusterProduction " << G4endl;
     2150
     2151  successful = false;
     2152  if (incidentTotalMomentum < 25. + G4UniformRand()*25.) return;
     2153
     2154  G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
     2155                                         +2.*targetMass*incidentEnergy);
     2156
     2157  G4HEVector pvI = incidentParticle;  // for the incident particle
     2158  pvI.setSide(1);
     2159
     2160  G4HEVector pvT = targetParticle;   // for the target particle
     2161  pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     2162  pvT.setSide( -1 );
     2163  pvT.setTOF( -1.);
     2164                    // distribute particles in forward and backward
     2165                    // hemispheres. Note that only low multiplicity
     2166                    // events from FirstIntInNuc.... should go into
     2167                    // this routine.
     2168  G4int targ  = 0; 
     2169  G4int ifor  = 0;
     2170  G4int iback = 0;
     2171  G4int pvCode;
     2172  G4double pvMass, pvEnergy;
     2173
     2174  pv[0].setSide(1);
     2175  pv[1].setSide(-1);
     2176  for (i = 0; i < vecLen; i++) {
     2177    if (i > 1) {
     2178      if (G4UniformRand() < 0.5) {
     2179        pv[i].setSide( 1 );
     2180        if (++ifor > 18) {
     2181          pv[i].setSide(-1);
     2182          ifor--;
     2183          iback++;
     2184        }
     2185      } else {
     2186        pv[i].setSide( -1 );
     2187        if (++iback > 18) {
     2188          pv[i].setSide(1);
     2189          ifor++;
     2190          iback--;
     2191        }
     2192      }
     2193    }
     2194
     2195    pvCode = pv[i].getCode();
     2196
     2197    if (   (    (incidentCode == protonCode) || (incidentCode == neutronCode)
     2198             || (incidentType == mesonType) )
     2199        && (    (pvCode == pionPlusCode) || (pvCode == pionMinusCode) )
     2200        && (    (G4UniformRand() < (10.-incidentTotalMomentum)/6.) )
     2201        && (    (G4UniformRand() < atomicWeight/300.) ) ) {
     2202      if (G4UniformRand() > atomicNumber/atomicWeight)
     2203        pv[i].setDefinition("Neutron");
     2204      else
     2205        pv[i].setDefinition("Proton");
     2206      targ++;
     2207    }
     2208    pv[i].setTOF( incidentTOF );                 
     2209  }
     2210   
     2211  G4double tb = 2. * iback;
     2212  if (centerOfMassEnergy < (2+G4UniformRand())) tb = (2.*iback + vecLen)/2.;
     2213   
     2214  G4double nucsup[] = {1.0, 0.7, 0.5, 0.4, 0.35, 0.3};
     2215  G4double psup[] = {3. , 6. , 20., 50., 100.,1000.};   
     2216  G4double s = centerOfMassEnergy*centerOfMassEnergy;
     2217
     2218  G4double xtarg = Amax(0.01, Amin(0.50, 0.312+0.2*std::log(std::log(s))+std::pow(s,1.5)/6000.)
    22492219                             * (std::pow(atomicWeight,0.33)-1.) * tb);
    2250    G4int momentumBin = 0;
     2220  G4int momentumBin = 0;
    22512221   while( (momentumBin < 6) && (incidentTotalMomentum > psup[momentumBin])) momentumBin++;
    22522222   momentumBin = Imin(5, momentumBin);
     
    27292699     }     
    27302700
    2731    // Do some smearing in the transverse direction due to Fermi motion
    2732    
    2733    G4double ry   = G4UniformRand();
    2734    G4double rz   = G4UniformRand();
    2735    G4double rx   = twopi*rz;
    2736    G4double a1   = std::sqrt(-2.0*std::log(ry));
    2737    G4double rantarg1 = a1*std::cos(rx)*0.02*targ/G4double(vecLen);
    2738    G4double rantarg2 = a1*std::sin(rx)*0.02*targ/G4double(vecLen);
    2739 
    2740    for (i = 0; i < vecLen; i++)
    2741      pv[i].setMomentum( pv[i].getMomentum().x()+rantarg1,
    2742                         pv[i].getMomentum().y()+rantarg2 );
    2743 
    2744    if (verboseLevel > 1) {                         
    2745      pvmx[7].setZero();
    2746      for (i = 0; i < vecLen; i++) pvmx[7].Add( pvmx[7], pv[i] ); 
    2747      teta = pvmx[7].Ang( pvmx[4] );   
    2748      G4cout << " After smearing " << teta << G4endl;
    2749    }
    2750 
    2751    // Rotate in the direction of the primary particle momentum (z-axis).
    2752    // This does disturb our inclusive distributions somewhat, but it is
    2753    // necessary for momentum conservation
    2754 
    2755    // Also subtract binding energies and make some further corrections
    2756    // if required
    2757 
    2758    G4double dekin = 0.0;
    2759    G4int npions = 0;   
    2760    G4double ek1 = 0.0;
    2761    G4double alekw, xxh;
    2762    G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
    2763    G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.0};
    2764    G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65, 0.70};
    2765    
    2766 
    2767    for (i = 0; i < vecLen; i++)
    2768       {
    2769         pv[i].Defs1( pv[i], pvI );
    2770         if (atomicWeight > 1.5)
    2771            {
    2772              ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
    2773              alekw = std::log( incidentKineticEnergy );
    2774              xxh   = 1.;
    2775              xxh   = 1.;
    2776              if(incidentCode == pionPlusCode || incidentCode == pionMinusCode)
    2777                {
    2778                  if(pv[i].getCode() == pionZeroCode)
    2779                    {
    2780                      if(G4UniformRand() < std::log(atomicWeight))
    2781                        {
    2782                          if (alekw > alem[0])
    2783                            {
    2784                               for (j = 1; j < 8; j++)
    2785                                  {
    2786                                     if(alekw < alem[j]) break;
    2787                                  }
    2788                               xxh =   (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alekw
    2789                                      + val0[j-1] - (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alem[j-1];
    2790                               xxh = 1. - xxh;
    2791                            }
    2792                        }     
    2793                     }
    2794                } 
    2795              dekin += ekin*(1.-xxh);
    2796              ekin *= xxh;
    2797              pv[i].setKineticEnergyAndUpdate( ekin );
    2798              pvCode = pv[i].getCode();
    2799              if ((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    2800                 {
    2801                   npions += 1;
    2802                   ek1 += ekin;
     2701  // Do some smearing in the transverse direction due to Fermi motion
     2702   
     2703  G4double ry   = G4UniformRand();
     2704  G4double rz   = G4UniformRand();
     2705  G4double rx   = twopi*rz;
     2706  G4double a1   = std::sqrt(-2.0*std::log(ry));
     2707  G4double rantarg1 = a1*std::cos(rx)*0.02*targ/G4double(vecLen);
     2708  G4double rantarg2 = a1*std::sin(rx)*0.02*targ/G4double(vecLen);
     2709
     2710  for (i = 0; i < vecLen; i++)
     2711    pv[i].setMomentum(pv[i].getMomentum().x()+rantarg1,
     2712                      pv[i].getMomentum().y()+rantarg2);
     2713
     2714  if (verboseLevel > 1) {
     2715    pvmx[7].setZero();
     2716    for (i = 0; i < vecLen; i++) pvmx[7].Add( pvmx[7], pv[i] ); 
     2717    teta = pvmx[7].Ang( pvmx[4] );   
     2718    G4cout << " After smearing " << teta << G4endl;
     2719  }
     2720
     2721  // Rotate in the direction of the primary particle momentum (z-axis).
     2722  // This does disturb our inclusive distributions somewhat, but it is
     2723  // necessary for momentum conservation
     2724
     2725  // Also subtract binding energies and make some further corrections
     2726  // if required
     2727
     2728  G4double dekin = 0.0;
     2729  G4int npions = 0;   
     2730  G4double ek1 = 0.0;
     2731  G4double alekw, xxh;
     2732  G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
     2733  G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.0};
     2734  G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65, 0.70};
     2735   
     2736  for (i = 0; i < vecLen; i++) {
     2737    pv[i].Defs1( pv[i], pvI );
     2738    if (atomicWeight > 1.5) {
     2739      ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
     2740      alekw = std::log( incidentKineticEnergy );
     2741      xxh   = 1.;
     2742      if (incidentCode == pionPlusCode || incidentCode == pionMinusCode) {
     2743        if (pv[i].getCode() == pionZeroCode) {
     2744          if (G4UniformRand() < std::log(atomicWeight)) {
     2745            if (alekw > alem[0]) {
     2746              G4int jmax = 1;
     2747              for (j = 1; j < 8; j++) {
     2748                if (alekw < alem[j]) {
     2749                  jmax = j;
     2750                  break;
    28032751                }
    2804            }
    2805       }
     2752              }
     2753              xxh = (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alekw
     2754                     + val0[jmax-1] - (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alem[jmax-1];
     2755              xxh = 1. - xxh;
     2756            }
     2757          }
     2758        }
     2759      }
     2760      dekin += ekin*(1.-xxh);
     2761      ekin *= xxh;
     2762      pv[i].setKineticEnergyAndUpdate( ekin );
     2763      pvCode = pv[i].getCode();
     2764      if ((pvCode == pionPlusCode) ||
     2765          (pvCode == pionMinusCode) ||
     2766          (pvCode == pionZeroCode)) {
     2767        npions += 1;
     2768        ek1 += ekin;
     2769      }
     2770    }
     2771  }
     2772
    28062773   if( (ek1 > 0.0) && (npions > 0) )
    28072774      {
     
    30032970   }
    30042971
    3005    successful = true;
    3006    delete [] pvmx;
    3007    delete [] tempV;
    3008    return;
    3009  }
     2972  successful = true;
     2973  delete [] pvmx;
     2974  delete [] tempV;
     2975  return;
     2976}
    30102977
    30112978void
    3012 G4HEInelastic::MediumEnergyCascading(G4bool &successful,
     2979G4HEInelastic::MediumEnergyCascading(G4bool& successful,
    30132980                                     G4HEVector pv[],
    3014                                      G4int &vecLen,     
    3015                                      G4double &excitationEnergyGNP,
    3016                                      G4double &excitationEnergyDTA,
    3017                                      G4HEVector incidentParticle,
    3018                                      G4HEVector targetParticle,
     2981                                     G4int& vecLen,     
     2982                                     G4double& excitationEnergyGNP,
     2983                                     G4double& excitationEnergyDTA,
     2984                                     const G4HEVector& incidentParticle,
     2985                                     const G4HEVector& targetParticle,
    30192986                                     G4double atomicWeight,
    30202987                                     G4double atomicNumber)
    3021  {   
    3022 //
    3023 //  The multiplicity of particles produced in the first interaction has been
    3024 //  calculated in one of the FirstIntInNuc.... routines. The nuclear
    3025 //  cascading particles are parametrized from experimental data.
    3026 //  A simple single variable description E D3S/DP3= F(Q) with
    3027 //  Q^2 = (M*X)^2 + PT^2 is used. Final state kinematic is produced
    3028 //  by an FF-type iterative cascade method.
    3029 //  Nuclear evaporation particles are added at the end of the routine.
    3030 
    3031 //  All quantities on the G4HEVector Array pv are in GeV- units.
    3032 
    3033    G4int protonCode       = Proton.getCode();
    3034    G4double protonMass    = Proton.getMass();
    3035    G4int neutronCode      = Neutron.getCode();
    3036    G4double kaonPlusMass  = KaonPlus.getMass();
    3037    G4int kaonPlusCode     = KaonPlus.getCode();   
    3038    G4int kaonMinusCode    = KaonMinus.getCode();
    3039    G4int kaonZeroSCode    = KaonZeroShort.getCode();
    3040    G4int kaonZeroLCode    = KaonZeroLong.getCode();
    3041    G4int kaonZeroCode     = KaonZero.getCode();
    3042    G4int antiKaonZeroCode = AntiKaonZero.getCode();
    3043    G4int pionPlusCode     = PionPlus.getCode();   
    3044    G4int pionZeroCode     = PionZero.getCode();   
    3045    G4int pionMinusCode    = PionMinus.getCode();
    3046    G4String mesonType     = PionPlus.getType();
    3047    G4String baryonType    = Proton.getType();
    3048    G4String antiBaryonType= AntiProton.getType();
    3049 
    3050    G4double targetMass   = targetParticle.getMass();
    3051 
    3052    G4int    incidentCode          = incidentParticle.getCode();
    3053    G4double incidentMass          = incidentParticle.getMass();
    3054    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    3055    G4double incidentEnergy        = incidentParticle.getEnergy();
    3056    G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    3057    G4String incidentType          = incidentParticle.getType();
    3058 //   G4double incidentTOF           = incidentParticle.getTOF();   
    3059    G4double incidentTOF           = 0.;
    3060    
    3061    // some local variables
    3062 
    3063    G4int i, j, l;
    3064 
    3065    if(verboseLevel > 1)
     2988{
     2989  // The multiplicity of particles produced in the first interaction has been
     2990  // calculated in one of the FirstIntInNuc.... routines. The nuclear
     2991  // cascading particles are parametrized from experimental data.
     2992  // A simple single variable description E D3S/DP3= F(Q) with
     2993  // Q^2 = (M*X)^2 + PT^2 is used. Final state kinematic is produced
     2994  // by an FF-type iterative cascade method.
     2995  // Nuclear evaporation particles are added at the end of the routine.
     2996
     2997  // All quantities on the G4HEVector Array pv are in GeV- units.
     2998
     2999  G4int protonCode       = Proton.getCode();
     3000  G4double protonMass    = Proton.getMass();
     3001  G4int neutronCode      = Neutron.getCode();
     3002  G4double kaonPlusMass  = KaonPlus.getMass();
     3003  G4int kaonPlusCode     = KaonPlus.getCode();   
     3004  G4int kaonMinusCode    = KaonMinus.getCode();
     3005  G4int kaonZeroSCode    = KaonZeroShort.getCode();
     3006  G4int kaonZeroLCode    = KaonZeroLong.getCode();
     3007  G4int kaonZeroCode     = KaonZero.getCode();
     3008  G4int antiKaonZeroCode = AntiKaonZero.getCode();
     3009  G4int pionPlusCode     = PionPlus.getCode();   
     3010  G4int pionZeroCode     = PionZero.getCode();   
     3011  G4int pionMinusCode = PionMinus.getCode();
     3012  G4String mesonType = PionPlus.getType();
     3013  G4String baryonType = Proton.getType();
     3014  G4String antiBaryonType = AntiProton.getType();
     3015
     3016  G4double targetMass = targetParticle.getMass();
     3017
     3018  G4int incidentCode = incidentParticle.getCode();
     3019  G4double incidentMass = incidentParticle.getMass();
     3020  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     3021  G4double incidentEnergy = incidentParticle.getEnergy();
     3022  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     3023  G4String incidentType = incidentParticle.getType();
     3024//  G4double incidentTOF           = incidentParticle.getTOF();   
     3025  G4double incidentTOF = 0.;
     3026   
     3027  // some local variables
     3028
     3029  G4int i, j, l;
     3030
     3031  if(verboseLevel > 1)
    30663032     G4cout << " G4HEInelastic::MediumEnergyCascading " << G4endl;
    30673033
    3068    // define annihilation channels.
     3034  // define annihilation channels.
    30693035                                 
    3070    G4bool annihilation = false;
    3071    if (incidentCode < 0 && incidentType == antiBaryonType &&
    3072        pv[0].getType() != antiBaryonType &&
    3073        pv[1].getType() != antiBaryonType   )
    3074          {
    3075            annihilation = true;
    3076          }   
    3077      
    3078    successful = false;
    3079 
    3080    G4double twsup[] = { 1., 1., 0.7, 0.5, 0.3, 0.2, 0.1, 0.0 };
     3036  G4bool annihilation = false;
     3037  if (incidentCode < 0 && incidentType == antiBaryonType &&
     3038      pv[0].getType() != antiBaryonType &&
     3039      pv[1].getType() != antiBaryonType) {
     3040    annihilation = true;
     3041  }
     3042 
     3043  successful = false;
     3044
     3045  G4double twsup[] = { 1., 1., 0.7, 0.5, 0.3, 0.2, 0.1, 0.0 };
    30813046   
    30823047   if(annihilation) goto start;
     
    35933558               }
    35943559            vecLen--;
    3595             if(vecLen < 2) return;
     3560            if (vecLen < 2) {
     3561              delete [] pvmx;
     3562              return;
     3563            }
    35963564            i++;
    35973565            pvmx[6].Add( pvmx[4], pvmx[5] );
     
    38293797   }
    38303798
    3831    // Rotate in the direction of the primary particle momentum (z-axis).
    3832    // This does disturb our inclusive distributions somewhat, but it is
    3833    // necessary for momentum conservation.
    3834 
    3835    // Also subtract binding energies and make some further corrections
    3836    // if required.
    3837 
    3838    G4double dekin = 0.0;
    3839    G4int npions = 0;   
    3840    G4double ek1 = 0.0;
    3841    G4double alekw, xxh;
    3842    G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
    3843    G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.00};
    3844    G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65,  0.70};
    3845    
    3846 
    3847    for (i = 0; i < vecLen; i++)
    3848       {
    3849         pv[i].Defs1( pv[i], pvI );
    3850         if (atomicWeight > 1.5)
    3851            {
    3852              ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
    3853              alekw = std::log( incidentKineticEnergy );
    3854              xxh   = 1.;
    3855              if(incidentCode == pionPlusCode || incidentCode == pionMinusCode)
    3856                {
    3857                  if(pv[i].getCode() == pionZeroCode)
    3858                    {
    3859                      if(G4UniformRand() < std::log(atomicWeight))
    3860                        {           
    3861                          if (alekw > alem[0])
    3862                            {
    3863                              for (j = 1; j < 8; j++)
    3864                                 {
    3865                                   if(alekw < alem[j]) break;
    3866                                 }
    3867                              xxh =   (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alekw
    3868                                     + val0[j-1] - (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alem[j-1];
    3869                              xxh = 1. - xxh;
    3870                            }
    3871                        }
    3872                     }
    3873                } 
    3874              dekin += ekin*(1.-xxh);
    3875              ekin *= xxh;
    3876              pv[i].setKineticEnergyAndUpdate( ekin );
    3877              pvCode = pv[i].getCode();
    3878              if ((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    3879                 {
    3880                   npions += 1;
    3881                   ek1 += ekin;
     3799  // Rotate in the direction of the primary particle momentum (z-axis).
     3800  // This does disturb our inclusive distributions somewhat, but it is
     3801  // necessary for momentum conservation.
     3802
     3803  // Also subtract binding energies and make some further corrections
     3804  // if required.
     3805
     3806  G4double dekin = 0.0;
     3807  G4int npions = 0;   
     3808  G4double ek1 = 0.0;
     3809  G4double alekw, xxh;
     3810  G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
     3811  G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00, 10.00};
     3812  G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65,  0.70};
     3813
     3814  for (i = 0; i < vecLen; i++) {
     3815    pv[i].Defs1( pv[i], pvI );
     3816    if (atomicWeight > 1.5) {
     3817      ekin = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
     3818      alekw = std::log( incidentKineticEnergy );
     3819      xxh = 1.;
     3820      if (incidentCode == pionPlusCode || incidentCode == pionMinusCode) {
     3821        if (pv[i].getCode() == pionZeroCode) {
     3822          if (G4UniformRand() < std::log(atomicWeight)) {           
     3823            if (alekw > alem[0]) {
     3824              G4int jmax = 1;
     3825              for (j = 1; j < 8; j++) {
     3826                if (alekw < alem[j]) {
     3827                  jmax = j;
     3828                  break;
    38823829                }
    3883            }
    3884       }
     3830              }
     3831              xxh = (val0[jmax] - val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alekw
     3832                   + val0[jmax-1] - (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alem[jmax-1];
     3833              xxh = 1. - xxh;
     3834            }
     3835          }
     3836        }
     3837      } 
     3838      dekin += ekin*(1.-xxh);
     3839      ekin *= xxh;
     3840      pv[i].setKineticEnergyAndUpdate( ekin );
     3841      pvCode = pv[i].getCode();
     3842      if ((pvCode == pionPlusCode) ||
     3843          (pvCode == pionMinusCode) ||
     3844          (pvCode == pionZeroCode)) {
     3845        npions += 1;
     3846        ek1 += ekin;
     3847      }
     3848    }
     3849  }
     3850
    38853851   if( (ek1 > 0.0) && (npions > 0) )
    38863852      {
     
    40874053
    40884054void
    4089 G4HEInelastic::MediumEnergyClusterProduction(G4bool &successful,
     4055G4HEInelastic::MediumEnergyClusterProduction(G4bool& successful,
    40904056                                             G4HEVector pv[],
    4091                                              G4int &vecLen,     
    4092                                              G4double &excitationEnergyGNP,
    4093                                              G4double &excitationEnergyDTA,
    4094                                              G4HEVector incidentParticle,
    4095                                              G4HEVector targetParticle,
     4057                                             G4int& vecLen,     
     4058                                             G4double& excitationEnergyGNP,
     4059                                             G4double& excitationEnergyDTA,
     4060                                             const G4HEVector& incidentParticle,
     4061                                             const G4HEVector& targetParticle,
    40964062                                             G4double atomicWeight,
    40974063                                             G4double atomicNumber)
    4098  {   
     4064{
    40994065// For low multiplicity in the first intranuclear interaction the cascading
    41004066// process as described in G4HEInelastic::MediumEnergyCascading does not work
     
    41044070//  All quantities on the G4HEVector Array pv are in GeV- units.
    41054071
    4106    G4int protonCode       = Proton.getCode();
    4107    G4double protonMass    = Proton.getMass();
    4108    G4int neutronCode      = Neutron.getCode();
    4109    G4double kaonPlusMass  = KaonPlus.getMass();
    4110    G4int pionPlusCode     = PionPlus.getCode();   
    4111    G4int pionZeroCode     = PionZero.getCode();   
    4112    G4int pionMinusCode    = PionMinus.getCode();
    4113    G4String mesonType    = PionPlus.getType();
    4114    G4String baryonType    = Proton.getType();
    4115    G4String antiBaryonType= AntiProton.getType();
    4116    
    4117    G4double targetMass  = targetParticle.getMass();
    4118 
    4119    G4int    incidentCode          = incidentParticle.getCode();
    4120    G4double incidentMass          = incidentParticle.getMass();
    4121    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    4122    G4double incidentEnergy        = incidentParticle.getEnergy();
    4123    G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    4124    G4String incidentType          = incidentParticle.getType();
     4072  G4int protonCode       = Proton.getCode();
     4073  G4double protonMass    = Proton.getMass();
     4074  G4int neutronCode      = Neutron.getCode();
     4075  G4double kaonPlusMass  = KaonPlus.getMass();
     4076  G4int pionPlusCode     = PionPlus.getCode();   
     4077  G4int pionZeroCode     = PionZero.getCode();   
     4078  G4int pionMinusCode = PionMinus.getCode();
     4079  G4String mesonType = PionPlus.getType();
     4080  G4String baryonType = Proton.getType();
     4081  G4String antiBaryonType = AntiProton.getType();
     4082   
     4083  G4double targetMass = targetParticle.getMass();
     4084
     4085  G4int incidentCode = incidentParticle.getCode();
     4086  G4double incidentMass = incidentParticle.getMass();
     4087  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     4088  G4double incidentEnergy = incidentParticle.getEnergy();
     4089  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     4090  G4String incidentType = incidentParticle.getType();
    41254091//   G4double incidentTOF           = incidentParticle.getTOF();   
    4126    G4double incidentTOF          = 0.;
    4127    
    4128    // some local variables
    4129 
    4130    G4int i, j;
    4131    
    4132    if(verboseLevel > 1) G4cout << " G4HEInelastic::MediumEnergyClusterProduction " << G4endl;
    4133 
    4134    if (incidentTotalMomentum < 0.01)
    4135       {
    4136         successful = false;
    4137         return;
    4138       }
    4139    G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
    4140                                        +2.*targetMass*incidentEnergy);
    4141 
    4142    G4HEVector pvI = incidentParticle;  // for the incident particle
    4143    pvI.setSide( 1 );
    4144 
    4145    G4HEVector pvT = targetParticle;   // for the target particle
    4146    pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    4147    pvT.setSide( -1 );
    4148    pvT.setTOF( -1.);
     4092  G4double incidentTOF = 0.;
     4093   
     4094  // some local variables
     4095
     4096  G4int i, j;
     4097   
     4098  if (verboseLevel > 1)
     4099    G4cout << " G4HEInelastic::MediumEnergyClusterProduction " << G4endl;
     4100
     4101  if (incidentTotalMomentum < 0.01) {
     4102    successful = false;
     4103    return;
     4104  }
     4105  G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
     4106                                        +2.*targetMass*incidentEnergy);
     4107
     4108  G4HEVector pvI = incidentParticle;  // for the incident particle
     4109  pvI.setSide( 1 );
     4110
     4111  G4HEVector pvT = targetParticle;   // for the target particle
     4112  pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     4113  pvT.setSide( -1 );
     4114  pvT.setTOF( -1.);
    41494115 
    4150    // Distribute particles in forward and backward hemispheres. Note that
    4151    // only low multiplicity events from FirstIntInNuc.... should go into
    4152    // this routine.
     4116  // Distribute particles in forward and backward hemispheres. Note that
     4117  // only low multiplicity events from FirstIntInNuc.... should go into
     4118  // this routine.
    41534119 
    4154    G4int targ = 0; 
    4155    G4int ifor = 0;
    4156    G4int iback = 0;
    4157    G4int pvCode;
    4158    G4double pvMass, pvEnergy;
     4120  G4int targ = 0; 
     4121  G4int ifor = 0;
     4122  G4int iback = 0;
     4123  G4int pvCode;
     4124  G4double pvMass, pvEnergy;
    41594125
    41604126   pv[0].setSide(  1 );
     
    42074173   G4double nucsup[] = { 1.0, 0.8, 0.6, 0.5, 0.4};
    42084174
    4209    G4double xtarg = Amax(0.01,  (0.312+0.2*std::log(std::log(centerOfMassEnergy*centerOfMassEnergy)))
     4175   G4double xtarg = Amax(0.01, (0.312+0.2*std::log(std::log(centerOfMassEnergy*centerOfMassEnergy)))
    42104176                             * (std::pow(atomicWeight,0.33)-1.) * tb);
    42114177   G4int ntarg = Poisson(xtarg);
     
    45584524   }
    45594525
    4560    G4bool dum(0);
    4561    G4double ekin, teta;
    4562 
    4563    if( lead )
    4564      {
    4565        for( i=0; i<vecLen; i++ )
    4566           {
    4567             if( pv[i].getCode() == lead )
    4568               {
    4569                 dum = false;
    4570                 break;
    4571               }
    4572           }
    4573        if( dum )
    4574          {
    4575            i = 0;         
     4526  G4bool dum(0);
     4527  G4double ekin, teta;
     4528
     4529  if (lead) {
     4530    for (i = 0; i < vecLen; i++) {
     4531      if (pv[i].getCode() == lead) {
     4532        dum = false;
     4533        break;
     4534      }
     4535    }
     4536    // At this point dum is always false, so the following code
     4537    // cannot be executed.  For now, comment it out.
     4538    /*
     4539    if (dum) {
     4540      i = 0;         
    45764541 
    4577            if(   (    (leadParticle.getType() == baryonType ||
    4578                        leadParticle.getType() == antiBaryonType)
    4579                    && (pv[1].getType() == baryonType ||
    4580                        pv[1].getType() == antiBaryonType))
    4581               || (    (leadParticle.getType() == mesonType)
    4582                    && (pv[1].getType() == mesonType)))
    4583              {
    4584                i = 1;
    4585              }
    4586 
    4587             ekin = pv[i].getKineticEnergy();
    4588             pv[i] = leadParticle;
    4589             if( pv[i].getFlag() )
    4590                 pv[i].setTOF( -1.0 );
    4591             else
    4592                 pv[i].setTOF( 1.0 );
    4593             pv[i].setKineticEnergyAndUpdate( ekin );
    4594          }
    4595      }
     4542      if ( ( (leadParticle.getType() == baryonType ||
     4543              leadParticle.getType() == antiBaryonType)
     4544            && (pv[1].getType() == baryonType ||
     4545                pv[1].getType() == antiBaryonType))
     4546            || ( (leadParticle.getType() == mesonType)
     4547              && (pv[1].getType() == mesonType))) {
     4548        i = 1;
     4549      }
     4550
     4551      ekin = pv[i].getKineticEnergy();
     4552      pv[i] = leadParticle;
     4553      if (pv[i].getFlag() )
     4554         pv[i].setTOF( -1.0 );
     4555      else
     4556          pv[i].setTOF( 1.0 );
     4557      pv[i].setKineticEnergyAndUpdate( ekin );
     4558    }
     4559    */
     4560  }
    45964561
    45974562   pvmx[4].setMass( incidentMass);
     
    46824647   }
    46834648
    4684    // Rotate in the direction of the primary particle momentum (z-axis).
    4685    // This does disturb our inclusive distributions somewhat, but it is
    4686    // necessary for momentum conservation.
    4687 
    4688    // Also subtract binding energies and make some further corrections
    4689    // if required.
    4690 
    4691    G4double dekin = 0.0;
    4692    G4int npions = 0;   
    4693    G4double ek1 = 0.0;
    4694    G4double alekw, xxh;
    4695    G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
    4696    G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00};
    4697    G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65};
    4698    
    4699 
    4700    for (i = 0; i < vecLen; i++)
    4701       {
    4702         pv[i].Defs1( pv[i], pvI );
    4703         if (atomicWeight > 1.5)
    4704            {
    4705              ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
    4706              alekw = std::log( incidentKineticEnergy );
    4707              xxh   = 1.;
    4708              xxh   = 1.;
    4709              if(incidentCode == pionPlusCode || incidentCode == pionMinusCode)
    4710                {
    4711                  if(pv[i].getCode() == pionZeroCode)
    4712                    {
    4713                      if(G4UniformRand() < std::log(atomicWeight))
    4714                        {
    4715                          if (alekw > alem[0])
    4716                            {
    4717                               for (j = 1; j < 8; j++)
    4718                                  {
    4719                                     if(alekw < alem[j]) break;
    4720                                  }
    4721                               xxh =   (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alekw
    4722                                      + val0[j-1] - (val0[j]-val0[j-1])/(alem[j]-alem[j-1])*alem[j-1];
    4723                               xxh = 1. - xxh;
    4724                            }
    4725                        }     
    4726                     }
    4727                } 
    4728              dekin += ekin*(1.-xxh);
    4729              ekin *= xxh;
    4730              pv[i].setKineticEnergyAndUpdate( ekin );
    4731              pvCode = pv[i].getCode();
    4732              if ((pvCode == pionPlusCode) || (pvCode == pionMinusCode) || (pvCode == pionZeroCode))
    4733                 {
    4734                   npions += 1;
    4735                   ek1 += ekin;
     4649  // Rotate in the direction of the primary particle momentum (z-axis).
     4650  // This does disturb our inclusive distributions somewhat, but it is
     4651  // necessary for momentum conservation.
     4652
     4653  // Also subtract binding energies and make some further corrections
     4654  // if required.
     4655
     4656  G4double dekin = 0.0;
     4657  G4int npions = 0;   
     4658  G4double ek1 = 0.0;
     4659  G4double alekw, xxh;
     4660  G4double cfa = 0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.);
     4661  G4double alem[] = {1.40, 2.30, 2.70, 3.00, 3.40, 4.60, 7.00};
     4662  G4double val0[] = {0.00, 0.40, 0.48, 0.51, 0.54, 0.60, 0.65};
     4663
     4664  for (i = 0; i < vecLen; i++) {
     4665    pv[i].Defs1( pv[i], pvI );
     4666    if (atomicWeight > 1.5) {
     4667      ekin  = Amax( 1.e-6,pv[i].getKineticEnergy() - cfa*( 1. + 0.5*normal()));
     4668      alekw = std::log( incidentKineticEnergy );
     4669      xxh = 1.;
     4670      xxh = 1.;
     4671      if (incidentCode == pionPlusCode || incidentCode == pionMinusCode) {
     4672        if (pv[i].getCode() == pionZeroCode) {
     4673          if (G4UniformRand() < std::log(atomicWeight)) {
     4674            if (alekw > alem[0]) {
     4675              G4int jmax = 1;
     4676              for (j = 1; j < 8; j++) {
     4677                if (alekw < alem[j]) {
     4678                  jmax = j;
     4679                  break;
    47364680                }
    4737            }
    4738       }
     4681              }
     4682              xxh = (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alekw
     4683                   + val0[jmax-1] - (val0[jmax]-val0[jmax-1])/(alem[jmax]-alem[jmax-1])*alem[jmax-1];
     4684              xxh = 1. - xxh;
     4685            }
     4686          }     
     4687        }
     4688      } 
     4689      dekin += ekin*(1.-xxh);
     4690      ekin *= xxh;
     4691      pv[i].setKineticEnergyAndUpdate( ekin );
     4692      pvCode = pv[i].getCode();
     4693      if ((pvCode == pionPlusCode) ||
     4694          (pvCode == pionMinusCode) ||
     4695          (pvCode == pionZeroCode)) {
     4696        npions += 1;
     4697        ek1 += ekin;
     4698      }
     4699    }
     4700  }
     4701
    47394702   if( (ek1 > 0.0) && (npions > 0) )
    47404703      {
     
    49414904
    49424905void
    4943 G4HEInelastic::QuasiElasticScattering(G4bool &successful,
    4944                                             G4HEVector pv[],
    4945                                             G4int &vecLen,     
    4946                                             G4double &excitationEnergyGNP,
    4947                                             G4double &excitationEnergyDTA,
    4948                                             G4HEVector incidentParticle,
    4949                                             G4HEVector targetParticle,
    4950                                             G4double atomicWeight,
    4951                                             G4double atomicNumber )
    4952  {   
    4953 // if the Cascading or Resonance - model fails, we try this,
    4954 // QuasiElasticScattering.
    4955 //   
    4956 //  All quantities on the G4HEVector Array pv are in GeV- units.
    4957 
    4958    G4int protonCode       = Proton.getCode();
    4959    G4String mesonType     = PionPlus.getType();
    4960    G4String baryonType    = Proton.getType();
    4961    G4String antiBaryonType= AntiProton.getType();
    4962    
    4963    G4double targetMass   = targetParticle.getMass();
    4964 
    4965    G4double incidentMass          = incidentParticle.getMass();
    4966    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    4967    G4double incidentEnergy        = incidentParticle.getEnergy();
    4968    G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    4969    G4String incidentType          = incidentParticle.getType();
     4906G4HEInelastic::QuasiElasticScattering(G4bool& successful,
     4907                                      G4HEVector pv[],
     4908                                      G4int& vecLen,   
     4909                                      G4double& excitationEnergyGNP,
     4910                                      G4double& excitationEnergyDTA,
     4911                                      const G4HEVector& incidentParticle,
     4912                                      const G4HEVector& targetParticle,
     4913                                      G4double atomicWeight,
     4914                                      G4double atomicNumber)
     4915{
     4916  // if the Cascading or Resonance - model fails, we try this,
     4917  // QuasiElasticScattering.
     4918  //   
     4919  //  All quantities on the G4HEVector Array pv are in GeV- units.
     4920
     4921  G4int protonCode = Proton.getCode();
     4922  G4String mesonType = PionPlus.getType();
     4923  G4String baryonType = Proton.getType();
     4924  G4String antiBaryonType = AntiProton.getType();
     4925   
     4926  G4double targetMass = targetParticle.getMass();
     4927  G4double incidentMass = incidentParticle.getMass();
     4928  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     4929  G4double incidentEnergy = incidentParticle.getEnergy();
     4930  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     4931  G4String incidentType = incidentParticle.getType();
    49704932//   G4double incidentTOF           = incidentParticle.getTOF();   
    4971    G4double incidentTOF           = 0.;
    4972    
    4973    // some local variables
    4974 
    4975    G4int i;
    4976    
    4977    if(verboseLevel > 1)
    4978      G4cout << " G4HEInelastic::QuasiElasticScattering " << G4endl;
    4979 
    4980    if (incidentTotalMomentum < 0.01 || vecLen < 2 )
    4981       {
    4982         successful = false;
    4983         return;
    4984       }
    4985    G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
    4986                                        +2.*targetMass*incidentEnergy);
    4987 
    4988    G4HEVector pvI = incidentParticle;  // for the incident particle
    4989    pvI.setSide( 1 );
    4990 
    4991    G4HEVector pvT = targetParticle;   // for the target particle
    4992    pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
    4993    pvT.setSide( -1 );
    4994    pvT.setTOF( -1.);
    4995 
    4996    G4HEVector* pvmx = new G4HEVector[3];
    4997 
    4998    if (atomicWeight > 1.5)   // for the following case better use ElasticScattering.
    4999       {
    5000         if (    (pvI.getCode() == pv[0].getCode() )
    5001              && (pvT.getCode() == pv[1].getCode() )
    5002              && (excitationEnergyGNP < 0.001)
    5003              && (excitationEnergyDTA < 0.001)                            )
    5004            {
    5005              successful = false;
    5006              return;
    5007            }
    5008       }
    5009 
    5010    pv[0].setSide( 1 );
    5011    pv[0].setFlag( false );
    5012    pv[0].setTOF( incidentTOF);
    5013    pv[0].setMomentumAndUpdate( incidentParticle.getMomentum() );
    5014    pv[1].setSide( -1 );
    5015    pv[1].setFlag( false );
    5016    pv[1].setTOF( incidentTOF);
    5017    pv[1].setMomentumAndUpdate(targetParticle.getMomentum() );
    5018 
    5019    if ( (incidentTotalMomentum > 0.1) && (centerOfMassEnergy > 0.01) )
    5020       {
    5021         if ( pv[1].getType() == mesonType )
    5022            {
    5023              if (G4UniformRand() < 0.5)
    5024                  pv[1].setDefinition( "Proton");
    5025              else
    5026                  pv[1].setDefinition( "Neutron");
    5027            }
    5028         pvmx[0].Add( pvI, pvT );
    5029         pvmx[1].Lor( pvI, pvmx[0] );
    5030         pvmx[2].Lor( pvT, pvmx[0] );
    5031         G4double pin = pvmx[1].Length();
    5032         G4double bvalue = Amax(0.01 , 4.225+1.795*std::log(incidentTotalMomentum));
    5033         G4double pf =   sqr( sqr(centerOfMassEnergy) + sqr(pv[1].getMass()) - sqr(pv[0].getMass()))
    5034                       - 4 * sqr(centerOfMassEnergy) * sqr(pv[1].getMass());
    5035         if ( pf < 0.001)
    5036            {
    5037              successful = false;
    5038              return;
    5039            }
    5040         pf = std::sqrt(pf)/(2.*centerOfMassEnergy);
    5041         G4double btrang = 4. * bvalue * pin * pf;
    5042         G4double exindt = -1.;
    5043         if (btrang < 46.) exindt += std::exp(-btrang);
    5044         G4double tdn = std::log(1. + G4UniformRand()*exindt)/btrang;
    5045         G4double ctet = Amax( -1., Amin(1., 1. + 2.*tdn));
    5046         G4double stet = std::sqrt((1.-ctet)*(1.+ctet));
    5047         G4double phi  = twopi * G4UniformRand();
    5048         pv[0].setMomentumAndUpdate( pf*stet*std::sin(phi),
    5049                                     pf*stet*std::cos(phi),
    5050                                     pf*ctet         );
    5051         pv[1].SmulAndUpdate( pv[0], -1.);
    5052        
    5053         for (i = 0; i < 2; i++)
    5054            {
    5055              pv[i].Lor( pv[i], pvmx[4] );
    5056              pv[i].Defs1( pv[i], pvI );
    5057              if (atomicWeight > 1.5)
    5058                {
    5059                  G4double ekin =    pv[i].getKineticEnergy()
    5060                                  -  0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.)
    5061                                    *(1. + 0.5*normal());
    5062                  ekin = Amax(0.0001, ekin);
    5063                  pv[i].setKineticEnergyAndUpdate( ekin );
    5064                }
    5065            }
    5066       }
    5067    vecLen = 2;
    5068 
    5069    //  add black track particles
    5070    //  the total number of particles produced is restricted to 198
    5071    //  this may have influence on very high energies
    5072 
    5073    if (verboseLevel > 1)
    5074      G4cout << " Evaporation " << atomicWeight << " " <<
    5075                excitationEnergyGNP << " " <<  excitationEnergyDTA << G4endl;
     4933  G4double incidentTOF = 0.;
     4934   
     4935  // some local variables
     4936  G4int i;
     4937   
     4938  if (verboseLevel > 1)
     4939    G4cout << " G4HEInelastic::QuasiElasticScattering " << G4endl;
     4940
     4941  if (incidentTotalMomentum < 0.01 || vecLen < 2) {
     4942    successful = false;
     4943    return;
     4944  }
     4945
     4946  G4double centerOfMassEnergy = std::sqrt( sqr(incidentMass) + sqr(targetMass)
     4947                                        +2.*targetMass*incidentEnergy);
     4948
     4949  G4HEVector pvI = incidentParticle;  // for the incident particle
     4950  pvI.setSide( 1 );
     4951
     4952  G4HEVector pvT = targetParticle;   // for the target particle
     4953  pvT.setMomentumAndUpdate( 0.0, 0.0, 0.0 );
     4954  pvT.setSide( -1 );
     4955  pvT.setTOF( -1.);
     4956
     4957  G4HEVector* pvmx = new G4HEVector[3];
     4958
     4959  if (atomicWeight > 1.5) {
     4960    // for the following case better use ElasticScattering
     4961    if (   (pvI.getCode() == pv[0].getCode() )
     4962        && (pvT.getCode() == pv[1].getCode() )
     4963        && (excitationEnergyGNP < 0.001)
     4964        && (excitationEnergyDTA < 0.001) ) {
     4965      successful = false;
     4966      delete [] pvmx;
     4967      return;
     4968    }
     4969  }
     4970
     4971  pv[0].setSide( 1 );
     4972  pv[0].setFlag( false );
     4973  pv[0].setTOF( incidentTOF);
     4974  pv[0].setMomentumAndUpdate( incidentParticle.getMomentum() );
     4975  pv[1].setSide( -1 );
     4976  pv[1].setFlag( false );
     4977  pv[1].setTOF( incidentTOF);
     4978  pv[1].setMomentumAndUpdate(targetParticle.getMomentum() );
     4979
     4980  if ((incidentTotalMomentum > 0.1) && (centerOfMassEnergy > 0.01) ) {
     4981    if (pv[1].getType() == mesonType) {
     4982      if (G4UniformRand() < 0.5)
     4983        pv[1].setDefinition( "Proton");
     4984      else
     4985        pv[1].setDefinition( "Neutron");
     4986    }
     4987    pvmx[0].Add( pvI, pvT );
     4988    pvmx[1].Lor( pvI, pvmx[0] );
     4989    pvmx[2].Lor( pvT, pvmx[0] );
     4990    G4double pin = pvmx[1].Length();
     4991    G4double bvalue = Amax(0.01 , 4.225+1.795*std::log(incidentTotalMomentum));
     4992    G4double pf = sqr(sqr(centerOfMassEnergy) + sqr(pv[1].getMass()) - sqr(pv[0].getMass()))
     4993                  - 4 * sqr(centerOfMassEnergy) * sqr(pv[1].getMass());
     4994
     4995    if (pf < 0.001) {
     4996      successful = false;
     4997      delete [] pvmx;
     4998      return;
     4999    }
     5000    pf = std::sqrt(pf)/(2.*centerOfMassEnergy);
     5001    G4double btrang = 4. * bvalue * pin * pf;
     5002    G4double exindt = -1.;
     5003    if (btrang < 46.) exindt += std::exp(-btrang);
     5004    G4double tdn = std::log(1. + G4UniformRand()*exindt)/btrang;
     5005    G4double ctet = Amax( -1., Amin(1., 1. + 2.*tdn));
     5006    G4double stet = std::sqrt((1.-ctet)*(1.+ctet));
     5007    G4double phi  = twopi * G4UniformRand();
     5008    pv[0].setMomentumAndUpdate( pf*stet*std::sin(phi),
     5009                                pf*stet*std::cos(phi),
     5010                                pf*ctet         );
     5011    pv[1].SmulAndUpdate( pv[0], -1.);
     5012    for (i = 0; i < 2; i++) {
     5013      // **  pv[i].Lor( pv[i], pvmx[4] );
     5014      // ** DHW 1 Dec 2010 : index 4 out of range : use 0
     5015      pv[i].Lor(pv[i], pvmx[0]);
     5016      pv[i].Defs1(pv[i], pvI);
     5017      if (atomicWeight > 1.5) {
     5018        G4double ekin = pv[i].getKineticEnergy()
     5019                     -  0.025*((atomicWeight-1.)/120.)*std::exp(-(atomicWeight-1.)/120.)
     5020                       *(1. + 0.5*normal());
     5021        ekin = Amax(0.0001, ekin);
     5022        pv[i].setKineticEnergyAndUpdate( ekin );
     5023      }
     5024    }
     5025  }
     5026  vecLen = 2;
     5027
     5028  //  add black track particles
     5029  //  the total number of particles produced is restricted to 198
     5030  //  this may have influence on very high energies
     5031
     5032  if (verboseLevel > 1)
     5033    G4cout << " Evaporation " << atomicWeight << " "
     5034           << excitationEnergyGNP << " " <<  excitationEnergyDTA << G4endl;
    50765035
    50775036   if( atomicWeight > 1.5 )
     
    52305189   }
    52315190
    5232    successful = true;
    5233    delete [] pvmx;
    5234    return;
    5235  }
     5191  successful = true;
     5192  delete [] pvmx;
     5193  return;
     5194}
    52365195
    52375196void
    5238 G4HEInelastic::ElasticScattering(G4bool &successful,
     5197G4HEInelastic::ElasticScattering(G4bool& successful,
    52395198                                 G4HEVector pv[],
    5240                                  G4int &vecLen, 
    5241                                  G4HEVector incidentParticle,
     5199                                 G4int& vecLen, 
     5200                                 const G4HEVector& incidentParticle,
    52425201                                 G4double atomicWeight,
    52435202                                 G4double /* atomicNumber*/)
    5244  {
    5245    if(verboseLevel > 1)
    5246      G4cout << " G4HEInelastic::ElasticScattering " << G4endl;
    5247 
    5248    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    5249    if (verboseLevel > 1)
    5250      G4cout << "DoIt: Incident particle momentum="
    5251             << incidentTotalMomentum << " GeV" << G4endl;
    5252    if (incidentTotalMomentum < 0.01)
    5253       {
    5254         successful = false;
    5255         return;
    5256       }
     5203{
     5204  if (verboseLevel > 1)
     5205    G4cout << " G4HEInelastic::ElasticScattering " << G4endl;
     5206
     5207  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     5208  if (verboseLevel > 1)
     5209    G4cout << "DoIt: Incident particle momentum="
     5210           << incidentTotalMomentum << " GeV" << G4endl;
     5211  if (incidentTotalMomentum < 0.01) {
     5212      successful = false;
     5213      return;
     5214  }
     5215
    52575216   if (atomicWeight < 0.5)
    52585217      {
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEKaonMinusInelastic.cc,v 1.14 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEKaonMinusInelastic.cc,v 1.16 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff
     35// and the low energy two-body model.  Not included is the low energy stuff
    3936// like nuclear reactions, nuclear fission without any cascading and all
    4037// processes for particles at rest. 
     
    4542#include "G4HEKaonMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEKaonMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEKaonMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                      G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEKaonMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEKaonMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    85 
    86     incidentKineticEnergy -= inelasticity;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEKaonMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEKaonMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                            atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     80
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130 
    131     vecLength  = 0;           
    132        
    133     if(verboseLevel > 1)
    134       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113
     114  vecLength = 0;
     115
     116  if (verboseLevel > 1)
     117    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    135118           << incidentCode << G4endl;
    136119
    137     G4bool successful = false;
     120  G4bool successful = false;
    138121   
    139     if(inElastic || (!inElastic && atomicWeight < 1.5))
    140       {
    141         FirstIntInCasKaonMinus(inElastic, availableEnergy, pv, vecLength,
    142                                incidentParticle, targetParticle);
    143 
    144         if(verboseLevel > 1)
    145            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    146 
    147 
    148         if ((vecLength > 0) && (availableEnergy > 1.))
    149                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    150                                                   pv, vecLength,
    151                                                   incidentParticle, targetParticle);
    152             HighEnergyCascading( successful, pv, vecLength,
    153                                  excitationEnergyGNP, excitationEnergyDTA,
    154                                  incidentParticle, targetParticle,
    155                                  atomicWeight, atomicNumber);
    156         if (!successful)
    157             HighEnergyClusterProduction( successful, pv, vecLength,
    158                                          excitationEnergyGNP, excitationEnergyDTA,
    159                                          incidentParticle, targetParticle,
    160                                          atomicWeight, atomicNumber);
    161         if (!successful)
    162             MediumEnergyCascading( successful, pv, vecLength,
    163                                    excitationEnergyGNP, excitationEnergyDTA,
    164                                    incidentParticle, targetParticle,
    165                                    atomicWeight, atomicNumber);
    166 
    167         if (!successful)
    168             MediumEnergyClusterProduction( successful, pv, vecLength,
    169                                            excitationEnergyGNP, excitationEnergyDTA,       
    170                                            incidentParticle, targetParticle,
    171                                            atomicWeight, atomicNumber);
    172         if (!successful)
    173             QuasiElasticScattering( successful, pv, vecLength,
    174                                     excitationEnergyGNP, excitationEnergyDTA,
    175                                     incidentParticle, targetParticle,
    176                                     atomicWeight, atomicNumber);
    177       }
    178     if (!successful)
    179       {
    180             ElasticScattering( successful, pv, vecLength,
    181                                incidentParticle,   
    182                                atomicWeight, atomicNumber);
    183       }
    184 
    185     if (!successful)
    186       {
    187         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    188       }
    189       FillParticleChange(pv,  vecLength);
    190       delete [] pv;
    191       theParticleChange.SetStatusChange(stopAndKill);
    192       return & theParticleChange;
    193   }
     122  FirstIntInCasKaonMinus(inElastic, availableEnergy, pv, vecLength,
     123                         incidentParticle, targetParticle);
     124
     125  if (verboseLevel > 1)
     126    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     127
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
     151                                  incidentParticle, targetParticle,
     152                                  atomicWeight, atomicNumber);
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
     158  if (!successful)
     159    ElasticScattering(successful, pv, vecLength,
     160                      incidentParticle,   
     161                      atomicWeight, atomicNumber);
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv,  vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    194172
    195173void
    196   G4HEKaonMinusInelastic::FirstIntInCasKaonMinus( G4bool &inElastic,
    197                                                   const G4double availableEnergy,
    198                                                   G4HEVector pv[],
    199                                                   G4int &vecLen,
    200                                                   G4HEVector incidentParticle,
    201                                                   G4HEVector targetParticle)
     174G4HEKaonMinusInelastic::FirstIntInCasKaonMinus(G4bool& inElastic,
     175                                               const G4double availableEnergy,
     176                                               G4HEVector pv[],
     177                                               G4int& vecLen,
     178                                               const G4HEVector& incidentParticle,
     179                                               const G4HEVector& targetParticle)
    202180
    203181// Kaon- undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208186// protons/neutrons by kaons or strange baryons according to the average
    209187// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222    G4int              neutronCode = Neutron.getCode();
    223    G4int               protonCode = Proton.getCode();
    224    G4int            kaonMinusCode = KaonMinus.getCode();
    225    G4int             kaonZeroCode = KaonZero.getCode();
    226    G4int         antiKaonZeroCode = AntiKaonZero.getCode(); 
    227 
    228    G4int               targetCode = targetParticle.getCode();
    229 //   G4double          incidentMass = incidentParticle.getMass();
    230 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    231    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    232 
    233    static G4bool first = true;
    234    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    235    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    236 
    237 //                                misc. local variables
    238 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    239 
    240    G4int i, counter, nt, np, nm, nz;
     188{
     189  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     190  static const G4double expxl = -expxu;         // lower bound for arg. of exp
     191
     192  static const G4double protb = 0.7;
     193  static const G4double neutb = 0.7;
     194  static const G4double     c = 1.25;
     195
     196  static const G4int numMul = 1200;
     197  static const G4int numSec = 60;
     198
     199  G4int neutronCode = Neutron.getCode();
     200  G4int protonCode = Proton.getCode();
     201  G4int kaonMinusCode = KaonMinus.getCode();
     202  G4int kaonZeroCode = KaonZero.getCode();
     203  G4int antiKaonZeroCode = AntiKaonZero.getCode(); 
     204
     205  G4int targetCode = targetParticle.getCode();
     206  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     207
     208  static G4bool first = true;
     209  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     210  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     211
     212  // misc. local variables
     213  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     214
     215  G4int i, counter, nt, np, nm, nz;
    241216
    242217   if( first )
    243      {                         // compute normalization constants, this will only be done once
     218     {       // compute normalization constants, this will only be done once
    244219       first = false;
    245220       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonPlusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEKaonPlusInelastic.cc,v 1.14 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEKaonPlusInelastic.cc,v 1.16 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEKaonPlusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEKaonPlusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEKaonPlusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                     G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEKaonPlusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEKaonPlusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEKaonPlusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEKaonPlusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107 
    108     if(G4UniformRand() < atomicNumber/atomicWeight)
    109       {
    110         targetParticle.setDefinition("Proton");
    111       }
    112     else
    113       {
    114         targetParticle.setDefinition("Neutron");
    115       }
    116 
    117     G4double targetMass         = targetParticle.getMass();
    118     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    119                                        + 2.0*targetMass*incidentTotalEnergy);
    120     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    121 
    122                                                                 // this was the meaning of inElastic in the
    123                                                                 // original Gheisha stand-alone version.
    124 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    125 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    126                                                                 // by unknown reasons, it has been replaced
    127                                                                 // to the following code in Geant???
    128     G4bool inElastic = true;
    129 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    130 
    131     vecLength  = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100
     101  if (G4UniformRand() < atomicNumber/atomicWeight) {
     102    targetParticle.setDefinition("Proton");
     103  } else {
     104    targetParticle.setDefinition("Neutron");
     105  }
     106
     107  G4double targetMass = targetParticle.getMass();
     108  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     109                                        + targetMass*targetMass
     110                                        + 2.0*targetMass*incidentTotalEnergy);
     111  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     112
     113  G4bool inElastic = true;
     114  vecLength = 0;
    132115       
    133     if(verboseLevel > 1)
    134       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     116  if (verboseLevel > 1)
     117    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    135118           << incidentCode << G4endl;
    136119
    137     G4bool successful = false;
     120  G4bool successful = false;
    138121   
    139     if(inElastic || (!inElastic && atomicWeight < 1.5))
    140       {
    141         FirstIntInCasKaonPlus(inElastic, availableEnergy, pv, vecLength,
    142                               incidentParticle, targetParticle, atomicWeight);
    143 
    144         if(verboseLevel > 1)
    145            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    146 
    147 
    148 
    149         if ((vecLength > 0) && (availableEnergy > 1.))
    150                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    151                                                   pv, vecLength,
    152                                                   incidentParticle, targetParticle);
    153             HighEnergyCascading( successful, pv, vecLength,
    154                                  excitationEnergyGNP, excitationEnergyDTA,
    155                                  incidentParticle, targetParticle,
    156                                  atomicWeight, atomicNumber);
    157         if (!successful)
    158             HighEnergyClusterProduction( successful, pv, vecLength,
    159                                          excitationEnergyGNP, excitationEnergyDTA,
    160                                          incidentParticle, targetParticle,
    161                                          atomicWeight, atomicNumber);
    162         if (!successful)
    163             MediumEnergyCascading( successful, pv, vecLength,
    164                                    excitationEnergyGNP, excitationEnergyDTA,
    165                                    incidentParticle, targetParticle,
    166                                    atomicWeight, atomicNumber);
    167 
    168         if (!successful)
    169             MediumEnergyClusterProduction( successful, pv, vecLength,
    170                                            excitationEnergyGNP, excitationEnergyDTA,       
    171                                            incidentParticle, targetParticle,
    172                                            atomicWeight, atomicNumber);
    173         if (!successful)
    174             QuasiElasticScattering( successful, pv, vecLength,
    175                                     excitationEnergyGNP, excitationEnergyDTA,
    176                                     incidentParticle, targetParticle,
    177                                     atomicWeight, atomicNumber);
    178       }
    179     if (!successful)
    180       {
    181             ElasticScattering( successful, pv, vecLength,
    182                                incidentParticle,   
    183                                atomicWeight, atomicNumber);
    184       }
    185 
    186     if (!successful)
    187       {
    188         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    189       }
    190       FillParticleChange(pv,  vecLength);
    191       delete [] pv;
    192       theParticleChange.SetStatusChange(stopAndKill);
    193       return & theParticleChange;
    194   }
     122  FirstIntInCasKaonPlus(inElastic, availableEnergy, pv, vecLength,
     123                        incidentParticle, targetParticle, atomicWeight);
     124
     125  if (verboseLevel > 1)
     126    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     127
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
     151                                  incidentParticle, targetParticle,
     152                                  atomicWeight, atomicNumber);
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
     158  if (!successful)
     159    ElasticScattering(successful, pv, vecLength,
     160                      incidentParticle,   
     161                      atomicWeight, atomicNumber);
     162
     163  if (!successful)
     164    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     165           << G4endl;
     166
     167  FillParticleChange(pv,  vecLength);
     168  delete [] pv;
     169  theParticleChange.SetStatusChange(stopAndKill);
     170  return &theParticleChange;
     171}
     172
    195173
    196174void
    197 G4HEKaonPlusInelastic::FirstIntInCasKaonPlus( G4bool &inElastic,
    198                                               const G4double availableEnergy,
    199                                               G4HEVector pv[],
    200                                               G4int &vecLen,
    201                                               G4HEVector incidentParticle,
    202                                               G4HEVector targetParticle,
    203                                               const G4double atomicWeight)
     175G4HEKaonPlusInelastic::FirstIntInCasKaonPlus(G4bool& inElastic,
     176                                             const G4double availableEnergy,
     177                                             G4HEVector pv[],
     178                                             G4int& vecLen,
     179                                             const G4HEVector& incidentParticle,
     180                                             const G4HEVector& targetParticle,
     181                                             const G4double atomicWeight)
    204182
    205183// Kaon+ undergoes interaction with nucleon within a nucleus.  Check if it is
     
    210188// protons/neutrons by kaons or strange baryons according to the average
    211189// multiplicity per inelastic reaction.
    212 
    213  {
    214    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    215    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    216 
    217    static const G4double protb = 0.7;
    218    static const G4double neutb = 0.7;
    219    static const G4double     c = 1.25;
    220 
    221    static const G4int   numMul = 1200;
    222    static const G4int   numSec = 60;
    223 
    224    G4int              neutronCode = Neutron.getCode();
    225    G4int              protonCode  = Proton.getCode();
    226 
    227    G4int               targetCode = targetParticle.getCode();
    228 //   G4double          incidentMass = incidentParticle.getMass();
    229 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    230    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    231 
    232    static G4bool first = true;
    233    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    234    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    235 
    236 //                                misc. local variables
    237 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    238 
    239    G4int i, counter, nt, np, nm, nz;
     190{
     191  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     192  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     193
     194  static const G4double protb = 0.7;
     195  static const G4double neutb = 0.7;
     196  static const G4double     c = 1.25;
     197
     198  static const G4int   numMul = 1200;
     199  static const G4int   numSec = 60;
     200
     201  G4int neutronCode = Neutron.getCode();
     202  G4int protonCode = Proton.getCode();
     203
     204  G4int targetCode = targetParticle.getCode();
     205  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     206
     207  static G4bool first = true;
     208  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     209  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     210
     211  // misc. local variables
     212  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     213
     214  G4int i, counter, nt, np, nm, nz;
    240215
    241216   if( first )
    242      {                         // compute normalization constants, this will only be done once
     217     {         // compute normalization constants, this will only be done once
    243218       first = false;
    244219       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEKaonZeroInelastic.cc,v 1.16 2010/02/09 22:02:20 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEKaonZeroInelastic.cc,v 1.18 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEKaonZeroInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEKaonZeroInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEKaonZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                     G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEKaonZeroInelastic: incident energy < 1 GeV" << G4endl;;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEKaonZeroInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEKaonZeroInelastic: incident energy < 1 GeV" << G4endl;;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEKaonZeroInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8075   
    81     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
    131        
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
     114
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
    141                               incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
    186                << G4endl;
    187 
    188     FillParticleChange(pv,  vecLength);
    189 
    190     delete [] pv;
    191     theParticleChange.SetStatusChange(stopAndKill);
    192     return & theParticleChange;
    193   }
     121  FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
     122                        incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv,  vecLength);
     167
     168  delete [] pv;
     169  theParticleChange.SetStatusChange(stopAndKill);
     170  return &theParticleChange;
     171}
     172
    194173
    195174void
    196 G4HEKaonZeroInelastic::FirstIntInCasKaonZero( G4bool &inElastic,
    197                                               const G4double availableEnergy,
    198                                               G4HEVector pv[],
    199                                               G4int &vecLen,
    200                                               G4HEVector incidentParticle,
    201                                               G4HEVector targetParticle,
    202                                               const G4double atomicWeight)
     175G4HEKaonZeroInelastic::FirstIntInCasKaonZero(G4bool& inElastic,
     176                                             const G4double availableEnergy,
     177                                             G4HEVector pv[],
     178                                             G4int& vecLen,
     179                                             const G4HEVector& incidentParticle,
     180                                             const G4HEVector& targetParticle,
     181                                             const G4double atomicWeight)
    203182
    204183// Kaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    209188// protons/neutrons by kaons or strange baryons according to the average
    210189// multiplicity per inelastic reaction.
    211 
    212  {
    213    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    214    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    215 
    216    static const G4double protb = 0.7;
    217    static const G4double neutb = 0.7;
    218    static const G4double     c = 1.25;
    219 
    220    static const G4int   numMul = 1200;
    221    static const G4int   numSec = 60;
    222 
    223    G4int              neutronCode = Neutron.getCode();
    224    G4int              protonCode  = Proton.getCode();
    225 
    226    G4int               targetCode = targetParticle.getCode();
    227 //   G4double          incidentMass = incidentParticle.getMass();
    228 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    229    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    230 
    231    static G4bool first = true;
    232    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    233    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    234 
    235 //                                misc. local variables
    236 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    237 
    238    G4int i, counter, nt, np, nm, nz;
     190{
     191  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     192  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     193
     194  static const G4double protb = 0.7;
     195  static const G4double neutb = 0.7;
     196  static const G4double     c = 1.25;
     197
     198  static const G4int numMul = 1200;
     199  static const G4int numSec = 60;
     200
     201  G4int neutronCode = Neutron.getCode();
     202  G4int protonCode  = Proton.getCode();
     203
     204  G4int targetCode = targetParticle.getCode();
     205  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     206
     207  static G4bool first = true;
     208  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     209  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     210
     211  // misc. local variables
     212  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     213
     214  G4int i, counter, nt, np, nm, nz;
    239215
    240216   if( first )
    241      {                         // compute normalization constants, this will only be done once
     217     {     // compute normalization constants, this will only be done once
    242218       first = false;
    243219       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroLongInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HEKaonZeroLongInelastic.cc,v 1.11 2010/02/09 21:59:10 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    28 //
     26// $Id: G4HEKaonZeroLongInelastic.cc,v 1.13 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029
     
    3231#include "G4ios.hh"
    3332
    34 //
    3533// G4 Process: Gheisha High Energy Collision model.
    3634// This includes the high energy cascading model, the two-body-resonance model
    37 // and the low energy two-body model. Not included are the low energy stuff like
    38 // nuclear reactions, nuclear fission without any cascading and all processes for
    39 // particles at rest.
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest.
    4038// 
    4139// New version by D.H. Wright (SLAC) to fix seg fault in old version
     
    4543#include "G4HEKaonZeroLongInelastic.hh"
    4644
    47 G4HadFinalState* G4HEKaonZeroLongInelastic::
    48 ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
     45G4HadFinalState*
     46G4HEKaonZeroLongInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     47                                         G4Nucleus& targetNucleus)
    4948{
    50   G4HEVector * pv = new G4HEVector[MAXPART];
    51   const G4HadProjectile *aParticle = &aTrack;
     49  G4HEVector* pv = new G4HEVector[MAXPART];
     50  const G4HadProjectile* aParticle = &aTrack;
    5251  const G4double atomicWeight = targetNucleus.GetN();
    5352  const G4double atomicNumber = targetNucleus.GetZ();
    5453  G4HEVector incidentParticle(aParticle);
    5554
    56   G4int    incidentCode          = incidentParticle.getCode();
    57   G4double incidentMass          = incidentParticle.getMass();
    58   G4double incidentTotalEnergy   = incidentParticle.getEnergy();
     55  G4int incidentCode = incidentParticle.getCode();
     56  G4double incidentMass = incidentParticle.getMass();
     57  G4double incidentTotalEnergy = incidentParticle.getEnergy();
    5958  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    6059  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     
    9392  incidentKineticEnergy -= excitation;
    9493  incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    95   incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    96                                   *(incidentTotalEnergy+incidentMass));
    97 
     94  incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)
     95                                     *(incidentTotalEnergy+incidentMass));
    9896
    9997  G4HEVector targetParticle;
    100   if(G4UniformRand() < atomicNumber/atomicWeight) {
     98  if (G4UniformRand() < atomicNumber/atomicWeight) {
    10199    targetParticle.setDefinition("Proton");
    102100  } else {
     
    105103
    106104  G4double targetMass = targetParticle.getMass();
    107   G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    108                                        + 2.0*targetMass*incidentTotalEnergy);
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                        + targetMass*targetMass
     107                                        + 2.0*targetMass*incidentTotalEnergy);
    109108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
    110                                     // this was the meaning of inElastic in the
    111                                     // original Gheisha stand-alone version.
    112 //  G4bool inElastic = InElasticCrossSectionInFirstInt
    113 //                      (availableEnergy, incidentCode, incidentTotalMomentum); 
    114 // for unknown reasons, it has been replaced by the following code in Geant???
    115109
    116110  G4bool inElastic = true;
    117 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    118 
    119111  vecLength = 0;           
    120112       
     
    125117  G4bool successful = false;
    126118   
    127   if(inElastic || (!inElastic && atomicWeight < 1.5)) {
    128  
    129     // Split K0L into K0 and K0bar
    130     if (G4UniformRand() < 0.5)
    131       FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
    132                                 incidentParticle, targetParticle );
    133     else
    134       FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
    135                             incidentParticle, targetParticle, atomicWeight );
    136 
    137     // Do nuclear interaction with either K0 or K0bar
    138     if ((vecLength > 0) && (availableEnergy > 1.))
    139       StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
    140                                     pv, vecLength,
    141                                     incidentParticle, targetParticle);
    142     HighEnergyCascading(successful, pv, vecLength,
    143                         excitationEnergyGNP, excitationEnergyDTA,
    144                         incidentParticle, targetParticle,
    145                         atomicWeight, atomicNumber);
    146     if (!successful)
    147       HighEnergyClusterProduction(successful, pv, vecLength,
    148                                   excitationEnergyGNP, excitationEnergyDTA,
     119  // Split K0L into K0 and K0bar
     120  if (G4UniformRand() < 0.5)
     121    FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
     122                              incidentParticle, targetParticle);
     123  else
     124    FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
     125                          incidentParticle, targetParticle, atomicWeight);
     126
     127  // Do nuclear interaction with either K0 or K0bar
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
    149151                                  incidentParticle, targetParticle,
    150152                                  atomicWeight, atomicNumber);
    151     if (!successful)
    152       MediumEnergyCascading(successful, pv, vecLength,
    153                             excitationEnergyGNP, excitationEnergyDTA,
    154                             incidentParticle, targetParticle,
    155                             atomicWeight, atomicNumber);
    156 
    157     if (!successful)
    158       MediumEnergyClusterProduction(successful, pv, vecLength,
    159                                     excitationEnergyGNP, excitationEnergyDTA,       
    160                                     incidentParticle, targetParticle,
    161                                     atomicWeight, atomicNumber);
    162     if (!successful)
    163       QuasiElasticScattering(successful, pv, vecLength,
    164                              excitationEnergyGNP, excitationEnergyDTA,
    165                              incidentParticle, targetParticle,
    166                              atomicWeight, atomicNumber);
    167   }
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
    168158
    169159  if (!successful)
     
    193183  delete [] pv;
    194184  theParticleChange.SetStatusChange(stopAndKill);
    195   return & theParticleChange;
     185  return &theParticleChange;
    196186}
    197187
    198188
    199189void
    200 G4HEKaonZeroLongInelastic::FirstIntInCasKaonZero(G4bool &inElastic,
     190G4HEKaonZeroLongInelastic::FirstIntInCasKaonZero(G4bool& inElastic,
    201191                                                 const G4double availableEnergy,
    202192                                                 G4HEVector pv[],
    203                                                  G4int &vecLen,
    204                                                  G4HEVector incidentParticle,
    205                                                  G4HEVector targetParticle,
     193                                                 G4int& vecLen,
     194                                                 const G4HEVector& incidentParticle,
     195                                                 const G4HEVector& targetParticle,
    206196                                                 const G4double atomicWeight)
    207197
     
    213203// protons/neutrons by kaons or strange baryons according to the average
    214204// multiplicity per inelastic reaction.
    215 
    216205{
    217   static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    218   static const G4double expxl = -expxu;         // lower bound for arg. of exp
     206  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     207  static const G4double expxl = -expxu;             // lower bound for arg. of exp
    219208
    220209  static const G4double protb = 0.7;
     
    521510
    522511void
    523 G4HEKaonZeroLongInelastic::FirstIntInCasAntiKaonZero(G4bool &inElastic,
     512G4HEKaonZeroLongInelastic::FirstIntInCasAntiKaonZero(G4bool& inElastic,
    524513                                                     const G4double availableEnergy,
    525514                                                     G4HEVector pv[],
    526                                                      G4int &vecLen,
    527                                                      G4HEVector incidentParticle,
    528                                                      G4HEVector targetParticle )
     515                                                     G4int& vecLen,
     516                                                     const G4HEVector& incidentParticle,
     517                                                     const G4HEVector& targetParticle)
    529518
    530519// AntiKaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    560549  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    561550
    562 //  misc. local variables
    563 //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     551  //  misc. local variables
     552  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    564553
    565554  G4int i, counter, nt, np, nm, nz;
    566555
    567   if(first) {
     556  if (first) {
    568557    // compute normalization constants, this will only be done once
    569558    first = false;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroShortInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4HEKaonZeroShortInelastic.cc,v 1.11 2010/02/09 21:58:57 dennis Exp $
    27 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    28 //
     26// $Id: G4HEKaonZeroShortInelastic.cc,v 1.13 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2928//
    3029
     
    3231#include "G4ios.hh"
    3332
    34 //
    3533// G4 Process: Gheisha High Energy Collision model.
    3634// This includes the high energy cascading model, the two-body-resonance model
    37 // and the low energy two-body model. Not included are the low energy stuff like
    38 // nuclear reactions, nuclear fission without any cascading and all processes for
    39 // particles at rest.
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest.
    4038// 
    4139// New version by D.H. Wright (SLAC) to fix seg fault in old version
     
    4543#include "G4HEKaonZeroShortInelastic.hh"
    4644
    47 G4HadFinalState* G4HEKaonZeroShortInelastic::
    48 ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus)
     45G4HadFinalState*
     46G4HEKaonZeroShortInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     47                                          G4Nucleus& targetNucleus)
    4948{
    50   G4HEVector * pv = new G4HEVector[MAXPART];
    51   const G4HadProjectile *aParticle = &aTrack;
     49  G4HEVector* pv = new G4HEVector[MAXPART];
     50  const G4HadProjectile* aParticle = &aTrack;
    5251  const G4double atomicWeight = targetNucleus.GetN();
    5352  const G4double atomicNumber = targetNucleus.GetZ();
    5453  G4HEVector incidentParticle(aParticle);
    5554
    56   G4int    incidentCode          = incidentParticle.getCode();
    57   G4double incidentMass          = incidentParticle.getMass();
    58   G4double incidentTotalEnergy   = incidentParticle.getEnergy();
     55  G4int incidentCode = incidentParticle.getCode();
     56  G4double incidentMass = incidentParticle.getMass();
     57  G4double incidentTotalEnergy = incidentParticle.getEnergy();
    5958  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    6059  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     
    9291
    9392  incidentKineticEnergy -= excitation;
    94   incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    95   incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    96                                   *(incidentTotalEnergy+incidentMass));
    97 
     93  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     94  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     95                                    *(incidentTotalEnergy+incidentMass));
    9896
    9997  G4HEVector targetParticle;
     
    105103
    106104  G4double targetMass = targetParticle.getMass();
    107   G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    108                                        + 2.0*targetMass*incidentTotalEnergy);
     105  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     106                                        + targetMass*targetMass
     107                                        + 2.0*targetMass*incidentTotalEnergy);
    109108  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
    110                                     // this was the meaning of inElastic in the
    111                                     // original Gheisha stand-alone version.
    112 //  G4bool inElastic = InElasticCrossSectionInFirstInt
    113 //                      (availableEnergy, incidentCode, incidentTotalMomentum); 
    114 // for unknown reasons, it has been replaced by the following code in Geant???
    115109
    116110  G4bool inElastic = true;
    117 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    118 
    119111  vecLength = 0;           
    120112       
     
    125117  G4bool successful = false;
    126118   
    127   if(inElastic || (!inElastic && atomicWeight < 1.5)) {
    128  
    129     // Split K0L into K0 and K0bar
    130     if (G4UniformRand() < 0.5)
    131       FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
    132                                 incidentParticle, targetParticle );
    133     else
    134       FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
    135                             incidentParticle, targetParticle, atomicWeight );
    136 
    137     // Do nuclear interaction with either K0 or K0bar
    138     if ((vecLength > 0) && (availableEnergy > 1.))
    139       StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
    140                                     pv, vecLength,
    141                                     incidentParticle, targetParticle);
    142     HighEnergyCascading(successful, pv, vecLength,
    143                         excitationEnergyGNP, excitationEnergyDTA,
    144                         incidentParticle, targetParticle,
    145                         atomicWeight, atomicNumber);
    146     if (!successful)
    147       HighEnergyClusterProduction(successful, pv, vecLength,
    148                                   excitationEnergyGNP, excitationEnergyDTA,
     119  // Split K0L into K0 and K0bar
     120  if (G4UniformRand() < 0.5)
     121    FirstIntInCasAntiKaonZero(inElastic, availableEnergy, pv, vecLength,
     122                              incidentParticle, targetParticle );
     123  else
     124    FirstIntInCasKaonZero(inElastic, availableEnergy, pv, vecLength,
     125                          incidentParticle, targetParticle, atomicWeight );
     126
     127  // Do nuclear interaction with either K0 or K0bar
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
    149151                                  incidentParticle, targetParticle,
    150152                                  atomicWeight, atomicNumber);
    151     if (!successful)
    152       MediumEnergyCascading(successful, pv, vecLength,
    153                             excitationEnergyGNP, excitationEnergyDTA,
    154                             incidentParticle, targetParticle,
    155                             atomicWeight, atomicNumber);
    156 
    157     if (!successful)
    158       MediumEnergyClusterProduction(successful, pv, vecLength,
    159                                     excitationEnergyGNP, excitationEnergyDTA,       
    160                                     incidentParticle, targetParticle,
    161                                     atomicWeight, atomicNumber);
    162     if (!successful)
    163       QuasiElasticScattering(successful, pv, vecLength,
    164                              excitationEnergyGNP, excitationEnergyDTA,
    165                              incidentParticle, targetParticle,
    166                              atomicWeight, atomicNumber);
    167   }
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
    168158
    169159  if (!successful)
     
    193183  delete [] pv;
    194184  theParticleChange.SetStatusChange(stopAndKill);
    195   return & theParticleChange;
     185  return &theParticleChange;
    196186}
    197187
    198188
    199189void
    200 G4HEKaonZeroShortInelastic::FirstIntInCasKaonZero(G4bool &inElastic,
    201                                                  const G4double availableEnergy,
    202                                                  G4HEVector pv[],
    203                                                  G4int &vecLen,
    204                                                  G4HEVector incidentParticle,
    205                                                  G4HEVector targetParticle,
    206                                                  const G4double atomicWeight)
     190G4HEKaonZeroShortInelastic::FirstIntInCasKaonZero(G4bool& inElastic,
     191                                                  const G4double availableEnergy,
     192                                                  G4HEVector pv[],
     193                                                  G4int& vecLen,
     194                                                  const G4HEVector& incidentParticle,
     195                                                  const G4HEVector& targetParticle,
     196                                                  const G4double atomicWeight)
    207197
    208198// Kaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    213203// protons/neutrons by kaons or strange baryons according to the average
    214204// multiplicity per inelastic reaction.
    215 
    216205{
    217   static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    218   static const G4double expxl = -expxu;         // lower bound for arg. of exp
     206  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     207  static const G4double expxl = -expxu;             // lower bound for arg. of exp
    219208
    220209  static const G4double protb = 0.7;
     
    521510
    522511void
    523 G4HEKaonZeroShortInelastic::FirstIntInCasAntiKaonZero(G4bool &inElastic,
    524                                                      const G4double availableEnergy,
    525                                                      G4HEVector pv[],
    526                                                      G4int &vecLen,
    527                                                      G4HEVector incidentParticle,
    528                                                      G4HEVector targetParticle )
     512G4HEKaonZeroShortInelastic::FirstIntInCasAntiKaonZero(G4bool& inElastic,
     513                                                      const G4double availableEnergy,
     514                                                      G4HEVector pv[],
     515                                                      G4int& vecLen,
     516                                                      const G4HEVector& incidentParticle,
     517                                                      const G4HEVector& targetParticle)
    529518
    530519// AntiKaon0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    535524// protons/neutrons by kaons or strange baryons according to the average
    536525// multiplicity per inelastic reaction.
    537 
    538526{
    539   static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    540   static const G4double expxl = -expxu;         // lower bound for arg. of exp
     527  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     528  static const G4double expxl = -expxu;             // lower bound for arg. of exp
    541529
    542530  static const G4double protb = 0.7;
     
    544532  static const G4double     c = 1.25;
    545533
    546   static const G4int   numMul = 1200;
    547   static const G4int   numSec = 60;
     534  static const G4int numMul = 1200;
     535  static const G4int numSec = 60;
    548536
    549537  G4int neutronCode = Neutron.getCode();
     
    560548  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    561549
    562 // misc. local variables
    563 // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     550  // misc. local variables
     551  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
    564552
    565553  G4int i, counter, nt, np, nm, nz;
    566554
    567   if(first) {
     555  if (first) {
    568556    // compute normalization constants, this will only be done once
    569557    first = false;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HELambdaInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HELambdaInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HELambdaInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HELambdaInelastic.hh"
    4643
    47 G4HadFinalState *  G4HELambdaInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HELambdaInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                   G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHELambdaInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HELambdaInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHELambdaInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HELambdaInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;           
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasLambda(inElastic, availableEnergy, pv, vecLength,
    141                             incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasLambda(inElastic, availableEnergy, pv, vecLength,
     122                      incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165  FillParticleChange(pv, vecLength);
     166  delete [] pv;
     167  theParticleChange.SetStatusChange(stopAndKill);
     168  return &theParticleChange;
     169}
     170
    193171
    194172void
    195 G4HELambdaInelastic::FirstIntInCasLambda( G4bool &inElastic,
    196                                           const G4double availableEnergy,
    197                                           G4HEVector pv[],
    198                                           G4int &vecLen,
    199                                           G4HEVector incidentParticle,
    200                                           G4HEVector targetParticle,
    201                                           const G4double atomicWeight)
     173G4HELambdaInelastic::FirstIntInCasLambda(G4bool& inElastic,
     174                                         const G4double availableEnergy,
     175                                         G4HEVector pv[],
     176                                         G4int& vecLen,
     177                                         const G4HEVector& incidentParticle,
     178                                         const G4HEVector& targetParticle,
     179                                         const G4double atomicWeight)
    202180
    203181// Lambda undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208186// data.  Replace some pions or protons/neutrons by kaons or strange baryons
    209187// according to the average multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222 //   G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234    //  misc. local variables
    235    //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     188{
     189  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     190  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     191
     192  static const G4double protb = 0.7;
     193  static const G4double neutb = 0.7;             
     194  static const G4double     c = 1.25;
     195
     196  static const G4int numMul = 1200;
     197  static const G4int numSec = 60;
     198
     199  G4int protonCode  = Proton.getCode();
     200
     201  G4int targetCode = targetParticle.getCode();
     202  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     203
     204  static G4bool first = true;
     205  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     206  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     207
     208  //  misc. local variables
     209  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     210
     211  G4int i, counter, nt, np, nm, nz;
    238212
    239213   if( first )
  • trunk/source/processes/hadronic/models/high_energy/src/G4HENeutronInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HENeutronInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HENeutronInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HENeutronInelastic.hh"
    4643
    47 G4HadFinalState *  G4HENeutronInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HENeutronInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                    G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHENeutronInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HENeutronInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHENeutronInelastic: incident energy < 1 GeV" << G4endl;
    8065   
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HENeutronInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8575   
    86     incidentKineticEnergy -= inelasticity;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8780   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     81  incidentKineticEnergy -= inelasticity;
     82   
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
    131        
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy  = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  // In the original Gheisha code the inElastic flag was set as follows
     113  //   G4bool inElastic = InElasticCrossSectionInFirstInt
     114  //                      (availableEnergy, incidentCode, incidentTotalMomentum); 
     115  // For unknown reasons, it has been replaced by the following code in Geant???
     116  //
     117  G4bool inElastic = true;
     118  //   if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
     119
     120  vecLength = 0;
     121
     122  if (verboseLevel > 1)
     123    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134124           << incidentCode << G4endl;
    135125
    136     G4bool successful = false;
     126  G4bool successful = false;
    137127   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasNeutron(inElastic, availableEnergy, pv, vecLength,
    141                              incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     128  FirstIntInCasNeutron(inElastic, availableEnergy, pv, vecLength,
     129                       incidentParticle, targetParticle, atomicWeight);
     130
     131  if (verboseLevel > 1)
     132    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     133
     134  if ((vecLength > 0) && (availableEnergy > 1.))
     135    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     136                                  pv, vecLength,
     137                                  incidentParticle, targetParticle);
     138
     139  HighEnergyCascading(successful, pv, vecLength,
     140                      excitationEnergyGNP, excitationEnergyDTA,
     141                      incidentParticle, targetParticle,
     142                      atomicWeight, atomicNumber);
     143  if (!successful)
     144    HighEnergyClusterProduction(successful, pv, vecLength,
     145                                excitationEnergyGNP, excitationEnergyDTA,
     146                                incidentParticle, targetParticle,
     147                                atomicWeight, atomicNumber);
     148  if (!successful)
     149    MediumEnergyCascading(successful, pv, vecLength,
     150                          excitationEnergyGNP, excitationEnergyDTA,
     151                          incidentParticle, targetParticle,
     152                          atomicWeight, atomicNumber);
     153
     154  if (!successful)
     155    MediumEnergyClusterProduction(successful, pv, vecLength,
     156                                  excitationEnergyGNP, excitationEnergyDTA,       
     157                                  incidentParticle, targetParticle,
     158                                  atomicWeight, atomicNumber);
     159  if (!successful)
     160    QuasiElasticScattering(successful, pv, vecLength,
     161                           excitationEnergyGNP, excitationEnergyDTA,
     162                           incidentParticle, targetParticle,
     163                           atomicWeight, atomicNumber);
     164  if (!successful)
     165    ElasticScattering(successful, pv, vecLength,
     166                      incidentParticle,   
     167                      atomicWeight, atomicNumber);
     168
     169  if (!successful)
     170    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     171           << G4endl;
     172
     173  FillParticleChange(pv, vecLength);
     174  delete [] pv;
     175  theParticleChange.SetStatusChange(stopAndKill);
     176  return &theParticleChange;
     177}
     178
    193179
    194180void
    195 G4HENeutronInelastic::FirstIntInCasNeutron( G4bool &inElastic,
    196                                             const G4double availableEnergy,
    197                                             G4HEVector pv[],
    198                                             G4int &vecLen,
    199                                             G4HEVector incidentParticle,
    200                                             G4HEVector targetParticle,
    201                                             const G4double atomicWeight)
     181G4HENeutronInelastic::FirstIntInCasNeutron(G4bool& inElastic,
     182                                           const G4double availableEnergy,
     183                                           G4HEVector pv[],
     184                                           G4int& vecLen,
     185                                           const G4HEVector& incidentParticle,
     186                                           const G4HEVector& targetParticle,
     187                                           const G4double atomicWeight)
    202188
    203189// Neutron undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208194// protons/neutrons by kaons or strange baryons according to the average
    209195// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.35;
    216    static const G4double neutb = 0.35;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222    G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     196{
     197  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     198  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     199
     200  static const G4double protb = 0.35;
     201  static const G4double neutb = 0.35;             
     202  static const G4double     c = 1.25;
     203
     204  static const G4int   numMul = 1200;
     205  static const G4int   numSec = 60;
     206
     207  G4int neutronCode = Neutron.getCode();
     208  G4int protonCode  = Proton.getCode();
     209
     210  G4int targetCode = targetParticle.getCode();
     211  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     212
     213  static G4bool first = true;
     214  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     215  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     216
     217  //  misc. local variables
     218  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     219
     220  G4int i, counter, nt, np, nm, nz;
    238221
    239222   if( first )
    240      {                         // compute normalization constants, this will only be done once
     223     {     // compute normalization constants, this will only be done once
    241224       first = false;
    242225       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEOmegaMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEOmegaMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEOmegaMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEOmegaMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEOmegaMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEOmegaMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                       G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEOmegaMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEOmegaMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEOmegaMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEOmegaMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8075   
    81     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasOmegaMinus(inElastic, availableEnergy, pv, vecLength,
    141                                 incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasOmegaMinus(inElastic, availableEnergy, pv, vecLength,
     122                          incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv,  vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HEOmegaMinusInelastic::FirstIntInCasOmegaMinus( G4bool &inElastic,
    196                                                   const G4double availableEnergy,
    197                                                   G4HEVector pv[],
    198                                                   G4int &vecLen,
    199                                                   G4HEVector incidentParticle,
    200                                                   G4HEVector targetParticle,
    201                                                   const G4double atomicWeight)
     174G4HEOmegaMinusInelastic::FirstIntInCasOmegaMinus(G4bool& inElastic,
     175                                                 const G4double availableEnergy,
     176                                                 G4HEVector pv[],
     177                                                 G4int& vecLen,
     178                                                 const G4HEVector& incidentParticle,
     179                                                 const G4HEVector& targetParticle,
     180                                                 const G4double atomicWeight)
    202181
    203182// Xi0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222 //   G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int protonCode  = Proton.getCode();
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     207  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     208
     209  //  misc. local variables
     210  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    238213
    239214   if( first )
    240      {                         // compute normalization constants, this will only be done once
     215     {    // compute normalization constants, this will only be done once
    241216       first = false;
    242217       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEPionMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
     26// $Id: G4HEPionMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2628//
    27 // $Id: G4HEPionMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 
    3029// 11-OCT-2007 F.W. Jones: fixed incorrect Imax (should be Imin) in
    3130//             sampling of charge exchange.
     
    3534#include "G4ios.hh"
    3635
    37 //
    3836// G4 Process: Gheisha High Energy Collision model.
    3937// This includes the high energy cascading model, the two-body-resonance model
    40 // and the low energy two-body model. Not included are the low energy stuff like
    41 // nuclear reactions, nuclear fission without any cascading and all processes for
    42 // particles at rest. 
     38// and the low energy two-body model. Not included are the low energy stuff
     39// like nuclear reactions, nuclear fission without any cascading and all
     40// processes for particles at rest. 
    4341// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4442// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4745#include "G4HEPionMinusInelastic.hh"
    4846
    49 G4HadFinalState * G4HEPionMinusInelastic::
    50 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    51   {
    52     G4HEVector * pv = new G4HEVector[MAXPART];
    53     const G4HadProjectile *aParticle = &aTrack;
    54 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    55     const G4double A = targetNucleus.GetN();
    56     const G4double Z = targetNucleus.GetZ();
    57     G4HEVector incidentParticle(aParticle);
     47G4HadFinalState*
     48G4HEPionMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     49                                      G4Nucleus& targetNucleus)
     50{
     51  G4HEVector* pv = new G4HEVector[MAXPART];
     52  const G4HadProjectile* aParticle = &aTrack;
     53  const G4double A = targetNucleus.GetN();
     54  const G4double Z = targetNucleus.GetZ();
     55  G4HEVector incidentParticle(aParticle);
    5856     
    59     G4double atomicNumber = Z;
    60     G4double atomicWeight = A;
    61 
    62     G4int    incidentCode          = incidentParticle.getCode();
    63     G4double incidentMass          = incidentParticle.getMass();
    64     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    65     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    66     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    67 
    68     if(incidentKineticEnergy < 1.)
    69       {
    70         G4cout << "GHEPionMinusInelastic: incident energy < 1 GeV" << G4endl ;
    71       }
    72     if(verboseLevel > 1)
    73       {
    74         G4cout << "G4HEPionMinusInelastic::ApplyYourself" << G4endl;
    75         G4cout << "incident particle " << incidentParticle.getName()
    76              << "mass "              << incidentMass
    77              << "kinetic energy "    << incidentKineticEnergy
    78              << G4endl;
    79         G4cout << "target material with (A,Z) = ("
    80              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    81       }
    82 
    83     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    84                                                  atomicWeight, atomicNumber);
    85     if(verboseLevel > 1)
    86         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    87 
    88     incidentKineticEnergy -= inelasticity;
     57  G4double atomicNumber = Z;
     58  G4double atomicWeight = A;
     59
     60  G4int incidentCode = incidentParticle.getCode();
     61  G4double incidentMass = incidentParticle.getMass();
     62  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     63  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     64  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     65
     66  if (incidentKineticEnergy < 1.)
     67    G4cout << "GHEPionMinusInelastic: incident energy < 1 GeV" << G4endl;
     68
     69  if (verboseLevel > 1) {
     70    G4cout << "G4HEPionMinusInelastic::ApplyYourself" << G4endl;
     71    G4cout << "incident particle " << incidentParticle.getName()
     72           << "mass "              << incidentMass
     73           << "kinetic energy "    << incidentKineticEnergy
     74           << G4endl;
     75    G4cout << "target material with (A,Z) = ("
     76           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     77  }
     78
     79  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     80                                              atomicWeight, atomicNumber);
     81  if (verboseLevel > 1)
     82    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     83
     84  incidentKineticEnergy -= inelasticity;
    8985   
    90     G4double excitationEnergyGNP = 0.;
    91     G4double excitationEnergyDTA = 0.;
    92 
    93     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    94                                                atomicWeight, atomicNumber,
    95                                                excitationEnergyGNP,
    96                                                excitationEnergyDTA);
    97     if(verboseLevel > 1)
    98       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    99            << excitationEnergyDTA << G4endl;             
    100 
    101 
    102     incidentKineticEnergy -= excitation;
    103     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    104     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    105                                   *(incidentTotalEnergy+incidentMass));
    106 
    107     G4HEVector targetParticle;
     86  G4double excitationEnergyGNP = 0.;
     87  G4double excitationEnergyDTA = 0.;
     88
     89  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     90                                          atomicWeight, atomicNumber,
     91                                          excitationEnergyGNP,
     92                                          excitationEnergyDTA);
     93  if (verboseLevel > 1)
     94    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     95           << excitationEnergyDTA << G4endl;
     96
     97  incidentKineticEnergy -= excitation;
     98  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     99  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     100                                    *(incidentTotalEnergy+incidentMass));
     101
     102  G4HEVector targetParticle;
    108103 
    109     if(G4UniformRand() < atomicNumber/atomicWeight)
    110       {
    111         targetParticle.setDefinition("Proton");
    112       }
    113     else
    114       {
    115         targetParticle.setDefinition("Neutron");
    116       }
    117 
    118     G4double targetMass         = targetParticle.getMass();
    119     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    120                                        + 2.0*targetMass*incidentTotalEnergy);
    121     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    122 
    123                                                                 // this was the meaning of inElastic in the
    124                                                                 // original Gheisha stand-alone version.
    125 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    126 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    127                                                                 // by unknown reasons, it has been replaced
    128                                                                 // to the following code in Geant???
    129     G4bool inElastic = true;
    130 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    131 
    132     vecLength = 0;           
     104  if (G4UniformRand() < atomicNumber/atomicWeight) {
     105    targetParticle.setDefinition("Proton");
     106  } else {
     107    targetParticle.setDefinition("Neutron");
     108  }
     109
     110  G4double targetMass = targetParticle.getMass();
     111  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     112                                        + targetMass*targetMass
     113                                        + 2.0*targetMass*incidentTotalEnergy);
     114  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     115
     116  // The value of the inElastic flag was originally defined in the Gheisha
     117  // stand-alone code as follows:
     118  //   G4bool inElastic = InElasticCrossSectionInFirstInt
     119  //                      (availableEnergy, incidentCode, incidentTotalMomentum); 
     120  // For unknown reasons, it was replaced by the following code in Geant
     121
     122  G4bool inElastic = true;
     123  //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
     124
     125  vecLength = 0;
    133126       
    134     if(verboseLevel > 1)
    135       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     127  if (verboseLevel > 1)
     128    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    136129           << incidentCode << G4endl;
    137130
    138     G4bool successful = false;
     131  G4bool successful = false;
    139132   
    140     if(inElastic || (!inElastic && atomicWeight < 1.5))
    141       {
    142         FirstIntInCasPionMinus(inElastic, availableEnergy, pv, vecLength,
    143                                incidentParticle, targetParticle);
    144 
    145         if(verboseLevel > 1)
    146            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    147 
    148 
    149         if ((vecLength > 0) && (availableEnergy > 1.))
    150                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    151                                                   pv, vecLength,
    152                                                   incidentParticle, targetParticle);
    153             HighEnergyCascading( successful, pv, vecLength,
    154                                  excitationEnergyGNP, excitationEnergyDTA,
    155                                  incidentParticle, targetParticle,
    156                                  atomicWeight, atomicNumber);
    157         if (!successful)
    158             HighEnergyClusterProduction( successful, pv, vecLength,
    159                                          excitationEnergyGNP, excitationEnergyDTA,
    160                                          incidentParticle, targetParticle,
    161                                          atomicWeight, atomicNumber);
    162         if (!successful)
    163             MediumEnergyCascading( successful, pv, vecLength,
    164                                    excitationEnergyGNP, excitationEnergyDTA,
    165                                    incidentParticle, targetParticle,
    166                                    atomicWeight, atomicNumber);
    167 
    168         if (!successful)
    169             MediumEnergyClusterProduction( successful, pv, vecLength,
    170                                            excitationEnergyGNP, excitationEnergyDTA,       
    171                                            incidentParticle, targetParticle,
    172                                            atomicWeight, atomicNumber);
    173         if (!successful)
    174             QuasiElasticScattering( successful, pv, vecLength,
    175                                     excitationEnergyGNP, excitationEnergyDTA,
    176                                     incidentParticle, targetParticle,
    177                                     atomicWeight, atomicNumber);
    178       }
    179     if (!successful)
    180       {
    181             ElasticScattering( successful, pv, vecLength,
    182                                incidentParticle,   
    183                                atomicWeight, atomicNumber);
    184       }
    185 
    186     if (!successful)
    187       {
    188         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    189       }
    190       FillParticleChange(pv,  vecLength);
    191       delete [] pv;
    192       theParticleChange.SetStatusChange(stopAndKill);
    193       return & theParticleChange;
    194   }
     133  FirstIntInCasPionMinus(inElastic, availableEnergy, pv, vecLength,
     134                         incidentParticle, targetParticle);
     135
     136  if (verboseLevel > 1)
     137    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     138
     139  if ((vecLength > 0) && (availableEnergy > 1.))
     140    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     141                                  pv, vecLength,
     142                                  incidentParticle, targetParticle);
     143
     144  HighEnergyCascading(successful, pv, vecLength,
     145                      excitationEnergyGNP, excitationEnergyDTA,
     146                      incidentParticle, targetParticle,
     147                      atomicWeight, atomicNumber);
     148  if (!successful)
     149    HighEnergyClusterProduction(successful, pv, vecLength,
     150                                excitationEnergyGNP, excitationEnergyDTA,
     151                                incidentParticle, targetParticle,
     152                                atomicWeight, atomicNumber);
     153  if (!successful)
     154    MediumEnergyCascading(successful, pv, vecLength,
     155                          excitationEnergyGNP, excitationEnergyDTA,
     156                          incidentParticle, targetParticle,
     157                          atomicWeight, atomicNumber);
     158
     159  if (!successful)
     160    MediumEnergyClusterProduction(successful, pv, vecLength,
     161                                  excitationEnergyGNP, excitationEnergyDTA,       
     162                                  incidentParticle, targetParticle,
     163                                  atomicWeight, atomicNumber);
     164  if (!successful)
     165    QuasiElasticScattering(successful, pv, vecLength,
     166                           excitationEnergyGNP, excitationEnergyDTA,
     167                           incidentParticle, targetParticle,
     168                           atomicWeight, atomicNumber);
     169  if (!successful)
     170    ElasticScattering(successful, pv, vecLength,
     171                      incidentParticle,   
     172                      atomicWeight, atomicNumber);
     173
     174  if (!successful)
     175    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     176           << G4endl;
     177
     178  FillParticleChange(pv,  vecLength);
     179  delete [] pv;
     180  theParticleChange.SetStatusChange(stopAndKill);
     181  return &theParticleChange;
     182}
     183
    195184
    196185void
    197 G4HEPionMinusInelastic::FirstIntInCasPionMinus( G4bool &inElastic,
    198                                                 const G4double availableEnergy,
    199                                                 G4HEVector pv[],
    200                                                 G4int &vecLen,
    201                                                 G4HEVector incidentParticle,
    202                                                 G4HEVector targetParticle)
     186G4HEPionMinusInelastic::FirstIntInCasPionMinus(G4bool& inElastic,
     187                                               const G4double availableEnergy,
     188                                               G4HEVector pv[],
     189                                               G4int& vecLen,
     190                                               const G4HEVector& incidentParticle,
     191                                               const G4HEVector& targetParticle)
    203192
    204193// Pion- undergoes interaction with nucleon within a nucleus.  Check if it is
     
    209198// protons/neutrons by kaons or strange baryons according to the average
    210199// multiplicity per inelastic reaction.
    211 
    212  {
    213    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    214    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    215 
    216    static const G4double protb = 0.7;
    217    static const G4double neutb = 0.7;
    218    static const G4double     c = 1.25;
    219 
    220    static const G4int   numMul = 1200;
    221    static const G4int   numSec = 60;
    222 
    223 //   G4int              neutronCode = Neutron.getCode();
    224    G4int              protonCode  = Proton.getCode();
    225 
    226    G4int               targetCode = targetParticle.getCode();
    227 //   G4double          incidentMass = incidentParticle.getMass();
    228 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    229    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    230 
    231    static G4bool first = true;
    232    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    233    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    234 
    235 //                                misc. local variables
    236 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    237 
    238    G4int i, counter, nt, np, nm, nz;
     200{
     201  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     202  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     203
     204  static const G4double protb = 0.7;
     205  static const G4double neutb = 0.7;
     206  static const G4double     c = 1.25;
     207
     208  static const G4int numMul = 1200;
     209  static const G4int numSec = 60;
     210
     211  G4int protonCode  = Proton.getCode();
     212
     213  G4int targetCode = targetParticle.getCode();
     214  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     215
     216  static G4bool first = true;
     217  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     218  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     219
     220  // misc. local variables
     221  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     222
     223  G4int i, counter, nt, np, nm, nz;
    239224
    240225   if( first )
    241      {                         // compute normalization constants, this will only be done once
     226     {    // compute normalization constants, this will only be done once
    242227       first = false;
    243228       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEPionPlusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEPionPlusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEPionPlusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEPionPlusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEPionPlusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEPionPlusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                     G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "G4HEPionPlusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEPionPlusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "G4HEPionPlusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEPionPlusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength      = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)                   
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113
     114  vecLength = 0;
    131115       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     116  if (verboseLevel > 1)
     117    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134118           << incidentCode << G4endl;
    135119
    136     G4bool successful = false;
     120  G4bool successful = false;
    137121   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasPionPlus(inElastic, availableEnergy, pv, vecLength,
    141                               incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188 
    189       FillParticleChange(pv,  vecLength);
    190       delete [] pv;
    191       theParticleChange.SetStatusChange(stopAndKill);
    192       return & theParticleChange;
    193   }
     122  FirstIntInCasPionPlus(inElastic, availableEnergy, pv, vecLength,
     123                        incidentParticle, targetParticle, atomicWeight);
     124
     125  if (verboseLevel > 1)
     126    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     127
     128  if ((vecLength > 0) && (availableEnergy > 1.))
     129    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     130                                  pv, vecLength,
     131                                  incidentParticle, targetParticle);
     132
     133  HighEnergyCascading(successful, pv, vecLength,
     134                      excitationEnergyGNP, excitationEnergyDTA,
     135                      incidentParticle, targetParticle,
     136                      atomicWeight, atomicNumber);
     137  if (!successful)
     138    HighEnergyClusterProduction(successful, pv, vecLength,
     139                                excitationEnergyGNP, excitationEnergyDTA,
     140                                incidentParticle, targetParticle,
     141                                atomicWeight, atomicNumber);
     142  if (!successful)
     143    MediumEnergyCascading(successful, pv, vecLength,
     144                          excitationEnergyGNP, excitationEnergyDTA,
     145                          incidentParticle, targetParticle,
     146                          atomicWeight, atomicNumber);
     147
     148  if (!successful)
     149    MediumEnergyClusterProduction(successful, pv, vecLength,
     150                                  excitationEnergyGNP, excitationEnergyDTA,       
     151                                  incidentParticle, targetParticle,
     152                                  atomicWeight, atomicNumber);
     153  if (!successful)
     154    QuasiElasticScattering(successful, pv, vecLength,
     155                           excitationEnergyGNP, excitationEnergyDTA,
     156                           incidentParticle, targetParticle,
     157                           atomicWeight, atomicNumber);
     158  if (!successful)
     159    ElasticScattering(successful, pv, vecLength,
     160                      incidentParticle,   
     161                      atomicWeight, atomicNumber);
     162
     163  if (!successful)
     164    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     165           << G4endl;
     166
     167  FillParticleChange(pv, vecLength);
     168  delete [] pv;
     169  theParticleChange.SetStatusChange(stopAndKill);
     170  return &theParticleChange;
     171}
     172
    194173
    195174void
    196 G4HEPionPlusInelastic::FirstIntInCasPionPlus( G4bool &inElastic,
    197                                               const G4double availableEnergy,
    198                                               G4HEVector pv[],
    199                                               G4int &vecLen,
    200                                               G4HEVector incidentParticle,
    201                                               G4HEVector targetParticle,
    202                                               const G4double atomicWeight)
     175G4HEPionPlusInelastic::FirstIntInCasPionPlus(G4bool& inElastic,
     176                                             const G4double availableEnergy,
     177                                             G4HEVector pv[],
     178                                             G4int& vecLen,
     179                                             const G4HEVector& incidentParticle,
     180                                             const G4HEVector& targetParticle,
     181                                             const G4double atomicWeight)
    203182
    204183// Pion+ undergoes interaction with nucleon within a nucleus.  Check if it is
     
    209188// protons/neutrons by kaons or strange baryons according to the average
    210189// multiplicity per inelastic reaction.
    211 
    212  {
    213    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    214    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    215 
    216    static const G4double protb = 0.7;
    217    static const G4double neutb = 0.7;
    218    static const G4double     c = 1.25;
    219 
    220    static const G4int   numMul = 1200;
    221    static const G4int   numSec = 60;
    222 
    223    G4int              neutronCode = Neutron.getCode();
    224    G4int              protonCode  = Proton.getCode();
    225    G4double           pionMass    = PionPlus.getMass();
    226 
    227    G4int               targetCode = targetParticle.getCode();
    228 //   G4double          incidentMass = incidentParticle.getMass();
    229 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    230    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    231 
    232    static G4bool first = true;
    233    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    234    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    235 
    236 //                                misc. local variables
    237 //                                np = number of pi+,  nm = number of pi-,  nz = number of pi0
    238 
    239    G4int i, counter, nt, np, nm, nz;
     190{
     191  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     192  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     193
     194  static const G4double protb = 0.7;
     195  static const G4double neutb = 0.7;
     196  static const G4double     c = 1.25;
     197
     198  static const G4int numMul = 1200;
     199  static const G4int numSec = 60;
     200
     201  G4int neutronCode = Neutron.getCode();
     202  G4int protonCode = Proton.getCode();
     203  G4double pionMass = PionPlus.getMass();
     204
     205  G4int targetCode = targetParticle.getCode();
     206  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     207
     208  static G4bool first = true;
     209  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     210  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     211
     212  // misc. local variables
     213  // np = number of pi+,  nm = number of pi-,  nz = number of pi0
     214
     215  G4int i, counter, nt, np, nm, nz;
    240216
    241217   if( first )
    242      {                         // compute normalization constants, this will only be done once
     218     {   // compute normalization constants, this will only be done once
    243219       first = false;
    244220       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEProtonInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEProtonInelastic.cc,v 1.14 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEProtonInelastic.cc,v 1.16 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEProtonInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEProtonInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEProtonInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                   G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     if(verboseLevel > 1)
    61       G4cout << "Z , A = " << atomicNumber << "  " << atomicWeight << G4endl;
    62 
    63     G4int    incidentCode          = incidentParticle.getCode();
    64     G4double incidentMass          = incidentParticle.getMass();
    65     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    66     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    67     G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
    68 
    69     if(incidentKineticEnergy < 1.)
    70       {
    71         G4cout << "GHEProtonInelastic: incident energy < 1 GeV" << G4endl;
    72       }
    73     if(verboseLevel > 1)
    74       {
    75         G4cout << "G4HEProtonInelastic::ApplyYourself" << G4endl;
    76         G4cout << "incident particle " << incidentParticle.getName() << " "
    77              << "mass "              << incidentMass << " "
    78              << "kinetic energy "    << incidentKineticEnergy
    79              << G4endl;
    80         G4cout << "target material with (A,Z) = ("
    81              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    82       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  if (verboseLevel > 1)
     58    G4cout << "Z , A = " << atomicNumber << "  " << atomicWeight << G4endl;
     59
     60  G4int incidentCode = incidentParticle.getCode();
     61  G4double incidentMass = incidentParticle.getMass();
     62  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     63  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     64  G4double incidentKineticEnergy = incidentParticle.getKineticEnergy();
     65
     66  if (incidentKineticEnergy < 1.)
     67    G4cout << "GHEProtonInelastic: incident energy < 1 GeV" << G4endl;
     68
     69  if (verboseLevel > 1) {
     70    G4cout << "G4HEProtonInelastic::ApplyYourself" << G4endl;
     71    G4cout << "incident particle " << incidentParticle.getName() << " "
     72           << "mass "              << incidentMass << " "
     73           << "kinetic energy "    << incidentKineticEnergy
     74           << G4endl;
     75    G4cout << "target material with (A,Z) = ("
     76           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     77  }
    8378   
    84     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    85                                                  atomicWeight, atomicNumber);
    86     if(verboseLevel > 1)
    87         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    88 
    89     incidentKineticEnergy -= inelasticity;
     79  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     80                                              atomicWeight, atomicNumber);
     81  if (verboseLevel > 1)
     82    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     83
     84  incidentKineticEnergy -= inelasticity;
    9085   
    91     G4double excitationEnergyGNP = 0.;
    92     G4double excitationEnergyDTA = 0.;
    93 
    94     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    95                                                atomicWeight, atomicNumber,
    96                                                excitationEnergyGNP,
    97                                                excitationEnergyDTA);
    98 
    99     if(verboseLevel > 1)
    100       G4cout << "nuclear excitation = " << excitation << " " << excitationEnergyGNP << " "
    101            << excitationEnergyDTA << G4endl;             
    102 
    103 
    104     incidentKineticEnergy -= excitation;
    105     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    106     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    107                                   *(incidentTotalEnergy+incidentMass));
    108 
    109 
    110     G4HEVector targetParticle;
    111     if(G4UniformRand() < atomicNumber/atomicWeight)
    112       {
    113         targetParticle.setDefinition("Proton");
    114       }
    115     else
    116       {
    117         targetParticle.setDefinition("Neutron");
    118       }
    119 
    120     G4double targetMass         = targetParticle.getMass();
    121     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    122                                        + 2.0*targetMass*incidentTotalEnergy);
    123     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    124 
    125                                                                 // this was the meaning of inElastic in the
    126                                                                 // original Gheisha stand-alone version.
    127 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    128 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    129                                                                 // by unknown reasons, it has been replaced
    130                                                                 // to the following code in Geant???
    131     G4bool inElastic = true;
    132 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    133 
    134     vecLength = 0;           
     86  G4double excitationEnergyGNP = 0.;
     87  G4double excitationEnergyDTA = 0.;
     88
     89  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     90                                          atomicWeight, atomicNumber,
     91                                          excitationEnergyGNP,
     92                                          excitationEnergyDTA);
     93
     94  if (verboseLevel > 1)
     95    G4cout << "nuclear excitation = " << excitation << " "
     96           << excitationEnergyGNP << " " << excitationEnergyDTA << G4endl;             
     97
     98  incidentKineticEnergy -= excitation;
     99  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     100  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     101                                    *(incidentTotalEnergy+incidentMass));
     102
     103  G4HEVector targetParticle;
     104  if (G4UniformRand() < atomicNumber/atomicWeight) {
     105    targetParticle.setDefinition("Proton");
     106  } else {
     107    targetParticle.setDefinition("Neutron");
     108  }
     109
     110  G4double targetMass = targetParticle.getMass();
     111  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     112                                        + targetMass*targetMass
     113                                        + 2.0*targetMass*incidentTotalEnergy);
     114  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     115
     116  // In the original Gheisha code, the inElastic flag was defined as follows:
     117  //   G4bool inElastic = InElasticCrossSectionInFirstInt
     118  //              (availableEnergy, incidentCode, incidentTotalMomentum);
     119  // For unknown reasons, it was replaced by the following code in Geant???
     120
     121  G4bool inElastic = true;
     122  //  if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
     123
     124  vecLength = 0;
    135125       
    136     if(verboseLevel > 1)
    137       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     126  if (verboseLevel > 1)
     127    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    138128           << incidentCode << G4endl;
    139129
    140     G4bool successful = false;
     130  G4bool successful = false;
    141131   
    142     if(inElastic || (!inElastic && atomicWeight < 1.5))
    143       {
    144         FirstIntInCasProton(inElastic, availableEnergy, pv, vecLength,
    145                             incidentParticle, targetParticle, atomicWeight);
    146 
    147         if(verboseLevel > 1)
    148            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    149 
    150 
    151         if ((vecLength > 0) && (availableEnergy > 1.))
    152                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    153                                                   pv, vecLength,
    154                                                   incidentParticle, targetParticle);
    155             HighEnergyCascading( successful, pv, vecLength,
    156                                  excitationEnergyGNP, excitationEnergyDTA,
    157                                  incidentParticle, targetParticle,
    158                                  atomicWeight, atomicNumber);
    159         if (!successful)
    160             HighEnergyClusterProduction( successful, pv, vecLength,
    161                                          excitationEnergyGNP, excitationEnergyDTA,
    162                                          incidentParticle, targetParticle,
    163                                          atomicWeight, atomicNumber);
    164         if (!successful)
    165             MediumEnergyCascading( successful, pv, vecLength,
    166                                    excitationEnergyGNP, excitationEnergyDTA,
    167                                    incidentParticle, targetParticle,
    168                                    atomicWeight, atomicNumber);
    169 
    170         if (!successful)
    171             MediumEnergyClusterProduction( successful, pv, vecLength,
    172                                            excitationEnergyGNP, excitationEnergyDTA,       
    173                                            incidentParticle, targetParticle,
    174                                            atomicWeight, atomicNumber);
    175         if (!successful)
    176             QuasiElasticScattering( successful, pv, vecLength,
    177                                     excitationEnergyGNP, excitationEnergyDTA,
    178                                     incidentParticle, targetParticle,
    179                                     atomicWeight, atomicNumber);
    180       }
    181     if (!successful)
    182       {
    183             ElasticScattering( successful, pv, vecLength,
    184                                incidentParticle,   
    185                                atomicWeight, atomicNumber);
    186       }
    187 
    188     if (!successful)
    189       {
    190         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    191       }
    192       FillParticleChange(pv,  vecLength);
    193       delete [] pv;
    194       theParticleChange.SetStatusChange(stopAndKill);
    195       return & theParticleChange;
    196   }
     132  FirstIntInCasProton(inElastic, availableEnergy, pv, vecLength,
     133                      incidentParticle, targetParticle, atomicWeight);
     134
     135  if (verboseLevel > 1)
     136    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     137
     138  if ((vecLength > 0) && (availableEnergy > 1.))
     139    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     140                                  pv, vecLength,
     141                                  incidentParticle, targetParticle);
     142
     143  HighEnergyCascading(successful, pv, vecLength,
     144                      excitationEnergyGNP, excitationEnergyDTA,
     145                      incidentParticle, targetParticle,
     146                      atomicWeight, atomicNumber);
     147  if (!successful)
     148    HighEnergyClusterProduction(successful, pv, vecLength,
     149                                excitationEnergyGNP, excitationEnergyDTA,
     150                                incidentParticle, targetParticle,
     151                                atomicWeight, atomicNumber);
     152  if (!successful)
     153    MediumEnergyCascading(successful, pv, vecLength,
     154                          excitationEnergyGNP, excitationEnergyDTA,
     155                          incidentParticle, targetParticle,
     156                          atomicWeight, atomicNumber);
     157
     158  if (!successful)
     159    MediumEnergyClusterProduction(successful, pv, vecLength,
     160                                  excitationEnergyGNP, excitationEnergyDTA,       
     161                                  incidentParticle, targetParticle,
     162                                  atomicWeight, atomicNumber);
     163  if (!successful)
     164    QuasiElasticScattering(successful, pv, vecLength,
     165                           excitationEnergyGNP, excitationEnergyDTA,
     166                           incidentParticle, targetParticle,
     167                           atomicWeight, atomicNumber);
     168  if (!successful)
     169    ElasticScattering(successful, pv, vecLength,
     170                      incidentParticle,   
     171                      atomicWeight, atomicNumber);
     172
     173  if (!successful)
     174    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     175           << G4endl;
     176
     177  FillParticleChange(pv, vecLength);
     178  delete [] pv;
     179  theParticleChange.SetStatusChange(stopAndKill);
     180  return &theParticleChange;
     181}
     182
    197183
    198184void
    199 G4HEProtonInelastic::FirstIntInCasProton( G4bool &inElastic,
    200                                           const G4double availableEnergy,
    201                                           G4HEVector pv[],
    202                                           G4int &vecLen,
    203                                           G4HEVector incidentParticle,
    204                                           G4HEVector targetParticle,
    205                                           const G4double atomicWeight)
     185G4HEProtonInelastic::FirstIntInCasProton(G4bool& inElastic,
     186                                         const G4double availableEnergy,
     187                                         G4HEVector pv[],
     188                                         G4int& vecLen,
     189                                         const G4HEVector& incidentParticle,
     190                                         const G4HEVector& targetParticle,
     191                                         const G4double atomicWeight)
    206192
    207193// Proton undergoes interaction with nucleon within a nucleus.  Check if it is
     
    212198// protons/neutrons by kaons or strange baryons according to the average
    213199// multiplicity per inelastic reaction.
    214 
    215  {
    216    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    217    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    218 
    219    static const G4double protb = 0.7;
    220    static const G4double neutb = 0.35;
    221    static const G4double     c = 1.25;
    222 
    223    static const G4int   numMul = 1200;
    224    static const G4int   numSec = 60;
    225 
    226    G4int              neutronCode = Neutron.getCode();
    227    G4int              protonCode  = Proton.getCode();
    228    G4double           pionMass    = PionPlus.getMass();
    229 
    230    G4int               targetCode = targetParticle.getCode();
    231 //   G4double          incidentMass = incidentParticle.getMass();
    232 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    233    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    234 
    235    static G4bool first = true;
    236    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    237    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    238 
    239                               //  misc. local variables
    240                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    241 
    242    G4int i, counter, nt, np, nm, nz;
    243 
    244    if( first )
    245      {                         // compute normalization constants, this will only be done once
    246        first = false;
    247        for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
    248        for( i=0; i<numSec; i++ )protnorm[i] = 0.0;
    249        counter = -1;
    250        for( np=0; np<(numSec/3); np++ )
    251           {
    252             for( nm=Imax(0,np-2); nm<=np; nm++ )
    253                {
    254                  for( nz=0; nz<numSec/3; nz++ )
    255                     {
    256                       if( ++counter < numMul )
    257                         {
    258                           nt = np+nm+nz;
    259                           if( (nt>0) && (nt<=numSec) )
    260                             {
    261                               protmul[counter] = pmltpc(np,nm,nz,nt,protb,c)
    262                                                  /(Factorial(2-np+nm)*Factorial(np-nm)) ;
    263                               protnorm[nt-1] += protmul[counter];
    264                             }
    265                         }
    266                     }
    267                }
     200{
     201  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     202  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     203
     204  static const G4double protb = 0.7;
     205  static const G4double neutb = 0.35;
     206  static const G4double     c = 1.25;
     207
     208  static const G4int numMul = 1200;
     209  static const G4int numSec = 60;
     210
     211  G4int neutronCode = Neutron.getCode();
     212  G4int protonCode = Proton.getCode();
     213  G4double pionMass = PionPlus.getMass();
     214
     215  G4int targetCode = targetParticle.getCode();
     216  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     217
     218  static G4bool first = true;
     219  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     220  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     221
     222  //  misc. local variables
     223  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     224
     225  G4int i, counter, nt, np, nm, nz;
     226
     227  if (first) {
     228    // compute normalization constants, this will only be done once
     229    first = false;
     230    for (i=0; i<numMul; i++) protmul[i] = 0.0;
     231    for (i=0; i<numSec; i++) protnorm[i] = 0.0;
     232    counter = -1;
     233    for (np=0; np<(numSec/3); np++) {
     234      for (nm=Imax(0,np-2); nm<=np; nm++) {
     235        for (nz=0; nz<numSec/3; nz++) {
     236          if (++counter < numMul) {
     237            nt = np+nm+nz;
     238            if ( (nt>0) && (nt<=numSec) ) {
     239              protmul[counter] = pmltpc(np,nm,nz,nt,protb,c)
     240                                 /(Factorial(2-np+nm)*Factorial(np-nm)) ;
     241              protnorm[nt-1] += protmul[counter];
     242            }
    268243          }
    269        for( i=0; i<numMul; i++ )neutmul[i]  = 0.0;
    270        for( i=0; i<numSec; i++ )neutnorm[i] = 0.0;
    271        counter = -1;
    272        for( np=0; np<numSec/3; np++ )
    273           {
    274             for( nm=Imax(0,np-1); nm<=(np+1); nm++ )
    275                {
    276                  for( nz=0; nz<numSec/3; nz++ )
    277                     {
    278                       if( ++counter < numMul )
    279                         {
    280                           nt = np+nm+nz;
    281                           if( (nt>0) && (nt<=numSec) )
    282                             {
    283                                neutmul[counter] = pmltpc(np,nm,nz,nt,neutb,c)
    284                                                   /(Factorial(1-np+nm)*Factorial(1+np-nm));
    285                                neutnorm[nt-1] += neutmul[counter];
    286                             }
    287                         }
    288                     }
    289                }
     244        }
     245      }
     246    }
     247
     248    for( i=0; i<numMul; i++ )neutmul[i]  = 0.0;
     249    for( i=0; i<numSec; i++ )neutnorm[i] = 0.0;
     250    counter = -1;
     251    for (np=0; np<numSec/3; np++) {
     252      for (nm=Imax(0,np-1); nm<=(np+1); nm++) {
     253        for (nz=0; nz<numSec/3; nz++) {
     254          if (++counter < numMul) {
     255            nt = np+nm+nz;
     256            if ( (nt>0) && (nt<=numSec) ) {
     257              neutmul[counter] = pmltpc(np,nm,nz,nt,neutb,c)
     258                                 /(Factorial(1-np+nm)*Factorial(1+np-nm));
     259              neutnorm[nt-1] += neutmul[counter];
     260            }
    290261          }
    291        for( i=0; i<numSec; i++ )
    292           {
    293             if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
    294             if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
    295           }
    296      }                                          // end of initialization
     262        }
     263      }
     264    }
     265    for (i=0; i<numSec; i++) {
     266      if( protnorm[i] > 0.0 )protnorm[i] = 1.0/protnorm[i];
     267      if( neutnorm[i] > 0.0 )neutnorm[i] = 1.0/neutnorm[i];
     268    }
     269  }                   // end of initialization
    297270
    298271         
    299                                               // initialize the first two places
    300                                               // the same as beam and target                                   
    301    pv[0] = incidentParticle;
    302    pv[1] = targetParticle;
    303    vecLen = 2;
     272  // initialize the first two places
     273  // the same as beam and target                                   
     274  pv[0] = incidentParticle;
     275  pv[1] = targetParticle;
     276  vecLen = 2;
    304277
    305278   if( !inElastic )
  • trunk/source/processes/hadronic/models/high_energy/src/G4HESigmaMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HESigmaMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HESigmaMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HESigmaMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HESigmaMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HESigmaMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                       G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHESigmaMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HESigmaMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    85 
    86     incidentKineticEnergy -= inelasticity;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHESigmaMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HESigmaMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     80
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    97            << excitationEnergyDTA << G4endl;             
    98 
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     92           << excitationEnergyDTA << G4endl;
     93
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasSigmaMinus(inElastic, availableEnergy, pv, vecLength,
    141                                 incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasSigmaMinus(inElastic, availableEnergy, pv, vecLength,
     122                          incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv, vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HESigmaMinusInelastic::FirstIntInCasSigmaMinus( G4bool &inElastic,
    196                                                   const G4double availableEnergy,
    197                                                   G4HEVector pv[],
    198                                                   G4int &vecLen,
    199                                                   G4HEVector incidentParticle,
    200                                                   G4HEVector targetParticle,
    201                                                   const G4double atomicWeight)
     174G4HESigmaMinusInelastic::FirstIntInCasSigmaMinus(G4bool& inElastic,
     175                                                 const G4double availableEnergy,
     176                                                 G4HEVector pv[],
     177                                                 G4int& vecLen,
     178                                                 const G4HEVector& incidentParticle,
     179                                                 const G4HEVector& targetParticle,
     180                                                 const G4double atomicWeight)
    202181
    203182// Sigma- undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222    G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int neutronCode = Neutron.getCode();
     201  G4int protonCode = Proton.getCode();
     202
     203  G4int targetCode = targetParticle.getCode();
     204  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     205
     206  static G4bool first = true;
     207  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     208  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     209
     210  //  misc. local variables
     211  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     212
     213  G4int i, counter, nt, np, nm, nz;
    238214
    239215   if( first )
    240      {                         // compute normalization constants, this will only be done once
     216     {     // compute normalization constants, this will only be done once
    241217       first = false;
    242218       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HESigmaPlusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HESigmaPlusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HESigmaPlusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HESigmaPlusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HESigmaPlusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HESigmaPlusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                      G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHESigmaPlusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HESigmaPlusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    85 
    86     incidentKineticEnergy -= inelasticity;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHESigmaPlusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HESigmaPlusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     80
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    97            << excitationEnergyDTA << G4endl;             
    98 
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength  = 0;           
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     92           << excitationEnergyDTA << G4endl;
     93
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasSigmaPlus(inElastic, availableEnergy, pv, vecLength,
    141                                incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasSigmaPlus(inElastic, availableEnergy, pv, vecLength,
     122                         incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv, vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HESigmaPlusInelastic::FirstIntInCasSigmaPlus( G4bool &inElastic,
    196                                                 const G4double availableEnergy,
    197                                                 G4HEVector pv[],
    198                                                 G4int &vecLen,
    199                                                 G4HEVector incidentParticle,
    200                                                 G4HEVector targetParticle,
    201                                                 const G4double atomicWeight)
     174G4HESigmaPlusInelastic::FirstIntInCasSigmaPlus(G4bool& inElastic,
     175                                               const G4double availableEnergy,
     176                                               G4HEVector pv[],
     177                                               G4int& vecLen,
     178                                               const G4HEVector& incidentParticle,
     179                                               const G4HEVector& targetParticle,
     180                                               const G4double atomicWeight)
    202181
    203182// Sigma+ undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222 //   G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int protonCode  = Proton.getCode();
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     207  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     208
     209  //  misc. local variables
     210  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    238213
    239214   if( first )
    240      {                         // compute normalization constants, this will only be done once
     215     {   // compute normalization constants, this will only be done once
    241216       first = false;
    242217       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HESigmaZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HESigmaZeroInelastic.cc,v 1.11 2006/06/29 20:30:44 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HESigmaZeroInelastic.cc,v 1.12 2010/11/20 04:01:33 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4643#include "G4Gamma.hh"
    4744
    48 G4HadFinalState *  G4HESigmaZeroInelastic::
    49 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    50   {
    51     G4HEVector * pv = new G4HEVector[MAXPART];
    52     const G4HadProjectile *aParticle = &aTrack;
    53 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    54     G4HEVector incidentParticle(aParticle);
     45G4HadFinalState*
     46G4HESigmaZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     47                                      G4Nucleus& targetNucleus)
     48{
     49  G4HEVector* pv = new G4HEVector[MAXPART];
     50  const G4HadProjectile* aParticle = &aTrack;
     51  G4HEVector incidentParticle(aParticle);
    5552     
    56     G4HELambdaInelastic theLambdaInelastic;
    57     theLambdaInelastic.SetMaxNumberOfSecondaries(MAXPART);
    58     theLambdaInelastic.SetVerboseLevel(verboseLevel);
     53  G4HELambdaInelastic theLambdaInelastic;
     54  theLambdaInelastic.SetMaxNumberOfSecondaries(MAXPART);
     55  theLambdaInelastic.SetVerboseLevel(verboseLevel);
    5956   
    60     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    61     G4double pgam = G4UniformRand()*incidentTotalMomentum*0.75;
    62     G4HEVector incidentLambda;
    63     incidentLambda.SmulAndUpdate( incidentParticle,
    64                                  (incidentTotalMomentum - pgam)/incidentTotalMomentum);                   
    65     G4DynamicParticle * aLambda = new G4DynamicParticle();
    66     aLambda->SetDefinition(G4Lambda::Lambda());
    67     aLambda->SetMomentum(incidentLambda.getMomentum());
    68     G4HadProjectile aLambdaTrack(*aLambda);
    69     G4HadFinalState * result = theLambdaInelastic.ApplyYourself(aLambdaTrack, targetNucleus);           
    70     vecLength = theLambdaInelastic.GetNumberOfSecondaries();
     57  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     58  G4double pgam = G4UniformRand()*incidentTotalMomentum*0.75;
     59  G4HEVector incidentLambda;
     60  incidentLambda.SmulAndUpdate(incidentParticle,
     61                      (incidentTotalMomentum - pgam)/incidentTotalMomentum);                   
     62  G4DynamicParticle* aLambda = new G4DynamicParticle();
     63  aLambda->SetDefinition(G4Lambda::Lambda());
     64  aLambda->SetMomentum(incidentLambda.getMomentum());
     65  G4HadProjectile aLambdaTrack(*aLambda);
     66  G4HadFinalState* result =
     67          theLambdaInelastic.ApplyYourself(aLambdaTrack, targetNucleus);               
     68  vecLength = theLambdaInelastic.GetNumberOfSecondaries();
    7169   
    72     pv[vecLength] = Gamma;
    73     pv[vecLength].setMomentum(incidentParticle.getMomentum());
    74     pv[vecLength].SmulAndUpdate( pv[vecLength],pgam/incidentTotalMomentum);
    75     G4DynamicParticle * aPhoton = new G4DynamicParticle();
    76     aPhoton->SetDefinition(G4Gamma::Gamma());
    77     aPhoton->SetMomentum(pv[vecLength].getMomentum());
    78     result->AddSecondary(aPhoton);
    79     delete [] pv;
    80     return result;
    81   }
    82        
     70  pv[vecLength] = Gamma;
     71  pv[vecLength].setMomentum(incidentParticle.getMomentum());
     72  pv[vecLength].SmulAndUpdate( pv[vecLength],pgam/incidentTotalMomentum);
     73  G4DynamicParticle* aPhoton = new G4DynamicParticle();
     74  aPhoton->SetDefinition(G4Gamma::Gamma());
     75  aPhoton->SetMomentum(pv[vecLength].getMomentum());
     76  result->AddSecondary(aPhoton);
     77  delete [] pv;
     78  return result;
     79}
    8380
    84 
    85 
    86 
    87 
    88 
    89 
    90 
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEVector.cc

    r1340 r1347  
    2525//
    2626//
    27 // $Id: G4HEVector.cc,v 1.20 2006/11/22 23:52:32 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
     27// $Id: G4HEVector.cc,v 1.22 2010/11/29 05:44:44 dennis Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    164164   }
    165165
    166 G4double
    167 G4HEVector::getTotalMomentum()
    168    {
    169      return std::sqrt(px*px + py*py + pz*pz);
    170    }
     166G4double G4HEVector::getTotalMomentum() const
     167{
     168  return std::sqrt(px*px + py*py + pz*pz);
     169}
    171170
    172171void
    173 G4HEVector::setMomentum( G4double x, G4double y, G4double z)
    174    {
    175      px = x;
    176      py = y;
    177      pz = z;
    178      return;
    179    }
    180 
    181 void
    182 G4HEVector::setMomentumAndUpdate( G4double x, G4double y, G4double z )
    183    {
    184      px = x;
    185      py = y;
    186      pz = z;
    187      energy        = std::sqrt(mass*mass + px*px + py*py + pz*pz);
    188      kineticEnergy = Amax(0.,energy-mass);
    189      return;
    190    }
    191 
    192 void
    193 G4HEVector::setMomentum( G4double x, G4double y )
    194    {
    195      px = x;
    196      py = y;
    197      return;
    198    }
     172G4HEVector::setMomentum(G4double x, G4double y, G4double z)
     173{
     174  px = x;
     175  py = y;
     176  pz = z;
     177  return;
     178}
     179
     180void
     181G4HEVector::setMomentumAndUpdate(G4double x, G4double y, G4double z)
     182{
     183  px = x;
     184  py = y;
     185  pz = z;
     186  energy = std::sqrt(mass*mass + px*px + py*py + pz*pz);
     187  kineticEnergy = Amax(0.,energy-mass);
     188  return;
     189}
     190
     191void
     192G4HEVector::setMomentum(G4double x, G4double y)
     193{
     194  px = x;
     195  py = y;
     196  return;
     197}
    199198
    200199void
     
    312311   }
    313312
    314 G4double
    315 G4HEVector::getEnergy()
    316    {
    317      return energy;
    318    }
    319 
    320 G4double
    321 G4HEVector::getKineticEnergy()
    322    {
    323      return kineticEnergy;
    324    }
     313G4double G4HEVector::getEnergy() const
     314{
     315  return energy;
     316}
     317
     318G4double G4HEVector::getKineticEnergy() const
     319{
     320  return kineticEnergy;
     321}
    325322
    326323void
     
    367364   }   
    368365
    369 G4double
    370 G4HEVector::getMass()
    371    {
    372      return mass;
    373    }
     366G4double G4HEVector::getMass() const
     367{
     368  return mass;
     369}
    374370
    375371void
     
    380376   }
    381377
    382 G4double
    383 G4HEVector::getCharge()
    384    {
    385      return charge;
    386    }
     378G4double G4HEVector::getCharge() const
     379{
     380  return charge;
     381}
    387382
    388383void
     
    433428   }
    434429
    435 G4int
    436 G4HEVector::getCode()
    437    {
    438      return code;
    439    }
    440 
    441 G4String
    442 G4HEVector::getName()
    443    {
    444      return particleName;
    445    }
    446 
    447 G4String
    448 G4HEVector::getType()
    449    {
    450      return particleType;
    451    }
     430G4int G4HEVector::getCode() const
     431{
     432  return code;
     433}
     434
     435G4String G4HEVector::getName() const
     436{
     437  return particleName;
     438}
     439
     440G4String G4HEVector::getType() const
     441{
     442  return particleType;
     443}
    452444 
    453 G4int
    454 G4HEVector::getBaryonNumber()
    455    {
    456      return baryon;
    457    }
    458 
    459 G4int
    460 G4HEVector::getStrangenessNumber()
    461    {
    462      return strangeness;
    463    }
     445G4int G4HEVector::getBaryonNumber() const
     446{
     447  return baryon;
     448}
     449
     450G4int G4HEVector::getStrangenessNumber() const
     451{
     452  return strangeness;
     453}
     454
    464455G4int
    465456G4HEVector::getQuarkContent(G4int flavor)
     
    589580   }
    590581
    591 G4double
    592 G4HEVector::CosAng( const G4HEVector & p )
    593    {
    594      G4double a = std::sqrt( (px*px + py*py + pz*pz)*(p.px*p.px + p.py*p.py + p.pz*p.pz) );
    595      if( a != 0.0 )
    596        {
    597          a = (px*p.px + py*p.py + pz*p.pz)/a;
    598          if( std::fabs(a) > 1.0 )
    599          {
    600            if(a<0.0) a=-1.0;
    601            else a=1.0;
    602          }   
    603        }
    604      return a;
    605    }
     582G4double G4HEVector::CosAng(const G4HEVector& p) const
     583{
     584  G4double a = std::sqrt( (px*px + py*py + pz*pz)*(p.px*p.px + p.py*p.py + p.pz*p.pz) );
     585  if (a != 0.0) {
     586    a = (px*p.px + py*p.py + pz*p.pz)/a;
     587    if (std::fabs(a) > 1.0) {
     588      if (a < 0.0) a = -1.0;
     589      else a = 1.0;
     590    }   
     591  }
     592  return a;
     593}
    606594
    607595G4double
     
    725713   }
    726714
    727 G4double
    728 G4HEVector::Length()
    729    {
    730      return  std::sqrt(px*px + py*py + pz*pz);
    731    }
     715G4double G4HEVector::Length() const
     716{
     717  return std::sqrt(px*px + py*py + pz*pz);
     718}
    732719
    733720void
     
    12971284}
    12981285
    1299 void
    1300 G4HEVector::Print( G4int L)
    1301    {
    1302      G4cout << "HEV: "
    1303           << L << " " << px << " " <<  py << " " <<  pz << " "
    1304           << energy << " " << mass << " " << charge << " "
    1305           << timeOfFlight << " " << side << " " << flag << " "
    1306           << code << " " << baryon << " " << particleName << G4endl;
    1307      /*
    1308      printf("HEV: %3d %6f.2 %6f.2 %6f.2 %6f.2 %6f.2 %3f.0 %4f.1 %3d
    1309              %3d %6d %6d %s \n", L, px, py, pz, energy, mass, charge,
    1310              timeOfFlight, side, flag, code, baryon, particleName);
    1311              */
    1312      return;                         
    1313    }
    1314 
     1286void G4HEVector::Print(G4int L) const
     1287{
     1288  G4cout << "HEV: "
     1289         << L << " " << px << " " <<  py << " " <<  pz << " "
     1290         << energy << " " << mass << " " << charge << " "
     1291         << timeOfFlight << " " << side << " " << flag << " "
     1292         << code << " " << baryon << " " << particleName << G4endl;
     1293  return;                         
     1294}
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEXiMinusInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEXiMinusInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEXiMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEXiMinusInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEXiMinusInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEXiMinusInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                    G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEXiMinusInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEXiMinusInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEXiMinusInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEXiMinusInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
    8075   
    81     G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                        + targetMass*targetMass
     109                                        + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasXiMinus(inElastic, availableEnergy, pv, vecLength,
    141                              incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasXiMinus(inElastic, availableEnergy, pv, vecLength,
     122                       incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv, vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HEXiMinusInelastic::FirstIntInCasXiMinus( G4bool &inElastic,
    196                                             const G4double availableEnergy,
    197                                             G4HEVector pv[],
    198                                             G4int &vecLen,
    199                                             G4HEVector incidentParticle,
    200                                             G4HEVector targetParticle,
    201                                             const G4double atomicWeight)
     174G4HEXiMinusInelastic::FirstIntInCasXiMinus(G4bool& inElastic,
     175                                           const G4double availableEnergy,
     176                                           G4HEVector pv[],
     177                                           G4int& vecLen,
     178                                           const G4HEVector& incidentParticle,
     179                                           const G4HEVector& targetParticle,
     180                                           const G4double atomicWeight)
    202181
    203182// Xi0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222    G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int neutronCode = Neutron.getCode();
     201  G4int protonCode = Proton.getCode();
     202
     203  G4int targetCode = targetParticle.getCode();
     204  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     205
     206  static G4bool first = true;
     207  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     208  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     209
     210  //  misc. local variables
     211  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     212
     213  G4int i, counter, nt, np, nm, nz;
    238214
    239215   if( first )
    240      {                         // compute normalization constants, this will only be done once
     216     {   // compute normalization constants, this will only be done once
    241217       first = false;
    242218       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
  • trunk/source/processes/hadronic/models/high_energy/src/G4HEXiZeroInelastic.cc

    r1340 r1347  
    2424// ********************************************************************
    2525//
    26 //
    27 // $Id: G4HEXiZeroInelastic.cc,v 1.15 2008/03/17 20:49:17 dennis Exp $
    28 // GEANT4 tag $Name: geant4-09-03-ref-09 $
    29 //
     26// $Id: G4HEXiZeroInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $
     27// GEANT4 tag $Name: geant4-09-04-ref-00 $
    3028//
    3129
     
    3331#include "G4ios.hh"
    3432
    35 //
    3633// G4 Process: Gheisha High Energy Collision model.
    3734// This includes the high energy cascading model, the two-body-resonance model
    38 // and the low energy two-body model. Not included are the low energy stuff like
    39 // nuclear reactions, nuclear fission without any cascading and all processes for
    40 // particles at rest. 
     35// and the low energy two-body model. Not included are the low energy stuff
     36// like nuclear reactions, nuclear fission without any cascading and all
     37// processes for particles at rest. 
    4138// First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 
    4239// H. Fesefeldt, RWTH-Aachen, 23-October-1996
     
    4542#include "G4HEXiZeroInelastic.hh"
    4643
    47 G4HadFinalState *  G4HEXiZeroInelastic::
    48 ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus )
    49   {
    50     G4HEVector * pv = new G4HEVector[MAXPART];
    51     const G4HadProjectile *aParticle = &aTrack;
    52 //    G4DynamicParticle *originalTarget = targetNucleus.ReturnTargetParticle();
    53     const G4double A = targetNucleus.GetN();
    54     const G4double Z = targetNucleus.GetZ();
    55     G4HEVector incidentParticle(aParticle);
     44G4HadFinalState*
     45G4HEXiZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack,
     46                                   G4Nucleus& targetNucleus)
     47{
     48  G4HEVector* pv = new G4HEVector[MAXPART];
     49  const G4HadProjectile* aParticle = &aTrack;
     50  const G4double A = targetNucleus.GetN();
     51  const G4double Z = targetNucleus.GetZ();
     52  G4HEVector incidentParticle(aParticle);
    5653     
    57     G4double atomicNumber = Z;
    58     G4double atomicWeight = A;
    59 
    60     G4int    incidentCode          = incidentParticle.getCode();
    61     G4double incidentMass          = incidentParticle.getMass();
    62     G4double incidentTotalEnergy   = incidentParticle.getEnergy();
    63     G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    64     G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
    65 
    66     if(incidentKineticEnergy < 1.)
    67       {
    68         G4cout << "GHEXiZeroInelastic: incident energy < 1 GeV" << G4endl;
    69       }
    70     if(verboseLevel > 1)
    71       {
    72         G4cout << "G4HEXiZeroInelastic::ApplyYourself" << G4endl;
    73         G4cout << "incident particle " << incidentParticle.getName()
    74              << "mass "              << incidentMass
    75              << "kinetic energy "    << incidentKineticEnergy
    76              << G4endl;
    77         G4cout << "target material with (A,Z) = ("
    78              << atomicWeight << "," << atomicNumber << ")" << G4endl;
    79       }
    80 
    81     G4double inelasticity  = NuclearInelasticity(incidentKineticEnergy,
    82                                                  atomicWeight, atomicNumber);
    83     if(verboseLevel > 1)
    84         G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
     54  G4double atomicNumber = Z;
     55  G4double atomicWeight = A;
     56
     57  G4int incidentCode = incidentParticle.getCode();
     58  G4double incidentMass = incidentParticle.getMass();
     59  G4double incidentTotalEnergy = incidentParticle.getEnergy();
     60  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     61  G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass;
     62
     63  if (incidentKineticEnergy < 1.)
     64    G4cout << "GHEXiZeroInelastic: incident energy < 1 GeV" << G4endl;
     65
     66  if (verboseLevel > 1) {
     67    G4cout << "G4HEXiZeroInelastic::ApplyYourself" << G4endl;
     68    G4cout << "incident particle " << incidentParticle.getName()
     69           << "mass "              << incidentMass
     70           << "kinetic energy "    << incidentKineticEnergy
     71           << G4endl;
     72    G4cout << "target material with (A,Z) = ("
     73           << atomicWeight << "," << atomicNumber << ")" << G4endl;
     74  }
     75
     76  G4double inelasticity = NuclearInelasticity(incidentKineticEnergy,
     77                                              atomicWeight, atomicNumber);
     78  if (verboseLevel > 1)
     79    G4cout << "nuclear inelasticity = " << inelasticity << G4endl;
    8580   
    86     incidentKineticEnergy -= inelasticity;
     81  incidentKineticEnergy -= inelasticity;
    8782   
    88     G4double excitationEnergyGNP = 0.;
    89     G4double excitationEnergyDTA = 0.;
    90 
    91     G4double excitation    = NuclearExcitation(incidentKineticEnergy,
    92                                                atomicWeight, atomicNumber,
    93                                                excitationEnergyGNP,
    94                                                excitationEnergyDTA);
    95     if(verboseLevel > 1)
    96       G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
     83  G4double excitationEnergyGNP = 0.;
     84  G4double excitationEnergyDTA = 0.;
     85
     86  G4double excitation = NuclearExcitation(incidentKineticEnergy,
     87                                          atomicWeight, atomicNumber,
     88                                          excitationEnergyGNP,
     89                                          excitationEnergyDTA);
     90  if (verboseLevel > 1)
     91    G4cout << "nuclear excitation = " << excitation << excitationEnergyGNP
    9792           << excitationEnergyDTA << G4endl;             
    9893
    99 
    100     incidentKineticEnergy -= excitation;
    101     incidentTotalEnergy    = incidentKineticEnergy + incidentMass;
    102     incidentTotalMomentum  = std::sqrt( (incidentTotalEnergy-incidentMass)                   
    103                                   *(incidentTotalEnergy+incidentMass));
    104 
    105 
    106     G4HEVector targetParticle;
    107     if(G4UniformRand() < atomicNumber/atomicWeight)
    108       {
    109         targetParticle.setDefinition("Proton");
    110       }
    111     else
    112       {
    113         targetParticle.setDefinition("Neutron");
    114       }
    115 
    116     G4double targetMass         = targetParticle.getMass();
    117     G4double centerOfMassEnergy = std::sqrt( incidentMass*incidentMass + targetMass*targetMass
    118                                        + 2.0*targetMass*incidentTotalEnergy);
    119     G4double availableEnergy    = centerOfMassEnergy - targetMass - incidentMass;
    120 
    121                                                                 // this was the meaning of inElastic in the
    122                                                                 // original Gheisha stand-alone version.
    123 //    G4bool   inElastic          = InElasticCrossSectionInFirstInt
    124 //                                    (availableEnergy, incidentCode, incidentTotalMomentum); 
    125                                                                 // by unknown reasons, it has been replaced
    126                                                                 // to the following code in Geant???
    127     G4bool inElastic = true;
    128 //    if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;   
    129 
    130     vecLength = 0;           
     94  incidentKineticEnergy -= excitation;
     95  incidentTotalEnergy = incidentKineticEnergy + incidentMass;
     96  incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass)
     97                                    *(incidentTotalEnergy+incidentMass));
     98
     99  G4HEVector targetParticle;
     100  if (G4UniformRand() < atomicNumber/atomicWeight) {
     101    targetParticle.setDefinition("Proton");
     102  } else {
     103    targetParticle.setDefinition("Neutron");
     104  }
     105
     106  G4double targetMass = targetParticle.getMass();
     107  G4double centerOfMassEnergy = std::sqrt(incidentMass*incidentMass
     108                                         + targetMass*targetMass
     109                                         + 2.0*targetMass*incidentTotalEnergy);
     110  G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass;
     111
     112  G4bool inElastic = true;
     113  vecLength = 0;
    131114       
    132     if(verboseLevel > 1)
    133       G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
     115  if (verboseLevel > 1)
     116    G4cout << "ApplyYourself: CallFirstIntInCascade for particle "
    134117           << incidentCode << G4endl;
    135118
    136     G4bool successful = false;
     119  G4bool successful = false;
    137120   
    138     if(inElastic || (!inElastic && atomicWeight < 1.5))
    139       {
    140         FirstIntInCasXiZero(inElastic, availableEnergy, pv, vecLength,
    141                             incidentParticle, targetParticle, atomicWeight);
    142 
    143         if(verboseLevel > 1)
    144            G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl; 
    145 
    146 
    147         if ((vecLength > 0) && (availableEnergy > 1.))
    148                    StrangeParticlePairProduction( availableEnergy, centerOfMassEnergy,
    149                                                   pv, vecLength,
    150                                                   incidentParticle, targetParticle);
    151             HighEnergyCascading( successful, pv, vecLength,
    152                                  excitationEnergyGNP, excitationEnergyDTA,
    153                                  incidentParticle, targetParticle,
    154                                  atomicWeight, atomicNumber);
    155         if (!successful)
    156             HighEnergyClusterProduction( successful, pv, vecLength,
    157                                          excitationEnergyGNP, excitationEnergyDTA,
    158                                          incidentParticle, targetParticle,
    159                                          atomicWeight, atomicNumber);
    160         if (!successful)
    161             MediumEnergyCascading( successful, pv, vecLength,
    162                                    excitationEnergyGNP, excitationEnergyDTA,
    163                                    incidentParticle, targetParticle,
    164                                    atomicWeight, atomicNumber);
    165 
    166         if (!successful)
    167             MediumEnergyClusterProduction( successful, pv, vecLength,
    168                                            excitationEnergyGNP, excitationEnergyDTA,       
    169                                            incidentParticle, targetParticle,
    170                                            atomicWeight, atomicNumber);
    171         if (!successful)
    172             QuasiElasticScattering( successful, pv, vecLength,
    173                                     excitationEnergyGNP, excitationEnergyDTA,
    174                                     incidentParticle, targetParticle,
    175                                     atomicWeight, atomicNumber);
    176       }
    177     if (!successful)
    178       {
    179             ElasticScattering( successful, pv, vecLength,
    180                                incidentParticle,   
    181                                atomicWeight, atomicNumber);
    182       }
    183 
    184     if (!successful)
    185       {
    186         G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles" << G4endl;
    187       }
    188       FillParticleChange(pv,  vecLength);
    189       delete [] pv;
    190       theParticleChange.SetStatusChange(stopAndKill);
    191       return & theParticleChange;
    192   }
     121  FirstIntInCasXiZero(inElastic, availableEnergy, pv, vecLength,
     122                      incidentParticle, targetParticle, atomicWeight);
     123
     124  if (verboseLevel > 1)
     125    G4cout << "ApplyYourself::StrangeParticlePairProduction" << G4endl;
     126
     127  if ((vecLength > 0) && (availableEnergy > 1.))
     128    StrangeParticlePairProduction(availableEnergy, centerOfMassEnergy,
     129                                  pv, vecLength,
     130                                  incidentParticle, targetParticle);
     131
     132  HighEnergyCascading(successful, pv, vecLength,
     133                      excitationEnergyGNP, excitationEnergyDTA,
     134                      incidentParticle, targetParticle,
     135                      atomicWeight, atomicNumber);
     136  if (!successful)
     137    HighEnergyClusterProduction(successful, pv, vecLength,
     138                                excitationEnergyGNP, excitationEnergyDTA,
     139                                incidentParticle, targetParticle,
     140                                atomicWeight, atomicNumber);
     141  if (!successful)
     142    MediumEnergyCascading(successful, pv, vecLength,
     143                          excitationEnergyGNP, excitationEnergyDTA,
     144                          incidentParticle, targetParticle,
     145                          atomicWeight, atomicNumber);
     146
     147  if (!successful)
     148    MediumEnergyClusterProduction(successful, pv, vecLength,
     149                                  excitationEnergyGNP, excitationEnergyDTA,       
     150                                  incidentParticle, targetParticle,
     151                                  atomicWeight, atomicNumber);
     152  if (!successful)
     153    QuasiElasticScattering(successful, pv, vecLength,
     154                           excitationEnergyGNP, excitationEnergyDTA,
     155                           incidentParticle, targetParticle,
     156                           atomicWeight, atomicNumber);
     157  if (!successful)
     158    ElasticScattering(successful, pv, vecLength,
     159                      incidentParticle,   
     160                      atomicWeight, atomicNumber);
     161
     162  if (!successful)
     163    G4cout << "GHEInelasticInteraction::ApplyYourself fails to produce final state particles"
     164           << G4endl;
     165
     166  FillParticleChange(pv, vecLength);
     167  delete [] pv;
     168  theParticleChange.SetStatusChange(stopAndKill);
     169  return &theParticleChange;
     170}
     171
    193172
    194173void
    195 G4HEXiZeroInelastic::FirstIntInCasXiZero( G4bool &inElastic,
    196                                           const G4double availableEnergy,
    197                                           G4HEVector pv[],
    198                                           G4int &vecLen,
    199                                           G4HEVector incidentParticle,
    200                                           G4HEVector targetParticle,
    201                                           const G4double atomicWeight)
     174G4HEXiZeroInelastic::FirstIntInCasXiZero(G4bool& inElastic,
     175                                         const G4double availableEnergy,
     176                                         G4HEVector pv[],
     177                                         G4int& vecLen,
     178                                         const G4HEVector& incidentParticle,
     179                                         const G4HEVector& targetParticle,
     180                                         const G4double atomicWeight)
    202181
    203182// Xi0 undergoes interaction with nucleon within a nucleus.  Check if it is
     
    208187// protons/neutrons by kaons or strange baryons according to the average
    209188// multiplicity per inelastic reaction.
    210 
    211  {
    212    static const G4double expxu =  std::log(MAXFLOAT); // upper bound for arg. of exp
    213    static const G4double expxl = -expxu;         // lower bound for arg. of exp
    214 
    215    static const G4double protb = 0.7;
    216    static const G4double neutb = 0.7;             
    217    static const G4double     c = 1.25;
    218 
    219    static const G4int   numMul = 1200;
    220    static const G4int   numSec = 60;
    221 
    222 //   G4int              neutronCode = Neutron.getCode();
    223    G4int              protonCode  = Proton.getCode();
    224 
    225    G4int               targetCode = targetParticle.getCode();
    226 //   G4double          incidentMass = incidentParticle.getMass();
    227 //   G4double        incidentEnergy = incidentParticle.getEnergy();
    228    G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
    229 
    230    static G4bool first = true;
    231    static G4double protmul[numMul], protnorm[numSec];  // proton constants
    232    static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
    233 
    234                               //  misc. local variables
    235                               //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
    236 
    237    G4int i, counter, nt, np, nm, nz;
     189{
     190  static const G4double expxu = std::log(MAXFLOAT); // upper bound for arg. of exp
     191  static const G4double expxl = -expxu;             // lower bound for arg. of exp
     192
     193  static const G4double protb = 0.7;
     194  static const G4double neutb = 0.7;             
     195  static const G4double     c = 1.25;
     196
     197  static const G4int numMul = 1200;
     198  static const G4int numSec = 60;
     199
     200  G4int protonCode = Proton.getCode();
     201
     202  G4int targetCode = targetParticle.getCode();
     203  G4double incidentTotalMomentum = incidentParticle.getTotalMomentum();
     204
     205  static G4bool first = true;
     206  static G4double protmul[numMul], protnorm[numSec];  // proton constants
     207  static G4double neutmul[numMul], neutnorm[numSec];  // neutron constants
     208
     209  //  misc. local variables
     210  //  np = number of pi+,  nm = number of pi-,  nz = number of pi0
     211
     212  G4int i, counter, nt, np, nm, nz;
    238213
    239214   if( first )
    240      {                         // compute normalization constants, this will only be done once
     215     {     // compute normalization constants, this will only be done once
    241216       first = false;
    242217       for( i=0; i<numMul; i++ )protmul[i]  = 0.0;
Note: See TracChangeset for help on using the changeset viewer.