Changeset 1347 for trunk/source/processes/hadronic/models/high_energy
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (14 years ago)
- Location:
- trunk/source/processes/hadronic/models/high_energy
- Files:
-
- 57 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/high_energy/History
r1315 r1347 14 14 * Please list in reverse chronological order (last date on top) 15 15 --------------------------------------------------------------- 16 17 3 Dec 2010 - Dennis Wright (hadr-hep-V09-03-03) 18 ------------------------------------------------ 19 - more CoVerity bug fixes in G4HEInelastic.cc : 20 array overrun in method QuasiElasticScattering (change pvmx[4] to 21 pvmx[0] 22 dead code due to bools dummy and dum always being false 23 memory leak in methods HighEnergyCascading, MediumEnergyCascading, 24 QuasiElasticScattering 25 use of loop variable outside of for loop 26 27 27 Nov 2010 - Dennis Wright (hadr-hep-V09-03-02) 28 ------------------------------------------------ 29 - more CoVerity bug fixes: G4HEInelastic.hh (init verboseLevel), 30 - make incidentParticle and targetParticle args const & 31 32 12 Nov 2010 - Dennis Wright (hadr-hep-V09-03-01) 33 ------------------------------------------------ 34 - Fix uninitialized variable (vecLength = 0) in header files of 35 G4HEAntiLambdaInelastic, G4HEAntiNeutronInelastic 36 G4HEAntiOmegaMinusInelastic, G4HEAntiProtonInelastic 37 G4HEAntiSigmaMinusInelastic, G4HEAntiSigmaPlusInelastic 38 G4HEAntiXiMinusInelastic, G4HEAntiXiZeroInelastic 39 G4HEKaonMinusInelastic, G4HEKaonPlusInelastic 40 G4HEKaonZeroInelastic, G4HELambdaInelastic 41 G4HENeutronInelastic, G4HEOmegaMinusInelastic 42 G4HEPionMinusInelastic, G4HEPionPlusInelastic 43 G4HEProtonInelastic, G4HESigmaMinusInelastic 44 G4HESigmaPlusInelastic, G4HEXiMinusInelastic 45 G4HEXiZeroInelastic 46 and remove dead code in .cc files of above 47 48 - Fix uninitialized variable (MAXPART = 0) in header file of 49 G4HEInelastic 50 - Initialize theQuarkContent and theAntiQuarkContent 51 in G4HEVector.hh 16 52 17 53 23 Jan 2010 - Dennis Wright (hadr-hep-V09-03-00) -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiKaonZeroInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEAntiKaonZeroInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEAntiKaonZeroInelastic.hh,v 1.15 2010/11/27 02:02:19 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEAntiKaonZeroInelastic() : G4HEInelastic("G4HEAntiKaonZeroInelastic") 58 58 { 59 theMinEnergy = 59 theMinEnergy = 20*GeV; 60 60 theMaxEnergy = 10*TeV; 61 61 MAXPART = 2048; … … 67 67 G4int vecLength; 68 68 69 G4HadFinalState * ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus ); 69 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 70 G4Nucleus& targetNucleus); 70 71 71 G4int 72 G4int GetNumberOfSecondaries() 72 73 { return vecLength; } 73 74 74 75 75 void FirstIntInCasAntiKaonZero(G4bool &inElastic, const G4double availableEnergy, 76 G4HEVector pv[], 77 G4int &vecLen, 78 G4HEVector incidentParticle, 79 G4HEVector targetParticle); 76 void FirstIntInCasAntiKaonZero(G4bool& inElastic, 77 const G4double availableEnergy, 78 G4HEVector pv[], 79 G4int& vecLen, 80 const G4HEVector& incidentParticle, 81 const G4HEVector& targetParticle); 80 82 }; 81 83 #endif 82 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiLambdaInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEAntiLambdaInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEAntiLambdaInelastic.hh,v 1.16 2010/11/27 02:02:59 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEAntiLambdaInelastic() : G4HEInelastic("G4HEAntiLambdaInelastic") 58 58 { 59 vecLength = 0; 59 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState * ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus ); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasAntiLambda(G4bool &inElastic, const G4double availableEnergy, 75 G4HEVector pv[], 76 G4int &vecLen, 77 G4HEVector incidentParticle, 78 G4HEVector targetParticle, 79 const G4double atomicWeight); 75 void FirstIntInCasAntiLambda(G4bool& inElastic, 76 const G4double availableEnergy, 77 G4HEVector pv[], 78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 81 const G4double atomicWeight); 80 82 }; 81 83 #endif -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiNeutronInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEAntiNeutronInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEAntiNeutronInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEAntiNeutronInelastic() : G4HEInelastic("G4HEAntiNeutronInelastic") 58 58 { 59 vecLength = 0; 59 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, 71 G4Nucleus &targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasAntiNeutron(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasAntiNeutron(G4bool &inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 78 G4int &vecLen, 77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiOmegaMinusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEAntiOmegaMinusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEAntiOmegaMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEAntiOmegaMinusInelastic() : G4HEInelastic("G4HEAntiOmegaMinusInelastic") 58 58 { 59 vecLength = 0; 59 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasAntiOmegaMinus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasAntiOmegaMinus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiProtonInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEAntiProtonInelastic.hh,v 1.1 5 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEAntiProtonInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEAntiProtonInelastic() : G4HEInelastic("G4HEAntiProtonInelastic") 58 58 { 59 vecLength = 0; 59 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, 71 G4Nucleus &targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasAntiProton(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasAntiProton(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiSigmaMinusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEAntiSigmaMinusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEAntiSigmaMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEAntiSigmaMinusInelastic() : G4HEInelastic("G4HEAntiSigmaMinusInelastic") 58 58 { 59 vecLength = 0; 59 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasAntiSigmaMinus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasAntiSigmaMinus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiSigmaPlusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEAntiSigmaPlusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEAntiSigmaPlusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEAntiSigmaPlusInelastic() : G4HEInelastic("G4HEAntiSigmaPlusInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself( const G4HadProjectile &aTrack, G4Nucleus &targetNucleus ); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasAntiSigmaPlus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasAntiSigmaPlus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiSigmaZeroInelastic.hh
r1340 r1347 26 26 // 27 27 // $Id: G4HEAntiSigmaZeroInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiXiMinusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEAntiXiMinusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEAntiXiMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEAntiXiMinusInelastic() : G4HEInelastic("G4HEAntiXiMinusInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasAntiXiMinus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasAntiXiMinus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEAntiXiZeroInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEAntiXiZeroInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEAntiXiZeroInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEAntiXiZeroInelastic() : G4HEInelastic("G4HEAntiXiZeroInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasAntiXiZero(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasAntiXiZero(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEInelastic.hh
r1340 r1347 24 24 // ******************************************************************** 25 25 // 26 // 27 // $Id: G4HEInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-03-ref-09 $ 26 // $Id: G4HEInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $ 27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 28 // 30 29 // … … 71 70 { 72 71 SetParticles(); 72 verboseLevel = 0; 73 MAXPART = 0; 73 74 conserveEnergy = true; 74 75 }; … … 76 77 ~G4HEInelastic(){ }; 77 78 78 void SetMaxNumberOfSecondaries( const G4int maxnumber )79 {MAXPART = maxnumber;}79 void SetMaxNumberOfSecondaries(const G4int maxnumber) 80 {MAXPART = maxnumber;} 80 81 81 void SetVerboseLevel( const G4int level) 82 { verboseLevel = level;} 83 84 G4int verboseLevel; 85 G4int MAXPART; 86 G4bool conserveEnergy; 87 88 void ForceEnergyConservation(G4bool energyConservation) 89 { conserveEnergy = energyConservation;} 90 G4bool EnergyConservation(void) 91 { return conserveEnergy;} 92 93 G4double Amin(G4double a, G4double b); 94 G4double Amax(G4double a, G4double b); 95 G4int Imin(G4int a, G4int b); 96 G4int Imax(G4int a, G4int b); 82 void SetVerboseLevel(const G4int level) {verboseLevel = level;} 83 84 G4int verboseLevel; 85 G4int MAXPART; 86 G4bool conserveEnergy; 87 88 void ForceEnergyConservation(G4bool energyConservation) 89 {conserveEnergy = energyConservation;} 90 91 G4bool EnergyConservation(void) {return conserveEnergy;} 92 93 G4double Amin(G4double a, G4double b); 94 G4double Amax(G4double a, G4double b); 95 G4int Imin(G4int a, G4int b); 96 G4int Imax(G4int a, G4int b); 97 97 98 void FillParticleChange(G4HEVector pv[], G4int aVecLength); 99 100 G4double pmltpc(G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c); 101 102 G4int Factorial(G4int n); 103 104 G4double NuclearInelasticity(G4double incidentKineticEnergy, 105 G4double atomicWeight, 106 G4double atomicNumber); 107 G4double NuclearExcitation(G4double incidentKineticEnergy, 108 G4double atomicWeight, 109 G4double atomicNumber, 110 G4double& excitationEnergyCascade, 111 G4double& excitationEnergyEvaporation); 98 void FillParticleChange(G4HEVector pv[], G4int aVecLength); 99 100 G4double pmltpc(G4int np, G4int nm, G4int nz, 101 G4int n, G4double b, G4double c); 102 103 G4int Factorial(G4int n); 104 105 G4double NuclearInelasticity(G4double incidentKineticEnergy, 106 G4double atomicWeight, 107 G4double atomicNumber); 108 109 G4double NuclearExcitation(G4double incidentKineticEnergy, 110 G4double atomicWeight, 111 G4double atomicNumber, 112 G4double& excitationEnergyCascade, 113 G4double& excitationEnergyEvaporation); 112 114 113 void HighEnergyCascading(G4bool &successful, 114 G4HEVector pv[], 115 G4int &vecLen, 116 G4double &excitationEnergyGNP, 117 G4double &excitationEnergyDTA, 118 G4HEVector incidentParticle, 119 G4HEVector targetParticle, 120 G4double atomicWeight, 121 G4double atomicNumber); 122 123 void HighEnergyClusterProduction(G4bool &successful, 124 G4HEVector pv[], 125 G4int &vecLen, 126 G4double &excitationEnergyGNP, 127 G4double &excitationEnergyDTA, 128 G4HEVector incidentParticle, 129 G4HEVector targetParticle, 130 G4double atomicWeight, 131 G4double atomicNumber); 132 133 void TuningOfHighEnergyCascading(G4HEVector pv[], 134 G4int &vecLen, 135 G4HEVector incidentParticle, 136 G4HEVector targetParticle, 137 G4double atomicWeight, 138 G4double atomicNumber); 139 140 void MediumEnergyCascading(G4bool &successful, 115 void HighEnergyCascading(G4bool& successful, 116 G4HEVector pv[], 117 G4int& vecLen, 118 G4double& excitationEnergyGNP, 119 G4double& excitationEnergyDTA, 120 const G4HEVector& incidentParticle, 121 const G4HEVector& targetParticle, 122 G4double atomicWeight, 123 G4double atomicNumber); 124 125 void HighEnergyClusterProduction(G4bool& successful, 141 126 G4HEVector pv[], 142 G4int &vecLen,143 G4double &excitationEnergyGNP,144 G4double &excitationEnergyDTA,145 G4HEVectorincidentParticle,146 G4HEVectortargetParticle,127 G4int& vecLen, 128 G4double& excitationEnergyGNP, 129 G4double& excitationEnergyDTA, 130 const G4HEVector& incidentParticle, 131 const G4HEVector& targetParticle, 147 132 G4double atomicWeight, 148 G4double atomicNumber); 149 150 void MediumEnergyClusterProduction(G4bool &successful, 151 G4HEVector pv[], 152 G4int &vecLen, 153 G4double &excitationEnergyGNP, 154 G4double &excitationEnergyDTA, 155 G4HEVector incidentParticle, 156 G4HEVector targetParticle, 157 G4double atomicWeight, 158 G4double atomicNumber); 159 160 void QuasiElasticScattering(G4bool &successful, 161 G4HEVector pv[], 162 G4int &vecLen, 163 G4double &excitationEnergyGNP, 164 G4double &excitationEnergyDTA, 165 G4HEVector incidentParticle, 166 G4HEVector targetParticle, 167 G4double atomicWeight, 168 G4double atomicNumber); 169 170 void ElasticScattering(G4bool &successful, 171 G4HEVector pv[], 172 G4int &vecLen, 173 G4HEVector incidentParticle, 174 G4double atomicWeight, 175 G4double atomicNumber); 176 177 G4int rtmi(G4double *x, G4double xli, G4double xri, G4double eps, 178 G4int iend, G4double aa, G4double bb, G4double cc, 179 G4double dd, G4double rr); 180 181 G4double fctcos(G4double t, G4double aa, G4double bb,G4double cc, 182 G4double dd, G4double rr); 133 G4double atomicNumber); 134 135 void TuningOfHighEnergyCascading(G4HEVector pv[], 136 G4int& vecLen, 137 const G4HEVector& incidentParticle, 138 const G4HEVector& targetParticle, 139 G4double atomicWeight, 140 G4double atomicNumber); 141 142 void MediumEnergyCascading(G4bool& successful, 143 G4HEVector pv[], 144 G4int& vecLen, 145 G4double& excitationEnergyGNP, 146 G4double& excitationEnergyDTA, 147 const G4HEVector& incidentParticle, 148 const G4HEVector& targetParticle, 149 G4double atomicWeight, 150 G4double atomicNumber); 151 152 void MediumEnergyClusterProduction(G4bool& successful, 153 G4HEVector pv[], 154 G4int& vecLen, 155 G4double& excitationEnergyGNP, 156 G4double& excitationEnergyDTA, 157 const G4HEVector& incidentParticle, 158 const G4HEVector& targetParticle, 159 G4double atomicWeight, 160 G4double atomicNumber); 161 162 void QuasiElasticScattering(G4bool& successful, 163 G4HEVector pv[], 164 G4int& vecLen, 165 G4double& excitationEnergyGNP, 166 G4double& excitationEnergyDTA, 167 const G4HEVector& incidentParticle, 168 const G4HEVector& targetParticle, 169 G4double atomicWeight, 170 G4double atomicNumber); 171 172 void ElasticScattering(G4bool& successful, 173 G4HEVector pv[], 174 G4int& vecLen, 175 const G4HEVector& incidentParticle, 176 G4double atomicWeight, 177 G4double atomicNumber); 178 179 G4int rtmi(G4double *x, G4double xli, G4double xri, G4double eps, 180 G4int iend, G4double aa, G4double bb, G4double cc, 181 G4double dd, G4double rr); 182 183 G4double fctcos(G4double t, G4double aa, G4double bb,G4double cc, 184 G4double dd, G4double rr); 183 185 184 void 185 186 187 G4int &vecLen,188 G4HEVectorincidentParticle,189 G4HEVectortargetParticle);190 191 G4double 192 193 194 186 void StrangeParticlePairProduction(const G4double availableEnergy, 187 const G4double centerOfMassEnergy, 188 G4HEVector pv[], 189 G4int& vecLen, 190 const G4HEVector& incidentParticle, 191 const G4HEVector& targetParticle); 192 193 G4double NBodyPhaseSpace(const G4double totalEnergy, 194 const G4bool constantCrossSection, 195 G4HEVector pv[], 196 G4int &vecLen); 195 197 196 G4double 197 198 199 200 201 202 203 G4double 204 205 void 206 207 G4double 198 G4double NBodyPhaseSpace(G4int npart, 199 G4HEVector pv[], 200 G4double wmax, 201 G4double wfcn, 202 G4int maxtrial, 203 G4int ntrial); 204 205 G4double gpdk(G4double a, G4double b, G4double c); 206 207 void QuickSort(G4double arr[], const G4int lidx, const G4int ridx); 208 209 G4double Alam(G4double a, G4double b, G4double c); 208 210 209 G4double 211 G4double CalculatePhaseSpaceWeight( G4int npart); 210 212 211 G4double 212 G4double 213 G4double 214 G4int 215 void 213 G4double normal(void); 214 G4double GammaRand(G4double avalue); 215 G4double Erlang(G4int mvalue); 216 G4int Poisson(G4double x); 217 void SetParticles(void); 216 218 217 219 G4HEVector PionPlus; … … 248 250 }; 249 251 250 #endif 251 252 252 #endif -
trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonMinusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEKaonMinusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEKaonMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEKaonMinusInelastic() : G4HEInelastic("G4HEKaonMinusInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasKaonMinus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasKaonMinus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle);78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle); 79 81 }; 80 #endif 81 82 #endif 82 83 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonPlusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEKaonPlusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEKaonPlusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEKaonPlusInelastic() : G4HEInelastic("G4HEKaonPlusInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasKaonPlus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasKaonPlus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonZeroInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEKaonZeroInelastic.hh,v 1.1 3 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEKaonZeroInelastic.hh,v 1.15 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEKaonZeroInelastic() : G4HEInelastic("G4HEKaonZeroInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 75 75 void FirstIntInCasKaonZero(G4bool &inElastic, const G4double availableEnergy, 76 void FirstIntInCasKaonZero(G4bool& inElastic, 77 const G4double availableEnergy, 76 78 G4HEVector pv[], 77 G4int &vecLen,78 G4HEVectorincidentParticle,79 G4HEVectortargetParticle,79 G4int& vecLen, 80 const G4HEVector& incidentParticle, 81 const G4HEVector& targetParticle, 80 82 const G4double atomicWeight); 81 83 }; 82 #endif 83 84 #endif 84 85 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonZeroLongInelastic.hh
r1340 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HEKaonZeroLongInelastic.hh,v 1.1 5 2010/02/09 21:58:09dennis Exp $27 // GEANT4 tag $Name: geant4-09-0 3-ref-09$26 // $Id: G4HEKaonZeroLongInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 28 28 // 29 29 // … … 56 56 G4HEKaonZeroLongInelastic() : G4HEInelastic("G4HEKaonZeroLongInelastic") 57 57 { 58 theMinEnergy = 58 theMinEnergy = 20*GeV; 59 59 theMaxEnergy = 10*TeV; 60 60 MAXPART = 2048; … … 64 64 ~G4HEKaonZeroLongInelastic(){ }; 65 65 66 // G4int verboseLevel;67 66 G4int vecLength; 68 67 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 68 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 69 G4Nucleus& targetNucleus); 70 70 71 71 G4int GetNumberOfSecondaries() 72 72 { return vecLength;}; 73 73 74 void FirstIntInCasKaonZero(G4bool &inElastic, const G4double availableEnergy, 74 void FirstIntInCasKaonZero(G4bool& inElastic, 75 const G4double availableEnergy, 75 76 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,77 G4int& vecLen, 78 const G4HEVector& incidentParticle, 79 const G4HEVector& targetParticle, 79 80 const G4double atomicWeight); 80 81 81 void FirstIntInCasAntiKaonZero(G4bool &inElastic, const G4double availableEnergy, 82 void FirstIntInCasAntiKaonZero(G4bool& inElastic, 83 const G4double availableEnergy, 82 84 G4HEVector pv[], 83 G4int &vecLen, 84 G4HEVector incidentParticle, 85 G4HEVector targetParticle); 85 G4int& vecLen, 86 const G4HEVector& incidentParticle, 87 const G4HEVector& targetParticle); 88 }; 89 #endif 86 90 87 // void SetVerboseLevel(G4int verbose)88 // { verboseLevel = verbose;};89 90 91 };92 #endif93 94 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEKaonZeroShortInelastic.hh
r1340 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HEKaonZeroShortInelastic.hh,v 1.1 5 2010/02/09 21:58:33dennis Exp $27 // GEANT4 tag $Name: geant4-09-0 3-ref-09$26 // $Id: G4HEKaonZeroShortInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 28 28 // 29 29 // … … 56 56 G4HEKaonZeroShortInelastic() : G4HEInelastic("G4HEKaonZeroShortInelastic") 57 57 { 58 theMinEnergy = 58 theMinEnergy = 20*GeV; 59 59 theMaxEnergy = 10*TeV; 60 60 MAXPART = 2048; … … 66 66 G4int vecLength; 67 67 68 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 68 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 69 G4Nucleus& targetNucleus); 69 70 70 71 G4int GetNumberOfSecondaries() 71 72 { return vecLength;}; 72 73 73 void FirstIntInCasKaonZero(G4bool &inElastic, const G4double availableEnergy, 74 void FirstIntInCasKaonZero(G4bool& inElastic, 75 const G4double availableEnergy, 74 76 G4HEVector pv[], 75 G4int &vecLen,76 G4HEVectorincidentParticle,77 G4HEVectortargetParticle,77 G4int& vecLen, 78 const G4HEVector& incidentParticle, 79 const G4HEVector& targetParticle, 78 80 const G4double atomicWeight); 79 81 80 void FirstIntInCasAntiKaonZero(G4bool &inElastic, const G4double availableEnergy, 82 void FirstIntInCasAntiKaonZero(G4bool& inElastic, 83 const G4double availableEnergy, 81 84 G4HEVector pv[], 82 G4int &vecLen, 83 G4HEVector incidentParticle, 84 G4HEVector targetParticle); 85 G4int& vecLen, 86 const G4HEVector& incidentParticle, 87 const G4HEVector& targetParticle); 88 }; 89 #endif 85 90 86 };87 #endif88 89 -
trunk/source/processes/hadronic/models/high_energy/include/G4HELambdaInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HELambdaInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HELambdaInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HELambdaInelastic() : G4HEInelastic("G4HELambdaInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasLambda(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasLambda(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HENeutronInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HENeutronInelastic.hh,v 1.1 5 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HENeutronInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HENeutronInelastic() : G4HEInelastic("G4HENeutronInelastic") 58 58 { 59 theMinEnergy = 45*GeV; 59 vecLength = 0; 60 theMinEnergy = 45*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasNeutron(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasNeutron(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEOmegaMinusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEOmegaMinusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEOmegaMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEOmegaMinusInelastic() : G4HEInelastic("G4HEOmegaMinusInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasOmegaMinus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasOmegaMinus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEPionMinusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEPionMinusInelastic.hh,v 1.1 5 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEPionMinusInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEPionMinusInelastic() : G4HEInelastic("G4HEPionMinusInelastic") 58 58 { 59 theMinEnergy = 45*GeV; 59 vecLength = 0; 60 theMinEnergy = 45*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasPionMinus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasPionMinus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle);78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle); 79 81 }; 80 #endif 81 82 #endif 82 83 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEPionPlusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEPionPlusInelastic.hh,v 1.1 5 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEPionPlusInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEPionPlusInelastic() : G4HEInelastic("G4HEPionPlusInelastic") 58 58 { 59 theMinEnergy = 45*GeV; 59 vecLength = 0; 60 theMinEnergy = 45*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasPionPlus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasPionPlus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEProtonInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEProtonInelastic.hh,v 1.1 5 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEProtonInelastic.hh,v 1.17 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEProtonInelastic() : G4HEInelastic("G4HEProtonInelastic") 58 58 { 59 theMinEnergy = 45*GeV; 59 vecLength = 0; 60 theMinEnergy = 45*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasProton(G4bool &inElastic, const G4double availableEnergy, 75 G4HEVector pv[], 76 G4int &vecLen, 77 G4HEVector incidentParticle, 78 G4HEVector targetParticle, 79 const G4double atomicWeight); 75 void FirstIntInCasProton(G4bool& inElastic, 76 const G4double availableEnergy, 77 G4HEVector pv[], 78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HESigmaMinusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HESigmaMinusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HESigmaMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HESigmaMinusInelastic() : G4HEInelastic("G4HESigmaMinusInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasSigmaMinus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasSigmaMinus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HESigmaPlusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HESigmaPlusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HESigmaPlusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HESigmaPlusInelastic() : G4HEInelastic("G4HESigmaPlusInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasSigmaPlus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasSigmaPlus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HESigmaZeroInelastic.hh
r1340 r1347 26 26 // 27 27 // $Id: G4HESigmaZeroInelastic.hh,v 1.14 2007/04/11 18:11:30 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/processes/hadronic/models/high_energy/include/G4HEVector.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEVector.hh,v 1.1 2 2006/06/29 20:29:48 gunterExp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEVector.hh,v 1.15 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 91 91 baryon = 0; 92 92 strangeness = 0; 93 for (G4int i = 0; i < NumberOfQuarkFlavor; i++) { 94 theQuarkContent[i] = 0; 95 theAntiQuarkContent[i] = 0; 96 } 93 97 } 94 98 … … 150 154 const G4ParticleMomentum getMomentum() const ; 151 155 152 G4double getTotalMomentum() ;156 G4double getTotalMomentum() const; 153 157 154 158 void setMomentum( G4double x, G4double y, G4double z); … … 172 176 void setKineticEnergyAndUpdate(G4double ekin); 173 177 174 G4double getEnergy() ;175 176 G4double getKineticEnergy() ;178 G4double getEnergy() const; 179 180 G4double getKineticEnergy() const; 177 181 178 182 void setMass( G4double m ); … … 180 184 void setMassAndUpdate( G4double m ); 181 185 182 G4double getMass() ;186 G4double getMass() const; 183 187 184 188 void setCharge( G4double c ); 185 189 186 G4double getCharge() ;190 G4double getCharge() const; 187 191 188 192 void setTOF( G4double t ); … … 200 204 void setCode( G4int c ); 201 205 202 G4int getCode() ;203 204 G4String getName() ;205 206 G4int getBaryonNumber() ;207 208 G4int getStrangenessNumber() ;206 G4int getCode() const; 207 208 G4String getName() const; 209 210 G4int getBaryonNumber() const; 211 212 G4int getStrangenessNumber() const; 209 213 210 214 G4int getQuarkContent(G4int flavor); … … 214 218 void setZero(); 215 219 216 G4String getType() ;220 G4String getType() const; 217 221 218 222 void Add( const G4HEVector & p1, const G4HEVector & p2 ); … … 222 226 void Lor( const G4HEVector & p1, const G4HEVector & p2 ); 223 227 224 G4double CosAng( const G4HEVector & p );228 G4double CosAng(const G4HEVector& p) const; 225 229 226 230 G4double Ang(const G4HEVector & p ); … … 244 248 void Norz( const G4HEVector & p ); 245 249 246 G4double Length() ;250 G4double Length() const; 247 251 248 252 void Exch( G4HEVector & p1); … … 260 264 G4int FillQuarkContent(); 261 265 262 void Print( G4int L);266 void Print(G4int L) const; 263 267 }; 264 268 265 269 #endif 266 270 267 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEXiMinusInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEXiMinusInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEXiMinusInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEXiMinusInelastic() : G4HEInelastic("G4HEXiMinusInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasXiMinus(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasXiMinus(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/include/G4HEXiZeroInelastic.hh
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEXiZeroInelastic.hh,v 1.1 4 2007/04/11 18:11:30dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-ref-09$27 // $Id: G4HEXiZeroInelastic.hh,v 1.16 2010/11/29 05:45:06 dennis Exp $ 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // … … 57 57 G4HEXiZeroInelastic() : G4HEInelastic("G4HEXiZeroInelastic") 58 58 { 59 theMinEnergy = 20*GeV; 59 vecLength = 0; 60 theMinEnergy = 20*GeV; 60 61 theMaxEnergy = 10*TeV; 61 62 MAXPART = 2048; … … 67 68 G4int vecLength; 68 69 69 G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus); 70 G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack, 71 G4Nucleus& targetNucleus); 70 72 71 G4int GetNumberOfSecondaries() 72 { return vecLength; } 73 G4int GetNumberOfSecondaries() {return vecLength;} 73 74 74 void FirstIntInCasXiZero(G4bool &inElastic, const G4double availableEnergy, 75 void FirstIntInCasXiZero(G4bool& inElastic, 76 const G4double availableEnergy, 75 77 G4HEVector pv[], 76 G4int &vecLen,77 G4HEVectorincidentParticle,78 G4HEVectortargetParticle,78 G4int& vecLen, 79 const G4HEVector& incidentParticle, 80 const G4HEVector& targetParticle, 79 81 const G4double atomicWeight); 80 82 }; 81 #endif 82 83 #endif 83 84 -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiKaonZeroInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // This includes the high energy cascading model, the two-body-resonance model 38 // and the low energy two-body model. Not included arethe low energy stuff like35 // and the low energy two-body model. Not included is the low energy stuff like 39 36 // nuclear reactions, nuclear fission without any cascading and all processes for 40 37 // particles at rest. … … 45 42 #include "G4HEAntiKaonZeroInelastic.hh" 46 43 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 } 44 G4HadFinalState* 45 G4HEAntiKaonZeroInelastic::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 } 77 72 78 G4double inelasticity= NuclearInelasticity(incidentKineticEnergy,79 80 if(verboseLevel > 1)81 73 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 74 atomicWeight, atomicNumber); 75 if (verboseLevel > 1) 76 G4cout << "nuclear inelasticity = " << inelasticity << G4endl; 82 77 83 78 incidentKineticEnergy -= inelasticity; 84 79 85 86 87 88 G4double excitation= NuclearExcitation(incidentKineticEnergy,89 90 91 92 if(verboseLevel > 1)93 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 94 89 << excitationEnergyDTA << G4endl; 95 90 96 91 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; 128 111 129 if(verboseLevel > 1)130 112 if (verboseLevel > 1) 113 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 131 114 << incidentCode << G4endl; 132 115 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 190 168 191 169 void 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. 170 G4HEAntiKaonZeroInelastic::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. 202 181 // If reaction is possible, find the correct number of pions/protons/neutrons 203 182 // produced using an interpolation to multiplicity data. Replace some pions or 204 183 // protons/neutrons by kaons or strange baryons according to the average 205 184 // 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; 237 213 238 214 if( first ) 239 { 215 { // compute normalization constants, this will only be done once 240 216 first = false; 241 217 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiLambdaInelastic.cc
r1340 r1347 25 25 // 26 26 // 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 $ 30 29 // 31 30 … … 33 32 #include "G4ios.hh" 34 33 35 //36 34 // G4 Process: Gheisha High Energy Collision model. 37 35 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 39 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 40 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 43 #include "G4HEAntiLambdaInelastic.hh" 46 44 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 46 G4HadFinalState* 47 G4HEAntiLambdaInelastic::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; 82 79 83 80 incidentKineticEnergy -= inelasticity; 84 81 85 86 87 88 G4double excitation= NuclearExcitation(incidentKineticEnergy,89 90 91 92 if(verboseLevel > 1)93 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 94 91 << excitationEnergyDTA << G4endl; 95 92 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; 128 113 129 if(verboseLevel > 1)130 114 if (verboseLevel > 1) 115 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 131 116 << incidentCode << G4endl; 132 117 133 118 G4bool successful = false; 134 119 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 190 170 191 171 void 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. 172 G4HEAntiLambdaInelastic::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. 203 184 // If reaction is possible, find the correct number of pions/protons/neutrons 204 185 // produced using an interpolation to multiplicity data. Replace some pions or 205 186 // protons/neutrons by kaons or strange baryons according to the average 206 187 // 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; 238 215 239 216 if( first ) 240 { 217 { // compute normalization constants, this will only be done once 241 218 first = false; 242 219 for( i=0; i<numMul ; i++ ) protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiNeutronInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEAntiNeutronInelastic.hh" 46 43 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; 44 G4HadFinalState* 45 G4HEAntiNeutronInelastic::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; 82 77 83 78 incidentKineticEnergy -= inelasticity; 84 79 85 86 87 88 G4double excitation= NuclearExcitation(incidentKineticEnergy,89 90 91 92 if(verboseLevel > 1)93 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 94 89 << excitationEnergyDTA << G4endl; 95 90 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; 128 111 129 if(verboseLevel > 1)130 112 if (verboseLevel > 1) 113 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 131 114 << incidentCode << G4endl; 132 115 133 116 G4bool successful = false; 134 117 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 190 168 191 169 void 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. 170 G4HEAntiNeutronInelastic::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. 203 182 // If reaction is possible, find the correct number of pions/protons/neutrons 204 183 // produced using an interpolation to multiplicity data. Replace some pions or 205 184 // protons/neutrons by kaons or strange baryons according to the average 206 185 // 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; 238 214 239 215 if( first ) 240 { 216 { // compute normalization constants, this will only be done once 241 217 first = false; 242 218 for( i=0; i<numMul ; i++ ) protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiOmegaMinusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEAntiOmegaMinusInelastic.hh" 46 43 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 { 44 G4HadFinalState* 45 G4HEAntiOmegaMinusInelastic::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) { 69 64 G4cout << "G4HEAntiOmegaMinusInelastic::ApplyYourself" << G4endl; 70 65 G4cout << "incident particle " << incidentParticle.getName() … … 74 69 G4cout << "target material with (A,Z) = (" 75 70 << atomicWeight << "," << atomicNumber << ")" << G4endl; 76 71 } 77 72 78 G4double inelasticity= NuclearInelasticity(incidentKineticEnergy,79 80 if(verboseLevel > 1)81 73 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 74 atomicWeight, atomicNumber); 75 if (verboseLevel > 1) 76 G4cout << "nuclear inelasticity = " << inelasticity << G4endl; 82 77 83 78 incidentKineticEnergy -= inelasticity; 84 79 85 86 87 88 G4double excitation= NuclearExcitation(incidentKineticEnergy,89 90 91 92 if(verboseLevel > 1)93 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 94 89 << excitationEnergyDTA << G4endl; 95 90 96 91 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; 128 112 129 if(verboseLevel > 1)130 113 if (verboseLevel > 1) 114 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 131 115 << incidentCode << G4endl; 132 116 133 117 G4bool successful = false; 134 118 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 190 169 191 170 void 192 G4HEAntiOmegaMinusInelastic::FirstIntInCasAntiOmegaMinus( G4bool &inElastic,193 194 195 G4int &vecLen,196 G4HEVectorincidentParticle,197 G4HEVectortargetParticle,198 const G4double atomicWeight)171 G4HEAntiOmegaMinusInelastic::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) 199 178 200 179 // AntiOmega undergoes interaction with nucleon within a nucleus. 201 180 // As in Geant3, we think that this routine has absolutely no influence 202 181 // 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 232 207 233 208 G4int i, counter, nt, np, nm, nz; 234 209 235 210 if( first ) 236 { 211 { // compute normalization constants, this will only be done once 237 212 first = false; 238 213 for( i=0; i<numMul ; i++ ) protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiProtonInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEAntiProtonInelastic.hh" 46 43 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 54 const G4double atomicNumber= targetNucleus.GetZ();55 56 57 G4int incidentCode= incidentParticle.getCode();58 G4double incidentMass= incidentParticle.getMass();59 G4double incidentTotalEnergy= incidentParticle.getEnergy();60 61 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 " << incidentMass72 << "kinetic energy " << incidentKineticEnergy73 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;44 G4HadFinalState* 45 G4HEAntiProtonInelastic::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; 82 79 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; 85 118 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 190 169 191 170 void 192 G4HEAntiProtonInelastic::FirstIntInCasAntiProton( G4bool &inElastic,193 194 195 G4int &vecLen,196 G4HEVectorincidentParticle,197 G4HEVectortargetParticle,198 171 G4HEAntiProtonInelastic::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) 199 178 200 179 // AntiProton undergoes interaction with nucleon within a nucleus. Check if it is … … 205 184 // protons/neutrons by kaons or strange baryons according to the average 206 185 // 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; 238 214 239 215 if( first ) 240 { 216 { // compute normalization constants, this will only be done once 241 217 first = false; 242 218 for( i=0; i<numMul ; i++ ) protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiSigmaMinusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEAntiSigmaMinusInelastic.hh" 46 43 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 } 44 G4HadFinalState* 45 G4HEAntiSigmaMinusInelastic::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 } 77 72 78 G4double inelasticity= NuclearInelasticity(incidentKineticEnergy,79 80 if(verboseLevel > 1)81 73 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 74 atomicWeight, atomicNumber); 75 if (verboseLevel > 1) 76 G4cout << "nuclear inelasticity = " << inelasticity << G4endl; 82 77 83 78 incidentKineticEnergy -= inelasticity; 84 79 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; 127 111 128 if(verboseLevel > 1)129 112 if (verboseLevel > 1) 113 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 130 114 << incidentCode << G4endl; 131 115 132 116 G4bool successful = false; 133 117 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 189 167 190 168 void 191 G4HEAntiSigmaMinusInelastic::FirstIntInCasAntiSigmaMinus( G4bool &inElastic,192 193 194 G4int &vecLen,195 G4HEVectorincidentParticle,196 G4HEVectortargetParticle,197 169 G4HEAntiSigmaMinusInelastic::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) 198 176 199 177 // AntiSigma- undergoes interaction with nucleon within a nucleus. Check if it is … … 204 182 // protons/neutrons by kaons or strange baryons according to the average 205 183 // 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; 237 212 238 213 if( first ) 239 { 214 { // compute normalization constants, this will only be done once 240 215 first = false; 241 216 for( i=0; i<numMul ; i++ ) protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiSigmaPlusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEAntiSigmaPlusInelastic.hh" 46 43 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; 44 G4HadFinalState* 45 G4HEAntiSigmaPlusInelastic::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; 84 79 85 86 87 88 G4double excitation= NuclearExcitation(incidentKineticEnergy,89 90 91 92 if(verboseLevel > 1)93 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 94 89 << excitationEnergyDTA << G4endl; 95 90 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; 128 111 129 if(verboseLevel > 1)130 112 if (verboseLevel > 1) 113 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 131 114 << incidentCode << G4endl; 132 115 133 116 G4bool successful = false; 134 117 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 190 169 191 170 void 192 G4HEAntiSigmaPlusInelastic::FirstIntInCasAntiSigmaPlus( G4bool &inElastic,193 194 195 G4int &vecLen,196 G4HEVectorincidentParticle,197 G4HEVectortargetParticle,198 171 G4HEAntiSigmaPlusInelastic::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) 199 178 200 179 // AntiSigma+ undergoes interaction with nucleon within a nucleus. Check if it is … … 205 184 // protons/neutrons by kaons or strange baryons according to the average 206 185 // 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; 238 213 239 214 if( first ) 240 { 215 { // compute normalization constants, this will only be done once 241 216 first = false; 242 217 for( i=0; i<numMul ; i++ ) protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiSigmaZeroInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 46 43 #include "G4Gamma.hh" 47 44 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); 45 G4HadFinalState* 46 G4HEAntiSigmaZeroInelastic::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); 57 55 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 } 80 77 81 82 83 84 85 86 87 -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiXiMinusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEAntiXiMinusInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEAntiXiMinusInelastic::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); 56 53 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; 85 80 86 81 incidentKineticEnergy -= inelasticity; 87 82 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; 131 114 132 if(verboseLevel > 1)133 115 if (verboseLevel > 1) 116 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 134 117 << incidentCode << G4endl; 135 118 136 119 G4bool successful = false; 137 120 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 193 171 194 172 void 195 G4HEAntiXiMinusInelastic::FirstIntInCasAntiXiMinus( G4bool &inElastic,196 197 198 G4int &vecLen,199 G4HEVectorincidentParticle,200 G4HEVectortargetParticle,201 173 G4HEAntiXiMinusInelastic::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) 202 180 203 181 // AntiXi- undergoes interaction with nucleon within a nucleus. 204 182 // As in Geant3, we think that this routine has absolutely no influence 205 183 // 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; 237 211 238 212 if( first ) 239 { 213 { // compute normalization constants, this will only be done once 240 214 first = false; 241 215 for( i=0; i<numMul ; i++ ) protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEAntiXiZeroInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEAntiXiZeroInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEAntiXiZeroInelastic::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); 56 53 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 } 80 75 81 G4double inelasticity= NuclearInelasticity(incidentKineticEnergy,82 83 if(verboseLevel > 1)84 76 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 77 atomicWeight, atomicNumber); 78 if (verboseLevel > 1) 79 G4cout << "nuclear inelasticity = " << inelasticity << G4endl; 85 80 86 81 incidentKineticEnergy -= inelasticity; 87 82 88 89 90 91 G4double excitation= NuclearExcitation(incidentKineticEnergy,92 93 94 95 if(verboseLevel > 1)96 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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; 131 114 132 if(verboseLevel > 1)133 115 if (verboseLevel > 1) 116 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 134 117 << incidentCode << G4endl; 135 118 136 119 G4bool successful = false; 137 120 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 194 171 195 172 void 196 G4HEAntiXiZeroInelastic::FirstIntInCasAntiXiZero( G4bool &inElastic,197 198 199 G4int &vecLen,200 G4HEVectorincidentParticle,201 G4HEVectortargetParticle,202 173 G4HEAntiXiZeroInelastic::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) 203 180 204 181 // AntiXi0 undergoes interaction with nucleon within a nucleus. … … 206 183 // on the whole performance of the program. Take AntiLambda instaed. 207 184 // ( 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; 238 212 239 213 if( first ) 240 { 214 { // compute normalization constants, this will only be done once 241 215 first = false; 242 216 for( i=0; i<numMul ; i++ ) protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEInelastic.cc
r962 r1347 25 25 // 26 26 // 27 //28 27 29 28 #include "globals.hh" … … 55 54 #include "G4Alpha.hh" 56 55 57 void 56 void G4HEInelastic::FillParticleChange(G4HEVector pv[], G4int aVecLength) 58 57 { 59 58 theParticleChange.Clear(); … … 77 76 aParticle->SetMomentum(pv[i].getMomentum()*GeV); 78 77 theParticleChange.AddSecondary(aParticle); 79 G4ParticleDefinition * dummy = G4KaonZero::KaonZero();80 dummy = G4AntiKaonZero::AntiKaonZero();81 78 } 82 79 } 83 80 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 } 81 void 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 } 120 116 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 }117 G4double G4HEInelastic::Amin(G4double a, G4double b) 118 { 119 G4double c = a; 120 if(b < a) c = b; 121 return c; 122 } 123 124 G4double G4HEInelastic::Amax(G4double a, G4double b) 125 { 126 G4double c = a; 127 if(b > a) c = b; 128 return c; 129 } 130 135 131 G4int 136 132 G4HEInelastic::Imin(G4int a, G4int b) … … 338 334 G4HEVector pv[], 339 335 G4int &vecLen, 340 G4HEVectorincidentParticle,341 G4HEVector targetParticle)336 const G4HEVector& incidentParticle, 337 const G4HEVector& targetParticle) 342 338 343 339 // Choose charge combinations K+ K-, K+ K0, K0 K0, K0 K-, … … 602 598 603 599 void 604 G4HEInelastic::HighEnergyCascading(G4bool &successful,600 G4HEInelastic::HighEnergyCascading(G4bool& successful, 605 601 G4HEVector pv[], 606 G4int &vecLen,607 G4double &excitationEnergyGNP,608 G4double &excitationEnergyDTA,609 G4HEVectorincidentParticle,610 G4HEVectortargetParticle,602 G4int& vecLen, 603 G4double& excitationEnergyGNP, 604 G4double& excitationEnergyDTA, 605 const G4HEVector& incidentParticle, 606 const G4HEVector& targetParticle, 611 607 G4double atomicWeight, 612 608 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(); 654 648 // G4double incidentTOF = incidentParticle.getTOF(); 655 G4double incidentTOF= 0.;656 657 658 659 660 661 if (verboseLevel > 1)662 G4cout << " G4HEInelastic::HighEnergyCascading "<< G4endl;663 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; 665 659 666 660 // define annihilation channels. 667 661 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 } 708 699 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) 720 710 721 711 if( (incidentCode==kaonPlusCode || incidentCode==kaonMinusCode || … … 760 750 } 761 751 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) 775 764 +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 815 803 816 804 G4double s, xtarg, ran; … … 928 916 } 929 917 930 931 932 933 934 if(vecLen <= 1) return;935 936 937 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; 938 926 939 927 for (i = 0; i < vecLen; i++) 940 928 { 941 929 if (pv[i].getSide() > 0) … … 945 933 } 946 934 } 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; 978 958 979 959 for (i = 0; i < vecLen; i++) … … 1014 994 } 1015 995 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 1068 1049 if( i == 1) 1069 1050 { … … 1277 1258 } // closes outer iteration 1278 1259 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}; 1312 1294 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 } 1347 1324 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 1354 1332 1355 1333 targ = 0; … … 1398 1376 } 1399 1377 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 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(); 1410 1388 1411 1389 pvmx[5].Add( pvmx[3], pvmx[4] ); … … 1471 1449 } 1472 1450 1473 1451 // Do some smearing in the transverse direction due to Fermi motion 1474 1452 1475 1453 G4double ry = G4UniformRand(); … … 1491 1469 } 1492 1470 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; 1548 1506 } 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 );1561 1507 } 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 1574 1551 1575 1552 if (verboseLevel > 1) … … 1781 1758 } 1782 1759 1783 1784 1760 return; 1761 } 1785 1762 1786 1763 void 1787 1764 G4HEInelastic::TuningOfHighEnergyCascading(G4HEVector pv[], 1788 G4int &vecLen,1789 G4HEVectorincidentParticle,1790 G4HEVectortargetParticle,1765 G4int& vecLen, 1766 const G4HEVector& incidentParticle, 1767 const G4HEVector& targetParticle, 1791 1768 G4double atomicWeight, 1792 1769 G4double atomicNumber) … … 2127 2104 2128 2105 void 2129 G4HEInelastic::HighEnergyClusterProduction(G4bool &successful,2106 G4HEInelastic::HighEnergyClusterProduction(G4bool& successful, 2130 2107 G4HEVector pv[], 2131 G4int &vecLen,2132 G4double &excitationEnergyGNP,2133 G4double &excitationEnergyDTA,2134 G4HEVectorincidentParticle,2135 G4HEVectortargetParticle,2108 G4int& vecLen, 2109 G4double& excitationEnergyGNP, 2110 G4double& excitationEnergyDTA, 2111 const G4HEVector& incidentParticle, 2112 const G4HEVector& targetParticle, 2136 2113 G4double atomicWeight, 2137 2114 G4double atomicNumber) 2138 2115 { 2139 2116 // For low multiplicity in the first intranuclear interaction the cascading process 2140 2117 // as described in G4HEInelastic::MediumEnergyCascading does not work … … 2144 2121 // All quantities on the G4HEVector Array pv are in GeV- units. 2145 2122 2146 2147 2148 2149 2150 2151 2152 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(); 2156 2133 2157 G4double targetMass= targetParticle.getMass();2134 G4double targetMass = targetParticle.getMass(); 2158 2135 2159 2136 G4int incidentCode = incidentParticle.getCode(); … … 2166 2143 G4double incidentTOF = 0.; 2167 2144 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.) 2249 2219 * (std::pow(atomicWeight,0.33)-1.) * tb); 2250 2220 G4int momentumBin = 0; 2251 2221 while( (momentumBin < 6) && (incidentTotalMomentum > psup[momentumBin])) momentumBin++; 2252 2222 momentumBin = Imin(5, momentumBin); … … 2729 2699 } 2730 2700 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; 2803 2751 } 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 2806 2773 if( (ek1 > 0.0) && (npions > 0) ) 2807 2774 { … … 3003 2970 } 3004 2971 3005 3006 3007 3008 3009 2972 successful = true; 2973 delete [] pvmx; 2974 delete [] tempV; 2975 return; 2976 } 3010 2977 3011 2978 void 3012 G4HEInelastic::MediumEnergyCascading(G4bool &successful,2979 G4HEInelastic::MediumEnergyCascading(G4bool& successful, 3013 2980 G4HEVector pv[], 3014 G4int &vecLen,3015 G4double &excitationEnergyGNP,3016 G4double &excitationEnergyDTA,3017 G4HEVectorincidentParticle,3018 G4HEVectortargetParticle,2981 G4int& vecLen, 2982 G4double& excitationEnergyGNP, 2983 G4double& excitationEnergyDTA, 2984 const G4HEVector& incidentParticle, 2985 const G4HEVector& targetParticle, 3019 2986 G4double atomicWeight, 3020 2987 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) 3066 3032 G4cout << " G4HEInelastic::MediumEnergyCascading " << G4endl; 3067 3033 3068 3034 // define annihilation channels. 3069 3035 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 }; 3081 3046 3082 3047 if(annihilation) goto start; … … 3593 3558 } 3594 3559 vecLen--; 3595 if(vecLen < 2) return; 3560 if (vecLen < 2) { 3561 delete [] pvmx; 3562 return; 3563 } 3596 3564 i++; 3597 3565 pvmx[6].Add( pvmx[4], pvmx[5] ); … … 3829 3797 } 3830 3798 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; 3882 3829 } 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 3885 3851 if( (ek1 > 0.0) && (npions > 0) ) 3886 3852 { … … 4087 4053 4088 4054 void 4089 G4HEInelastic::MediumEnergyClusterProduction(G4bool &successful,4055 G4HEInelastic::MediumEnergyClusterProduction(G4bool& successful, 4090 4056 G4HEVector pv[], 4091 G4int &vecLen,4092 G4double &excitationEnergyGNP,4093 G4double &excitationEnergyDTA,4094 G4HEVectorincidentParticle,4095 G4HEVectortargetParticle,4057 G4int& vecLen, 4058 G4double& excitationEnergyGNP, 4059 G4double& excitationEnergyDTA, 4060 const G4HEVector& incidentParticle, 4061 const G4HEVector& targetParticle, 4096 4062 G4double atomicWeight, 4097 4063 G4double atomicNumber) 4098 { 4064 { 4099 4065 // For low multiplicity in the first intranuclear interaction the cascading 4100 4066 // process as described in G4HEInelastic::MediumEnergyCascading does not work … … 4104 4070 // All quantities on the G4HEVector Array pv are in GeV- units. 4105 4071 4106 4107 4108 4109 4110 4111 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 4122 G4double incidentEnergy= incidentParticle.getEnergy();4123 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(); 4125 4091 // G4double incidentTOF = incidentParticle.getTOF(); 4126 G4double incidentTOF= 0.;4127 4128 4129 4130 4131 4132 if(verboseLevel > 1) G4cout << " G4HEInelastic::MediumEnergyClusterProduction " << G4endl;4133 4134 if (incidentTotalMomentum < 0.01) 4135 4136 4137 4138 4139 4140 +2.*targetMass*incidentEnergy);4141 4142 4143 4144 4145 4146 4147 4148 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.); 4149 4115 4150 4151 4152 4116 // Distribute particles in forward and backward hemispheres. Note that 4117 // only low multiplicity events from FirstIntInNuc.... should go into 4118 // this routine. 4153 4119 4154 G4int targ= 0;4155 G4int ifor= 0;4156 4157 4158 4120 G4int targ = 0; 4121 G4int ifor = 0; 4122 G4int iback = 0; 4123 G4int pvCode; 4124 G4double pvMass, pvEnergy; 4159 4125 4160 4126 pv[0].setSide( 1 ); … … 4207 4173 G4double nucsup[] = { 1.0, 0.8, 0.6, 0.5, 0.4}; 4208 4174 4209 G4double xtarg = Amax(0.01, 4175 G4double xtarg = Amax(0.01, (0.312+0.2*std::log(std::log(centerOfMassEnergy*centerOfMassEnergy))) 4210 4176 * (std::pow(atomicWeight,0.33)-1.) * tb); 4211 4177 G4int ntarg = Poisson(xtarg); … … 4558 4524 } 4559 4525 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; 4576 4541 4577 if( ((leadParticle.getType() == baryonType ||4578 4579 4580 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 else4592 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 } 4596 4561 4597 4562 pvmx[4].setMass( incidentMass); … … 4682 4647 } 4683 4648 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; 4736 4680 } 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 4739 4702 if( (ek1 > 0.0) && (npions > 0) ) 4740 4703 { … … 4941 4904 4942 4905 void 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(); 4906 G4HEInelastic::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(); 4970 4932 // 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; 5076 5035 5077 5036 if( atomicWeight > 1.5 ) … … 5230 5189 } 5231 5190 5232 5233 5234 5235 5191 successful = true; 5192 delete [] pvmx; 5193 return; 5194 } 5236 5195 5237 5196 void 5238 G4HEInelastic::ElasticScattering(G4bool &successful,5197 G4HEInelastic::ElasticScattering(G4bool& successful, 5239 5198 G4HEVector pv[], 5240 G4int &vecLen,5241 G4HEVectorincidentParticle,5199 G4int& vecLen, 5200 const G4HEVector& incidentParticle, 5242 5201 G4double atomicWeight, 5243 5202 G4double /* atomicNumber*/) 5244 5245 if(verboseLevel > 1)5246 5247 5248 5249 5250 5251 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 5257 5216 if (atomicWeight < 0.5) 5258 5217 { -
trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonMinusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // This includes the high energy cascading model, the two-body-resonance model 38 // and the low energy two-body model. Not included arethe low energy stuff35 // and the low energy two-body model. Not included is the low energy stuff 39 36 // like nuclear reactions, nuclear fission without any cascading and all 40 37 // processes for particles at rest. … … 45 42 #include "G4HEKaonMinusInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEKaonMinusInelastic::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); 56 53 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; 87 82 88 89 90 91 G4double excitation= NuclearExcitation(incidentKineticEnergy,92 93 94 95 if(verboseLevel > 1)96 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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 " 135 118 << incidentCode << G4endl; 136 119 137 120 G4bool successful = false; 138 121 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 194 172 195 173 void 196 G4HEKaonMinusInelastic::FirstIntInCasKaonMinus( G4bool &inElastic,197 198 199 G4int &vecLen,200 G4HEVectorincidentParticle,201 G4HEVectortargetParticle)174 G4HEKaonMinusInelastic::FirstIntInCasKaonMinus(G4bool& inElastic, 175 const G4double availableEnergy, 176 G4HEVector pv[], 177 G4int& vecLen, 178 const G4HEVector& incidentParticle, 179 const G4HEVector& targetParticle) 202 180 203 181 // Kaon- undergoes interaction with nucleon within a nucleus. Check if it is … … 208 186 // protons/neutrons by kaons or strange baryons according to the average 209 187 // 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; 241 216 242 217 if( first ) 243 { 218 { // compute normalization constants, this will only be done once 244 219 first = false; 245 220 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonPlusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEKaonPlusInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEKaonPlusInelastic::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); 56 53 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; 85 80 86 81 incidentKineticEnergy -= inelasticity; 87 82 88 89 90 91 G4double excitation= NuclearExcitation(incidentKineticEnergy,92 93 94 95 if(verboseLevel > 1)96 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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; 132 115 133 if(verboseLevel > 1)134 116 if (verboseLevel > 1) 117 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 135 118 << incidentCode << G4endl; 136 119 137 120 G4bool successful = false; 138 121 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 195 173 196 174 void 197 G4HEKaonPlusInelastic::FirstIntInCasKaonPlus( G4bool &inElastic,198 199 200 G4int &vecLen,201 G4HEVectorincidentParticle,202 G4HEVectortargetParticle,203 175 G4HEKaonPlusInelastic::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) 204 182 205 183 // Kaon+ undergoes interaction with nucleon within a nucleus. Check if it is … … 210 188 // protons/neutrons by kaons or strange baryons according to the average 211 189 // 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; 240 215 241 216 if( first ) 242 { 217 { // compute normalization constants, this will only be done once 243 218 first = false; 244 219 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEKaonZeroInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEKaonZeroInelastic::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); 56 53 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 } 80 75 81 G4double inelasticity= NuclearInelasticity(incidentKineticEnergy,82 83 if(verboseLevel > 1)84 76 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 77 atomicWeight, atomicNumber); 78 if (verboseLevel > 1) 79 G4cout << "nuclear inelasticity = " << inelasticity << G4endl; 85 80 86 81 incidentKineticEnergy -= inelasticity; 87 82 88 89 90 91 G4double excitation= NuclearExcitation(incidentKineticEnergy,92 93 94 95 if(verboseLevel > 1)96 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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 " 134 117 << incidentCode << G4endl; 135 118 136 119 G4bool successful = false; 137 120 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 194 173 195 174 void 196 G4HEKaonZeroInelastic::FirstIntInCasKaonZero( G4bool &inElastic,197 198 199 G4int &vecLen,200 G4HEVectorincidentParticle,201 G4HEVectortargetParticle,202 175 G4HEKaonZeroInelastic::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) 203 182 204 183 // Kaon0 undergoes interaction with nucleon within a nucleus. Check if it is … … 209 188 // protons/neutrons by kaons or strange baryons according to the average 210 189 // 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; 239 215 240 216 if( first ) 241 { 217 { // compute normalization constants, this will only be done once 242 218 first = false; 243 219 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroLongInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 29 28 // 30 29 … … 32 31 #include "G4ios.hh" 33 32 34 //35 33 // G4 Process: Gheisha High Energy Collision model. 36 34 // 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 like38 // nuclear reactions, nuclear fission without any cascading and all processes for39 // p articles 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. 40 38 // 41 39 // New version by D.H. Wright (SLAC) to fix seg fault in old version … … 45 43 #include "G4HEKaonZeroLongInelastic.hh" 46 44 47 G4HadFinalState* G4HEKaonZeroLongInelastic:: 48 ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus) 45 G4HadFinalState* 46 G4HEKaonZeroLongInelastic::ApplyYourself(const G4HadProjectile& aTrack, 47 G4Nucleus& targetNucleus) 49 48 { 50 G4HEVector 51 const G4HadProjectile *aParticle = &aTrack;49 G4HEVector* pv = new G4HEVector[MAXPART]; 50 const G4HadProjectile* aParticle = &aTrack; 52 51 const G4double atomicWeight = targetNucleus.GetN(); 53 52 const G4double atomicNumber = targetNucleus.GetZ(); 54 53 G4HEVector incidentParticle(aParticle); 55 54 56 G4int incidentCode= incidentParticle.getCode();57 G4double incidentMass 58 G4double incidentTotalEnergy 55 G4int incidentCode = incidentParticle.getCode(); 56 G4double incidentMass = incidentParticle.getMass(); 57 G4double incidentTotalEnergy = incidentParticle.getEnergy(); 59 58 G4double incidentTotalMomentum = incidentParticle.getTotalMomentum(); 60 59 G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass; … … 93 92 incidentKineticEnergy -= excitation; 94 93 incidentTotalEnergy = incidentKineticEnergy + incidentMass; 95 incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass) 96 *(incidentTotalEnergy+incidentMass)); 97 94 incidentTotalMomentum = std::sqrt( (incidentTotalEnergy-incidentMass) 95 *(incidentTotalEnergy+incidentMass)); 98 96 99 97 G4HEVector targetParticle; 100 if (G4UniformRand() < atomicNumber/atomicWeight) {98 if (G4UniformRand() < atomicNumber/atomicWeight) { 101 99 targetParticle.setDefinition("Proton"); 102 100 } else { … … 105 103 106 104 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); 109 108 G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass; 110 // this was the meaning of inElastic in the111 // original Gheisha stand-alone version.112 // G4bool inElastic = InElasticCrossSectionInFirstInt113 // (availableEnergy, incidentCode, incidentTotalMomentum);114 // for unknown reasons, it has been replaced by the following code in Geant???115 109 116 110 G4bool inElastic = true; 117 // if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;118 119 111 vecLength = 0; 120 112 … … 125 117 G4bool successful = false; 126 118 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, 149 151 incidentParticle, targetParticle, 150 152 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); 168 158 169 159 if (!successful) … … 193 183 delete [] pv; 194 184 theParticleChange.SetStatusChange(stopAndKill); 195 return & 185 return &theParticleChange; 196 186 } 197 187 198 188 199 189 void 200 G4HEKaonZeroLongInelastic::FirstIntInCasKaonZero(G4bool &inElastic,190 G4HEKaonZeroLongInelastic::FirstIntInCasKaonZero(G4bool& inElastic, 201 191 const G4double availableEnergy, 202 192 G4HEVector pv[], 203 G4int &vecLen,204 G4HEVectorincidentParticle,205 G4HEVectortargetParticle,193 G4int& vecLen, 194 const G4HEVector& incidentParticle, 195 const G4HEVector& targetParticle, 206 196 const G4double atomicWeight) 207 197 … … 213 203 // protons/neutrons by kaons or strange baryons according to the average 214 204 // multiplicity per inelastic reaction. 215 216 205 { 217 static const G4double expxu = 218 static const G4double expxl = -expxu; // lower bound for arg. of exp206 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 219 208 220 209 static const G4double protb = 0.7; … … 521 510 522 511 void 523 G4HEKaonZeroLongInelastic::FirstIntInCasAntiKaonZero(G4bool &inElastic,512 G4HEKaonZeroLongInelastic::FirstIntInCasAntiKaonZero(G4bool& inElastic, 524 513 const G4double availableEnergy, 525 514 G4HEVector pv[], 526 G4int &vecLen,527 G4HEVectorincidentParticle,528 G4HEVector targetParticle)515 G4int& vecLen, 516 const G4HEVector& incidentParticle, 517 const G4HEVector& targetParticle) 529 518 530 519 // AntiKaon0 undergoes interaction with nucleon within a nucleus. Check if it is … … 560 549 static G4double neutmul[numMul], neutnorm[numSec]; // neutron constants 561 550 562 // misc. local variables563 // np = number of pi+, nm = number of pi-, nz = number of pi0551 // misc. local variables 552 // np = number of pi+, nm = number of pi-, nz = number of pi0 564 553 565 554 G4int i, counter, nt, np, nm, nz; 566 555 567 if (first) {556 if (first) { 568 557 // compute normalization constants, this will only be done once 569 558 first = false; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEKaonZeroShortInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 29 28 // 30 29 … … 32 31 #include "G4ios.hh" 33 32 34 //35 33 // G4 Process: Gheisha High Energy Collision model. 36 34 // 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 like38 // nuclear reactions, nuclear fission without any cascading and all processes for39 // p articles 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. 40 38 // 41 39 // New version by D.H. Wright (SLAC) to fix seg fault in old version … … 45 43 #include "G4HEKaonZeroShortInelastic.hh" 46 44 47 G4HadFinalState* G4HEKaonZeroShortInelastic:: 48 ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus) 45 G4HadFinalState* 46 G4HEKaonZeroShortInelastic::ApplyYourself(const G4HadProjectile& aTrack, 47 G4Nucleus& targetNucleus) 49 48 { 50 G4HEVector 51 const G4HadProjectile *aParticle = &aTrack;49 G4HEVector* pv = new G4HEVector[MAXPART]; 50 const G4HadProjectile* aParticle = &aTrack; 52 51 const G4double atomicWeight = targetNucleus.GetN(); 53 52 const G4double atomicNumber = targetNucleus.GetZ(); 54 53 G4HEVector incidentParticle(aParticle); 55 54 56 G4int incidentCode= incidentParticle.getCode();57 G4double incidentMass 58 G4double incidentTotalEnergy 55 G4int incidentCode = incidentParticle.getCode(); 56 G4double incidentMass = incidentParticle.getMass(); 57 G4double incidentTotalEnergy = incidentParticle.getEnergy(); 59 58 G4double incidentTotalMomentum = incidentParticle.getTotalMomentum(); 60 59 G4double incidentKineticEnergy = incidentTotalEnergy - incidentMass; … … 92 91 93 92 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)); 98 96 99 97 G4HEVector targetParticle; … … 105 103 106 104 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); 109 108 G4double availableEnergy = centerOfMassEnergy - targetMass - incidentMass; 110 // this was the meaning of inElastic in the111 // original Gheisha stand-alone version.112 // G4bool inElastic = InElasticCrossSectionInFirstInt113 // (availableEnergy, incidentCode, incidentTotalMomentum);114 // for unknown reasons, it has been replaced by the following code in Geant???115 109 116 110 G4bool inElastic = true; 117 // if (G4UniformRand() < elasticCrossSection/totalCrossSection) inElastic = false;118 119 111 vecLength = 0; 120 112 … … 125 117 G4bool successful = false; 126 118 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, 149 151 incidentParticle, targetParticle, 150 152 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); 168 158 169 159 if (!successful) … … 193 183 delete [] pv; 194 184 theParticleChange.SetStatusChange(stopAndKill); 195 return & 185 return &theParticleChange; 196 186 } 197 187 198 188 199 189 void 200 G4HEKaonZeroShortInelastic::FirstIntInCasKaonZero(G4bool &inElastic,201 const G4double availableEnergy,202 G4HEVector pv[],203 G4int &vecLen,204 G4HEVectorincidentParticle,205 G4HEVectortargetParticle,206 const G4double atomicWeight)190 G4HEKaonZeroShortInelastic::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) 207 197 208 198 // Kaon0 undergoes interaction with nucleon within a nucleus. Check if it is … … 213 203 // protons/neutrons by kaons or strange baryons according to the average 214 204 // multiplicity per inelastic reaction. 215 216 205 { 217 static const G4double expxu = 218 static const G4double expxl = -expxu; // lower bound for arg. of exp206 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 219 208 220 209 static const G4double protb = 0.7; … … 521 510 522 511 void 523 G4HEKaonZeroShortInelastic::FirstIntInCasAntiKaonZero(G4bool &inElastic,524 const G4double availableEnergy,525 G4HEVector pv[],526 G4int &vecLen,527 G4HEVectorincidentParticle,528 G4HEVector targetParticle)512 G4HEKaonZeroShortInelastic::FirstIntInCasAntiKaonZero(G4bool& inElastic, 513 const G4double availableEnergy, 514 G4HEVector pv[], 515 G4int& vecLen, 516 const G4HEVector& incidentParticle, 517 const G4HEVector& targetParticle) 529 518 530 519 // AntiKaon0 undergoes interaction with nucleon within a nucleus. Check if it is … … 535 524 // protons/neutrons by kaons or strange baryons according to the average 536 525 // multiplicity per inelastic reaction. 537 538 526 { 539 static const G4double expxu = 540 static const G4double expxl = -expxu; // lower bound for arg. of exp527 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 541 529 542 530 static const G4double protb = 0.7; … … 544 532 static const G4double c = 1.25; 545 533 546 static const G4int 547 static const G4int 534 static const G4int numMul = 1200; 535 static const G4int numSec = 60; 548 536 549 537 G4int neutronCode = Neutron.getCode(); … … 560 548 static G4double neutmul[numMul], neutnorm[numSec]; // neutron constants 561 549 562 //misc. local variables563 //np = number of pi+, nm = number of pi-, nz = number of pi0550 // misc. local variables 551 // np = number of pi+, nm = number of pi-, nz = number of pi0 564 552 565 553 G4int i, counter, nt, np, nm, nz; 566 554 567 if (first) {555 if (first) { 568 556 // compute normalization constants, this will only be done once 569 557 first = false; -
trunk/source/processes/hadronic/models/high_energy/src/G4HELambdaInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HELambdaInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HELambdaInelastic::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); 56 53 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; 85 80 86 81 incidentKineticEnergy -= inelasticity; 87 82 88 89 90 91 G4double excitation= NuclearExcitation(incidentKineticEnergy,92 93 94 95 if(verboseLevel > 1)96 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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; 131 114 132 if(verboseLevel > 1)133 115 if (verboseLevel > 1) 116 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 134 117 << incidentCode << G4endl; 135 118 136 119 G4bool successful = false; 137 120 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 193 171 194 172 void 195 G4HELambdaInelastic::FirstIntInCasLambda( G4bool &inElastic,196 197 198 G4int &vecLen,199 G4HEVectorincidentParticle,200 G4HEVectortargetParticle,201 173 G4HELambdaInelastic::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) 202 180 203 181 // Lambda undergoes interaction with nucleon within a nucleus. Check if it is … … 208 186 // data. Replace some pions or protons/neutrons by kaons or strange baryons 209 187 // 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; 238 212 239 213 if( first ) -
trunk/source/processes/hadronic/models/high_energy/src/G4HENeutronInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HENeutronInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HENeutronInelastic::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); 56 53 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; 80 65 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 } 85 75 86 incidentKineticEnergy -= inelasticity; 76 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 77 atomicWeight, atomicNumber); 78 if (verboseLevel > 1) 79 G4cout << "nuclear inelasticity = " << inelasticity << G4endl; 87 80 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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 " 134 124 << incidentCode << G4endl; 135 125 136 126 G4bool successful = false; 137 127 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 193 179 194 180 void 195 G4HENeutronInelastic::FirstIntInCasNeutron( G4bool &inElastic,196 197 198 G4int &vecLen,199 G4HEVectorincidentParticle,200 G4HEVectortargetParticle,201 181 G4HENeutronInelastic::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) 202 188 203 189 // Neutron undergoes interaction with nucleon within a nucleus. Check if it is … … 208 194 // protons/neutrons by kaons or strange baryons according to the average 209 195 // 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; 238 221 239 222 if( first ) 240 { 223 { // compute normalization constants, this will only be done once 241 224 first = false; 242 225 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEOmegaMinusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEOmegaMinusInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEOmegaMinusInelastic::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); 56 53 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 } 80 75 81 G4double inelasticity= NuclearInelasticity(incidentKineticEnergy,82 83 if(verboseLevel > 1)84 76 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 77 atomicWeight, atomicNumber); 78 if (verboseLevel > 1) 79 G4cout << "nuclear inelasticity = " << inelasticity << G4endl; 85 80 86 81 incidentKineticEnergy -= inelasticity; 87 82 88 89 90 91 G4double excitation= NuclearExcitation(incidentKineticEnergy,92 93 94 95 if(verboseLevel > 1)96 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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; 131 114 132 if(verboseLevel > 1)133 115 if (verboseLevel > 1) 116 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 134 117 << incidentCode << G4endl; 135 118 136 119 G4bool successful = false; 137 120 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 193 172 194 173 void 195 G4HEOmegaMinusInelastic::FirstIntInCasOmegaMinus( G4bool &inElastic,196 197 198 G4int &vecLen,199 G4HEVectorincidentParticle,200 G4HEVectortargetParticle,201 174 G4HEOmegaMinusInelastic::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) 202 181 203 182 // Xi0 undergoes interaction with nucleon within a nucleus. Check if it is … … 208 187 // protons/neutrons by kaons or strange baryons according to the average 209 188 // 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; 238 213 239 214 if( first ) 240 { 215 { // compute normalization constants, this will only be done once 241 216 first = false; 242 217 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEPionMinusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HEPionMinusInelastic.cc,v 1.17 2010/11/29 05:44:44 dennis Exp $ 27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 26 28 // 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 30 29 // 11-OCT-2007 F.W. Jones: fixed incorrect Imax (should be Imin) in 31 30 // sampling of charge exchange. … … 35 34 #include "G4ios.hh" 36 35 37 //38 36 // G4 Process: Gheisha High Energy Collision model. 39 37 // 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 like41 // nuclear reactions, nuclear fission without any cascading and all processes for42 // p articles 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. 43 41 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 44 42 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 47 45 #include "G4HEPionMinusInelastic.hh" 48 46 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 56 57 47 G4HadFinalState* 48 G4HEPionMinusInelastic::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); 58 56 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; 89 85 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; 108 103 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; 133 126 134 if(verboseLevel > 1)135 127 if (verboseLevel > 1) 128 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 136 129 << incidentCode << G4endl; 137 130 138 131 G4bool successful = false; 139 132 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 195 184 196 185 void 197 G4HEPionMinusInelastic::FirstIntInCasPionMinus( G4bool &inElastic,198 199 200 G4int &vecLen,201 G4HEVectorincidentParticle,202 G4HEVectortargetParticle)186 G4HEPionMinusInelastic::FirstIntInCasPionMinus(G4bool& inElastic, 187 const G4double availableEnergy, 188 G4HEVector pv[], 189 G4int& vecLen, 190 const G4HEVector& incidentParticle, 191 const G4HEVector& targetParticle) 203 192 204 193 // Pion- undergoes interaction with nucleon within a nucleus. Check if it is … … 209 198 // protons/neutrons by kaons or strange baryons according to the average 210 199 // 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; 239 224 240 225 if( first ) 241 { 226 { // compute normalization constants, this will only be done once 242 227 first = false; 243 228 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEPionPlusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEPionPlusInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEPionPlusInelastic::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); 56 53 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; 85 80 86 81 incidentKineticEnergy -= inelasticity; 87 82 88 89 90 91 G4double excitation= NuclearExcitation(incidentKineticEnergy,92 93 94 95 if(verboseLevel > 1)96 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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; 131 115 132 if(verboseLevel > 1)133 116 if (verboseLevel > 1) 117 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 134 118 << incidentCode << G4endl; 135 119 136 120 G4bool successful = false; 137 121 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 194 173 195 174 void 196 G4HEPionPlusInelastic::FirstIntInCasPionPlus( G4bool &inElastic,197 198 199 G4int &vecLen,200 G4HEVectorincidentParticle,201 G4HEVectortargetParticle,202 175 G4HEPionPlusInelastic::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) 203 182 204 183 // Pion+ undergoes interaction with nucleon within a nucleus. Check if it is … … 209 188 // protons/neutrons by kaons or strange baryons according to the average 210 189 // 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; 240 216 241 217 if( first ) 242 { 218 { // compute normalization constants, this will only be done once 243 219 first = false; 244 220 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEProtonInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEProtonInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEProtonInelastic::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); 56 53 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 } 83 78 84 G4double inelasticity= NuclearInelasticity(incidentKineticEnergy,85 86 if(verboseLevel > 1)87 88 89 79 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 80 atomicWeight, atomicNumber); 81 if (verboseLevel > 1) 82 G4cout << "nuclear inelasticity = " << inelasticity << G4endl; 83 84 incidentKineticEnergy -= inelasticity; 90 85 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; 135 125 136 if(verboseLevel > 1)137 126 if (verboseLevel > 1) 127 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 138 128 << incidentCode << G4endl; 139 129 140 130 G4bool successful = false; 141 131 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 197 183 198 184 void 199 G4HEProtonInelastic::FirstIntInCasProton( G4bool &inElastic,200 201 202 G4int &vecLen,203 G4HEVectorincidentParticle,204 G4HEVectortargetParticle,205 185 G4HEProtonInelastic::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) 206 192 207 193 // Proton undergoes interaction with nucleon within a nucleus. Check if it is … … 212 198 // protons/neutrons by kaons or strange baryons according to the average 213 199 // 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 } 268 243 } 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 } 290 261 } 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 297 270 298 271 299 300 301 302 303 272 // initialize the first two places 273 // the same as beam and target 274 pv[0] = incidentParticle; 275 pv[1] = targetParticle; 276 vecLen = 2; 304 277 305 278 if( !inElastic ) -
trunk/source/processes/hadronic/models/high_energy/src/G4HESigmaMinusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HESigmaMinusInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HESigmaMinusInelastic::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); 56 53 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; 87 82 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; 131 114 132 if(verboseLevel > 1)133 115 if (verboseLevel > 1) 116 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 134 117 << incidentCode << G4endl; 135 118 136 119 G4bool successful = false; 137 120 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 193 172 194 173 void 195 G4HESigmaMinusInelastic::FirstIntInCasSigmaMinus( G4bool &inElastic,196 197 198 G4int &vecLen,199 G4HEVectorincidentParticle,200 G4HEVectortargetParticle,201 174 G4HESigmaMinusInelastic::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) 202 181 203 182 // Sigma- undergoes interaction with nucleon within a nucleus. Check if it is … … 208 187 // protons/neutrons by kaons or strange baryons according to the average 209 188 // 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; 238 214 239 215 if( first ) 240 { 216 { // compute normalization constants, this will only be done once 241 217 first = false; 242 218 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HESigmaPlusInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HESigmaPlusInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HESigmaPlusInelastic::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); 56 53 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; 87 82 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; 131 114 132 if(verboseLevel > 1)133 115 if (verboseLevel > 1) 116 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 134 117 << incidentCode << G4endl; 135 118 136 119 G4bool successful = false; 137 120 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 193 172 194 173 void 195 G4HESigmaPlusInelastic::FirstIntInCasSigmaPlus( G4bool &inElastic,196 197 198 G4int &vecLen,199 G4HEVectorincidentParticle,200 G4HEVectortargetParticle,201 174 G4HESigmaPlusInelastic::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) 202 181 203 182 // Sigma+ undergoes interaction with nucleon within a nucleus. Check if it is … … 208 187 // protons/neutrons by kaons or strange baryons according to the average 209 188 // 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; 238 213 239 214 if( first ) 240 { 215 { // compute normalization constants, this will only be done once 241 216 first = false; 242 217 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HESigmaZeroInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 46 43 #include "G4Gamma.hh" 47 44 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 45 G4HadFinalState* 46 G4HESigmaZeroInelastic::ApplyYourself(const G4HadProjectile& aTrack, 47 G4Nucleus& targetNucleus) 48 { 49 G4HEVector* pv = new G4HEVector[MAXPART]; 50 const G4HadProjectile* aParticle = &aTrack; 51 G4HEVector incidentParticle(aParticle); 55 52 56 57 58 53 G4HELambdaInelastic theLambdaInelastic; 54 theLambdaInelastic.SetMaxNumberOfSecondaries(MAXPART); 55 theLambdaInelastic.SetVerboseLevel(verboseLevel); 59 56 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(); 71 69 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 } 83 80 84 85 86 87 88 89 90 -
trunk/source/processes/hadronic/models/high_energy/src/G4HEVector.cc
r1340 r1347 25 25 // 26 26 // 27 // $Id: G4HEVector.cc,v 1.2 0 2006/11/22 23:52:32dennis Exp $28 // GEANT4 tag $Name: geant4-09-0 3-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 $ 29 29 // 30 30 // … … 164 164 } 165 165 166 G4double 167 G4HEVector::getTotalMomentum() 168 { 169 return std::sqrt(px*px + py*py + pz*pz); 170 } 166 G4double G4HEVector::getTotalMomentum() const 167 { 168 return std::sqrt(px*px + py*py + pz*pz); 169 } 171 170 172 171 void 173 G4HEVector::setMomentum( 174 175 176 177 178 179 180 181 void 182 G4HEVector::setMomentumAndUpdate( G4double x, G4double y, G4double z)183 184 185 186 187 energy= std::sqrt(mass*mass + px*px + py*py + pz*pz);188 189 190 191 192 void 193 G4HEVector::setMomentum( G4double x, G4double y)194 195 196 197 198 172 G4HEVector::setMomentum(G4double x, G4double y, G4double z) 173 { 174 px = x; 175 py = y; 176 pz = z; 177 return; 178 } 179 180 void 181 G4HEVector::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 191 void 192 G4HEVector::setMomentum(G4double x, G4double y) 193 { 194 px = x; 195 py = y; 196 return; 197 } 199 198 200 199 void … … 312 311 } 313 312 314 G4double 315 G4HEVector::getEnergy() 316 { 317 return energy; 318 } 319 320 G4double 321 G4HEVector::getKineticEnergy() 322 { 323 return kineticEnergy; 324 } 313 G4double G4HEVector::getEnergy() const 314 { 315 return energy; 316 } 317 318 G4double G4HEVector::getKineticEnergy() const 319 { 320 return kineticEnergy; 321 } 325 322 326 323 void … … 367 364 } 368 365 369 G4double 370 G4HEVector::getMass() 371 { 372 return mass; 373 } 366 G4double G4HEVector::getMass() const 367 { 368 return mass; 369 } 374 370 375 371 void … … 380 376 } 381 377 382 G4double 383 G4HEVector::getCharge() 384 { 385 return charge; 386 } 378 G4double G4HEVector::getCharge() const 379 { 380 return charge; 381 } 387 382 388 383 void … … 433 428 } 434 429 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 } 430 G4int G4HEVector::getCode() const 431 { 432 return code; 433 } 434 435 G4String G4HEVector::getName() const 436 { 437 return particleName; 438 } 439 440 G4String G4HEVector::getType() const 441 { 442 return particleType; 443 } 452 444 453 G4int 454 G4HEVector::getBaryonNumber() 455 { 456 return baryon; 457 } 458 459 G4int 460 G4HEVector::getStrangenessNumber() 461 { 462 return strangeness; 463 } 445 G4int G4HEVector::getBaryonNumber() const 446 { 447 return baryon; 448 } 449 450 G4int G4HEVector::getStrangenessNumber() const 451 { 452 return strangeness; 453 } 454 464 455 G4int 465 456 G4HEVector::getQuarkContent(G4int flavor) … … 589 580 } 590 581 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 } 582 G4double 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 } 606 594 607 595 G4double … … 725 713 } 726 714 727 G4double 728 G4HEVector::Length() 729 { 730 return std::sqrt(px*px + py*py + pz*pz); 731 } 715 G4double G4HEVector::Length() const 716 { 717 return std::sqrt(px*px + py*py + pz*pz); 718 } 732 719 733 720 void … … 1297 1284 } 1298 1285 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 1286 void 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 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEXiMinusInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEXiMinusInelastic::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); 56 53 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 } 80 75 81 G4double inelasticity= NuclearInelasticity(incidentKineticEnergy,82 83 if(verboseLevel > 1)84 76 G4double inelasticity = NuclearInelasticity(incidentKineticEnergy, 77 atomicWeight, atomicNumber); 78 if (verboseLevel > 1) 79 G4cout << "nuclear inelasticity = " << inelasticity << G4endl; 85 80 86 81 incidentKineticEnergy -= inelasticity; 87 82 88 89 90 91 G4double excitation= NuclearExcitation(incidentKineticEnergy,92 93 94 95 if(verboseLevel > 1)96 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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; 131 114 132 if(verboseLevel > 1)133 115 if (verboseLevel > 1) 116 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 134 117 << incidentCode << G4endl; 135 118 136 119 G4bool successful = false; 137 120 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 193 172 194 173 void 195 G4HEXiMinusInelastic::FirstIntInCasXiMinus( G4bool &inElastic,196 197 198 G4int &vecLen,199 G4HEVectorincidentParticle,200 G4HEVectortargetParticle,201 174 G4HEXiMinusInelastic::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) 202 181 203 182 // Xi0 undergoes interaction with nucleon within a nucleus. Check if it is … … 208 187 // protons/neutrons by kaons or strange baryons according to the average 209 188 // 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; 238 214 239 215 if( first ) 240 { 216 { // compute normalization constants, this will only be done once 241 217 first = false; 242 218 for( i=0; i<numMul; i++ )protmul[i] = 0.0; -
trunk/source/processes/hadronic/models/high_energy/src/G4HEXiZeroInelastic.cc
r1340 r1347 24 24 // ******************************************************************** 25 25 // 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 $ 30 28 // 31 29 … … 33 31 #include "G4ios.hh" 34 32 35 //36 33 // G4 Process: Gheisha High Energy Collision model. 37 34 // 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 like39 // nuclear reactions, nuclear fission without any cascading and all processes for40 // p articles 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. 41 38 // First work done by J.L.Chuma and F.W.Jones, TRIUMF, June 96. 42 39 // H. Fesefeldt, RWTH-Aachen, 23-October-1996 … … 45 42 #include "G4HEXiZeroInelastic.hh" 46 43 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 54 55 44 G4HadFinalState* 45 G4HEXiZeroInelastic::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); 56 53 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; 85 80 86 81 incidentKineticEnergy -= inelasticity; 87 82 88 89 90 91 G4double excitation= NuclearExcitation(incidentKineticEnergy,92 93 94 95 if(verboseLevel > 1)96 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 97 92 << excitationEnergyDTA << G4endl; 98 93 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; 131 114 132 if(verboseLevel > 1)133 115 if (verboseLevel > 1) 116 G4cout << "ApplyYourself: CallFirstIntInCascade for particle " 134 117 << incidentCode << G4endl; 135 118 136 119 G4bool successful = false; 137 120 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 193 172 194 173 void 195 G4HEXiZeroInelastic::FirstIntInCasXiZero( G4bool &inElastic,196 197 198 G4int &vecLen,199 G4HEVectorincidentParticle,200 G4HEVectortargetParticle,201 174 G4HEXiZeroInelastic::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) 202 181 203 182 // Xi0 undergoes interaction with nucleon within a nucleus. Check if it is … … 208 187 // protons/neutrons by kaons or strange baryons according to the average 209 188 // 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; 238 213 239 214 if( first ) 240 { 215 { // compute normalization constants, this will only be done once 241 216 first = false; 242 217 for( i=0; i<numMul; i++ )protmul[i] = 0.0;
Note: See TracChangeset
for help on using the changeset viewer.