Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
-------------------------------------------------------------------
|
||||
|
||||
==================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation
|
||||
==================================================
|
||||
|
||||
History file for Low Energy Parameterized Models
|
||||
------------------------------------------------
|
||||
|
||||
This file should be used to summarize modifications introduced in the
|
||||
code and to keep track of all tags.
|
||||
|
||||
---------------------------------------------------------------
|
||||
* Please list in reverse chronological order (last date on top)
|
||||
---------------------------------------------------------------
|
||||
|
||||
14 Dec 2005 - V.Ivanchenko (hadr-lep-V07-01-04)
|
||||
----------------------------------------------
|
||||
G4LElastic.cc: restore version 1.19
|
||||
G4LElasticB: alternative version with 4-momentum balance
|
||||
|
||||
03 Dec 2005 - V.Ivanchenko (hadr-lep-V07-01-03)
|
||||
----------------------------------------------
|
||||
G4LElastic.cc: add protection in center of mass reference system (20 MeV/c),
|
||||
which was before in lab system. Below this momentum model is not valid
|
||||
|
||||
29 Nov 2005 - G.Cosmo (hadr-lep-V07-01-02)
|
||||
------------------------------------------
|
||||
Get rid of problematic printout in G4LElastic.cc causing porting
|
||||
issues on VC++ compiler.
|
||||
|
||||
28 Nov 2005 - V.Ivanchenko (hadr-lep-V07-01-01)
|
||||
----------------------------------------------
|
||||
26 Nov 2005 - Fix of cosT calculation (internal unit for Q^2 is GeV)
|
||||
|
||||
24 Nov 2005 - D.Wright (hadr-lep-V07-01-00)
|
||||
-------------------------------------------
|
||||
22 Nov 2005 - G.Cosmo
|
||||
G4LElastic.cc: use std::numeric_limits instead of FLT_MAX for porting on
|
||||
MSVC++8.0 compiler.
|
||||
|
||||
24 Nov 2005 - V. Ivanchenko
|
||||
G4LElastic.cc: calculate cos(theta) in CM system (as it should be)
|
||||
|
||||
17 Nov 2005 - D.Wright
|
||||
G4LCapture.cc: in method ApplyYourself, fixed unit bug in gamma momentum
|
||||
and added 2.2 MeV gamma for special case of n capture on H
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LCapture.hh,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// G4 Low energy model: neutron capture -- header file
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAlphaInelastic.hh,v 1.8 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy Alpha Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 21-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiKaonZeroInelastic.hh,v 1.5 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy KaonZeroL Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 12-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiLambdaInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy AntiLambda Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiNeutronInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy AntiNeutron Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiOmegaMinusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy AntiOmegaMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiProtonInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy AntiProton Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiSigmaMinusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy AntiSigmaMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiSigmaPlusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy AntiSigmaPlus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiXiMinusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy AntiXiMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiXiZeroInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy AntiXiZero Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEDeuteronInelastic.hh,v 1.8 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy Deuteron Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 25-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEKaonMinusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy KaonMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 12-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEKaonPlusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy KaonPlus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 12-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEKaonZeroInelastic.hh,v 1.5 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy KaonZeroS Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 12-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEKaonZeroLInelastic.hh,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// G4 Gheisha High Energy model class -- header file
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEKaonZeroSInelastic.hh,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// G4 Gheisha High Energy model class -- header file
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LELambdaInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy Lambda Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 18-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEOmegaMinusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy OmegaMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Nov-1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEPionMinusInelastic.hh,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy PionMinus Inelastic Process
|
||||
// original by J.L. Chuma, TRIUMF, 03-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEPionPlusInelastic.hh,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy PionPlus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Nov-1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEProtonInelastic.hh,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy Proton Inelastic Process
|
||||
// original by H.P. Wellisch
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LESigmaMinusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy SigmaMinus Inelastic Process
|
||||
// original by J.L. Chuma, TRIUMF, 03-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LESigmaPlusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy SigmaPlus Inelastic Process
|
||||
// original by J.L. Chuma, TRIUMF, 03-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LETritonInelastic.hh,v 1.8 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy Triton Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 25-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEXiMinusInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy XiMinus Inelastic Process
|
||||
// original by J.L. Chuma, TRIUMF, 03-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEXiZeroInelastic.hh,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy XiZero Inelastic Process
|
||||
// original by J.L. Chuma, TRIUMF, 03-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LElastic.hh,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// G4 Model: Low energy elastic scattering -- header file
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LElasticB.hh,v 1.1 2005/12/14 18:13:06 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// G4 Model: Low energy elastic scattering with 4-momentum balance
|
||||
// Derived fron G4LElastic of F.W. Jones, TRIUMF, 04-JUN-96
|
||||
//
|
||||
// Modified:
|
||||
// 14-Dec-05 V.Ivanchenko rename the class
|
||||
//
|
||||
// use -scheme for elastic scattering: HPW, 20th June 1997
|
||||
// most of the code comes from the old Low-energy Elastic class
|
||||
//
|
||||
|
||||
|
||||
#ifndef G4LElasticB_h
|
||||
#define G4LElasticB_h 1
|
||||
|
||||
// Class Description
|
||||
// Final state production model for hadron nuclear elastic scattering;
|
||||
// To be used in your physics list in case you need this physics.
|
||||
// In this case you want to register an object of this class with
|
||||
// the corresponding process.
|
||||
// Class Description - End
|
||||
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Element.hh"
|
||||
#include "G4ElementVector.hh"
|
||||
#include "G4ElementTable.hh"
|
||||
#include "G4PhysicsTable.hh"
|
||||
#include "G4PhysicsVector.hh"
|
||||
#include "G4LPhysicsFreeVector.hh"
|
||||
//#include "G4HadronicCrossSections.hh"
|
||||
#include "G4LightMedia.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4TrackStatus.hh"
|
||||
#include "G4HadronicInteraction.hh"
|
||||
|
||||
|
||||
class G4LElasticB : public G4HadronicInteraction
|
||||
{
|
||||
public:
|
||||
|
||||
G4LElasticB() : G4HadronicInteraction()
|
||||
{
|
||||
SetMinEnergy( 0.0*GeV );
|
||||
SetMaxEnergy( DBL_MAX );
|
||||
}
|
||||
|
||||
~G4LElasticB() {};
|
||||
|
||||
G4HadFinalState * ApplyYourself(const G4HadProjectile & aTrack,
|
||||
G4Nucleus & targetNucleus);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
G4LightMedia LightMedia;
|
||||
|
||||
G4int Rtmi(G4double* x, G4double xli, G4double xri, G4double eps,
|
||||
G4int iend,
|
||||
G4double aa, G4double bb, G4double cc, G4double dd,
|
||||
G4double rr);
|
||||
|
||||
G4double Fctcos(G4double t,
|
||||
G4double aa, G4double bb, G4double cc, G4double dd,
|
||||
G4double rr);
|
||||
|
||||
void Defs1(G4double p, G4double px, G4double py, G4double pz,
|
||||
G4double pxinc, G4double pyinc, G4double pzinc,
|
||||
G4double* pxnew, G4double* pynew, G4double* pznew);
|
||||
};
|
||||
#endif
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LFission.hh,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// G4 Low-energy Model: Fission -- header file
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4LCapture.cc,v 1.11 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4LCapture.cc,v 1.12 2005/11/17 23:10:26 dennis Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// G4 Model: Low-energy Neutron Capture
|
||||
@@ -66,9 +66,9 @@ G4LCapture::ApplyYourself(const G4HadProjectile & aTrack, G4Nucleus& targetNucle
|
||||
|
||||
const G4LorentzVector theMom = aTrack.Get4Momentum();
|
||||
G4double P = theMom.vect().mag()/GeV;
|
||||
G4double Px = theMom.vect().x();
|
||||
G4double Py = theMom.vect().y();
|
||||
G4double Pz = theMom.vect().z();
|
||||
G4double Px = theMom.vect().x()/GeV;
|
||||
G4double Py = theMom.vect().y()/GeV;
|
||||
G4double Pz = theMom.vect().z()/GeV;
|
||||
G4double E = theMom.e()/GeV;
|
||||
G4double E0 = aTrack.GetDefinition()->GetPDGMass()/GeV;
|
||||
G4double Q = aTrack.GetDefinition()->GetPDGCharge();
|
||||
@@ -82,7 +82,9 @@ G4LCapture::ApplyYourself(const G4HadProjectile & aTrack, G4Nucleus& targetNucle
|
||||
G4cout << "mass " << E0 << " GeV" << G4endl;
|
||||
G4cout << "charge " << Q << G4endl;
|
||||
}
|
||||
// GHEISHA ADD operation to get total energy, mass, charge:
|
||||
|
||||
// GHEISHA ADD operation to get total energy, mass, charge:
|
||||
|
||||
if (verboseLevel > 1) {
|
||||
G4cout << "G4LCapture:ApplyYourself: material:" << G4endl;
|
||||
G4cout << "A " << N << G4endl;
|
||||
@@ -105,10 +107,15 @@ G4LCapture::ApplyYourself(const G4HadProjectile & aTrack, G4Nucleus& targetNucle
|
||||
Py = -Py;
|
||||
Pz = -Pz;
|
||||
|
||||
// Make a gamma...
|
||||
// Make a gamma...
|
||||
|
||||
G4double ran = G4RandGauss::shoot();
|
||||
G4double p = 0.0065 + ran*0.0010;
|
||||
G4double p;
|
||||
if (Z == 1 && N == 1) { // special case for hydrogen
|
||||
p = 0.0022;
|
||||
} else {
|
||||
G4double ran = G4RandGauss::shoot();
|
||||
p = 0.0065 + ran*0.0010;
|
||||
}
|
||||
|
||||
G4double ran1 = G4UniformRand();
|
||||
G4double ran2 = G4UniformRand();
|
||||
@@ -134,33 +141,34 @@ G4LCapture::ApplyYourself(const G4HadProjectile & aTrack, G4Nucleus& targetNucle
|
||||
G4ThreeVector(px*GeV, py*GeV, pz*GeV));
|
||||
theParticleChange.AddSecondary(aGamma);
|
||||
|
||||
// Make another gamma if there is sufficient energy left over...
|
||||
// Make another gamma if there is sufficient energy left over...
|
||||
|
||||
G4double xp = 0.008 - p;
|
||||
if (xp <= 0.) return &theParticleChange;
|
||||
if (xp > 0.) {
|
||||
if (Z > 1 || N > 1) {
|
||||
ran1 = G4UniformRand();
|
||||
ran2 = G4UniformRand();
|
||||
cost = -1. + 2.*ran1;
|
||||
sint = std::sqrt(std::abs(1. - cost*cost));
|
||||
phi = ran2*twopi;
|
||||
|
||||
ran1 = G4UniformRand();
|
||||
ran2 = G4UniformRand();
|
||||
cost = -1. + 2.*ran1;
|
||||
sint = std::sqrt(std::abs(1. - cost*cost));
|
||||
phi = ran2*twopi;
|
||||
px = xp*sint*std::sin(phi);
|
||||
py = xp*sint*std::cos(phi);
|
||||
pz = xp*cost;
|
||||
e = xp;
|
||||
e0 = 0.;
|
||||
|
||||
px = xp*sint*std::sin(phi);
|
||||
py = xp*sint*std::cos(phi);
|
||||
pz = xp*cost;
|
||||
e = xp;
|
||||
e0 = 0.;
|
||||
a = px*Px + py*Py + pz*Pz;
|
||||
a = (a/(E + E0) - e)/E0;
|
||||
|
||||
a = px*Px + py*Py + pz*Pz;
|
||||
a = (a/(E + E0) - e)/E0;
|
||||
|
||||
px = px + a*Px;
|
||||
py = py + a*Py;
|
||||
pz = pz + a*Pz;
|
||||
|
||||
aGamma = new G4DynamicParticle(G4Gamma::GammaDefinition(),
|
||||
G4ThreeVector(px*GeV, py*GeV, pz*GeV));
|
||||
theParticleChange.AddSecondary(aGamma);
|
||||
px = px + a*Px;
|
||||
py = py + a*Py;
|
||||
pz = pz + a*Pz;
|
||||
|
||||
aGamma = new G4DynamicParticle(G4Gamma::GammaDefinition(),
|
||||
G4ThreeVector(px*GeV, py*GeV, pz*GeV));
|
||||
theParticleChange.AddSecondary(aGamma);
|
||||
}
|
||||
}
|
||||
return &theParticleChange;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiKaonZeroInelastic.cc,v 1.9 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy KaonZeroLong Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 11-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiLambdaInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: AntiLambda Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiNeutronInelastic.cc,v 1.13 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: AntiNeutron Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 18-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiOmegaMinusInelastic.cc,v 1.11 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: AntiOmegaMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 20-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiProtonInelastic.cc,v 1.13 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: AntiProton Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 13-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiSigmaMinusInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: AntiSigmaMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiSigmaPlusInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: AntiSigmaPlus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiXiMinusInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: AntiXiMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 20-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEAntiXiZeroInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: AntiXiZero Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 20-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEKaonMinusInelastic.cc,v 1.14 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy KaonMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 12-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEKaonPlusInelastic.cc,v 1.12 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy KaonPlus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 05-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEKaonZeroInelastic.cc,v 1.8 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Low Energy KaonZeroShort Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 11-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LELambdaInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: Lambda Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 18-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEOmegaMinusInelastic.cc,v 1.11 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: OmegaMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 20-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEPionPlusInelastic.cc,v 1.13 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: PionPlus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Nov-1996
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LESigmaMinusInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: SigmaMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LESigmaPlusInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: SigmaPlus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 19-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEXiMinusInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: XiMinus Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 20-Feb-1997
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LEXiZeroInelastic.cc,v 1.10 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// Hadronic Process: XiZero Inelastic Process
|
||||
// J.L. Chuma, TRIUMF, 20-Feb-1997
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
// most of the code comes from the old Low-energy Elastic class
|
||||
//
|
||||
// 25-JUN-98 FWJ: replaced missing Initialize for ParticleChange.
|
||||
// 14-DEC-05 V.Ivanchenko: restore 1.19 version (7.0)
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
@@ -148,7 +149,6 @@ G4LElastic::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleu
|
||||
G4double t1 = -std::log(ran)/bb;
|
||||
G4double t2 = -std::log(ran)/dd;
|
||||
if (verboseLevel > 1) {
|
||||
G4cout << "log(FLT_MAX)=" << std::log(FLT_MAX) << G4endl;
|
||||
G4cout << "t1,Fctcos " << t1 << " " << Fctcos(t1, aa, bb, cc, dd, rr) <<
|
||||
G4endl;
|
||||
G4cout << "t2,Fctcos " << t2 << " " << Fctcos(t2, aa, bb, cc, dd, rr) <<
|
||||
|
||||
@@ -0,0 +1,406 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// Physics model class G4LElasticB (derived from G4LElastic)
|
||||
//
|
||||
// G4 Model: Low-energy Elastic scattering with 4-momentum balance
|
||||
// F.W. Jones, TRIUMF, 04-JUN-96
|
||||
//
|
||||
// use -scheme for elastic scattering: HPW, 20th June 1997
|
||||
// most of the code comes from the old Low-energy Elastic class
|
||||
//
|
||||
// 25-JUN-98 FWJ: replaced missing Initialize for ParticleChange.
|
||||
// 09-Set-05 V.Ivanchenko HARP version of the model: fix scattering
|
||||
// on hydrogen, use relativistic Lorentz transformation
|
||||
// 24-Nov-05 V.Ivanchenko sample cost in center of mass reference system
|
||||
// 03-Dec-05 V.Ivanchenko add protection to initial momentum 20 MeV/c in
|
||||
// center of mass system (before it was in lab system)
|
||||
// below model is not valid
|
||||
// 14-Dec-05 V.Ivanchenko change protection to cos(theta) < -1 and
|
||||
// rename the class
|
||||
//
|
||||
|
||||
#include "G4LElasticB.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4IonTable.hh"
|
||||
|
||||
G4HadFinalState*
|
||||
G4LElasticB::ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& targetNucleus)
|
||||
{
|
||||
if(getenv("debug_LElastic")) verboseLevel = 5;
|
||||
theParticleChange.Clear();
|
||||
const G4HadProjectile* aParticle = &aTrack;
|
||||
G4double atno2 = targetNucleus.GetN();
|
||||
G4double zTarget = targetNucleus.GetZ();
|
||||
theParticleChange.SetEnergyChange(aTrack.GetKineticEnergy());
|
||||
theParticleChange.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
|
||||
|
||||
// Elastic scattering off Hydrogen
|
||||
|
||||
G4DynamicParticle* aSecondary = 0;
|
||||
if (atno2 < 1.5) {
|
||||
const G4ParticleDefinition* aParticleType = aParticle->GetDefinition();
|
||||
if (aParticleType == G4PionPlus::PionPlus())
|
||||
aSecondary = LightMedia.PionPlusExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4PionMinus::PionMinus())
|
||||
aSecondary = LightMedia.PionMinusExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4KaonPlus::KaonPlus())
|
||||
aSecondary = LightMedia.KaonPlusExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4KaonZeroShort::KaonZeroShort())
|
||||
aSecondary = LightMedia.KaonZeroShortExchange(aParticle,targetNucleus);
|
||||
else if (aParticleType == G4KaonZeroLong::KaonZeroLong())
|
||||
aSecondary = LightMedia.KaonZeroLongExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4KaonMinus::KaonMinus())
|
||||
aSecondary = LightMedia.KaonMinusExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4Proton::Proton())
|
||||
aSecondary = LightMedia.ProtonExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4AntiProton::AntiProton())
|
||||
aSecondary = LightMedia.AntiProtonExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4Neutron::Neutron())
|
||||
aSecondary = LightMedia.NeutronExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4AntiNeutron::AntiNeutron())
|
||||
aSecondary = LightMedia.AntiNeutronExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4Lambda::Lambda())
|
||||
aSecondary = LightMedia.LambdaExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4AntiLambda::AntiLambda())
|
||||
aSecondary = LightMedia.AntiLambdaExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4SigmaPlus::SigmaPlus())
|
||||
aSecondary = LightMedia.SigmaPlusExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4SigmaMinus::SigmaMinus())
|
||||
aSecondary = LightMedia.SigmaMinusExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4AntiSigmaPlus::AntiSigmaPlus())
|
||||
aSecondary = LightMedia.AntiSigmaPlusExchange(aParticle,targetNucleus);
|
||||
else if (aParticleType == G4AntiSigmaMinus::AntiSigmaMinus())
|
||||
aSecondary= LightMedia.AntiSigmaMinusExchange(aParticle,targetNucleus);
|
||||
else if (aParticleType == G4XiZero::XiZero())
|
||||
aSecondary = LightMedia.XiZeroExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4XiMinus::XiMinus())
|
||||
aSecondary = LightMedia.XiMinusExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4AntiXiZero::AntiXiZero())
|
||||
aSecondary = LightMedia.AntiXiZeroExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4AntiXiMinus::AntiXiMinus())
|
||||
aSecondary = LightMedia.AntiXiMinusExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4OmegaMinus::OmegaMinus())
|
||||
aSecondary = LightMedia.OmegaMinusExchange(aParticle, targetNucleus);
|
||||
else if (aParticleType == G4AntiOmegaMinus::AntiOmegaMinus())
|
||||
aSecondary= LightMedia.AntiOmegaMinusExchange(aParticle,targetNucleus);
|
||||
else if (aParticleType == G4KaonPlus::KaonPlus())
|
||||
aSecondary = LightMedia.KaonPlusExchange(aParticle, targetNucleus);
|
||||
}
|
||||
|
||||
// Has a charge or strangeness exchange occurred?
|
||||
if (aSecondary) {
|
||||
aSecondary->SetMomentum(aParticle->Get4Momentum().vect());
|
||||
theParticleChange.SetStatusChange(stopAndKill);
|
||||
theParticleChange.AddSecondary(aSecondary);
|
||||
}
|
||||
// G4cout << "Entering elastic scattering 1"<<G4endl;
|
||||
|
||||
G4double p = aParticle->GetTotalMomentum()/GeV;
|
||||
if (verboseLevel > 1)
|
||||
G4cout << "G4LElasticB::DoIt: Incident particle p=" << p << " GeV" << G4endl;
|
||||
|
||||
if (p < 0.01) return &theParticleChange;
|
||||
|
||||
// G4cout << "Entering elastic scattering 2"<<G4endl;
|
||||
// Compute the direction of elastic scattering.
|
||||
// It is planned to replace this code with a method based on
|
||||
// parameterized functions and a Monte Carlo method to invert the CDF.
|
||||
|
||||
G4double ran = G4UniformRand();
|
||||
G4double aa, bb, cc, dd, rr;
|
||||
if (atno2 <= 62.) {
|
||||
aa = std::pow(atno2, 1.63);
|
||||
bb = 14.5*std::pow(atno2, 0.66);
|
||||
cc = 1.4*std::pow(atno2, 0.33);
|
||||
dd = 10.;
|
||||
}
|
||||
else {
|
||||
aa = std::pow(atno2, 1.33);
|
||||
bb = 60.*std::pow(atno2, 0.33);
|
||||
cc = 0.4*std::pow(atno2, 0.40);
|
||||
dd = 10.;
|
||||
}
|
||||
aa = aa/bb;
|
||||
cc = cc/dd;
|
||||
rr = (aa + cc)*ran;
|
||||
if (verboseLevel > 1) {
|
||||
G4cout << "DoIt: aa,bb,cc,dd,rr" << G4endl;
|
||||
G4cout << aa << " " << bb << " " << cc << " " << dd << " " << rr << G4endl;
|
||||
}
|
||||
G4double t1 = -std::log(ran)/bb;
|
||||
G4double t2 = -std::log(ran)/dd;
|
||||
if (verboseLevel > 1) {
|
||||
G4cout << "t1,Fctcos " << t1 << " " << Fctcos(t1, aa, bb, cc, dd, rr) <<
|
||||
G4endl;
|
||||
G4cout << "t2,Fctcos " << t2 << " " << Fctcos(t2, aa, bb, cc, dd, rr) <<
|
||||
G4endl;
|
||||
}
|
||||
G4double eps = 0.001;
|
||||
G4int ind1 = 10;
|
||||
G4double t = 0.0;
|
||||
G4int ier1;
|
||||
ier1 = Rtmi(&t, t1, t2, eps, ind1,
|
||||
aa, bb, cc, dd, rr);
|
||||
if (verboseLevel > 1) {
|
||||
G4cout << "From Rtmi, ier1=" << ier1 << G4endl;
|
||||
G4cout << "t, Fctcos " << t << " " << Fctcos(t, aa, bb, cc, dd, rr) <<
|
||||
G4endl;
|
||||
}
|
||||
if (ier1 != 0) t = 0.25*(3.*t1 + t2);
|
||||
if (verboseLevel > 1) {
|
||||
G4cout << "t, Fctcos " << t << " " << Fctcos(t, aa, bb, cc, dd, rr) <<
|
||||
G4endl;
|
||||
}
|
||||
|
||||
// Scattered particle referred to axis of incident particle
|
||||
G4double m1=aParticle->GetDefinition()->GetPDGMass();
|
||||
if(aSecondary) m1 = aSecondary->GetMass();
|
||||
|
||||
G4int Z=static_cast<G4int>(zTarget+.5);
|
||||
G4int A=static_cast<G4int>(atno2);
|
||||
G4ParticleDefinition * theDef = 0;
|
||||
if(Z == 1 && A == 1) {
|
||||
theDef = G4Proton::Proton();
|
||||
} else {
|
||||
if(G4UniformRand()<atno2-A) A++;
|
||||
theDef = G4ParticleTable::GetParticleTable()->FindIon(Z,A,0,Z);
|
||||
}
|
||||
G4double m2 = theDef->GetPDGMass();
|
||||
G4LorentzVector lv1 = aParticle->Get4Momentum();
|
||||
G4LorentzVector lv0(0.0,0.0,0.0,m2);
|
||||
|
||||
G4LorentzVector lv = lv0 + lv1;
|
||||
G4ThreeVector bst = lv.boostVector();
|
||||
lv1.boost(-bst);
|
||||
lv0.boost(-bst);
|
||||
G4ThreeVector p1 = lv1.vect();
|
||||
G4double ptot = p1.mag();
|
||||
G4double ptotgev = ptot/GeV;
|
||||
if (ptotgev < 0.01) return &theParticleChange;
|
||||
|
||||
// Sampling in CM system
|
||||
G4double phi = G4UniformRand()*twopi;
|
||||
G4double cost = 1. - 0.5*t/(ptotgev*ptotgev);
|
||||
G4double sint = 0.0;
|
||||
if(cost > 1.0) cost = 1.0;
|
||||
else {
|
||||
if(cost < -1.0) cost = -1.0 + 2.0*G4UniformRand();
|
||||
sint = std::sqrt((1.0-cost)*(1.0+cost));
|
||||
}
|
||||
// G4cout << "Entering elastic scattering 3"<<G4endl;
|
||||
if (verboseLevel > 1)
|
||||
G4cout << "cos(t)=" << cost << " sin(t)=" << sint << G4endl;
|
||||
|
||||
G4ThreeVector v1(sint*std::cos(phi),sint*std::sin(phi),cost);
|
||||
p1 = p1.unit();
|
||||
v1.rotateUz(p1);
|
||||
v1 *= ptot;
|
||||
G4LorentzVector nlv11(v1.x(),v1.y(),v1.z(),std::sqrt(ptot*ptot + m1*m1));
|
||||
G4LorentzVector nlv01 = lv0 + lv1 - nlv11;
|
||||
nlv01.boost(bst);
|
||||
nlv11.boost(bst);
|
||||
//G4cout << " P0= "<< nlv01 << " P1= "<< nlv11<<" m= " << m1 <<G4endl;
|
||||
|
||||
if (aSecondary) {
|
||||
aSecondary->SetMomentum(nlv11.vect());
|
||||
} else {
|
||||
theParticleChange.SetMomentumChange(nlv11.vect().unit());
|
||||
theParticleChange.SetEnergyChange(std::max(nlv11.e() - m1,0.0));
|
||||
}
|
||||
G4DynamicParticle * aSec = new G4DynamicParticle(theDef, nlv01);
|
||||
theParticleChange.AddSecondary(aSec);
|
||||
|
||||
// G4cout << " ion info "<<atno2 << " "<<A<<" "<<Z<<" "<<zTarget<<G4endl;
|
||||
return &theParticleChange;
|
||||
}
|
||||
|
||||
// The following is a "translation" of a root-finding routine
|
||||
// from GEANT3.21/GHEISHA. Some of the labelled block structure has
|
||||
// been retained for clarity. This routine will not be needed after
|
||||
// the planned revisions to DoIt().
|
||||
|
||||
G4int
|
||||
G4LElasticB::Rtmi(G4double* x, G4double xli, G4double xri, G4double eps,
|
||||
G4int iend,
|
||||
G4double aa, G4double bb, G4double cc, G4double dd,
|
||||
G4double rr)
|
||||
{
|
||||
G4int ier = 0;
|
||||
G4double xl = xli;
|
||||
G4double xr = xri;
|
||||
*x = xl;
|
||||
G4double tol = *x;
|
||||
G4double f = Fctcos(tol, aa, bb, cc, dd, rr);
|
||||
if (f == 0.) return ier;
|
||||
G4double fl, fr;
|
||||
fl = f;
|
||||
*x = xr;
|
||||
tol = *x;
|
||||
f = Fctcos(tol, aa, bb, cc, dd, rr);
|
||||
if (f == 0.) return ier;
|
||||
fr = f;
|
||||
|
||||
// Error return in case of wrong input data
|
||||
if (fl*fr >= 0.) {
|
||||
ier = 2;
|
||||
return ier;
|
||||
}
|
||||
|
||||
// Basic assumption fl*fr less than 0 is satisfied.
|
||||
// Generate tolerance for function values.
|
||||
G4int i = 0;
|
||||
G4double tolf = 100.*eps;
|
||||
|
||||
// Start iteration loop
|
||||
label4:
|
||||
i++;
|
||||
|
||||
// Start bisection loop
|
||||
for (G4int k = 1; k <= iend; k++) {
|
||||
*x = 0.5*(xl + xr);
|
||||
tol = *x;
|
||||
f = Fctcos(tol, aa, bb, cc, dd, rr);
|
||||
if (f == 0.) return 0;
|
||||
if (f*fr < 0.) { // Interchange xl and xr in order to get the
|
||||
tol = xl; // same Sign in f and fr
|
||||
xl = xr;
|
||||
xr = tol;
|
||||
tol = fl;
|
||||
fl = fr;
|
||||
fr = tol;
|
||||
}
|
||||
tol = f - fl;
|
||||
G4double a = f*tol;
|
||||
a = a + a;
|
||||
if (a < fr*(fr - fl) && i <= iend) goto label17;
|
||||
xr = *x;
|
||||
fr = f;
|
||||
|
||||
// Test on satisfactory accuracy in bisection loop
|
||||
tol = eps;
|
||||
a = std::abs(xr);
|
||||
if (a > 1.) tol = tol*a;
|
||||
if (std::abs(xr - xl) <= tol && std::abs(fr - fl) <= tolf) goto label14;
|
||||
}
|
||||
// End of bisection loop
|
||||
|
||||
// No convergence after iend iteration steps followed by iend
|
||||
// successive steps of bisection or steadily increasing function
|
||||
// values at right bounds. Error return.
|
||||
ier = 1;
|
||||
|
||||
label14:
|
||||
if (std::abs(fr) > std::abs(fl)) {
|
||||
*x = xl;
|
||||
f = fl;
|
||||
}
|
||||
return ier;
|
||||
|
||||
// Computation of iterated x-value by inverse parabolic interp
|
||||
label17:
|
||||
G4double a = fr - f;
|
||||
G4double dx = (*x - xl)*fl*(1. + f*(a - tol)/(a*(fr - fl)))/tol;
|
||||
G4double xm = *x;
|
||||
G4double fm = f;
|
||||
*x = xl - dx;
|
||||
tol = *x;
|
||||
f = Fctcos(tol, aa, bb, cc, dd, rr);
|
||||
if (f == 0.) return ier;
|
||||
|
||||
// Test on satisfactory accuracy in iteration loop
|
||||
tol = eps;
|
||||
a = std::abs(*x);
|
||||
if (a > 1) tol = tol*a;
|
||||
if (std::abs(dx) <= tol && std::abs(f) <= tolf) return ier;
|
||||
|
||||
// Preparation of next bisection loop
|
||||
if (f*fl < 0.) {
|
||||
xr = *x;
|
||||
fr = f;
|
||||
}
|
||||
else {
|
||||
xl = *x;
|
||||
fl = f;
|
||||
xr = xm;
|
||||
fr = fm;
|
||||
}
|
||||
goto label4;
|
||||
}
|
||||
|
||||
|
||||
// Test function for root-finder
|
||||
|
||||
G4double
|
||||
G4LElasticB::Fctcos(G4double t,
|
||||
G4double aa, G4double bb, G4double cc, G4double dd,
|
||||
G4double rr)
|
||||
{
|
||||
const G4double expxl = -82.;
|
||||
const G4double expxu = 82.;
|
||||
|
||||
G4double test1 = -bb*t;
|
||||
if (test1 > expxu) test1 = expxu;
|
||||
if (test1 < expxl) test1 = expxl;
|
||||
|
||||
G4double test2 = -dd*t;
|
||||
if (test2 > expxu) test2 = expxu;
|
||||
if (test2 < expxl) test2 = expxl;
|
||||
|
||||
return aa*std::exp(test1) + cc*std::exp(test2) - rr;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
G4LElasticB::Defs1(G4double p, G4double px, G4double py, G4double pz,
|
||||
G4double pxinc, G4double pyinc, G4double pzinc,
|
||||
G4double* pxnew, G4double* pynew, G4double* pznew)
|
||||
{
|
||||
// Transform scattered particle to reflect direction of incident particle
|
||||
G4double pt2 = pxinc*pxinc + pyinc*pyinc;
|
||||
if (pt2 > 0.) {
|
||||
G4double cost = pzinc/p;
|
||||
G4double sint1 = std::sqrt(std::abs((1. - cost )*(1.+cost)));
|
||||
G4double sint2 = std::sqrt(pt2)/p;
|
||||
G4double sint = 0.5*(sint1 + sint2);
|
||||
G4double ph = pi*0.5;
|
||||
if (pyinc < 0.) ph = pi*1.5;
|
||||
if (std::abs(pxinc) > 1.e-6) ph = std::atan2(pyinc, pxinc);
|
||||
G4double cosp = std::cos(ph);
|
||||
G4double sinp = std::sin(ph);
|
||||
if (verboseLevel > 1) {
|
||||
G4cout << "cost sint " << cost << " " << sint << G4endl;
|
||||
G4cout << "cosp sinp " << cosp << " " << sinp << G4endl;
|
||||
}
|
||||
*pxnew = cost*cosp*px - sinp*py + sint*cosp*pz;
|
||||
*pynew = cost*sinp*px + cosp*py + sint*sinp*pz;
|
||||
*pznew = -sint*px +cost*pz;
|
||||
}
|
||||
else {
|
||||
G4double cost=pzinc/p;
|
||||
*pxnew = cost*px;
|
||||
*pynew = py;
|
||||
*pznew = cost*pz;
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LFission.cc,v 1.12 2005/06/04 13:38:34 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
//
|
||||
// G4 Model: Low Energy Fission
|
||||
|
||||
Reference in New Issue
Block a user