Import Geant4 8.2.0 source tree
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ElectroNuclearReaction.hh,v 1.23 2006/06/29 20:07:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4ElectroNuclearReaction -- header file
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4GammaNuclearReaction.hh,v 1.13 2006/06/29 20:07:48 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4GammaNuclearReaction -- header file
|
||||
|
||||
+13
-3
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QANuMuNuclearCrossSection.hh,v 1.5 2006/06/29 20:07:58 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QANuMuNuclearCrossSection.hh,v 1.6 2006/12/01 10:57:46 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4QANuMuNuclearCrossSection -- header file
|
||||
@@ -62,9 +62,12 @@ public:
|
||||
|
||||
G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=-14);
|
||||
|
||||
// At present momentum (pMom) must be in GeV (@@ Units)
|
||||
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG=0);
|
||||
|
||||
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z,
|
||||
G4int N, G4double Momentum);
|
||||
|
||||
G4int GetExchangePDGCode();
|
||||
|
||||
G4double GetDirectPart(G4double Q2);
|
||||
@@ -94,6 +97,13 @@ private:
|
||||
static G4double* lastEN; // Pointer to the last array of the energy axis
|
||||
static G4double* lastTX; // Pointer to the last array of the total CS function
|
||||
static G4double* lastQE; // Pointer to the last array of the QE CS function
|
||||
static G4int lastPDG; // The last projectile PDG
|
||||
static G4int lastN; // The last N of calculated nucleus
|
||||
static G4int lastZ; // The last Z of calculated nucleus
|
||||
static G4double lastP; // Last used in the cross section Momentum
|
||||
static G4double lastTH; // Last value of the Momentum Threshold
|
||||
static G4double lastCS; // Last value of the Cross Section
|
||||
static G4int lastI; // The last position in the DAMDB
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QAtomicElectronScattering.hh,v 1.2 2006/12/13 15:45:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QAtomicElectronScattering header ----------------
|
||||
// by Mikhail Kossov, December 2003.
|
||||
// Header of G4QAtomicElectronScattering class (mu-,pi-,K-) of the CHIPS Simulation Branch in GEANT4
|
||||
// -------------------------------------------------------------------------------
|
||||
// This is a unique CHIPS class for the Nuclear Capture At Rest Prosesses.
|
||||
// -------------------------------------------------------------------------------
|
||||
// At present (Dec.04) only pi+/-, K+/- proton, neutron, antiproton and antineutron
|
||||
// collisions with protons are implemented, which are fundamental for the in matter
|
||||
// simulation of hadronic reactions. The interactions of the same particles with
|
||||
// nuclei are planned only. The collisions of nuclei with nuclei are possible...
|
||||
// The simulation is based on the G4QuasmonString class, which extends the CHIPS model
|
||||
// to the highest energyes, implementing the Quasmon string with the
|
||||
// String->Quasmons->Hadrons scenario of the quark-gluon string fragmentation
|
||||
// --> CHIPS is a SU(3) event generator, so it does not include reactions with the
|
||||
// heavy (c,b,t), which can be simulated only by the SU(6) QUIPS (QUark Invariant
|
||||
// Phase Space) model which is an expantion of the CHIPS.-December 2003.M.Kossov.-
|
||||
// -------------------------------------------------------------------------------
|
||||
// Algorithms: the interactions in CHIPS are described by the quark exchange (QE) process.
|
||||
// The first step is the low energy quark exchange. If as a result of the QE one or
|
||||
// both secondary hadrons are below the pi0 threshold (roughly) they are pushed to the
|
||||
// Ground State (GS) value(s). The excited (above the pi0 production threshold) hadronic
|
||||
// state is considered as a Quasmon, which is filled in the G4QuasmonVector of the
|
||||
// G4QuasmonString class. On the second step all G4Quasmons are decayed by the
|
||||
// G4Quasmon class and fiill the G4QHadronVector output. If the exchange quark is too far
|
||||
// in the rapidity space (a parameter of the G4QuasmonString class) from any of the quarks
|
||||
// of the other hadron it creates a string with the nearest in the rapidity space quark.
|
||||
// This string is converted into a Quasmon. This forces the coalescence of the residuals
|
||||
// in the another Quasmon, while the possibility exist to create more residual Quasmons
|
||||
// instead of one - one per each target-quark+projectile-antiquark(diquark) pair. This
|
||||
// possibility is tuned by the Drell-Yan pair production process. If the target (or
|
||||
// pojectile) are nuclei, then the Quasmons are created not only in vacuum, where they
|
||||
// can be fragmented by the G4Quasmon class, but in nuclear matter of the residual target
|
||||
// (or projectile). If the Quasmons are crated in nuclear matter, they are fragmented by
|
||||
// the G4QEnvironment class with the subsequent Quark Exchange nuclear fragmentation.
|
||||
// This is the planned scenario.- December 2004.Mikhail Kossov.-
|
||||
// --------------------------------------------------------------------------------
|
||||
// ****************************************************************************************
|
||||
// ********* This HEADER is temporary moved from the photolepton_hadron directory *********
|
||||
// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
|
||||
// ****************************************************************************************
|
||||
|
||||
#ifndef G4QAtomicElectronScattering_hh
|
||||
#define G4QAtomicElectronScattering_hh
|
||||
|
||||
// GEANT4 Headers
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4VDiscreteProcess.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4NucleiPropertiesTable.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4LorentzVector.hh"
|
||||
|
||||
// CHIPS Headers
|
||||
#include "G4QEnvironment.hh"
|
||||
#include "G4VQCrossSection.hh"
|
||||
#include "G4QIsotope.hh"
|
||||
#include "G4QElectronNuclearCrossSection.hh"
|
||||
#include "G4QPhotonNuclearCrossSection.hh"
|
||||
#include "G4QMuonNuclearCrossSection.hh"
|
||||
#include "G4QTauNuclearCrossSection.hh"
|
||||
#include "G4QuasmonString.hh"
|
||||
#include "G4QPDGToG4Particle.hh"
|
||||
//<vector> is included in G4QIsotope.hh
|
||||
//#include <vector>
|
||||
|
||||
class G4QAtomicElectronScattering : public G4VDiscreteProcess
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
G4QAtomicElectronScattering(const G4String& processName ="CHIPSNuclearCollision");
|
||||
|
||||
// Destructor
|
||||
~G4QAtomicElectronScattering();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition& particle);
|
||||
|
||||
G4double GetMeanFreePath(const G4Track& aTrack, G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
// It returns the MeanFreePath of the process for the current track :
|
||||
// (energy, material)
|
||||
// The previousStepSize and G4ForceCondition* are not used.
|
||||
// This function overloads a virtual function of the base class.
|
||||
// It is invoked by the ProcessManager of the Particle.
|
||||
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
|
||||
// It computes the final state of the process (at end of step),
|
||||
// returned as a ParticleChange object.
|
||||
// This function overloads a virtual function of the base class.
|
||||
// It is invoked by the ProcessManager of the Particle.
|
||||
|
||||
|
||||
G4LorentzVector GetEnegryMomentumConservation();
|
||||
|
||||
G4int GetNumberOfNeutronsInTarget();
|
||||
|
||||
// Static functions
|
||||
static void SetManual();
|
||||
static void SetStandard();
|
||||
static void SetParameters(G4double temper=180., G4double ssin2g=.1, G4double etaetap=.3,
|
||||
G4double fN=0., G4double fD=0., G4double cP=1., G4double mR=1.,
|
||||
G4int npCHIPSWorld=234, G4double solAn=.5, G4bool efFlag=false,
|
||||
G4double piTh=141.4,G4double mpi2=20000.,G4double dinum=1880.);
|
||||
|
||||
private:
|
||||
|
||||
// Hide assignment operator as private
|
||||
G4QAtomicElectronScattering& operator=(const G4QAtomicElectronScattering &right);
|
||||
|
||||
// Copy constructor
|
||||
G4QAtomicElectronScattering(const G4QAtomicElectronScattering&);
|
||||
|
||||
// BODY
|
||||
// Static Parameters
|
||||
static G4bool manualFlag; // If false then standard parameters are used
|
||||
static G4int nPartCWorld; // The#of particles for hadronization (limit of A of fragm.)
|
||||
// -> Parameters of the G4Quasmon class:
|
||||
static G4double Temperature; // Quasmon Temperature
|
||||
static G4double SSin2Gluons; // Percent of ssbar sea in a constituen gluon
|
||||
static G4double EtaEtaprime; // Part of eta-prime in all etas
|
||||
// -> Parameters of the G4QNucleus class:
|
||||
static G4double freeNuc; // probability of the quasi-free baryon on surface
|
||||
static G4double freeDib; // probability of the quasi-free dibaryon on surface
|
||||
static G4double clustProb; // clusterization probability in dense region
|
||||
static G4double mediRatio; // relative vacuum hadronization probability
|
||||
// -> Parameters of the G4QEnvironment class:
|
||||
static G4bool EnergyFlux; // Flag for Energy Flux use instead of Multy Quasmon
|
||||
static G4double SolidAngle; // Part of Solid Angle to capture secondaries(@@A-dep)
|
||||
static G4double PiPrThresh; // Pion Production Threshold for gammas
|
||||
static G4double M2ShiftVir; // Shift for M2=-Q2=m_pi^2 of the virtual gamma
|
||||
static G4double DiNuclMass; // Double Nucleon Mass for virtual normalization
|
||||
//
|
||||
// Working parameters
|
||||
G4VQCrossSection* theCS;
|
||||
G4LorentzVector EnMomConservation; // Residual of Energy/Momentum Cons.
|
||||
G4int nOfNeutrons; // #of neutrons in the target nucleus
|
||||
|
||||
// Modifires for the reaction
|
||||
G4double Time; // Time shift of the capture reaction
|
||||
G4double EnergyDeposition; // Energy deposited in the reaction
|
||||
};
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QCaptureAtRest.hh,v 1.2 2006/06/29 20:08:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QCaptureAtRest header ----------------
|
||||
// by Mikhail Kossov, December 2003.
|
||||
|
||||
+8
-2
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QCollision.hh,v 1.6 2006/06/29 20:08:02 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QCollision.hh,v 1.7 2006/10/30 10:33:36 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QCollision header ----------------
|
||||
// by Mikhail Kossov, December 2003.
|
||||
@@ -127,9 +127,15 @@ public:
|
||||
// This function overloads a virtual function of the base class.
|
||||
// It is invoked by the ProcessManager of the Particle.
|
||||
|
||||
// Fake void functions
|
||||
void SetPhysicsTableBining(G4double, G4double, G4int) {;}
|
||||
void BuildPhysicsTable(const G4ParticleDefinition&) {;}
|
||||
void PrintInfoDefinition() {;}
|
||||
|
||||
// Internal Energy-Momentum Residual
|
||||
G4LorentzVector GetEnegryMomentumConservation();
|
||||
|
||||
// Number of neutrons in the target nucleus (primary)
|
||||
G4int GetNumberOfNeutronsInTarget();
|
||||
|
||||
// Static functions ---------------------------------------------------------------------
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QElastic.hh,v 1.2 2006/06/29 20:08:04 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QElastic header ----------------
|
||||
// by Mikhail Kossov, December 2003.
|
||||
|
||||
+26
-11
@@ -24,12 +24,12 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4QElasticCrossSection -- header file
|
||||
// M.V. Kossov, ITEP(Moscow), 24-OCT-01
|
||||
// The last update: M.V. Kossov, CERN/ITEP (Moscow) 25-Sept-03
|
||||
// The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Oct-2006
|
||||
//
|
||||
|
||||
#ifndef G4QElasticCrossSection_h
|
||||
@@ -61,10 +61,15 @@ public:
|
||||
|
||||
static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
|
||||
|
||||
// At present momentum (pMom) must be in GeV (@@ Units)
|
||||
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG=0);
|
||||
|
||||
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
|
||||
G4double pP);
|
||||
|
||||
G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2
|
||||
G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
|
||||
G4double GetHMaxT(); // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
|
||||
|
||||
private:
|
||||
G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
|
||||
@@ -82,15 +87,23 @@ private:
|
||||
// ---- Local (for particular pP, pPDG, tZ, tN) -----
|
||||
static G4bool onlyCS; // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
|
||||
static G4double lastSIG; // Last calculated cross section
|
||||
static G4double lastLP; // Last log(mom_of_the_incident_hadron)
|
||||
static G4double lastLP; // Last log(mom_of_the_incident_hadron in GeV)
|
||||
static G4double lastTM; // Last t_maximum
|
||||
static G4double theSS; // The Last squared slope of first difruction
|
||||
static G4double theS1; // The Last mantissa of first difruction
|
||||
static G4double theB1; // The Last slope of first difruction
|
||||
static G4double theS2; // The Last mantissa of second difruction
|
||||
static G4double theB2; // The Last slope of second difruction
|
||||
static G4double theS3; // The Last mantissa of third difruction
|
||||
static G4double theB3; // The Last slope of third difruction
|
||||
static G4int lastN; // The last N of calculated nucleus
|
||||
static G4int lastZ; // The last Z of calculated nucleus
|
||||
static G4double lastP; // Last used in the cross section Momentum
|
||||
static G4double lastTH; // Last value of the Momentum Threshold
|
||||
static G4double lastCS; // Last value of the Cross Section
|
||||
static G4int lastI; // The last position in the DAMDB
|
||||
static G4double theSS; // The Last squared slope of first diffruction
|
||||
static G4double theS1; // The Last mantissa of first diffruction
|
||||
static G4double theB1; // The Last slope of first diffruction
|
||||
static G4double theS2; // The Last mantissa of second diffruction
|
||||
static G4double theB2; // The Last slope of second diffruction
|
||||
static G4double theS3; // The Last mantissa of third diffruction
|
||||
static G4double theB3; // The Last slope of third diffruction
|
||||
static G4double theS4; // The Last mantissa of 4-th diffruction
|
||||
static G4double theB4; // The Last slope of 4-th diffruction
|
||||
// ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
|
||||
static G4int lastPDG; // Last PDG code of the projectile
|
||||
static G4int lastTZ; // Last atomic number of the target
|
||||
@@ -105,5 +118,7 @@ private:
|
||||
static G4double* lastB2T; // E-dep of the slope of theSecond difruction
|
||||
static G4double* lastS3T; // E-dep of mantissa of the third difruction
|
||||
static G4double* lastB3T; // E-dep of the slope of the third difruction
|
||||
static G4double* lastS4T; // E-dep of mantissa of the 4-th difruction
|
||||
static G4double* lastB4T; // E-dep of the slope of the 4-th difruction
|
||||
};
|
||||
#endif
|
||||
|
||||
+12
-1
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4QElectronNuclearCrossSection -- header file
|
||||
@@ -61,6 +61,10 @@ public:
|
||||
|
||||
G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=11);
|
||||
|
||||
// At present momentum (pMom) must be in GeV (@@ Units)
|
||||
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG=0);
|
||||
|
||||
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N,
|
||||
G4double Momentum);
|
||||
|
||||
@@ -93,6 +97,13 @@ private:
|
||||
static G4double* lastJ1; // Pointer to the last array of the J1 function
|
||||
static G4double* lastJ2; // Pointer to the last array of the J2 function
|
||||
static G4double* lastJ3; // Pointer to the last array of the J3 function
|
||||
static G4int lastPDG; // The last projectile PDG
|
||||
static G4int lastN; // The last N of calculated nucleus
|
||||
static G4int lastZ; // The last Z of calculated nucleus
|
||||
static G4double lastP; // Last used in the cross section Momentum
|
||||
static G4double lastTH; // Last value of the Momentum Threshold
|
||||
static G4double lastCS; // Last value of the Cross Section
|
||||
static G4int lastI; // The last position in the DAMDB
|
||||
};
|
||||
|
||||
inline G4double G4QElectronNuclearCrossSection::DFun(G4double x)//PhotoNucCSParametrization
|
||||
|
||||
+161
@@ -0,0 +1,161 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QGluonString.hh,v 1.1 2006/10/30 10:33:38 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QGluonString header ----------------
|
||||
// by Mikhail Kossov, October 2006.
|
||||
// Header of G4QGluonString (N,pi,K,aN,Hyperons,aHyp) of CHIPS Simulation Branch
|
||||
// -------------------------------------------------------------------------------
|
||||
// -->> At present (17.10.2006) started only with proton-nuclear reactions <<--
|
||||
// -------------------------------------------------------------------------------
|
||||
// This is a QGS CHIPS class for the Hadron-Nuclear Inelastic Interaction Prosesses
|
||||
// -------------------------------------------------------------------------------
|
||||
// This class follows the structure of the G4QCollision class and its content can be
|
||||
// eventually moved to G4QCollision class. At present the alternative realisation of
|
||||
// the hadronic inelastic process (G4QGluonString) is kept for comparison with other
|
||||
// G4QCollision algorithms. It can be attached as an inelastic process to all hadrons
|
||||
// --------------------------------------------------------------------------------
|
||||
// ****************************************************************************************
|
||||
// ***** This HEADER is a property of the CHIPS hadronic package in Geant4 (M. Kosov) *****
|
||||
// *********** DO NOT MAKE ANY CHANGE without approval of Mikhail.Kossov@cern.ch **********
|
||||
// ****************************************************************************************
|
||||
|
||||
#ifndef G4QGluonString_hh
|
||||
#define G4QGluonString_hh
|
||||
|
||||
// GEANT4 Headers
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4VDiscreteProcess.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4NucleiPropertiesTable.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4LorentzVector.hh"
|
||||
|
||||
// CHIPS Headers
|
||||
#include "G4QEnvironment.hh"
|
||||
#include "G4VQCrossSection.hh"
|
||||
#include "G4QIsotope.hh"
|
||||
#include "G4QProtonNuclearCrossSection.hh"
|
||||
#include "G4QPDGToG4Particle.hh"
|
||||
#include <vector>
|
||||
|
||||
class G4QGluonString : public G4VDiscreteProcess
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
G4QGluonString(const G4String& processName ="CHIPS_QGS_Inelastic");
|
||||
|
||||
// Destructor
|
||||
~G4QGluonString();
|
||||
|
||||
G4bool IsApplicable(const G4ParticleDefinition& particle);
|
||||
|
||||
G4double GetMeanFreePath(const G4Track& aTrack, G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
// It returns the MeanFreePath of the process for the current track :
|
||||
// (energy, material)
|
||||
// The previousStepSize and G4ForceCondition* are not used.
|
||||
// This function overloads a virtual function of the base class.
|
||||
// It is invoked by the ProcessManager of the Particle.
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
|
||||
// It computes the final state of the process (at end of step),
|
||||
// returned as a ParticleChange object.
|
||||
// This function overloads a virtual function of the base class.
|
||||
// It is invoked by the ProcessManager of the Particle.
|
||||
|
||||
// Fake void functions
|
||||
void SetPhysicsTableBining(G4double, G4double, G4int) {;}
|
||||
void BuildPhysicsTable(const G4ParticleDefinition&) {;}
|
||||
void PrintInfoDefinition() {;}
|
||||
|
||||
// Internal Energy-Momentum Residual
|
||||
G4LorentzVector GetEnegryMomentumConservation();
|
||||
|
||||
// Number of neutrons in the target nucleus (primary)
|
||||
G4int GetNumberOfNeutronsInTarget();
|
||||
|
||||
// Static functions ---------------------------------------------------------------------
|
||||
static void SetManual();
|
||||
static void SetStandard();
|
||||
static void SetParameters(G4double temper=180., G4double ssin2g=.1, G4double etaetap=.3,
|
||||
G4double fN=0., G4double fD=0., G4double cP=1., G4double mR=1.,
|
||||
G4int npCHIPSWorld=234, G4double solAn=.5, G4bool efFlag=false,
|
||||
G4double piTh=141.4,G4double mpi2=20000.,G4double dinum=1880.);
|
||||
//--- End of static member functions ----------------------------------------------------
|
||||
|
||||
private:
|
||||
|
||||
// Hide assignment operator as private
|
||||
G4QGluonString& operator=(const G4QGluonString &right);
|
||||
|
||||
// Copy constructor
|
||||
G4QGluonString(const G4QGluonString&);
|
||||
|
||||
// BODY
|
||||
// Static Parameters --------------------------------------------------------------------
|
||||
static G4bool manualFlag; // If false then standard parameters are used
|
||||
static G4int nPartCWorld; // The#of particles for hadronization (limit of A of fragm.)
|
||||
// -> Parameters of the G4Quasmon class:
|
||||
static G4double Temperature; // Quasmon Temperature
|
||||
static G4double SSin2Gluons; // Percent of ssbar sea in a constituen gluon
|
||||
static G4double EtaEtaprime; // Part of eta-prime in all etas
|
||||
// -> Parameters of the G4QNucleus class:
|
||||
static G4double freeNuc; // probability of the quasi-free baryon on surface
|
||||
static G4double freeDib; // probability of the quasi-free dibaryon on surface
|
||||
static G4double clustProb; // clusterization probability in dense region
|
||||
static G4double mediRatio; // relative vacuum hadronization probability
|
||||
// -> Parameters of the G4QEnvironment class:
|
||||
static G4bool EnergyFlux; // Flag for Energy Flux use instead of Multy Quasmon
|
||||
static G4double SolidAngle; // Part of Solid Angle to capture secondaries(@@A-dep)
|
||||
static G4double PiPrThresh; // Pion Production Threshold for gammas
|
||||
static G4double M2ShiftVir; // Shift for M2=-Q2=m_pi^2 of the virtual gamma
|
||||
static G4double DiNuclMass; // Double Nucleon Mass for virtual normalization
|
||||
//--------------------------------- End of static parameters ---------------------------
|
||||
// Working parameters
|
||||
G4VQCrossSection* theCS;
|
||||
G4LorentzVector EnMomConservation; // Residual of Energy/Momentum Cons.
|
||||
G4int nOfNeutrons; // #of neutrons in the target nucleus
|
||||
|
||||
// Modifires for the reaction
|
||||
G4double Time; // Time shift of the capture reaction
|
||||
G4double EnergyDeposition; // Energy deposited in the reaction
|
||||
static std::vector <G4int> ElementZ; // Z of the element(i) in theLastCalc
|
||||
static std::vector <G4double> ElProbInMat; // SumProbabilityElements in Material
|
||||
static std::vector <std::vector<G4int>*> ElIsoN; // N of isotope(j) of Element(i)
|
||||
static std::vector <std::vector<G4double>*> IsoProbInEl;// SumProbabIsotopes in Element i
|
||||
};
|
||||
#endif
|
||||
|
||||
+13
-2
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QMuonNuclearCrossSection.hh,v 1.4 2006/06/29 20:08:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QMuonNuclearCrossSection.hh,v 1.5 2006/12/01 10:57:46 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4QMuonNuclearCrossSection -- header file
|
||||
@@ -65,6 +65,10 @@ public:
|
||||
|
||||
G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=13);
|
||||
|
||||
// At present momentum (pMom) must be in GeV (@@ Units)
|
||||
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG=0);
|
||||
|
||||
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N,
|
||||
G4double Momentum);
|
||||
|
||||
@@ -97,6 +101,13 @@ private:
|
||||
static G4double* lastJ1; // Pointer to the last array of the J1 function
|
||||
static G4double* lastJ2; // Pointer to the last array of the J2 function
|
||||
static G4double* lastJ3; // Pointer to the last array of the J3 function
|
||||
static G4int lastPDG; // The last projectile PDG
|
||||
static G4int lastN; // The last N of calculated nucleus
|
||||
static G4int lastZ; // The last Z of calculated nucleus
|
||||
static G4double lastP; // Last used in the cross section Momentum
|
||||
static G4double lastTH; // Last value of the Momentum Threshold
|
||||
static G4double lastCS; // Last value of the Cross Section
|
||||
static G4int lastI; // The last position in the DAMDB
|
||||
};
|
||||
|
||||
inline G4double G4QMuonNuclearCrossSection::DFun(G4double x)// Parametrization of PhotNucCS
|
||||
|
||||
+13
-2
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QNuMuNuclearCrossSection.hh,v 1.5 2006/06/29 20:08:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QNuMuNuclearCrossSection.hh,v 1.6 2006/12/01 10:57:46 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4QNuMuNuclearCrossSection -- header file
|
||||
@@ -62,6 +62,10 @@ public:
|
||||
|
||||
G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=14);
|
||||
|
||||
// At present momentum (pMom) must be in GeV (@@ Units)
|
||||
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG=0);
|
||||
|
||||
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z,
|
||||
G4int N, G4double Momentum);
|
||||
|
||||
@@ -94,6 +98,13 @@ private:
|
||||
static G4double* lastEN; // Pointer to the last array of the energy axis
|
||||
static G4double* lastTX; // Pointer to the last array of the total CS function
|
||||
static G4double* lastQE; // Pointer to the last array of the QE CS function
|
||||
static G4int lastPDG; // The last projectile PDG
|
||||
static G4int lastN; // The last N of calculated nucleus
|
||||
static G4int lastZ; // The last Z of calculated nucleus
|
||||
static G4double lastP; // Last used in the cross section Momentum
|
||||
static G4double lastTH; // Last value of the Momentum Threshold
|
||||
static G4double lastCS; // Last value of the Cross Section
|
||||
static G4int lastI; // The last position in the DAMDB
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+14
-3
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4QPhotonNuclearCrossSection -- header file
|
||||
@@ -57,8 +57,12 @@ public:
|
||||
|
||||
static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
|
||||
|
||||
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z,
|
||||
G4int N, G4double Momentum);
|
||||
// At present momentum (pMom) must be in GeV (@@ Units)
|
||||
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG=0);
|
||||
|
||||
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N,
|
||||
G4double Momentum);
|
||||
|
||||
G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=22);
|
||||
|
||||
@@ -73,6 +77,13 @@ private:
|
||||
static G4double* lastHEN; // Pointer to the last array of HEn cross sections
|
||||
static G4double lastE; // Last used in the cross section Energy
|
||||
static G4double lastSP; // Last value of the ShadowingPomeron (A-dependent)
|
||||
static G4int lastPDG; // The last projectile PDG
|
||||
static G4int lastN; // The last N of calculated nucleus
|
||||
static G4int lastZ; // The last Z of calculated nucleus
|
||||
static G4double lastP; // Last used in the cross section Momentum
|
||||
static G4double lastTH; // Last value of the Momentum Threshold
|
||||
static G4double lastCS; // Last value of the Cross Section
|
||||
static G4int lastI; // The last position in the DAMDB
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+12
-1
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4QProtonNuclearCrossSection -- header file
|
||||
@@ -57,6 +57,10 @@ public:
|
||||
|
||||
static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
|
||||
|
||||
// At present momentum (pMom) must be in GeV (@@ Units)
|
||||
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG=0);
|
||||
|
||||
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z,
|
||||
G4int N, G4double Momentum);
|
||||
|
||||
@@ -70,6 +74,13 @@ private:
|
||||
static G4double* lastHEN; // Pointer to the last array of HighEnergy cross sections
|
||||
static G4double lastE; // Last used in the cross section Energy
|
||||
static G4double lastSP; // Last value of the ShadowingPomeron (A-dependent)
|
||||
static G4int lastPDG; // The last projectile PDG
|
||||
static G4int lastN; // The last N of calculated nucleus
|
||||
static G4int lastZ; // The last Z of calculated nucleus
|
||||
static G4double lastP; // Last used in the cross section Momentum
|
||||
static G4double lastTH; // Last value of the Momentum Threshold
|
||||
static G4double lastCS; // Last value of the Cross Section
|
||||
static G4int lastI; // The last position in the DAMDB
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4QStringChipsParticleLevelInterface_h
|
||||
#define G4QStringChipsParticleLevelInterface_h
|
||||
|
||||
#include "G4VIntraNuclearTransportModel.hh"
|
||||
#include "G4ChiralInvariantPhaseSpace.hh"
|
||||
|
||||
class G4QStringChipsParticleLevelInterface : public G4VIntraNuclearTransportModel
|
||||
{
|
||||
public:
|
||||
G4QStringChipsParticleLevelInterface();
|
||||
virtual G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
|
||||
G4Nucleus& theNucleus);
|
||||
|
||||
virtual G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries,
|
||||
G4V3DNucleus* theNucleus);
|
||||
private:
|
||||
|
||||
G4ChiralInvariantPhaseSpace theModel;
|
||||
G4double theEnergyLossPerFermi;
|
||||
|
||||
G4double theInnerCoreDensityCut;
|
||||
|
||||
G4double fractionOfSingleQuasiFreeNucleons;
|
||||
G4double fractionOfPairedQuasiFreeNucleons;
|
||||
G4double clusteringCoefficient;
|
||||
G4double temperature;
|
||||
G4double halfTheStrangenessOfSee;
|
||||
G4double etaToEtaPrime;
|
||||
G4double fusionToExchange;
|
||||
G4int nop;
|
||||
};
|
||||
#endif
|
||||
+13
-2
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QTauNuclearCrossSection.hh,v 1.4 2006/06/29 20:08:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QTauNuclearCrossSection.hh,v 1.5 2006/12/01 10:57:46 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 physics class: G4QTauNuclearCrossSection -- header file
|
||||
@@ -65,6 +65,10 @@ public:
|
||||
|
||||
G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=15);
|
||||
|
||||
// At present momentum (pMom) must be in GeV (@@ Units)
|
||||
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG=0);
|
||||
|
||||
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N,
|
||||
G4double Momentum);
|
||||
|
||||
@@ -97,6 +101,13 @@ private:
|
||||
static G4double* lastJ1; // Pointer to the last array of the J1 function
|
||||
static G4double* lastJ2; // Pointer to the last array of the J2 function
|
||||
static G4double* lastJ3; // Pointer to the last array of the J3 function
|
||||
static G4int lastPDG; // The last projectile PDG
|
||||
static G4int lastN; // The last N of calculated nucleus
|
||||
static G4int lastZ; // The last Z of calculated nucleus
|
||||
static G4double lastP; // Last used in the cross section Momentum
|
||||
static G4double lastTH; // Last value of the Momentum Threshold
|
||||
static G4double lastCS; // Last value of the Cross Section
|
||||
static G4int lastI; // The last position in the DAMDB
|
||||
};
|
||||
|
||||
inline G4double G4QTauNuclearCrossSection::DFun(G4double x)// Parametrization of PhotNucCS
|
||||
|
||||
+42
@@ -29,6 +29,9 @@
|
||||
#include "G4VIntraNuclearTransportModel.hh"
|
||||
#include "G4ChiralInvariantPhaseSpace.hh"
|
||||
|
||||
// Open this if you wish histogramming of the impact parameter issue
|
||||
//#define hdebug_SCPLI
|
||||
|
||||
class G4StringChipsParticleLevelInterface : public G4VIntraNuclearTransportModel
|
||||
{
|
||||
public:
|
||||
@@ -53,5 +56,44 @@ class G4StringChipsParticleLevelInterface : public G4VIntraNuclearTransportModel
|
||||
G4double etaToEtaPrime;
|
||||
G4double fusionToExchange;
|
||||
G4int nop;
|
||||
|
||||
#ifdef hdebug_SCPLI
|
||||
//Static variables for histogramming
|
||||
static const G4int nbh;
|
||||
static G4double bhmax;
|
||||
static G4double bhdb;
|
||||
static G4double ehmax;
|
||||
static G4double ehde;
|
||||
static G4double toth;
|
||||
static G4int bover;
|
||||
static G4int eover;
|
||||
static G4int* bhis;
|
||||
static G4int* ehis;
|
||||
public:
|
||||
//Static functions
|
||||
static void Reset()
|
||||
{
|
||||
bhdb=bhmax/nbh;
|
||||
ehde=bhmax/nbh;
|
||||
toth=0.;
|
||||
bover=0;
|
||||
eover=0;
|
||||
for(G4int i=0; i<nbh; i++)
|
||||
{
|
||||
bhis[i]=0;
|
||||
ehis[i]=0;
|
||||
}
|
||||
}
|
||||
static void SetMaxB(G4double mB) {bhmax=mB;}
|
||||
static void SetMaxE(G4double mE) {ehmax=mE;}
|
||||
static G4int GetB(G4int i){return bhis[i];}
|
||||
static G4int GetE(G4int i){return ehis[i];}
|
||||
static G4double GetTot() {return toth;}
|
||||
static G4int GetNbn() {return nbh;}
|
||||
static G4double GetDB() {return bhdb;}
|
||||
static G4double GetDE() {return ehde;}
|
||||
static G4int GetBov() {return bover;}
|
||||
static G4int GetEov() {return eover;}
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
+8
-15
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VQCrossSection.hh,v 1.6 2006/06/29 20:08:24 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4VQCrossSection.hh,v 1.8 2006/12/09 14:33:35 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// GEANT4 virtual class: G4VQCrossSection -- header file
|
||||
@@ -92,12 +92,12 @@ protected:
|
||||
public:
|
||||
virtual ~G4VQCrossSection() {;}// for each particle separate instance of G4QXCrossSection
|
||||
//@@ can be improved in future)// should be used and inside a separate istance of CS's
|
||||
// Set the new tolerance (abs(p_old/p_new-1)<tolerance)
|
||||
static void setTolerance(G4double tol){tolerance=tol;}// Set NewTolerance for SameCrosSec
|
||||
|
||||
// At present momentum (pMom) must be in GeV (@@ Units)
|
||||
virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG=0);
|
||||
|
||||
static void setTolerance(G4double tol); // Set NewTolerance for TheSameCroSec
|
||||
virtual G4double GetCrossSection(G4bool, G4double, G4int, G4int, G4int pPDG=0)
|
||||
{return G4double(pPDG);}
|
||||
|
||||
virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0); // Gives 0 by default
|
||||
|
||||
@@ -119,6 +119,8 @@ public:
|
||||
|
||||
virtual G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // -t=Q2 for hadronic
|
||||
|
||||
virtual G4double GetHMaxT(); // max(-t=Q2)/2 for hadronic (MeV^2)
|
||||
|
||||
virtual G4double GetExchangeQ2(G4double nu=0); // Q2 for lepto-nuclear reactions
|
||||
|
||||
virtual G4double GetVirtualFactor(G4double nu, G4double Q2); // ReductionFactor (leptA)
|
||||
@@ -167,16 +169,7 @@ protected:
|
||||
G4double LinearFit(G4double X, G4int N, G4double* XN, G4double* YN);
|
||||
|
||||
G4double EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double* Y);
|
||||
protected:
|
||||
static G4int lastPDG; // The last projectile PDG
|
||||
static G4int lastN; // The last N of calculated nucleus
|
||||
static G4int lastZ; // The last Z of calculated nucleus
|
||||
static G4double lastP; // Last used in the cross section Momentum
|
||||
static G4double lastTH; // Last value of the Momentum Threshold
|
||||
static G4double lastCS; // Last value of the Cross Section
|
||||
static G4int lastI; // The last position in the DAMDB
|
||||
|
||||
private:
|
||||
static G4double tolerance;// relative tolerance in momentum to get old CroSec
|
||||
};
|
||||
|
||||
|
||||
+179
-2
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QANuMuNuclearCrossSection.cc,v 1.8 2006/06/29 20:08:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QANuMuNuclearCrossSection.cc,v 1.9 2006/12/01 10:57:46 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4QANuMuNuclearCrossSection for gamma+A cross sections
|
||||
@@ -56,6 +56,13 @@ G4double G4QANuMuNuclearCrossSection::lastE=0.; //Last used in cross section T
|
||||
G4double* G4QANuMuNuclearCrossSection::lastEN=0; //Pointer to the Energy Scale of TX & QE
|
||||
G4double* G4QANuMuNuclearCrossSection::lastTX=0; //Pointer to the LastArray of TX function
|
||||
G4double* G4QANuMuNuclearCrossSection::lastQE=0; //Pointer to the LastArray of QE function
|
||||
G4int G4QANuMuNuclearCrossSection::lastPDG=0; // The last PDG code of the projectile
|
||||
G4int G4QANuMuNuclearCrossSection::lastN=0; // The last N of calculated nucleus
|
||||
G4int G4QANuMuNuclearCrossSection::lastZ=0; // The last Z of calculated nucleus
|
||||
G4double G4QANuMuNuclearCrossSection::lastP=0.; // Last used in cross section Momentum
|
||||
G4double G4QANuMuNuclearCrossSection::lastTH=0.; // Last threshold momentum
|
||||
G4double G4QANuMuNuclearCrossSection::lastCS=0.; // Last value of the Cross Section
|
||||
G4int G4QANuMuNuclearCrossSection::lastI=0; // The last position in the DAMDB
|
||||
|
||||
// Returns Pointer to the G4VQCrossSection class
|
||||
G4VQCrossSection* G4QANuMuNuclearCrossSection::GetPointer()
|
||||
@@ -64,6 +71,176 @@ G4VQCrossSection* G4QANuMuNuclearCrossSection::GetPointer()
|
||||
return &theCrossSection;
|
||||
}
|
||||
|
||||
// The main member function giving the collision cross section (P is in IU, CS is in mb)
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4QANuMuNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
|
||||
G4int tgZ, G4int tgN, G4int pPDG)
|
||||
{
|
||||
static G4int j; // A#0f records found in DB for this projectile
|
||||
static std::vector <G4int> colPDG;// Vector of the projectile PDG code
|
||||
static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
|
||||
static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
|
||||
static std::vector <G4double> colP; // Vector of last momenta for the reaction
|
||||
static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
|
||||
static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
G4double pEn=pMom;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS:>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
|
||||
<<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
|
||||
<<colN.size()<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pPDG!=-14)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // projectile PDG=0 is a mistake (?!) @@
|
||||
}
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
|
||||
{
|
||||
in = false; // By default the isotope haven't be found in AMDB
|
||||
lastP = 0.; // New momentum history (nothing to compare with)
|
||||
lastPDG = pPDG; // The last PDG of the projectile
|
||||
lastN = tgN; // The last N of the calculated nucleus
|
||||
lastZ = tgZ; // The last Z of the calculated nucleus
|
||||
lastI = colN.size(); // Size of the Associative Memory DB in the heap
|
||||
j = 0; // A#0f records found in DB for this projectile
|
||||
if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
|
||||
{ // The nucleus with projPDG is found in AMDB
|
||||
if(colN[i]==tgN && colZ[i]==tgZ)
|
||||
{
|
||||
lastI=i;
|
||||
lastTH =colTH[i]; // Last THreshold (A-dependent)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS:*Found*P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",X=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Energy is below the Threshold value
|
||||
}
|
||||
lastP =colP [i]; // Last Momentum (A-dependent)
|
||||
lastCS =colCS[i]; // Last CrossSect (A-dependent)
|
||||
if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
in = true; // This is the case when the isotop is found in DB
|
||||
// Momentum pMom is in IU ! @@ Units
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::G:UpdaDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // read & update
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(lastCS<=0. && pEn>lastTH) // Correct the threshold
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
break; // Go out of the LOOP
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"---G4QAMNCrossSec::GetCrosSec:pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
|
||||
<<",Z["<<i<<"]="<<colZ[i]<<",cPDG="<<colPDG[i]<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
j++; // Increment a#0f records found in DB for this pPDG
|
||||
}
|
||||
if(!in) // This nucleus has not been calculated previously
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lstI="<<lastI<<G4endl;
|
||||
#endif
|
||||
//!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
|
||||
lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
|
||||
if(lastCS<=0.)
|
||||
{
|
||||
lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
|
||||
#endif
|
||||
if(pEn>lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCrosSec:New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
colN.push_back(tgN);
|
||||
colZ.push_back(tgZ);
|
||||
colPDG.push_back(pPDG);
|
||||
colP.push_back(pMom);
|
||||
colTH.push_back(lastTH);
|
||||
colCS.push_back(lastCS);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS:1st,P="<<pMom<<"(MeV),X="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
} // End of creation of the new set of parameters
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
colP[lastI]=pMom;
|
||||
colPDG[lastI]=pPDG;
|
||||
colCS[lastI]=lastCS;
|
||||
}
|
||||
} // End of parameters udate
|
||||
else if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Momentum is below the Threshold Value -> CS=0
|
||||
}
|
||||
else if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCS:UpdaCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
|
||||
lastP=pMom;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAMNCS::GetCrSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
}
|
||||
|
||||
// Gives the threshold energy = the same for all nuclei (@@ can be reduced for hevy nuclei)
|
||||
G4double G4QANuMuNuclearCrossSection::ThresholdEnergy(G4int Z, G4int N, G4int)
|
||||
{
|
||||
|
||||
+616
@@ -0,0 +1,616 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QAtomicElectronScattering.cc,v 1.2 2006/12/13 15:45:19 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QAtomicElectronScattering class -----------------
|
||||
// by Mikhail Kossov, December 2003.
|
||||
// G4QAtomicElectronScattering class of the CHIPS Simulation Branch in GEANT4
|
||||
// ---------------------------------------------------------------
|
||||
// ****************************************************************************************
|
||||
// ********** This CLASS is temporary moved from the photolepton_hadron directory *********
|
||||
// ****************************************************************************************
|
||||
|
||||
//#define debug
|
||||
//#define pdebug
|
||||
|
||||
#include "G4QAtomicElectronScattering.hh"
|
||||
|
||||
G4QAtomicElectronScattering::G4QAtomicElectronScattering(const G4String& processName):
|
||||
G4VDiscreteProcess(processName)
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomicElectronScattering::Constructor is called"<<G4endl;
|
||||
#endif
|
||||
if (verboseLevel>0) G4cout << GetProcessName() << " process is created "<< G4endl;
|
||||
|
||||
G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World with 234 particles
|
||||
G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // Clusterization param's
|
||||
G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime); // Hadronic parameters
|
||||
G4QEnvironment::SetParameters(SolidAngle); // SolAngle of pbar-A secondary mesons capture
|
||||
//@@ Initialize here the G4QuasmonString parameters
|
||||
}
|
||||
|
||||
G4bool G4QAtomicElectronScattering::manualFlag=false; // If false:use standard parameters
|
||||
G4double G4QAtomicElectronScattering::Temperature=180.; // Critical Temperature (High Ener)
|
||||
G4double G4QAtomicElectronScattering::SSin2Gluons=0.3; // Supression of s-quarks (to u&d)
|
||||
G4double G4QAtomicElectronScattering::EtaEtaprime=0.3; // Supression of eta(gg->qq/3g->qq)
|
||||
G4double G4QAtomicElectronScattering::freeNuc=0.5; // % of free nucleons on a surface
|
||||
G4double G4QAtomicElectronScattering::freeDib=0.05; // % of free diBaryons on a surface
|
||||
G4double G4QAtomicElectronScattering::clustProb=5.; // Nuclear clusterization parameter
|
||||
G4double G4QAtomicElectronScattering::mediRatio=10.; // medium/vacuum hadronizationRatio
|
||||
G4int G4QAtomicElectronScattering::nPartCWorld=152; // #of particles in the CHIPS World
|
||||
G4double G4QAtomicElectronScattering::SolidAngle=0.5; // A part of Solid Angle to capture
|
||||
G4bool G4QAtomicElectronScattering::EnergyFlux=false; // Flag to use EnergyFlux or MultyQ
|
||||
G4double G4QAtomicElectronScattering::PiPrThresh=141.4; // PiProductionThreshold for gammas
|
||||
G4double G4QAtomicElectronScattering::M2ShiftVir=20000.;// M2=-Q2=m_pi^2 shift of virtGamma
|
||||
G4double G4QAtomicElectronScattering::DiNuclMass=1880.; // Double Nucleon Mass for VirtNorm
|
||||
|
||||
void G4QAtomicElectronScattering::SetManual() {manualFlag=true;}
|
||||
void G4QAtomicElectronScattering::SetStandard() {manualFlag=false;}
|
||||
|
||||
// Fill the private parameters
|
||||
void G4QAtomicElectronScattering::SetParameters(G4double temper, G4double ssin2g, G4double etaetap,
|
||||
G4double fN, G4double fD, G4double cP, G4double mR,
|
||||
G4int nParCW, G4double solAn, G4bool efFlag,
|
||||
G4double piThresh, G4double mpisq, G4double dinum)
|
||||
{// =============================================================================
|
||||
Temperature=temper;
|
||||
SSin2Gluons=ssin2g;
|
||||
EtaEtaprime=etaetap;
|
||||
freeNuc=fN;
|
||||
freeDib=fD;
|
||||
clustProb=cP;
|
||||
mediRatio=mR;
|
||||
nPartCWorld = nParCW;
|
||||
EnergyFlux=efFlag;
|
||||
SolidAngle=solAn;
|
||||
PiPrThresh=piThresh;
|
||||
M2ShiftVir=mpisq;
|
||||
DiNuclMass=dinum;
|
||||
G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World with 234 particles
|
||||
G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // Clusterization param's
|
||||
G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime); // Hadronic parameters
|
||||
G4QEnvironment::SetParameters(SolidAngle); // SolAngle of pbar-A secondary mesons capture
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
||||
G4QAtomicElectronScattering::~G4QAtomicElectronScattering() {}
|
||||
|
||||
|
||||
G4LorentzVector G4QAtomicElectronScattering::GetEnegryMomentumConservation()
|
||||
{
|
||||
return EnMomConservation;
|
||||
}
|
||||
|
||||
G4int G4QAtomicElectronScattering::GetNumberOfNeutronsInTarget()
|
||||
{
|
||||
return nOfNeutrons;
|
||||
}
|
||||
|
||||
G4double G4QAtomicElectronScattering::GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double,G4ForceCondition* Fc)
|
||||
{
|
||||
*Fc = NotForced;
|
||||
const G4DynamicParticle* incidentParticle = aTrack.GetDynamicParticle();
|
||||
G4ParticleDefinition* incidentParticleDefinition=incidentParticle->GetDefinition();
|
||||
if( !IsApplicable(*incidentParticleDefinition))
|
||||
G4cout<<"-Wa-G4QAtElScat::GetMeanFreePath called for not implemented particle"<<G4endl;
|
||||
// Calculate the mean Cross Section for the set of Elements(*Isotopes) in the Material
|
||||
G4double Momentum = incidentParticle->GetTotalMomentum(); // 3-momentum of the Particle
|
||||
const G4Material* material = aTrack.GetMaterial(); // Get the current material
|
||||
const G4double* NOfNucPerVolume = material->GetVecNbOfAtomsPerVolume();
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
G4int nE=material->GetNumberOfElements();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElectScattering::GetMeanFreePath:"<<nE<<" Elem's in theMaterial"<<G4endl;
|
||||
#endif
|
||||
G4bool leptoNuc=false; // By default the reaction is not lepto-nuclear
|
||||
G4VQCrossSection* CSmanager=G4QElectronNuclearCrossSection::GetPointer();
|
||||
if(incidentParticleDefinition == G4Electron::Electron())
|
||||
{
|
||||
CSmanager=G4QElectronNuclearCrossSection::GetPointer();
|
||||
leptoNuc=true;
|
||||
}
|
||||
else G4cout<<"G4QAtomEScattering::GetMeanFreePath:Particle isn't known in CHIPS"<<G4endl;
|
||||
|
||||
G4QIsotope* Isotopes = G4QIsotope::Get(); // Pointer to the G4QIsotopes singelton
|
||||
G4double sigma=0.;
|
||||
for(G4int i=0; i<nE; ++i)
|
||||
{
|
||||
G4int Z = static_cast<G4int>((*theElementVector)[i]->GetZ()); // Z of the Element
|
||||
std::vector<std::pair<G4int,G4double>*>* cs= Isotopes->GetCSVector(Z); // Pointer to CS
|
||||
G4int nIs=cs->size(); // A#Of Isotopes in the Element
|
||||
if(nIs) for(G4int j=0; j<nIs; j++) // Calculate CS for eachIsotope of El
|
||||
{
|
||||
std::pair<G4int,G4double>* curIs=(*cs)[j]; // A pointer, which is used twice
|
||||
G4int N=curIs->first; // #ofNeuterons in the isotope
|
||||
curIs->second = CSmanager->GetCrossSection(true,Momentum,Z,N,13); // CS calculation
|
||||
} // End of temporary initialization of the cross sections in the G4QIsotope singeltone
|
||||
sigma+=Isotopes->GetMeanCrossSection(Z)*NOfNucPerVolume[i]; // SUM(MeanCS*NOFNperV)
|
||||
} // End of LOOP over Elements
|
||||
|
||||
// Check that cross section is not zero and return the mean free path
|
||||
if(sigma > 0.) return 1./sigma; // Mean path [distance]
|
||||
return DBL_MAX;
|
||||
}
|
||||
|
||||
|
||||
G4bool G4QAtomicElectronScattering::IsApplicable(const G4ParticleDefinition& particle)
|
||||
{
|
||||
if (particle == *( G4MuonPlus::MuonPlus() )) return true;
|
||||
else if (particle == *( G4MuonMinus::MuonMinus() )) return true;
|
||||
else if (particle == *( G4TauPlus::TauPlus() )) return true;
|
||||
else if (particle == *( G4TauMinus::TauMinus() )) return true;
|
||||
else if (particle == *( G4Electron::Electron() )) return true;
|
||||
else if (particle == *( G4Positron::Positron() )) return true;
|
||||
else if (particle == *( G4Gamma::Gamma() )) return true;
|
||||
else if (particle == *( G4Proton::Proton() )) return true;
|
||||
//else if (particle == *( G4Neutron::Neutron() )) return true;
|
||||
//else if (particle == *( G4PionMinus::PionMinus() )) return true;
|
||||
//else if (particle == *( G4PionPlus::PionPlus() )) return true;
|
||||
//else if (particle == *( G4KaonPlus::KaonPlus() )) return true;
|
||||
//else if (particle == *( G4KaonMinus::KaonMinus() )) return true;
|
||||
//else if (particle == *( G4KaonZeroLong::KaonZeroLong() )) return true;
|
||||
//else if (particle == *(G4KaonZeroShort::KaonZeroShort())) return true;
|
||||
//else if (particle == *( G4Lambda::Lambda() )) return true;
|
||||
//else if (particle == *( G4SigmaPlus::SigmaPlus() )) return true;
|
||||
//else if (particle == *( G4SigmaMinus::SigmaMinus() )) return true;
|
||||
//else if (particle == *( G4SigmaZero::SigmaZero() )) return true;
|
||||
//else if (particle == *( G4XiMinus::XiMinus() )) return true;
|
||||
//else if (particle == *( G4XiZero::XiZero() )) return true;
|
||||
//else if (particle == *( G4OmegaMinus::OmegaMinus() )) return true;
|
||||
//else if (particle == *( G4AntiNeutron::AntiNeutron() )) return true;
|
||||
//else if (particle == *( G4AntiProton::AntiProton() )) return true;
|
||||
#ifdef debug
|
||||
G4cout<<"***G4QAtomElScattering::IsApplicable: PDG="<<particle.GetPDGEncoding()<<G4endl;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4QAtomicElectronScattering::PostStepDoIt(const G4Track& track,
|
||||
const G4Step& step)
|
||||
{
|
||||
static const G4double mu=G4MuonMinus::MuonMinus()->GetPDGMass(); // muon mass
|
||||
static const G4double mu2=mu*mu; // squared muon mass
|
||||
//static const G4double dpi=M_PI+M_PI; // 2*pi (for Phi distr.) ***changed to twopi***
|
||||
static const G4double mNeut= G4QPDGCode(2112).GetMass();
|
||||
static const G4double mProt= G4QPDGCode(2212).GetMass();
|
||||
static const G4double dM=mProt+mNeut; // doubled nucleon mass
|
||||
//static const G4double mPi0 = G4QPDGCode(111).GetMass();
|
||||
//static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0);
|
||||
//static const G4double mPi = G4QPDGCode(211).GetMass();
|
||||
//static const G4double mMu = G4QPDGCode(13).GetMass();
|
||||
//static const G4double mTau = G4QPDGCode(15).GetMass();
|
||||
//static const G4double mEl = G4QPDGCode(11).GetMass();
|
||||
//
|
||||
const G4DynamicParticle* projHadron = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particle=projHadron->GetDefinition();
|
||||
G4LorentzVector proj4M=projHadron->Get4Momentum();
|
||||
G4double momentum = projHadron->GetTotalMomentum(); // 3-momentum of the Particle
|
||||
G4double Momentum=proj4M.rho();
|
||||
if(std::fabs(Momentum-momentum)>.001) G4cerr<<"G4QAtElScat::PSDI P="<<Momentum<<"="
|
||||
<<momentum<<G4endl;
|
||||
#ifdef debug
|
||||
G4double mp=proj4M.m();
|
||||
G4cout<<"G4QAtomElScattering::PostStepDoIt called, P="<<Momentum<<"="<<momentum<<G4endl;
|
||||
#endif
|
||||
if (!IsApplicable(*particle)) // Check applicability
|
||||
{
|
||||
G4cerr<<"G4QAtomElectScat::PostStepDoIt:Only gam,e+,e-,mu+,mu-,t+,t-,p are implemented"
|
||||
<<G4endl;
|
||||
return 0;
|
||||
}
|
||||
const G4Material* material = track.GetMaterial(); // Get the current material
|
||||
G4int Z=0;
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
G4int i=0;
|
||||
G4double sum=0.;
|
||||
G4int nE=material->GetNumberOfElements();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElectronScat::PostStepDoIt: "<<nE<<" elements in the material."<<G4endl;
|
||||
#endif
|
||||
G4int projPDG=0; // PDG Code prototype for the captured hadron
|
||||
// Not all these particles are implemented yet (see Is Applicable)
|
||||
if (particle == G4MuonPlus::MuonPlus() ) projPDG= -13;
|
||||
else if (particle == G4MuonMinus::MuonMinus() ) projPDG= 13;
|
||||
else if (particle == G4Electron::Electron() ) projPDG= 11;
|
||||
else if (particle == G4Positron::Positron() ) projPDG= -11;
|
||||
else if (particle == G4Gamma::Gamma() ) projPDG= 22;
|
||||
else if (particle == G4Proton::Proton() ) projPDG= 2212;
|
||||
else if (particle == G4Neutron::Neutron() ) projPDG= 2112;
|
||||
else if (particle == G4PionMinus::PionMinus() ) projPDG= -211;
|
||||
else if (particle == G4PionPlus::PionPlus() ) projPDG= 211;
|
||||
else if (particle == G4KaonPlus::KaonPlus() ) projPDG= 2112;
|
||||
else if (particle == G4KaonMinus::KaonMinus() ) projPDG= -321;
|
||||
else if (particle == G4KaonZeroLong::KaonZeroLong() ) projPDG= 130;
|
||||
else if (particle == G4KaonZeroShort::KaonZeroShort()) projPDG= 310;
|
||||
else if (particle == G4TauPlus::TauPlus() ) projPDG= -15;
|
||||
else if (particle == G4TauMinus::TauMinus() ) projPDG= 15;
|
||||
else if (particle == G4Lambda::Lambda() ) projPDG= 3122;
|
||||
else if (particle == G4SigmaPlus::SigmaPlus() ) projPDG= 3222;
|
||||
else if (particle == G4SigmaMinus::SigmaMinus() ) projPDG= 3112;
|
||||
else if (particle == G4SigmaZero::SigmaZero() ) projPDG= 3212;
|
||||
else if (particle == G4XiMinus::XiMinus() ) projPDG= 3312;
|
||||
else if (particle == G4XiZero::XiZero() ) projPDG= 3322;
|
||||
else if (particle == G4OmegaMinus::OmegaMinus() ) projPDG= 3334;
|
||||
else if (particle == G4AntiNeutron::AntiNeutron() ) projPDG=-2112;
|
||||
else if (particle == G4AntiProton::AntiProton() ) projPDG=-2212;
|
||||
#ifdef debug
|
||||
G4int prPDG=particle->GetPDGEncoding();
|
||||
G4cout<<"G4QAtomElScat::PostStepRestDoIt: projPDG="<<projPDG<<",stPDG="<<prPDG<<G4endl;
|
||||
#endif
|
||||
if(!projPDG)
|
||||
{
|
||||
G4cerr<<"-Warning-G4QAtomElScattering::PostStepDoIt:Undefined captured hadron"<<G4endl;
|
||||
return 0;
|
||||
}
|
||||
// @@ It's a standard randomization procedure, which can be placed in G4QMaterial class
|
||||
std::vector<G4double> sumfra;
|
||||
for(i=0; i<nE; ++i)
|
||||
{
|
||||
G4double frac=material->GetFractionVector()[i];
|
||||
sum+=frac;
|
||||
sumfra.push_back(sum); // remember the summation steps
|
||||
}
|
||||
G4double rnd = sum*G4UniformRand();
|
||||
for(i=0; i<nE; ++i) if (rnd<sumfra[i]) break;
|
||||
G4Element* pElement=(*theElementVector)[i];
|
||||
Z=static_cast<G4int>(pElement->GetZ());
|
||||
if(Z<=0)
|
||||
{
|
||||
G4cerr<<"-Warning-G4QAtomicElectronScattering::PostStepDoIt: Element's Z="<<Z<<G4endl;
|
||||
if(Z<0) return 0;
|
||||
}
|
||||
G4int N = Z;
|
||||
G4int isoSize=0; // The default for the isoVectorLength is 0
|
||||
G4IsotopeVector* isoVector=pElement->GetIsotopeVector();
|
||||
if(isoVector) isoSize=isoVector->size(); // Get real size of the isotopeVector if exists
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomicElectronScattering::PostStepDoIt: isovectorLength="<<isoSize<<G4endl;
|
||||
#endif
|
||||
if(isoSize) // The Element has not trivial abumdance set
|
||||
{
|
||||
// @@ the following solution is temporary till G4Element can contain the QIsotopIndex
|
||||
G4int curInd=G4QIsotope::Get()->GetLastIndex(Z);
|
||||
if(!curInd) // The new artificial element must be defined
|
||||
{
|
||||
std::vector<std::pair<G4int,G4double>*>* newAbund =
|
||||
new std::vector<std::pair<G4int,G4double>*>;
|
||||
G4double* abuVector=pElement->GetRelativeAbundanceVector();
|
||||
for(G4int j=0; j<isoSize; j++)
|
||||
{
|
||||
N=pElement->GetIsotope(j)->GetN()-Z;
|
||||
if(pElement->GetIsotope(j)->GetZ()!=Z) G4cerr<<"*G4QCaptureAtRest::AtRestDoIt: Z="
|
||||
<<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
|
||||
G4double abund=abuVector[j];
|
||||
std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElScat::PostStepDoIt:pair#="<<j<<", N="<<N<<",ab="<<abund<<G4endl;
|
||||
#endif
|
||||
newAbund->push_back(pr);
|
||||
}
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElectScat::PostStepDoIt:pairVectorLength="<<newAbund->size()<<G4endl;
|
||||
#endif
|
||||
curInd=G4QIsotope::Get()->InitElement(Z,1,newAbund);
|
||||
for(G4int k=0; k<isoSize; k++) delete (*newAbund)[k];
|
||||
delete newAbund;
|
||||
}
|
||||
// @@ ^^^^^^^^^^ End of the temporary solution ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
N = G4QIsotope::Get()->GetNeutrons(Z,curInd);
|
||||
}
|
||||
else N = G4QIsotope::Get()->GetNeutrons(Z);
|
||||
nOfNeutrons=N; // Remember it for energy-mom. check
|
||||
G4double dd=0.025;
|
||||
G4double am=Z+N;
|
||||
G4double sr=std::sqrt(am);
|
||||
G4double dsr=0.01*(sr+sr);
|
||||
if(dsr<dd)dsr=dd;
|
||||
if(manualFlag) G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // ManualP
|
||||
else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP ClustPars
|
||||
else if(projPDG==-211) G4QNucleus::SetParameters(.67-dsr,.32-dsr,5.,9.);//Pi- ClustPars
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElectScattering::PostStepDoIt: N="<<N<<" for element with Z="<<Z<<G4endl;
|
||||
#endif
|
||||
if(N<0)
|
||||
{
|
||||
G4cerr<<"---Warning---G4QAtomElectScat::PostStepDoIt:Element with N="<<N<< G4endl;
|
||||
return 0;
|
||||
}
|
||||
if(projPDG==11||projPDG==-11||projPDG==13||projPDG==-13||projPDG==15||projPDG==-15)
|
||||
{ // Lepto-nuclear case with the equivalent photon algorithm. @@InFuture + neutrino & QE
|
||||
G4double kinEnergy= projHadron->GetKineticEnergy();
|
||||
G4ParticleMomentum dir = projHadron->GetMomentumDirection();
|
||||
G4VQCrossSection* CSmanager=G4QElectronNuclearCrossSection::GetPointer();
|
||||
G4int aProjPDG=std::abs(projPDG);
|
||||
if(aProjPDG==13) CSmanager=G4QMuonNuclearCrossSection::GetPointer();
|
||||
if(aProjPDG==15) CSmanager=G4QTauNuclearCrossSection::GetPointer();
|
||||
G4double xSec=CSmanager->GetCrossSection(false,Momentum,Z,N,13);//Recalculate CrossSect
|
||||
// @@ check a possibility to separate p, n, or alpha (!)
|
||||
if(xSec <= 0.) // The cross-section iz 0 -> Do Nothing
|
||||
{
|
||||
//Do Nothing Action insead of the reaction
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
G4double photonEnergy = CSmanager->GetExchangeEnergy(); // Energy of EqivExchangePart
|
||||
if( kinEnergy < photonEnergy )
|
||||
{
|
||||
//Do Nothing Action insead of the reaction
|
||||
G4cerr<<"G4QAtomElectScat::PSDoIt: phE="<<photonEnergy<<">leptE="<<kinEnergy<<G4endl;
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
G4double photonQ2 = CSmanager->GetExchangeQ2(photonEnergy);// Q2(t) of EqivExchangePart
|
||||
G4double W=photonEnergy-photonQ2/dM;// HadronicEnergyFlow (W-energy) for virtual photon
|
||||
if(W<0.)
|
||||
{
|
||||
//Do Nothing Action insead of the reaction
|
||||
G4cout<<"G4QAtomElScat::PostStepDoIt:(lN) negative equivalent energy W="<<W<<G4endl;
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
// Update G4VParticleChange for the scattered muon
|
||||
G4VQCrossSection* thePhotonData=G4QPhotonNuclearCrossSection::GetPointer();
|
||||
G4double sigNu=thePhotonData->GetCrossSection(true,photonEnergy, Z, N);// Integrated CS
|
||||
G4double sigK =thePhotonData->GetCrossSection(true, W, Z, N); // Real CrosSect
|
||||
G4double rndFraction = CSmanager->GetVirtualFactor(photonEnergy, photonQ2);
|
||||
if(sigNu*G4UniformRand()>sigK*rndFraction)
|
||||
{
|
||||
//Do NothingToDo Action insead of the reaction
|
||||
G4cout<<"G4QAtomElectScat::PostStepDoIt: probability correction - DoNothing"<<G4endl;
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
G4double iniE=kinEnergy+mu; // Initial total energy of the muon
|
||||
G4double finE=iniE-photonEnergy; // Final total energy of the muon
|
||||
if(finE>0) aParticleChange.ProposeEnergy(finE) ;
|
||||
else
|
||||
{
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
}
|
||||
// Scatter the muon
|
||||
G4double EEm=iniE*finE-mu2; // Just an intermediate value to avoid "2*"
|
||||
G4double iniP=std::sqrt(iniE*iniE-mu2); // Initial momentum of the electron
|
||||
G4double finP=std::sqrt(finE*finE-mu2); // Final momentum of the electron
|
||||
G4double cost=(EEm+EEm-photonQ2)/iniP/finP; // cos(theta) for the electron scattering
|
||||
if(cost>1.) cost=1.; // To avoid the accuracy of calculation problem
|
||||
//else if(cost>1.001) // @@ error report can be done, but not necessary
|
||||
if(cost<-1.) cost=-1.; // To avoid the accuracy of calculation problem
|
||||
//else if(cost<-1.001) // @@ error report can be done, but not necessary
|
||||
// --- Example from electromagnetic physics --
|
||||
//G4ThreeVector newMuonDirection(dirx,diry,dirz);
|
||||
//newMuonDirection.rotateUz(dir);
|
||||
//aParticleChange.ProposeMomentumDirection(newMuonDirection1) ;
|
||||
// The scattering in respect to the derection of the incident muon is made impicitly:
|
||||
G4ThreeVector ort=dir.orthogonal(); // Not normed orthogonal vector (!) (to dir)
|
||||
G4ThreeVector ortx = ort.unit(); // First unit vector orthogonal to the direction
|
||||
G4ThreeVector orty = dir.cross(ortx);// Second unit vector orthoganal to the direction
|
||||
G4double sint=std::sqrt(1.-cost*cost); // Perpendicular component
|
||||
G4double phi=twopi*G4UniformRand(); // phi of scattered electron
|
||||
G4double sinx=sint*std::sin(phi); // x-component
|
||||
G4double siny=sint*std::cos(phi); // y-component
|
||||
G4ThreeVector findir=cost*dir+sinx*ortx+siny*orty;
|
||||
aParticleChange.ProposeMomentumDirection(findir); // new direction for the muon
|
||||
const G4ThreeVector photon3M=iniP*dir-finP*findir;
|
||||
projPDG=22;
|
||||
proj4M=G4LorentzVector(photon3M,photon3M.mag());
|
||||
}
|
||||
G4int targPDG=90000000+Z*1000+N; // PDG Code of the target nucleus
|
||||
G4QPDGCode targQPDG(targPDG);
|
||||
G4double tM=targQPDG.GetMass();
|
||||
EnMomConservation=proj4M+G4LorentzVector(0.,0.,0.,tM); // Total 4-mom of the reaction
|
||||
G4QHadronVector* output=new G4QHadronVector; // Prototype of the output G4QHadronVector
|
||||
// @@@@@@@@@@@@@@ Temporary for the testing purposes --- Begin
|
||||
//G4bool elF=false; // Flag of the ellastic scattering is "false" by default
|
||||
//G4double eWei=1.;
|
||||
// @@@@@@@@@@@@@@ Temporary for the testing purposes --- End
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElScat::PostStepDoIt: projPDG="<<projPDG<<", targPDG="<<targPDG<<G4endl;
|
||||
#endif
|
||||
G4QHadron* pH = new G4QHadron(projPDG,proj4M); // ---> DELETED -->-- -+
|
||||
if(momentum<1000.) // Condition for using G4QEnvironment (not G4QuasmonString) |
|
||||
{ // |
|
||||
G4QHadronVector projHV; // |
|
||||
projHV.push_back(pH); // DESTROYED over 2 lines -+ |
|
||||
G4QEnvironment* pan= new G4QEnvironment(projHV,targPDG);// ---> DELETED --->-----+ | |
|
||||
std::for_each(projHV.begin(), projHV.end(), DeleteQHadron()); // <---<------<----+-+-+
|
||||
projHV.clear(); // <------------<---------------<-------------------<------------+-+ .
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElectScat::PostStepDoIt: pPDG="<<projPDG<<", mp="<<mp<<G4endl;// | .
|
||||
#endif
|
||||
try // | .
|
||||
{ // | .
|
||||
delete output; // | .
|
||||
output = pan->Fragment();// DESTROYED in the end of the LOOP work space | .
|
||||
} // | .
|
||||
catch (G4QException& error)// | .
|
||||
{ // | .
|
||||
//#ifdef pdebug
|
||||
G4cerr<<"**G4QAtomElectScat::PostStepDoIt:G4QE Exception is catched"<<G4endl;//| .
|
||||
//#endif
|
||||
G4Exception("G4QAtomElScat::PostStepDoIt:","27",FatalException,"CHIPScrash");//| .
|
||||
} // | .
|
||||
delete pan; // Delete the Nuclear Environment <--<--+ .
|
||||
} // .
|
||||
else // Use G4QuasmonString .
|
||||
{ // ^
|
||||
G4QuasmonString* pan= new G4QuasmonString(pH,false,targPDG,false);//-> DELETED --+ |
|
||||
delete pH; // --------<-------+---+
|
||||
#ifdef debug
|
||||
G4double mp=G4QPDGCode(projPDG).GetMass(); // Mass of the projectile particle |
|
||||
G4cout<<"G4QAtomElectScat::PostStepDoIt: pPDG="<<projPDG<<", pM="<<mp<<G4endl; //|
|
||||
#endif
|
||||
//G4int tNH=0; // Prototype of the number of secondaries inOut|
|
||||
try // |
|
||||
{ // |
|
||||
delete output; // |
|
||||
output = pan->Fragment();// DESTROYED in the end of the LOOP work space |
|
||||
// @@@@@@@@@@@@@@ Temporary for the testing purposes --- Begin |
|
||||
//tNH=pan->GetNOfHadrons(); // For the test purposes of the String |
|
||||
//if(tNH==2) // At least 2 hadrons are in the Constr.Output |
|
||||
//{// |
|
||||
// elF=true; // Just put a flag for the ellastic Scattering |
|
||||
// delete output; // Delete a prototype of dummy G4QHadronVector |
|
||||
// output = pan->GetHadrons(); // DESTROYED in the end of the LOOP work space |
|
||||
//}// |
|
||||
//eWei=pan->GetWeight(); // Just an example for the weight of the event |
|
||||
#ifdef debug
|
||||
//G4cout<<"=====>>G4QAtomElScat::PostStepDoIt:elF="<<elF<<",n="<<tNH<<G4endl;//|
|
||||
#endif
|
||||
// @@@@@@@@@@@@@@ Temporary for the testing purposes --- End |
|
||||
} // |
|
||||
catch (G4QException& error)// |
|
||||
{ // |
|
||||
//#ifdef pdebug
|
||||
G4cerr<<"**G4QAtomElectScat::PostStepDoIt: GEN Exception is catched"<<G4endl;//|
|
||||
//#endif
|
||||
G4Exception("G4QAtomElSct::AtRestDoIt:","27",FatalException,"QString Excep");//|
|
||||
} // |
|
||||
delete pan; // Delete the Nuclear Environment ---<--+
|
||||
}
|
||||
aParticleChange.Initialize(track);
|
||||
G4double localtime = track.GetGlobalTime();
|
||||
G4ThreeVector position = track.GetPosition();
|
||||
G4TouchableHandle trTouchable = track.GetTouchableHandle();
|
||||
// ------------- From here the secondaries are filled -------------------------
|
||||
G4int tNH = output->size(); // A#of hadrons in the output
|
||||
aParticleChange.SetNumberOfSecondaries(tNH);
|
||||
// Now add nuclear fragments
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElectronScat::PostStepDoIt: "<<tNH<<" particles are generated"<<G4endl;
|
||||
#endif
|
||||
G4int nOut=output->size(); // Real length of the output @@ Temporary
|
||||
if(tNH==1) tNH=0; // @@ Temporary
|
||||
if(tNH==2&&2!=nOut) G4cout<<"--Warning--G4QAtomElScat::PostStepDoIt: 2 # "<<nOut<<G4endl;
|
||||
// Deal with ParticleChange final state interface to GEANT4 output of the process
|
||||
//if(tNH==2) for(i=0; i<tNH; i++) // @@ Temporary tNH==2 instead of just tNH
|
||||
if(tNH) for(i=0; i<tNH; i++) // @@ Temporary tNH==2 instead of just tNH
|
||||
{
|
||||
// Note that one still has to take care of Hypernuclei (with Lambda or Sigma inside)
|
||||
// Hypernucleus mass calculation and ion-table interface upgrade => work for Hisaya @@
|
||||
// The decau process for hypernuclei must be developed in GEANT4 (change CHIPS body)
|
||||
G4QHadron* hadr=output->operator[](i); // Pointer to the output hadron
|
||||
G4int PDGCode = hadr->GetPDGCode();
|
||||
G4int nFrag = hadr->GetNFragments();
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAtomElectScat::AtRestDoIt: H#"<<i<<",PDG="<<PDGCode<<",nF="<<nFrag<<G4endl;
|
||||
#endif
|
||||
if(nFrag) // Skip intermediate (decayed) hadrons
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElScat::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl;
|
||||
#endif
|
||||
delete hadr;
|
||||
continue;
|
||||
}
|
||||
G4DynamicParticle* theSec = new G4DynamicParticle;
|
||||
G4ParticleDefinition* theDefinition;
|
||||
if (PDGCode==90000001) theDefinition = G4Neutron::Neutron();
|
||||
else if(PDGCode==90001000) theDefinition = G4Proton::Proton();//While it can be in ions
|
||||
else if(PDGCode==91000000) theDefinition = G4Lambda::Lambda();
|
||||
else if(PDGCode==311 || PDGCode==-311)
|
||||
{
|
||||
if(G4UniformRand()>.5) theDefinition = G4KaonZeroLong::KaonZeroLong(); // K_L
|
||||
else theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
|
||||
}
|
||||
else if(PDGCode==91000999) theDefinition = G4SigmaPlus::SigmaPlus();
|
||||
else if(PDGCode==90999001) theDefinition = G4SigmaMinus::SigmaMinus();
|
||||
else if(PDGCode==91999000) theDefinition = G4XiMinus::XiMinus();
|
||||
else if(PDGCode==91999999) theDefinition = G4XiZero::XiZero();
|
||||
else if(PDGCode==92998999) theDefinition = G4OmegaMinus::OmegaMinus();
|
||||
else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
|
||||
{
|
||||
G4int aZ = hadr->GetCharge();
|
||||
G4int aA = hadr->GetBaryonNumber();
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAtomicElectronScattering::AtRestDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
|
||||
#endif
|
||||
theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,aA,0,aZ);
|
||||
}
|
||||
//else theDefinition = G4ParticleTable::GetParticleTable()->FindParticle(PDGCode);
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAtomElectScat::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl;
|
||||
#endif
|
||||
theDefinition = G4QPDGToG4Particle::Get()->GetParticleDefinition(PDGCode);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAtomElScat::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
|
||||
#endif
|
||||
}
|
||||
if(!theDefinition)
|
||||
{
|
||||
G4cout<<"---Warning---G4QAtomElScattering::PostStepDoIt: drop PDG="<<PDGCode<<G4endl;
|
||||
delete hadr;
|
||||
continue;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QAtomElScat::PostStepDoIt:Name="<<theDefinition->GetParticleName()<<G4endl;
|
||||
#endif
|
||||
theSec->SetDefinition(theDefinition);
|
||||
G4LorentzVector h4M=hadr->Get4Momentum();
|
||||
EnMomConservation-=h4M;
|
||||
#ifdef tdebug
|
||||
G4cout<<"G4QCollis::PSDI:"<<i<<","<<PDGCode<<h4M<<h4M.m()<<EnMomConservation<<G4endl;
|
||||
#endif
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomElectScat::PostStepDoIt:#"<<i<<",PDG="<<PDGCode<<",4M="<<h4M<<G4endl;
|
||||
#endif
|
||||
theSec->Set4Momentum(h4M); // ^
|
||||
delete hadr; // <-----<-----------<-------------<---------------------<---------<-----+
|
||||
#ifdef debug
|
||||
G4ThreeVector curD=theSec->GetMomentumDirection(); // ^
|
||||
G4double curM=theSec->GetMass(); // |
|
||||
G4double curE=theSec->GetKineticEnergy()+curM; // ^
|
||||
G4cout<<"G4QCollis::PSDoIt:p="<<curD<<curD.mag()<<",e="<<curE<<",m="<<curM<<G4endl;// |
|
||||
#endif
|
||||
G4Track* aNewTrack = new G4Track(theSec, localtime, position ); // ^
|
||||
aNewTrack->SetTouchableHandle(trTouchable); // |
|
||||
aParticleChange.AddSecondary( aNewTrack ); // |
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomicElectronScattering::PostStepDoIt:#"<<i<<" is done."<<G4endl; // |
|
||||
#endif
|
||||
} // |
|
||||
delete output; // instances of the G4QHadrons from the output are already deleted above +
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill); // Kill the absorbed particle
|
||||
//return &aParticleChange; // This is not enough (ClearILL)
|
||||
#ifdef debug
|
||||
G4cout<<"G4QAtomicElectronScattering::PostStepDoIt:****PostStepDoIt done****"<<G4endl;
|
||||
#endif
|
||||
return G4VDiscreteProcess::PostStepDoIt(track, step);
|
||||
}
|
||||
+58
-16
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QCaptureAtRest.cc,v 1.3 2006/06/29 20:08:28 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QCaptureAtRest.cc,v 1.7 2006/11/22 13:49:06 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QCaptureAtRest class -----------------
|
||||
// by Mikhail Kossov, December 2003.
|
||||
@@ -214,18 +214,22 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
G4cerr<<"---Worning---G4QCaptureAtRest::AtRestDoIt:Element with Z="<<Z<< G4endl;
|
||||
if(Z<0) return 0;
|
||||
}
|
||||
G4QIsotope* Isotopes = G4QIsotope::Get(); // Pointer to the G4QIsotopes singleton
|
||||
G4int N = Z;
|
||||
G4int isoSize=0; // The default for the isoVectorLength is 0
|
||||
G4int indEl=0; // Index of non-natural element or 0 (default)
|
||||
G4IsotopeVector* isoVector=pElement->GetIsotopeVector();
|
||||
if(isoVector) isoSize=isoVector->size(); // Get real size of the isotopeVector if exists
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt: isovectorLength="<<isoSize<<G4endl;
|
||||
#endif
|
||||
if(isoSize) // The Element has not trivial abumdance set
|
||||
if(isoSize) // The Element has not trivial abumdance set
|
||||
{
|
||||
// @@ the following solution is temporary till G4Element can contain the QIsotopIndex
|
||||
G4int curInd=G4QIsotope::Get()->GetLastIndex(Z);
|
||||
if(!curInd) // The new artificial element must be defined
|
||||
indEl=pElement->GetIndex()+1; // Index of the non-trivial element is an order
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCapAR::GetMFP: iE="<<indEl<<", def="<<Isotopes->IsDefined(Z,indEl)<<G4endl;
|
||||
#endif
|
||||
if(!Isotopes->IsDefined(Z,indEl)) // This index is not defined for this Z: define
|
||||
{
|
||||
std::vector<std::pair<G4int,G4double>*>* newAbund =
|
||||
new std::vector<std::pair<G4int,G4double>*>;
|
||||
@@ -245,14 +249,14 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt: pairVectorLength="<<newAbund->size()<<G4endl;
|
||||
#endif
|
||||
curInd=G4QIsotope::Get()->InitElement(Z,1,newAbund);
|
||||
indEl=Isotopes->InitElement(Z,indEl,newAbund); // redefinie newInd (if exists)
|
||||
for(G4int k=0; k<isoSize; k++) delete (*newAbund)[k];
|
||||
delete newAbund;
|
||||
}
|
||||
// @@ ^^^^^^^^^^ End of the temporary solution ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
N = G4QIsotope::Get()->GetNeutrons(Z,curInd);
|
||||
N = Isotopes->GetNeutrons(Z,indEl);
|
||||
}
|
||||
else N = G4QIsotope::Get()->GetNeutrons(Z);
|
||||
else N = Isotopes->GetNeutrons(Z);
|
||||
nOfNeutrons=N; // Remember it for energy-mom. check
|
||||
G4double dd=0.025;
|
||||
G4double am=Z+N;
|
||||
@@ -289,6 +293,13 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
#endif
|
||||
G4double localtime = track.GetGlobalTime();
|
||||
G4ThreeVector position = track.GetPosition();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt: t="<<localtime<<", p="<<position<<G4endl;
|
||||
#endif
|
||||
G4TouchableHandle trTouchable = track.GetTouchableHandle();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt: touch="<<trTouchable<<G4endl;
|
||||
#endif
|
||||
localtime += Time;
|
||||
std::vector<G4double>* cascE = new std::vector<G4double>;
|
||||
std::vector<G4Track*>* cascT = new std::vector<G4Track*>;
|
||||
@@ -310,12 +321,16 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
mAP=QPDGbase.GetNuclMass(Z-1,N+1,0); // M_GSCompoundNucleus-proton
|
||||
G4double mAA=1000000.; // Default (light nuclei) mass of the GSCompoundNucleus-alpha
|
||||
if(Z>=2 && N>=1) mAA=QPDGbase.GetNuclMass(Z-2,N-1,0); // mass of GSCompNucleus-alpha
|
||||
G4double eProt=mAR-mAP-mProt;
|
||||
if(mAR<mAN && eProt>0.)
|
||||
G4double eProt=mAR-mAP-mProt; // Possible kin Enrgy of residual proton
|
||||
if(mAR<mAN && eProt>0.) // Compound is impossible but ChEx's possible
|
||||
{
|
||||
G4double eNeut=totNE-mNeut;
|
||||
if(eNeut<0.) eNeut=0.;
|
||||
if(totNE-mNeut<.0001) chargExElastic=true; // neutron is too soft -> chargeExchange
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt: n-Capture isn't possible mC="<<mAR<<" < mGS="
|
||||
<<mAN<<", Ep="<<eProt<<G4endl;
|
||||
#endif
|
||||
G4double eNeut=totNE-mNeut; // Kinetic energy of the projectile neutron
|
||||
if(eNeut<0.) eNeut=0.; // This is just an accuracy correction
|
||||
if(eNeut<.0001) chargExElastic=true; // neutron is too soft -> charge Exchange
|
||||
else
|
||||
{
|
||||
G4double probP=std::sqrt(eProt*(dmProt+eProt));
|
||||
@@ -324,10 +339,24 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
else chargExElastic=true; // proton's phase space is bigger -> chargeExchange
|
||||
}
|
||||
}
|
||||
else if(mAR<mAN||(mAR<mAP+mProt&&mAR<mAA+mAlph)) neutronElastic=true; // nElaScattering
|
||||
else if(mAR<=mAN||(mAR<=mAP+mProt&&mAR<=mAA+mAlph)) // Impossible to radiate n or Alpha
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt: n-Capture only elastic is possible"<<G4endl;
|
||||
#endif
|
||||
neutronElastic=true; // nElaScattering
|
||||
}
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt: n-Capture El="<<neutronElastic<<", Ex="
|
||||
<<chargExElastic<<G4endl;
|
||||
#endif
|
||||
}
|
||||
G4int nuPDG=14; // Prototype for weak decay
|
||||
if(projPDG==15) nuPDG=16;
|
||||
#ifdef debug
|
||||
G4int CV=0;
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt:DecayIf is reached CV="<<CV<<G4endl;
|
||||
#endif
|
||||
if(projPDG==2112 && neutronElastic) // Elastic scattering of low energy neutron
|
||||
{
|
||||
#ifdef debug
|
||||
@@ -345,8 +374,12 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
output->push_back(secnuc); // Fill recoil nucleus to the output
|
||||
G4QHadron* neutron = new G4QHadron(2112,n4Mom); // Create Hadron for the Neutron
|
||||
output->push_back(neutron); // Fill the neutron to the output
|
||||
#ifdef debug
|
||||
CV=27;
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt:ElasN="<<n4Mom<<",A="<<a4Mom<<",CV="<<CV<<G4endl;
|
||||
#endif
|
||||
}
|
||||
if(projPDG==2112 && chargExElastic) // ChargeEx from neutron to proton: (n,p) reac
|
||||
else if(projPDG==2112 && chargExElastic) // ChargeEx from neutron to proton: (n,p) reac
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt:npChEx, 4M="<<proj4M<<",Z="<<Z<<",N="<<N<<G4endl;
|
||||
@@ -364,6 +397,10 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
output->push_back(secnuc); // Fill recharged nucleus to the output
|
||||
G4QHadron* proton = new G4QHadron(2212,p4Mom); // Create Hadron for the Proton
|
||||
output->push_back(proton) ; // Fill the proton to the output
|
||||
#ifdef debug
|
||||
CV=21;
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt:ChExP="<<p4Mom<<",A="<<a4Mom<<",CV="<<CV<<G4endl;
|
||||
#endif
|
||||
}
|
||||
else if(projPDG==-211 && targPDG==90001000)// Use Panofsky Ratio for (p+pi-) system decay
|
||||
{ // (p+pi-=>n+pi0)/p+pi-=>n+gamma) = 3/2
|
||||
@@ -549,6 +586,7 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
else theSec = new G4DynamicParticle(G4Gamma::Gamma(),RndmDir(),-ener);
|
||||
projLV-=theSec->Get4Momentum();
|
||||
G4Track* aNewTrack = new G4Track(theSec, localtime, position );
|
||||
aNewTrack->SetTouchableHandle(trTouchable);
|
||||
cascT->push_back(aNewTrack);
|
||||
}
|
||||
}
|
||||
@@ -581,6 +619,9 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
G4Exception("G4QCaptureAtRest::AtRestDoIt:","27",FatalException,"Gen.CHIPS Except.");
|
||||
} // |
|
||||
delete pan; // Delete the Nuclear Environment <--<--+
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt: CHIPS fragmentation is done, CV="<<CV<<G4endl;
|
||||
#endif
|
||||
}
|
||||
aParticleChange.Initialize(track);
|
||||
G4int tNH = output->size(); // A#of hadrons in the output without EM Cascade
|
||||
@@ -680,6 +721,7 @@ G4VParticleChange* G4QCaptureAtRest::AtRestDoIt(const G4Track& track, const G4St
|
||||
G4cout<<"G4QCapAtRest::AtRDoIt:p="<<curD<<curD.mag()<<",e="<<curE<<",m="<<curM<<G4endl;
|
||||
#endif
|
||||
G4Track* aNewTrack = new G4Track(theSec, localtime, position );
|
||||
aNewTrack->SetTouchableHandle(trTouchable);
|
||||
aParticleChange.AddSecondary( aNewTrack );
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCaptureAtRest::AtRestDoIt:#"<<i<<" is done."<<G4endl;
|
||||
|
||||
+216
-67
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QCollision.cc,v 1.11 2006/06/29 20:08:30 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QCollision.cc,v 1.16 2006/11/22 13:49:06 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QCollision class -----------------
|
||||
// by Mikhail Kossov, December 2003.
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
//#define debug
|
||||
//#define pdebug
|
||||
//#define ppdebug
|
||||
|
||||
#include "G4QCollision.hh"
|
||||
|
||||
@@ -127,13 +128,25 @@ G4int G4QCollision::GetNumberOfNeutronsInTarget()
|
||||
// ********** All CHIPS cross sections are calculated in the surface units ************
|
||||
G4double G4QCollision::GetMeanFreePath(const G4Track& aTrack,G4double,G4ForceCondition* Fc)
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::GetMeanFreePath: Called Fc="<<*Fc<<G4endl;
|
||||
#endif
|
||||
*Fc = NotForced;
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::GetMeanFreePath: Before GetDynPart"<<G4endl;
|
||||
#endif
|
||||
const G4DynamicParticle* incidentParticle = aTrack.GetDynamicParticle();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::GetMeanFreePath: Before GetDef"<<G4endl;
|
||||
#endif
|
||||
G4ParticleDefinition* incidentParticleDefinition=incidentParticle->GetDefinition();
|
||||
if( !IsApplicable(*incidentParticleDefinition))
|
||||
G4cout<<"-W-G4QCollision::GetMeanFreePath called for not implemented particle"<<G4endl;
|
||||
// Calculate the mean Cross Section for the set of Elements(*Isotopes) in the Material
|
||||
G4double Momentum = incidentParticle->GetTotalMomentum(); // 3-momentum of the Particle
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollis::GetMeanFreePath: BeforeGetMaterial"<<G4endl;
|
||||
#endif
|
||||
const G4Material* material = aTrack.GetMaterial(); // Get the current material
|
||||
const G4double* NOfNucPerVolume = material->GetVecNbOfAtomsPerVolume();
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
@@ -219,7 +232,7 @@ G4double G4QCollision::GetMeanFreePath(const G4Track& aTrack,G4double,G4ForceCon
|
||||
#endif
|
||||
if(isoSize) // The Element has non-trivial abumdance set
|
||||
{
|
||||
indEl=pElement->GetIndex(); // Index of the non-trivial element
|
||||
indEl=pElement->GetIndex()+1; // Index of the non-trivial element
|
||||
if(!Isotopes->IsDefined(Z,indEl)) // This index is not defined for this Z: define
|
||||
{
|
||||
std::vector<std::pair<G4int,G4double>*>* newAbund =
|
||||
@@ -233,7 +246,7 @@ G4double G4QCollision::GetMeanFreePath(const G4Track& aTrack,G4double,G4ForceCon
|
||||
G4double abund=abuVector[j];
|
||||
std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::PostStepDoIt:pair#="<<j<<", N="<<N<<",ab="<<abund<<G4endl;
|
||||
G4cout<<"G4QCollision::GetMeanFreePath: p#="<<j<<",N="<<N<<",ab="<<abund<<G4endl;
|
||||
#endif
|
||||
newAbund->push_back(pr);
|
||||
}
|
||||
@@ -258,6 +271,9 @@ G4double G4QCollision::GetMeanFreePath(const G4Track& aTrack,G4double,G4ForceCon
|
||||
G4int N=curIs->first; // #of Neuterons in the isotope j of El i
|
||||
IsN->push_back(N); // Remember Min N for the Element
|
||||
G4double CSI=CSmanager->GetCrossSection(true,Momentum,Z,N,pPDG);//CS(j,i) for isotope
|
||||
#ifdef debug
|
||||
G4cout<<"GQC::GMF:X="<<CSI<<",M="<<Momentum<<",Z="<<Z<<",N="<<N<<",P="<<pPDG<<G4endl;
|
||||
#endif
|
||||
curIs->second = CSI;
|
||||
susi+=CSI; // Make a sum per isotopes
|
||||
SPI->push_back(susi); // Remember summed cross-section
|
||||
@@ -265,9 +281,12 @@ G4double G4QCollision::GetMeanFreePath(const G4Track& aTrack,G4double,G4ForceCon
|
||||
sigma+=Isotopes->GetMeanCrossSection(Z,indEl)*NOfNucPerVolume[i];//SUM(MeanCS*NOfNperV)
|
||||
ElProbInMat.push_back(sigma);
|
||||
} // End of LOOP over Elements
|
||||
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCol::GetMeanFrPa: S="<<sigma<<",e="<<photNucBias<<",w="<<weakNucBias<<G4endl;
|
||||
#endif
|
||||
// Check that cross section is not zero and return the mean free path
|
||||
if(photNucBias!=1.) if(incidentParticleDefinition == G4MuonPlus::MuonPlus() ||
|
||||
if(photNucBias!=1.) if(incidentParticleDefinition == G4Gamma::Gamma() ||
|
||||
incidentParticleDefinition == G4MuonPlus::MuonPlus() ||
|
||||
incidentParticleDefinition == G4MuonMinus::MuonMinus() ||
|
||||
incidentParticleDefinition == G4Electron::Electron() ||
|
||||
incidentParticleDefinition == G4Positron::Positron() ||
|
||||
@@ -322,8 +341,12 @@ G4bool G4QCollision::IsApplicable(const G4ParticleDefinition& particle)
|
||||
|
||||
G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step& step)
|
||||
{
|
||||
static const G4double me=G4Electron::Electron()->GetPDGMass(); // electron mass
|
||||
static const G4double me2=me*me; // squared electron mass
|
||||
static const G4double mu=G4MuonMinus::MuonMinus()->GetPDGMass(); // muon mass
|
||||
static const G4double mu2=mu*mu; // squared muon mass
|
||||
static const G4double mt=G4TauMinus::TauMinus()->GetPDGMass(); // tau mass
|
||||
static const G4double mt2=mt*mt; // squared tau mass
|
||||
//static const G4double dpi=M_PI+M_PI; // 2*pi (for Phi distr.) ***changed to twopi***
|
||||
static const G4double mNeut= G4QPDGCode(2112).GetMass();
|
||||
static const G4double mNeut2= mNeut*mNeut;
|
||||
@@ -340,19 +363,18 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
static const G4double dM=mProt+mNeut; // doubled nucleon mass
|
||||
static const G4double mudM=mu2/dM; // for x limit
|
||||
static const G4double hdM=dM/2.; // M of the "nucleon"
|
||||
//static const G4double hdM2=hdM*hdM; // M2 of the "nucleon"
|
||||
static const G4double hdM2=hdM*hdM; // M2 of the "nucleon"
|
||||
//static const G4double mPi0 = G4QPDGCode(111).GetMass();
|
||||
//static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0);
|
||||
static const G4double mPi = G4QPDGCode(211).GetMass();
|
||||
static const G4double tmPi = mPi+mPi; // Doubled mass of the charged pion
|
||||
static const G4double stmPi= tmPi*tmPi; // Squared Doubled mass of the charged pion
|
||||
static const G4double mPPi = mPi+mProt; // Delta threshold
|
||||
//static const G4double mPPi2= mPPi*mPPi; // Delta low threshold for W2
|
||||
//static const G4double mDel2= 1400*1400; // Delta up threshold for W2 (in MeV^2)
|
||||
//static const G4double mDel2= 1400*1400; // Delta up threshold for W2 (in MeV^2)
|
||||
static const G4double muD = mPPi+mu; // Multiperipheral threshold
|
||||
static const G4double muD2 = muD*muD;
|
||||
//static const G4double mMu = G4QPDGCode(13).GetMass();
|
||||
//static const G4double mTau = G4QPDGCode(15).GetMass();
|
||||
//static const G4double mEl = G4QPDGCode(11).GetMass();
|
||||
//
|
||||
//-------------------------------------------------------------------------------------
|
||||
const G4DynamicParticle* projHadron = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particle=projHadron->GetDefinition();
|
||||
#ifdef debug
|
||||
@@ -461,7 +483,7 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
std::vector<G4int>* IsN = ElIsoN[i]; // Vector of "#of neutrons" in the isotope El[i]
|
||||
G4int nofIsot=SPI->size(); // #of isotopes in the element i
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollis::PosStDoIt:n="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<",r="<<rnd<<G4endl;
|
||||
G4cout<<"G4QCollis::PosStDoIt:n="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
|
||||
#endif
|
||||
G4int j=0;
|
||||
if(nofIsot>1)
|
||||
@@ -502,36 +524,64 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
G4cerr<<"---Warning---G4QCollision::PostStepDoIt:Element with N="<<N<< G4endl;
|
||||
return 0;
|
||||
}
|
||||
G4int targPDG=90000000+Z*1000+N; // PDG Code of the target nucleus
|
||||
aParticleChange.Initialize(track);
|
||||
G4double localtime = track.GetGlobalTime();
|
||||
G4ThreeVector position = track.GetPosition();
|
||||
G4TouchableHandle trTouchable = track.GetTouchableHandle();
|
||||
//
|
||||
G4int targPDG=90000000+Z*1000+N; // PDG Code of the target nucleus
|
||||
G4QPDGCode targQPDG(targPDG);
|
||||
G4double tM=targQPDG.GetMass();
|
||||
G4QHadronVector* output=new G4QHadronVector;// Prototype of EnvironOutput G4QHadronVector
|
||||
G4double absMom = 0.; // Prototype of absorbed by nucleus Moment
|
||||
G4QHadronVector* leadhs=new G4QHadronVector;// Prototype of QuasmOutput G4QHadronVectorum
|
||||
G4LorentzVector lead4M(0.,0.,0.,0.); // Prototype of LeadingQ 4-momentum
|
||||
if(aProjPDG==11 || aProjPDG==13 || aProjPDG==15) // leptons with photonuclear
|
||||
{ // Lepto-nuclear case with the equivalent photon algorithm. @@InFuture + neutrino & QE
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::PostStDoIt:startSt="<<aParticleChange.GetTrackStatus()<<G4endl;
|
||||
#endif
|
||||
G4double kinEnergy= projHadron->GetKineticEnergy();
|
||||
G4ParticleMomentum dir = projHadron->GetMomentumDirection();
|
||||
G4VQCrossSection* CSmanager=G4QElectronNuclearCrossSection::GetPointer();
|
||||
if(aProjPDG== 13) CSmanager=G4QMuonNuclearCrossSection::GetPointer();
|
||||
if(aProjPDG== 15) CSmanager=G4QTauNuclearCrossSection::GetPointer();
|
||||
// @@ Probably this is not necessary any more
|
||||
G4double xSec=CSmanager->GetCrossSection(false,Momentum,Z,N);//Recalculate CrossSection
|
||||
// @@ check a possibility to separate p, n, or alpha (!)
|
||||
G4double photonEnergy = CSmanager->GetExchangeEnergy(); // Energy of EqivExchangePart
|
||||
if(xSec <= 0.) // The cross-section iz 0 -> Do Nothing
|
||||
G4double ml=me;
|
||||
G4double ml2=me2;
|
||||
if(aProjPDG== 13)
|
||||
{
|
||||
G4cerr<<"-Warning-G4QCollision::PSDoIt: IsStillCalled photE="<<photonEnergy<<G4endl;
|
||||
CSmanager=G4QMuonNuclearCrossSection::GetPointer();
|
||||
ml=mu;
|
||||
ml2=mu2;
|
||||
}
|
||||
if(aProjPDG== 15)
|
||||
{
|
||||
CSmanager=G4QTauNuclearCrossSection::GetPointer();
|
||||
ml=mt;
|
||||
ml2=mt2;
|
||||
}
|
||||
// @@ Probably this is not necessary any more (?)
|
||||
G4double xSec=CSmanager->GetCrossSection(false,Momentum,Z,N,aProjPDG);// Recalculate XS
|
||||
// @@ check a possibility to separate p, n, or alpha (!)
|
||||
if(xSec <= 0.) // The cross-section is 0 -> Do Nothing
|
||||
{
|
||||
#ifdef debug
|
||||
G4cerr<<"G4QCollision::PSDoIt: Called for zero Cross-section"<<G4endl;
|
||||
#endif
|
||||
//Do Nothing Action insead of the reaction
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
aParticleChange.ProposeMomentumDirection(dir);
|
||||
aParticleChange.ProposeTrackStatus(fAlive);
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
if( kinEnergy < photonEnergy )
|
||||
G4double photonEnergy = CSmanager->GetExchangeEnergy(); // Energy of EqivExchangePart
|
||||
if( kinEnergy < photonEnergy || photonEnergy < 0.)
|
||||
{
|
||||
//Do Nothing Action insead of the reaction
|
||||
G4cerr<<"G4QCollision::PSDoIt: photE="<<photonEnergy<<">leptE="<<kinEnergy<<G4endl;
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
aParticleChange.ProposeMomentumDirection(dir);
|
||||
aParticleChange.ProposeTrackStatus(fAlive);
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
G4double photonQ2 = CSmanager->GetExchangeQ2(photonEnergy);// Q2(t) of EqivExchangePart
|
||||
@@ -539,60 +589,129 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
if(W<0.)
|
||||
{
|
||||
//Do Nothing Action insead of the reaction
|
||||
#ifdef debug
|
||||
G4cout << "G4QCollision::PostStepDoIt:(lN) negative equivalent energy W="<<W<<G4endl;
|
||||
#endif
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
aParticleChange.ProposeMomentumDirection(dir);
|
||||
aParticleChange.ProposeTrackStatus(fAlive);
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
// Update G4VParticleChange for the scattered muon
|
||||
G4VQCrossSection* thePhotonData=G4QPhotonNuclearCrossSection::GetPointer();
|
||||
G4double sigNu=thePhotonData->GetCrossSection(true,photonEnergy,Z,N);// IntegratedCrSec
|
||||
G4double sigK =thePhotonData->GetCrossSection(true, W, Z, N); // Real CrossSect.
|
||||
G4double sigNu=thePhotonData->GetCrossSection(true,photonEnergy,Z,N,22);//Integrated XS
|
||||
G4double sigK =thePhotonData->GetCrossSection(true, W, Z, N, 22); // Real XS
|
||||
G4double rndFraction = CSmanager->GetVirtualFactor(photonEnergy, photonQ2);
|
||||
if(sigNu*G4UniformRand()>sigK*rndFraction)
|
||||
{
|
||||
//Do NothingToDo Action insead of the reaction
|
||||
#ifdef debug
|
||||
G4cout << "G4QCollision::PostStepDoIt: probability correction - DoNothing"<<G4endl;
|
||||
#endif
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
aParticleChange.ProposeMomentumDirection(dir);
|
||||
aParticleChange.ProposeTrackStatus(fAlive);
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
G4double iniE=kinEnergy+mu; // Initial total energy of the muon
|
||||
G4double finE=iniE-photonEnergy; // Final total energy of the muon
|
||||
if(finE>0) aParticleChange.ProposeEnergy(finE) ;
|
||||
else
|
||||
G4double iniE=kinEnergy+ml; // Initial total energy of the lepton
|
||||
G4double finE=iniE-photonEnergy; // Final total energy of the lepton
|
||||
aParticleChange.ProposeEnergy(finE-ml);
|
||||
if(finE<=ml) // Secondary lepton (e/mu/tau) at rest disappears
|
||||
{
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
if(aProjPDG== 11) aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
else aParticleChange.ProposeTrackStatus(fStopButAlive);
|
||||
aParticleChange.ProposeMomentumDirection(dir);
|
||||
}
|
||||
// Scatter the muon
|
||||
G4double EEm=iniE*finE-mu2; // Just an intermediate value to avoid "2*"
|
||||
G4double iniP=std::sqrt(iniE*iniE-mu2); // Initial momentum of the electron
|
||||
G4double finP=std::sqrt(finE*finE-mu2); // Final momentum of the electron
|
||||
G4double cost=(EEm+EEm-photonQ2)/iniP/finP; // cos(theta) for the electron scattering
|
||||
else aParticleChange.ProposeTrackStatus(fAlive);
|
||||
G4double iniP=std::sqrt(iniE*iniE-ml2); // Initial momentum of the electron
|
||||
G4double finP=std::sqrt(finE*finE-ml2); // Final momentum of the electron
|
||||
G4double cost=(iniE*finE-ml2-photonQ2/2)/iniP/finP; // cos(scat_ang_of_lepton)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QCollision::PostStDoIt: Q2="<<photonQ2<<", cost="<<cost<<G4endl;
|
||||
#endif
|
||||
if(cost>1.) cost=1.; // To avoid the accuracy of calculation problem
|
||||
//else if(cost>1.001) // @@ error report can be done, but not necessary
|
||||
if(cost<-1.) cost=-1.; // To avoid the accuracy of calculation problem
|
||||
//else if(cost<-1.001) // @@ error report can be done, but not necessary
|
||||
// --- Example from electromagnetic physics --
|
||||
//G4ThreeVector newMuonDirection(dirx,diry,dirz);
|
||||
//newMuonDirection.rotateUz(dir);
|
||||
//aParticleChange.ProposeMomentumDirection(newMuonDirection1) ;
|
||||
// The scattering in respect to the derection of the incident muon is made impicitly:
|
||||
//
|
||||
// Scatter the lepton ( @@ make the same thing for real photons)
|
||||
// At this point we have photonEnergy and photonQ2 (with notDefinedPhi)->SelectProjPart
|
||||
G4double absEn = am*GeV; // @@(b) Mean Energy Absorbed by a Nucleus
|
||||
if(absEn < photonEnergy) // --> the absorption of energy can happen
|
||||
{
|
||||
G4double abtEn = absEn+hdM; // @@(b) MeanEnergyAbsorbed by a nucleus (+M_N)
|
||||
G4double abEn2 = abtEn*abtEn; // Squared absorbed Energy + MN
|
||||
G4double abMo2 = abEn2-hdM2; // Squared absorbed Momentum of compound system
|
||||
G4double phEn2 = photonEnergy*photonEnergy;
|
||||
G4double phMo2 = phEn2+photonQ2; // Squared momentum of primary virtual photon
|
||||
G4double phMo = std::sqrt(phMo2); // Momentum of the primary virtual photon
|
||||
absMom = std::sqrt(abMo2); // Absorbed Momentum
|
||||
if(absMom < phMo) // --> the absorption of momentum can happen
|
||||
{
|
||||
G4double dEn = photonEnergy - absEn;
|
||||
G4double dMo = phMo - absMom; // Leading momentum
|
||||
G4double sF = dEn*dEn - dMo*dMo;// s of leading particle
|
||||
#ifdef ppdebug
|
||||
G4cout<<"G4QCol::PStDoIt: sF="<<sF<<", phEn="<<photonEnergy<<G4endl;
|
||||
#endif
|
||||
if(sF > stmPi) // --> Leading fragmentation is possible
|
||||
{
|
||||
photonEnergy = absEn; // New value of the photon energy
|
||||
photonQ2=abMo2-absEn*absEn; // New value of the photon Q2
|
||||
absEn = dEn; // Put energy of leading particle to absEn (!)
|
||||
}
|
||||
else absMom=0.; // Flag that nothing has happened
|
||||
}
|
||||
}
|
||||
// ------------- End of ProjPart selection
|
||||
//
|
||||
// Scattering in respect to the derection of the incident muon is made impicitly:
|
||||
G4ThreeVector ort=dir.orthogonal(); // Not normed orthogonal vector (!) (to dir)
|
||||
G4ThreeVector ortx = ort.unit(); // First unit vector orthogonal to the direction
|
||||
G4ThreeVector orty = dir.cross(ortx);// Second unit vector orthoganal to the direction
|
||||
G4double sint=std::sqrt(1.-cost*cost); // Perpendicular component
|
||||
G4double sint=std::sqrt(1.-cost*cost); // Perpendicular component
|
||||
G4double phi=twopi*G4UniformRand(); // phi of scattered electron
|
||||
G4double sinx=sint*std::sin(phi); // x-component
|
||||
G4double siny=sint*std::cos(phi); // y-component
|
||||
G4double sinx=sint*std::sin(phi); // x perpendicular component
|
||||
G4double siny=sint*std::cos(phi); // y perpendicular component
|
||||
G4ThreeVector findir=cost*dir+sinx*ortx+siny*orty;
|
||||
aParticleChange.ProposeMomentumDirection(findir); // new direction for the muon
|
||||
const G4ThreeVector photon3M=iniP*dir-finP*findir;
|
||||
aParticleChange.ProposeMomentumDirection(findir); // new direction for the lepton
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QCollision::PostStepDoIt: E="<<aParticleChange.GetEnergy()<<","<<finE
|
||||
<<", d="<<*aParticleChange.GetMomentumDirection()<<","<<findir<<G4endl;
|
||||
#endif
|
||||
G4ThreeVector photon3M=iniP*dir-finP*findir;// 3D total momentum of photon
|
||||
if(absMom) // Photon must be reduced & LeadingSyst fragmented
|
||||
{
|
||||
G4double ptm=photon3M.mag();
|
||||
G4ThreeVector lead3M=photon3M*(ptm-absMom)/ptm;
|
||||
photon3M-=lead3M; // Reduce photon momentum (energy is reduced)
|
||||
proj4M=G4LorentzVector(lead3M,absEn); // 4-momentum of leading System
|
||||
lead4M=proj4M; // Remember 4-mom for the total 4-momentum
|
||||
G4Quasmon* pan= new G4Quasmon(G4QContent(1,1,0,1,1,0),proj4M);// ---> DELETED -->---+
|
||||
try // |
|
||||
{ // |
|
||||
delete leadhs; // |
|
||||
G4QNucleus vac(90000000); // |
|
||||
leadhs=pan->Fragment(vac,1); // DELETED after it is copied to output vector |
|
||||
} // |
|
||||
catch (G4QException& error) // |
|
||||
{ // |
|
||||
G4cerr<<"***G4QCollision::PostStepDoIt: G4Quasmon Exception is catched"<<G4endl;//|
|
||||
G4Exception("G4QCollision::PostStepDoIt:","72",FatalException,"QuasmonCrash"); //|
|
||||
} // |
|
||||
delete pan; // Delete the Nuclear Environment <----<---+
|
||||
#ifdef ppdebug
|
||||
G4cout<<"G4QCol::PStDoIt: l4M="<<proj4M<<proj4M.m2()<<", N="<<leadhs->size()<<",pt="
|
||||
<<ptm<<",pa="<<absMom<<",El="<<absEn<<",Pl="<<ptm-absMom<<G4endl;
|
||||
#endif
|
||||
}
|
||||
projPDG=22;
|
||||
proj4M=G4LorentzVector(photon3M,photon3M.mag()); //@@ photon is real?
|
||||
proj4M=G4LorentzVector(photon3M,photonEnergy);
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::PostStDoIt: St="<<aParticleChange.GetTrackStatus()<<", g4m="
|
||||
<<proj4M<<", lE="<<finE<<", lP="<<finP*findir<<", d="<<findir.mag2()<<G4endl;
|
||||
#endif
|
||||
}
|
||||
else if(aProjPDG==14)// ** neutrino nuclear interactions (only nu_mu/anu_mu & only CC) **
|
||||
{
|
||||
@@ -610,7 +729,7 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
scatPDG=-13; // secondary scattered mu+
|
||||
}
|
||||
// @@ Probably this is not necessary any more
|
||||
G4double xSec=CSmanager->GetCrossSection(false,Momentum,Z,N);//Recalculate CrossSection
|
||||
G4double xSec=CSmanager->GetCrossSection(false,Momentum,Z,N,aProjPDG);//Recalculate XS
|
||||
// @@ check a possibility to separate p, n, or alpha (!)
|
||||
if(xSec <= 0.) // The cross-section = 0 -> Do Nothing
|
||||
{
|
||||
@@ -618,7 +737,8 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
//Do Nothing Action insead of the reaction
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
aParticleChange.ProposeMomentumDirection(dir);
|
||||
aParticleChange.ProposeTrackStatus(fAlive);
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
scat=true; // event with changed scattered projectile
|
||||
@@ -668,13 +788,14 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
G4cout << "G4QCollision::PostStepDoIt: probability correction - DoNothing"<<G4endl;
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
aParticleChange.ProposeMomentumDirection(dir);
|
||||
aParticleChange.ProposeTrackStatus(fAlive);
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
if((!nuanu||N)&&totCS*G4UniformRand()<qelCS||s<muD2)// ****** Quasi-Elastic interaction
|
||||
{
|
||||
G4double Q2=CSmanager->GetQEL_ExchangeQ2(); // OK, im MeV^2
|
||||
G4double ds=s+s; // dpubled s
|
||||
G4double ds=s+s; // doubled s
|
||||
G4double sqs=std::sqrt(s); // M_cm
|
||||
G4double pi=(s-mIN*mIN)/(sqs+sqs); // initial momentum in CMS
|
||||
G4double dpi=pi+pi; // doubled initial momentum in CMS
|
||||
@@ -731,7 +852,10 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill); // the initial neutrino is killed
|
||||
}
|
||||
EnMomConservation=proj4M+G4LorentzVector(0.,0.,0.,tM); // Total 4-mom of the reaction
|
||||
G4QHadronVector* output=new G4QHadronVector; // Prototype of the output G4QHadronVector
|
||||
if(absMom) EnMomConservation+=lead4M; // Add E/M of leading System
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::PostStDoIt:before St="<<aParticleChange.GetTrackStatus()<<G4endl;
|
||||
#endif
|
||||
// @@@@@@@@@@@@@@ Temporary for the testing purposes --- Begin
|
||||
//G4bool elF=false; // Flag of the ellastic scattering is "false" by default
|
||||
//G4double eWei=1.;
|
||||
@@ -800,29 +924,42 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
// } // |
|
||||
// delete pan; // Delete the Nuclear Environment ---<--+
|
||||
//}
|
||||
aParticleChange.Initialize(track);
|
||||
G4double localtime = track.GetGlobalTime();
|
||||
G4ThreeVector position = track.GetPosition();
|
||||
// --- the scattered hadron with changed nature can be added here ---
|
||||
if(scat)
|
||||
{
|
||||
G4QHadron* scatHadron = new G4QHadron(scatPDG,scat4M);
|
||||
output->push_back(scatHadron);
|
||||
}
|
||||
G4int qNH=leadhs->size();
|
||||
if(absMom)
|
||||
{
|
||||
if(qNH) for(G4int iq=0; iq<qNH; iq++)
|
||||
{
|
||||
G4QHadron* loh=(*leadhs)[iq]; // Pointer to the output hadron
|
||||
output->push_back(loh);
|
||||
}
|
||||
delete leadhs;
|
||||
}
|
||||
// ------------- From here the secondaries are filled -------------------------
|
||||
G4int tNH = output->size(); // A#of hadrons in the output
|
||||
aParticleChange.SetNumberOfSecondaries(tNH);
|
||||
// Now add nuclear fragments
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::PostStepDoIt: "<<tNH<<" particles are generated"<<G4endl;
|
||||
#endif
|
||||
#ifdef ppdebug
|
||||
if(absMom)G4cout<<"G4QCollision::PostStepDoIt: t="<<tNH<<", q="<<qNH<<G4endl;
|
||||
#endif
|
||||
G4int nOut=output->size(); // Real length of the output @@ Temporary
|
||||
if(tNH==1 && !scat) // @@ Temporary. Find out why it happened!
|
||||
{
|
||||
G4cout<<"-Warning-G4QCollision::PostStepDoIt: only one secondary! Make 0."<<G4endl;
|
||||
G4cout<<"-Warning-G4QCollision::PostStepDoIt: 1 secondary! absMom="<<absMom;
|
||||
if(absMom) G4cout<<", qNH="<<qNH;
|
||||
G4cout<<", PDG0="<<(*output)[0]->GetPDGCode();
|
||||
G4cout<<G4endl;
|
||||
tNH=0;
|
||||
delete output->operator[](0); // delete the creazy hadron
|
||||
output->pop_back(); // clean up the output vector
|
||||
output->pop_back(); // clean up the output vector
|
||||
}
|
||||
if(tNH==2&&2!=nOut) G4cout<<"--Warning--G4QCollision::PostStepDoIt: 2 # "<<nOut<<G4endl;
|
||||
// Deal with ParticleChange final state interface to GEANT4 output of the process
|
||||
@@ -832,7 +969,7 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
// Note that one still has to take care of Hypernuclei (with Lambda or Sigma inside)
|
||||
// Hypernucleus mass calculation and ion-table interface upgrade => work for Hisaya @@
|
||||
// The decau process for hypernuclei must be developed in GEANT4 (change CHIPS body)
|
||||
G4QHadron* hadr=output->operator[](i); // Pointer to the output hadron
|
||||
G4QHadron* hadr=(*output)[i]; // Pointer to the output hadron
|
||||
G4int PDGCode = hadr->GetPDGCode();
|
||||
G4int nFrag = hadr->GetNFragments();
|
||||
#ifdef pdebug
|
||||
@@ -883,7 +1020,9 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
}
|
||||
if(!theDefinition)
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"---Warning---G4QCollision::PostStepDoIt: drop PDG="<<PDGCode<<G4endl;
|
||||
#endif
|
||||
delete hadr;
|
||||
continue;
|
||||
}
|
||||
@@ -908,16 +1047,26 @@ G4VParticleChange* G4QCollision::PostStepDoIt(const G4Track& track, const G4Step
|
||||
G4cout<<"G4QCollis::PSDoIt:p="<<curD<<curD.mag()<<",e="<<curE<<",m="<<curM<<G4endl;// |
|
||||
#endif
|
||||
G4Track* aNewTrack = new G4Track(theSec, localtime, position ); // ^
|
||||
aParticleChange.AddSecondary( aNewTrack ); // |
|
||||
aNewTrack->SetTouchableHandle(trTouchable); // |
|
||||
aParticleChange.AddSecondary( aNewTrack ); // |
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::PostStepDoIt:#"<<i<<" is done."<<G4endl; // |
|
||||
#endif
|
||||
} // |
|
||||
delete output; // instances of the G4QHadrons from the output are already deleted above +
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill); // Kill the absorbed particle
|
||||
//return &aParticleChange; // This is not enough (ClearILL)
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::PostStepDoIt: **** PostStepDoIt is done ****"<<G4endl;
|
||||
G4cout<<"G4QCollision::PostStDoIt: after St="<<aParticleChange.GetTrackStatus()<<G4endl;
|
||||
#endif
|
||||
if(aProjPDG!=11 && aProjPDG!=13 && aProjPDG!=15)
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill); // Kill the absorbed particle
|
||||
//return &aParticleChange; // This is not enough (ClearILL)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QCollision::PostStepDoIt: E="<<aParticleChange.GetEnergy()
|
||||
<<", d="<<*aParticleChange.GetMomentumDirection()<<G4endl;
|
||||
#endif
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollision::PostStepDoIt:*** PostStepDoIt is done ***, P="<<aProjPDG<<", St="
|
||||
<<aParticleChange.GetTrackStatus()<<G4endl;
|
||||
#endif
|
||||
return G4VDiscreteProcess::PostStepDoIt(track, step);
|
||||
}
|
||||
|
||||
+100
-43
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QElastic.cc,v 1.6 2006/06/29 20:08:32 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QElastic.cc,v 1.16 2006/12/09 14:33:35 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QElastic class -----------------
|
||||
// by Mikhail Kossov, December 2003.
|
||||
@@ -37,6 +37,8 @@
|
||||
//#define debug
|
||||
//#define pdebug
|
||||
//#define tdebug
|
||||
//#define nandebug
|
||||
//#define ppdebug
|
||||
|
||||
#include "G4QElastic.hh"
|
||||
|
||||
@@ -78,6 +80,10 @@ G4double G4QElastic::GetMeanFreePath(const G4Track& aTrack,G4double Q,G4ForceCon
|
||||
G4cout<<"*W*G4QElastic::GetMeanFreePath: is called for notImplementedParticle"<<G4endl;
|
||||
// Calculate the mean Cross Section for the set of Elements(*Isotopes) in the Material
|
||||
G4double Momentum = incidentParticle->GetTotalMomentum(); // 3-momentum of the Particle
|
||||
#ifdef debug
|
||||
G4double KinEn = incidentParticle->GetKineticEnergy();
|
||||
G4cout<<"G4QElastic::GetMeanFreePath: kinE="<<KinEn<<",Mom="<<Momentum<<G4endl; // Result
|
||||
#endif
|
||||
const G4Material* material = aTrack.GetMaterial(); // Get the current material
|
||||
const G4double* NOfNucPerVolume = material->GetVecNbOfAtomsPerVolume();
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
@@ -85,19 +91,12 @@ G4double G4QElastic::GetMeanFreePath(const G4Track& aTrack,G4double Q,G4ForceCon
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElastic::GetMeanFreePath:"<<nE<<" Elem's in theMaterial"<<G4endl;
|
||||
#endif
|
||||
G4VQCrossSection* CSmanager=0;
|
||||
G4VQCrossSection* CSmanager=G4QElasticCrossSection::GetPointer();
|
||||
G4int pPDG=0;
|
||||
if(incidentParticleDefinition == G4Proton::Proton())
|
||||
{
|
||||
CSmanager=G4QElasticCrossSection::GetPointer();
|
||||
pPDG=2212;
|
||||
}
|
||||
else if(incidentParticleDefinition == G4Neutron::Neutron())
|
||||
{
|
||||
CSmanager=G4QElasticCrossSection::GetPointer();
|
||||
pPDG=2112;
|
||||
}
|
||||
else G4cout<<"G4QElastic::GetMeanFreePath: np,pp,pd,pHe implemented in CHIPS"<<G4endl;
|
||||
|
||||
if (incidentParticleDefinition == G4Proton::Proton() ) pPDG=2212;
|
||||
else if(incidentParticleDefinition == G4Neutron::Neutron()) pPDG=2112;
|
||||
else G4cout<<"G4QElastic::GetMeanFreePath:only nA & pA are implemented in CHIPS"<<G4endl;
|
||||
|
||||
G4QIsotope* Isotopes = G4QIsotope::Get(); // Pointer to the G4QIsotopes singleton
|
||||
G4double sigma=0.; // Sums over elements for the material
|
||||
@@ -121,15 +120,18 @@ G4double G4QElastic::GetMeanFreePath(const G4Track& aTrack,G4double Q,G4ForceCon
|
||||
G4int Z = static_cast<G4int>(pElement->GetZ()); // Z of the Element
|
||||
ElementZ.push_back(Z); // Remember Z of the Element
|
||||
G4int isoSize=0; // The default for the isoVectorLength is 0
|
||||
G4int indEl=0; // Index of non-trivial element or 0(default)
|
||||
G4int indEl=0; // Index of non-natural element or 0(default)
|
||||
G4IsotopeVector* isoVector=pElement->GetIsotopeVector(); // Get the predefined IsoVect
|
||||
if(isoVector) isoSize=isoVector->size();// Get size of the existing isotopeVector
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElastic::GetMeanFreePath: isovectorLength="<<isoSize<<G4endl; // Result
|
||||
#endif
|
||||
if(isoSize) // The Element has non-trivial abumdance set
|
||||
if(isoSize) // The Element has non-trivial abundance set
|
||||
{
|
||||
indEl=pElement->GetIndex(); // Index of the non-trivial element
|
||||
indEl=pElement->GetIndex()+1; // Index of the non-trivial element is an order
|
||||
#ifdef debug
|
||||
G4cout<<"G4QEl::GetMFP: iE="<<indEl<<", def="<<Isotopes->IsDefined(Z,indEl)<<G4endl;
|
||||
#endif
|
||||
if(!Isotopes->IsDefined(Z,indEl)) // This index is not defined for this Z: define
|
||||
{
|
||||
std::vector<std::pair<G4int,G4double>*>* newAbund =
|
||||
@@ -161,6 +163,9 @@ G4double G4QElastic::GetMeanFreePath(const G4Track& aTrack,G4double Q,G4ForceCon
|
||||
std::vector<G4int>* IsN = new std::vector<G4int>; // Pointer to the N vector
|
||||
ElIsoN.push_back(IsN);
|
||||
G4int nIs=cs->size(); // A#Of Isotopes in the Element
|
||||
#ifdef debug
|
||||
G4cout<<"G4QEl::GMFP:=***=>,#isot="<<nIs<<", Z="<<Z<<", indEl="<<indEl<<G4endl;
|
||||
#endif
|
||||
G4double susi=0.; // sum of CS over isotopes
|
||||
if(nIs) for(G4int j=0; j<nIs; j++) // Calculate CS for eachIsotope of El
|
||||
{
|
||||
@@ -168,20 +173,34 @@ G4double G4QElastic::GetMeanFreePath(const G4Track& aTrack,G4double Q,G4ForceCon
|
||||
G4int N=curIs->first; // #of Neuterons in the isotope j of El i
|
||||
IsN->push_back(N); // Remember Min N for the Element
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElast::GMFP:*true*, P="<<Momentum<<",Z="<<Z<<",N="<<N<<",PDG="<<pPDG<<G4endl;
|
||||
G4cout<<"G4QEl::GMFP:*true*,P="<<Momentum<<",Z="<<Z<<",N="<<N<<",PDG="<<pPDG<<G4endl;
|
||||
#endif
|
||||
G4bool ccsf=true;
|
||||
if(Q==-27.) ccsf=false;
|
||||
#ifdef debug
|
||||
G4cout<<"G4QEl::GMFP: GetCS #1 j="<<j<<G4endl;
|
||||
#endif
|
||||
G4double CSI=CSmanager->GetCrossSection(ccsf,Momentum,Z,N,pPDG);//CS(j,i) for isotope
|
||||
|
||||
#ifdef debug
|
||||
G4cout<<"G4QEl::GMFP: jI="<<j<<", Zt="<<Z<<", Nt="<<N<<", Mom="<<Momentum<<", XSec="
|
||||
<<CSI/millibarn<<G4endl;
|
||||
#endif
|
||||
curIs->second = CSI;
|
||||
susi+=CSI; // Make a sum per isotopes
|
||||
SPI->push_back(susi); // Remember summed cross-section
|
||||
} // End of temporary initialization of the cross sections in the G4QIsotope singeltone
|
||||
sigma+=Isotopes->GetMeanCrossSection(Z,indEl)*NOfNucPerVolume[i];//SUM(MeanCS*NOfNperV)
|
||||
#ifdef debug
|
||||
G4cout<<"G4QEl::GMFP: <S>="<<Isotopes->GetMeanCrossSection(Z,indEl)<<", AddToSigma="
|
||||
<<Isotopes->GetMeanCrossSection(Z,indEl)*NOfNucPerVolume[i]<<G4endl;
|
||||
#endif
|
||||
ElProbInMat.push_back(sigma);
|
||||
} // End of LOOP over Elements
|
||||
|
||||
// Check that cross section is not zero and return the mean free path
|
||||
#ifdef debug
|
||||
G4cout<<"G4QEl::GMFP: MeanFreePath="<<1./sigma<<G4endl;
|
||||
#endif
|
||||
if(sigma > 0.) return 1./sigma; // Mean path [distance]
|
||||
return DBL_MAX;
|
||||
}
|
||||
@@ -230,7 +249,9 @@ G4VParticleChange* G4QElastic::PostStepDoIt(const G4Track& track, const G4Step&
|
||||
const G4DynamicParticle* projHadron = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particle=projHadron->GetDefinition();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElastic::PostStepDoIt: Before the GetMeanFreePath is called"<<G4endl;
|
||||
G4cout<<"G4QElastic::PostStepDoIt: Before the GetMeanFreePath is called In4M="
|
||||
<<projHadron->Get4Momentum()<<" of PDG="<<particle->GetPDGEncoding()<<", Type="
|
||||
<<particle->GetParticleType()<<", Subtp="<<particle->GetParticleSubType()<<G4endl;
|
||||
#endif
|
||||
G4ForceCondition cond=NotForced;
|
||||
GetMeanFreePath(track, -27., &cond); // @@ ?? jus to update parameters?
|
||||
@@ -240,13 +261,14 @@ G4VParticleChange* G4QElastic::PostStepDoIt(const G4Track& track, const G4Step&
|
||||
G4LorentzVector proj4M=(projHadron->Get4Momentum())*MeV; // Convert to MeV!
|
||||
G4LorentzVector scat4M=proj4M; // @@ Must be filled (?)
|
||||
G4double momentum = projHadron->GetTotalMomentum()*MeV; // 3-momentum of the Proj in MeV
|
||||
G4double Momentum = proj4M.rho(); // Just for the test purposes
|
||||
G4double Momentum = proj4M.rho(); // @@ Just for the test purposes
|
||||
if(std::fabs(Momentum-momentum)>.000001)
|
||||
G4cerr<<"*War*G4QElastic::PostStepDoIt:P(IU)="<<Momentum<<"="<<momentum<<G4endl;
|
||||
G4double pM2=proj4M.m2(); // in MeV^2
|
||||
G4double pM=std::sqrt(pM2); // in MeV
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElastic::PostStepDoIt: pP(IU)="<<Momentum<<"="<<momentum<<",pM="<<pM<<G4endl;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QElastic::PostStepDoIt: pP(IU)="<<Momentum<<"="<<momentum<<",pM="<<pM
|
||||
<<",scat4M="<<scat4M<<scat4M.m()<<G4endl;
|
||||
#endif
|
||||
if (!IsApplicable(*particle)) // Check applicability
|
||||
{
|
||||
@@ -366,8 +388,18 @@ G4VParticleChange* G4QElastic::PostStepDoIt(const G4Track& track, const G4Step&
|
||||
return 0;
|
||||
}
|
||||
aParticleChange.Initialize(track);
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElastic::PostStepDoIt: track is initialized"<<G4endl;
|
||||
#endif
|
||||
G4double localtime = track.GetGlobalTime();
|
||||
G4ThreeVector position = track.GetPosition();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElastic::PostStepDoIt: before Touchable extraction"<<G4endl;
|
||||
#endif
|
||||
G4TouchableHandle trTouchable = track.GetTouchableHandle();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElastic::PostStepDoIt: Touchable is extracted"<<G4endl;
|
||||
#endif
|
||||
//
|
||||
G4int targPDG=90000000+Z*1000+N; // CHIPS PDG Code of the target nucleus
|
||||
G4QPDGCode targQPDG(targPDG);
|
||||
@@ -387,34 +419,52 @@ G4VParticleChange* G4QElastic::PostStepDoIt(const G4Track& track, const G4Step&
|
||||
G4double xSec=CSmanager->GetCrossSection(false, Momentum, Z, N, projPDG);// Rec.CrossSect
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElast::PSDI:pPDG="<<projPDG<<",P="<<Momentum<<",CS="<<xSec/millibarn<<G4endl;
|
||||
#endif
|
||||
#ifdef nandebug
|
||||
if(xSec>0. || xSec<0. || xSec==0);
|
||||
else G4cout<<"******G4QElast::PSDI:xSec="<<xSec/millibarn<<G4endl;
|
||||
#endif
|
||||
// @@ check a possibility to separate p, n, or alpha (!)
|
||||
if(xSec <= 0.) // The cross-section iz 0 -> Do Nothing
|
||||
{
|
||||
G4cerr<<"*Warning*G4QElastic::PSDoIt: Zero cross-section"<<G4endl;
|
||||
#ifdef pdebug
|
||||
G4cerr<<"*Warning*G4QElastic::PSDoIt:*Zero cross-sectionp* PDG="<<projPDG<<",tPDG="
|
||||
<<targPDG<<",P="<<Momentum<<G4endl;
|
||||
#endif
|
||||
//Do Nothing Action insead of the reaction
|
||||
aParticleChange.ProposeEnergy(kinEnergy);
|
||||
aParticleChange.ProposeLocalEnergyDeposit(0.);
|
||||
aParticleChange.ProposeMomentumDirection(dir) ;
|
||||
return G4VDiscreteProcess::PostStepDoIt(track,step);
|
||||
}
|
||||
G4double mint=CSmanager->GetExchangeT(Z,N,projPDG); // -t in MeV^2
|
||||
// @@ only for pp: M_1=M_2=M_p, (1-cost)=(-t)/T/M
|
||||
// G4double cost=1.-mint/kinEnergy/tM; // cos(theta) in CMS
|
||||
// In general
|
||||
G4double tM2=tM*tM;
|
||||
G4double pEn=pM+kinEnergy; // tot projectile Energy in MeV
|
||||
G4double sM=(tM+tM)*pEn+tM2+pM2; // Mondelstam s
|
||||
G4double twop2cm=(tM2+tM2)*(pEn*pEn-pM2)/sM;// Doubled squared momentum in CM system
|
||||
G4double cost=1.-mint/twop2cm; // cos(theta) in CMS
|
||||
//
|
||||
#ifdef tdebug
|
||||
G4cout<<"G4QElastic::PoStDoI:t="<<mint<<",T="<<kinEnergy<<",M="<<tM<<",c="<<cost<<G4endl;
|
||||
G4double mint=CSmanager->GetExchangeT(Z,N,projPDG); // fanctional randomized -t in MeV^2
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QElast::PSDI:pPDG="<<projPDG<<",tPDG="<<targPDG<<",P="<<Momentum<<",CS="
|
||||
<<xSec<<",-t="<<mint<<G4endl;
|
||||
#endif
|
||||
if(cost>1. || cost<-1.)
|
||||
#ifdef nandebug
|
||||
if(mint>-.0000001);
|
||||
else G4cout<<"******G4QElast::PSDI:-t="<<mint<<G4endl;
|
||||
#endif
|
||||
//G4double cost=1.-mint/twop2cm; // cos(theta) in CMS
|
||||
G4double cost=1.-mint/CSmanager->GetHMaxT();// cos(theta) in CMS
|
||||
//
|
||||
#ifdef ppdebug
|
||||
G4cout<<"G4QElastic::PoStDoI:t="<<mint<<",dpcm2="<<twop2cm<<"="<<CSmanager->GetHMaxT()
|
||||
<<",Ek="<<kinEnergy<<",tM="<<tM<<",pM="<<pM<<",s="<<sM<<",cost="<<cost<<G4endl;
|
||||
#endif
|
||||
if(cost>1. || cost<-1. || !(cost>-1. || cost<1.))
|
||||
{
|
||||
if(cost>1.000001 || cost<-1.000001) G4cout<<"*Warning*G4QElastic::PostStepDoIt: cos="
|
||||
<<cost<<", t="<<mint<<",T="<<kinEnergy<<", M="<<tM<<",tm="<<2*kinEnergy*tM<<G4endl;
|
||||
if(cost>1.000001 || cost<-1.000001 || !(cost>-1. || cost<1.))
|
||||
{
|
||||
G4double tM2=tM*tM; // Squared target mass
|
||||
G4double pEn=pM+kinEnergy; // tot projectile Energy in MeV
|
||||
G4double sM=(tM+tM)*pEn+tM2+pM2; // Mondelstam s
|
||||
G4double twop2cm=(tM2+tM2)*(pEn*pEn-pM2)/sM;// Max_t/2 (2*p^2_cm)
|
||||
G4cout<<"*Warning*G4QElastic::PostStepDoIt:cos="<<cost<<",t="<<mint<<",T="<<kinEnergy
|
||||
<<",tM="<<tM<<",tmax="<<2*kinEnergy*tM<<",p="<<projPDG<<",t="<<targPDG<<G4endl;
|
||||
G4cout<<"..G4QElastic::PoStDoI: dpcm2="<<twop2cm<<"="<<CSmanager->GetHMaxT()<<G4endl;
|
||||
}
|
||||
if (cost>1.) cost=1.;
|
||||
else if(cost<-1.) cost=-1.;
|
||||
}
|
||||
@@ -423,17 +473,22 @@ G4VParticleChange* G4QElastic::PostStepDoIt(const G4Track& track, const G4Step&
|
||||
if(!G4QHadron(tot4M).RelDecayIn2(scat4M, reco4M, dir4M, cost, cost))
|
||||
{
|
||||
G4cerr<<"G4QElastic::PSD:t4M="<<tot4M<<",pM="<<pM<<",tM="<<tM<<",cost="<<cost<<G4endl;
|
||||
throw G4QException("G4QElastic::PostStepDoIt: Can't decay Elastic Compound");
|
||||
//throw G4QException("G4QElastic::PostStepDoIt: Can't decay Elastic Compound");
|
||||
}
|
||||
#ifdef tdebug
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElastic::PoStDoIt:s4M="<<scat4M<<"+r4M="<<reco4M<<"="<<scat4M+reco4M<<G4endl;
|
||||
G4cout<<"G4QElastic::PoStDoIt: scatE="<<scat4M.e()-pM<<", recoE="<<reco4M.e()-tM<<",d4M="
|
||||
<<tot4M-scat4M-reco4M<<G4endl;
|
||||
#endif
|
||||
// Update G4VParticleChange for the scattered muon
|
||||
G4double finE=scat4M.e()-pM; // Final kinetic energy of the scattered proton
|
||||
if(finE>0) aParticleChange.ProposeEnergy(finE);
|
||||
else
|
||||
{
|
||||
G4cerr<<"*Warning*G4QElastic::PostStDoIt: Zero or negative scattered E="<<finE<<G4endl;
|
||||
if(finE<-1.e-8 || !(finE>-1.||finE<1.))
|
||||
G4cerr<<"*Warning*G4QElastic::PostStDoIt: Zero or negative scattered E="<<finE
|
||||
<<", s4M="<<scat4M<<", r4M="<<reco4M<<", d4M="<<tot4M-scat4M-reco4M<<G4endl;
|
||||
//throw G4QException("G4QElastic::PostStDoIt: 0, negative, or nan energy");
|
||||
aParticleChange.ProposeEnergy(0.) ;
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
}
|
||||
@@ -452,7 +507,7 @@ G4VParticleChange* G4QElastic::PostStepDoIt(const G4Track& track, const G4Step&
|
||||
->FindIon(Z,aA,0,Z);
|
||||
if(!theDefinition)G4cout<<"*Warning*G4QElastic::PostStepDoIt:drop PDG="<<targPDG<<G4endl;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QElastic::PostStepDoIt:Name="<<theDefinition->GetParticleName()<<G4endl;
|
||||
G4cout<<"G4QElastic::PostStepDoIt:RecoilName="<<theDefinition->GetParticleName()<<G4endl;
|
||||
#endif
|
||||
theSec->SetDefinition(theDefinition);
|
||||
|
||||
@@ -467,7 +522,9 @@ G4VParticleChange* G4QElastic::PostStepDoIt(const G4Track& track, const G4Step&
|
||||
G4double curE=theSec->GetKineticEnergy()+curM;
|
||||
G4cout<<"G4QElastic::PSDoIt:p="<<curD<<curD.mag()<<",e="<<curE<<",m="<<curM<<G4endl;
|
||||
#endif
|
||||
// Make a recoil nucleus
|
||||
G4Track* aNewTrack = new G4Track(theSec, localtime, position );
|
||||
aNewTrack->SetTouchableHandle(trTouchable);
|
||||
aParticleChange.AddSecondary( aNewTrack );
|
||||
#ifdef debug
|
||||
G4cout<<"G4QElastic::PostStepDoIt: **** PostStepDoIt is done ****"<<G4endl;
|
||||
|
||||
+1011
-153
File diff suppressed because it is too large
Load Diff
+204
-14
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QElectronNuclearCrossSection.cc,v 1.8 2006/06/29 20:08:36 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QElectronNuclearCrossSection.cc,v 1.11 2006/12/04 10:44:22 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4QElectronNuclearCrossSection for gamma+A cross sections
|
||||
@@ -54,6 +54,13 @@ G4double G4QElectronNuclearCrossSection::lastH=0.;// LastValue of High Energy A
|
||||
G4double* G4QElectronNuclearCrossSection::lastJ1=0;// Pointer to lastArray of J1 function
|
||||
G4double* G4QElectronNuclearCrossSection::lastJ2=0;// Pointer to lastArray of J2 function
|
||||
G4double* G4QElectronNuclearCrossSection::lastJ3=0;// Pointer to lastArray of J3 function
|
||||
G4int G4QElectronNuclearCrossSection::lastPDG=0; // The last PDG code of the projectile
|
||||
G4int G4QElectronNuclearCrossSection::lastN=0; // The last N of calculated nucleus
|
||||
G4int G4QElectronNuclearCrossSection::lastZ=0; // The last Z of calculated nucleus
|
||||
G4double G4QElectronNuclearCrossSection::lastP=0.; // Last used in cross section Momentum
|
||||
G4double G4QElectronNuclearCrossSection::lastTH=0.; // Last threshold momentum
|
||||
G4double G4QElectronNuclearCrossSection::lastCS=0.; // Last value of the Cross Section
|
||||
G4int G4QElectronNuclearCrossSection::lastI=0; // The last position in the DAMDB
|
||||
|
||||
// Returns Pointer to the G4VQCrossSection class
|
||||
G4VQCrossSection* G4QElectronNuclearCrossSection::GetPointer()
|
||||
@@ -62,6 +69,178 @@ G4VQCrossSection* G4QElectronNuclearCrossSection::GetPointer()
|
||||
return &theCrossSection;
|
||||
}
|
||||
|
||||
// The main member function giving the collision cross section (P is in IU, CS is in mb)
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4QElectronNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
|
||||
G4int tgZ, G4int tgN, G4int pPDG)
|
||||
{
|
||||
static const G4double mel=0.5109989; // Mass of the electron in MeV
|
||||
static const G4double mel2=mel*mel; // Squared Mass of the electron in MeV
|
||||
static G4int j; // A#0f records found in DB for this projectile
|
||||
static std::vector <G4int> colPDG;// Vector of the projectile PDG code
|
||||
static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
|
||||
static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
|
||||
static std::vector <G4double> colP; // Vector of last momenta for the reaction
|
||||
static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
|
||||
static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
G4double pEn=std::sqrt(pMom*pMom+mel2)-mel; // ==> electron/positron kinEnergy
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
|
||||
<<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
|
||||
<<colN.size()<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(std::abs(pPDG)!=11)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // projectile PDG=0 is a mistake (?!) @@
|
||||
}
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
|
||||
{
|
||||
in = false; // By default the isotope haven't be found in AMDB
|
||||
lastP = 0.; // New momentum history (nothing to compare with)
|
||||
lastPDG = pPDG; // The last PDG of the projectile
|
||||
lastN = tgN; // The last N of the calculated nucleus
|
||||
lastZ = tgZ; // The last Z of the calculated nucleus
|
||||
lastI = colN.size(); // Size of the Associative Memory DB in the heap
|
||||
j = 0; // A#0f records found in DB for this projectile
|
||||
if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
|
||||
{ // The nucleus with projPDG is found in AMDB
|
||||
if(colN[i]==tgN && colZ[i]==tgZ)
|
||||
{
|
||||
lastI=i;
|
||||
lastTH =colTH[i]; // Last THreshold (A-dependent)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Energy is below the Threshold value
|
||||
}
|
||||
lastP =colP [i]; // Last Momentum (A-dependent)
|
||||
lastCS =colCS[i]; // Last CrossSect (A-dependent)
|
||||
if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
#endif
|
||||
CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // Update param's only
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
in = true; // This is the case when the isotop is found in DB
|
||||
// Momentum pMom is in IU ! @@ Units
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // read & update
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(lastCS<=0. && pEn>lastTH) // Correct the threshold
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
break; // Go out of the LOOP
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"---G4QENCrossSec::GetCrosSec:pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
|
||||
<<",Z["<<i<<"]="<<colZ[i]<<",cPDG="<<colPDG[i]<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
j++; // Increment a#0f records found in DB for this pPDG
|
||||
}
|
||||
if(!in) // This nucleus has not been calculated previously
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
|
||||
#endif
|
||||
//!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
|
||||
lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
|
||||
if(lastCS<=0.)
|
||||
{
|
||||
lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
|
||||
#endif
|
||||
if(pEn>lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
colN.push_back(tgN);
|
||||
colZ.push_back(tgZ);
|
||||
colPDG.push_back(pPDG);
|
||||
colP.push_back(pMom);
|
||||
colTH.push_back(lastTH);
|
||||
colCS.push_back(lastCS);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
} // End of creation of the new set of parameters
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
colP[lastI]=pMom;
|
||||
colPDG[lastI]=pPDG;
|
||||
colCS[lastI]=lastCS;
|
||||
}
|
||||
} // End of parameters udate
|
||||
else if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Momentum is below the Threshold Value -> CS=0
|
||||
}
|
||||
else if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
|
||||
lastP=pMom;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QENCS::GetCroSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
}
|
||||
|
||||
// Gives the threshold energy for different nuclei (min of p- and n-threshold)
|
||||
// *******************************************************************************
|
||||
// *** This function is the same for all lepto- & photo-nuclear reactions, for ***
|
||||
@@ -81,7 +260,7 @@ G4double G4QElectronNuclearCrossSection::ThresholdEnergy(G4int Z, G4int N, G4int
|
||||
|
||||
G4int A=Z+N;
|
||||
if(A<1) return infEn;
|
||||
else if(A==1) return 134.9766; // Pi0 threshold for the nucleon
|
||||
else if(A==1) return 144.76; // Pi0 threshold in MeV for the proton: T>m+(m^2+2lm)/2M
|
||||
// CHIPS - Direct GEANT
|
||||
//G4double mT= G4QPDGCode(111).GetNuclMass(Z,N,0);
|
||||
G4double mT= 0.;
|
||||
@@ -181,8 +360,8 @@ G4double G4QElectronNuclearCrossSection::CalculateCrossSection(G4bool CS, G4int
|
||||
lastF = GetFunctions(A,lastJ1,lastJ2,lastJ3);//newZeroPos and J-functions filling
|
||||
lastH = alop*A*(1.-.072*std::log(A)); // like lastSP of G4PhotonuclearCrossSection
|
||||
#ifdef pdebug
|
||||
G4cout<<"==>G4QElNCS::CalcCS:lJ1="<<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3;
|
||||
if(J3.size()) G4cout<<", p="<<J3[0];
|
||||
G4cout<<"==>G4QElNCS::CalcCS: pJ1="<<lastJ1<<",pJ2="<<lastJ2<<",pJ3="<<lastJ3;
|
||||
if(lastJ1) G4cout<<", J1="<<lastJ1[0]<<",J2="<<lastJ2[0]<<",J3="<<lastJ3[0];
|
||||
G4cout<<G4endl;
|
||||
#endif
|
||||
// *** The synchronization check ***
|
||||
@@ -207,16 +386,16 @@ G4double G4QElectronNuclearCrossSection::CalculateCrossSection(G4bool CS, G4int
|
||||
return 0.;
|
||||
}
|
||||
G4double lE=std::log(lastE); // log(muE) (it is necessary for the fit)
|
||||
lastG=lE-lmel; // Gamma of the electron (used to recover log(muE))
|
||||
lastG=lE-lmel; // Gamma of the electron (used to recover log(eE))
|
||||
G4double dlg1=lastG+lastG-1.;
|
||||
G4double lgoe=lastG/lastE;
|
||||
if(lE<lEMa) // Log fit is made explicitly to fix the last bin for the randomization
|
||||
if(lE<lEMa) // Log fit is made explicitly to fix the last bin for the randomization
|
||||
{
|
||||
G4double shift=(lE-lEMi)/dlnE;
|
||||
G4int blast=static_cast<int>(shift);
|
||||
#ifdef pdebug
|
||||
G4cout<<"-->G4QElectronNuclearCS::CalcCrossSect:LOGfit b="<<blast<<",max="<<mL<<",lJ1="
|
||||
<<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<G4endl;
|
||||
<<lastJ1<<",lJ2="<<lastJ2<<",lJ3="<<lastJ3<<",lEmin="<<lEMi<<",d="<<dlnE<<G4endl;
|
||||
#endif
|
||||
if(blast<0) blast=0;
|
||||
if(blast>=mL) blast=mL-1;
|
||||
@@ -229,11 +408,11 @@ G4double G4QElectronNuclearCrossSection::CalculateCrossSection(G4bool CS, G4int
|
||||
lastSig= YNi+shift*(YNj-YNi);
|
||||
if(lastSig>YNj)lastSig=YNj;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QElectNucCS::CalcCS:S="<<lastSig<<",E="<<lE<<",Yi="<<YNi<<",Yj="<<YNj<<",M="
|
||||
<<lEMa<<G4endl;
|
||||
G4cout<<"G4QElectNucCS::CalcCS:S="<<lastSig<<",lE="<<lE<<",Yi="<<YNi<<",Yj="<<YNj
|
||||
<<",J1="<<lastJ1[blast]<<",J2="<<lastJ2[blast]<<",J3="<<lastJ3[blast]<<G4endl;
|
||||
G4cout<<"G4QElectNucCS::CalcCS:s="<<shift<<",Jb="<<lastJ1[blast]<<",J="<<lastJ1[lastL];
|
||||
if(J3.size()) G4cout<<", p="<<J3[0];
|
||||
G4cout<<",b="<<blast<<G4endl;
|
||||
G4cout<<",b="<<blast<<",lEmax="<<lEMa<<",lgoe="<<lgoe<<G4endl;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
@@ -2380,24 +2559,31 @@ G4int G4QElectronNuclearCrossSection::GetFunctions(G4double a, G4double* x,
|
||||
static const G4double* P2[nN]=
|
||||
{P20,P21,P22,P23,P24,P25,P26,P27,P28,P29,P210,P211,P212,P213};
|
||||
// --------------------------------
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QElNucCroSect::GetFunctions is called A="<<a<<G4endl;
|
||||
#endif
|
||||
G4int r=-1; // Low channel for J-functions
|
||||
if(a<=.9999 || a>238.49) // Plutonium 244 is forbidden
|
||||
if(a<=.9999 || a>238.49) // Plutonium 244 and higher are forbidden
|
||||
{
|
||||
G4cout<<"***G4QElectronNuclearCrossSection::GetFunctions: A="<<a<<"(?). No CS"<<G4endl;
|
||||
return r;
|
||||
}
|
||||
G4int iA=static_cast<G4int>(a+.499); // Make the round integer of the atomic number
|
||||
G4int iA=static_cast<G4int>(a+.499); // Make the round integer of the atomic number
|
||||
G4double ai=iA;
|
||||
if(a!=ai) a=ai;
|
||||
for(G4int i=0; i<nN; i++)
|
||||
{
|
||||
if(std::fabs(a-A[i])<.0005) // if A coincides with one of the basic A's -> get from Tab
|
||||
if(std::fabs(a-A[i])<.5) // if A coincides with the basic A, get from Tab
|
||||
{
|
||||
for(G4int k=0; k<nE; k++)
|
||||
{
|
||||
x[k]=P0[i][k]; // J0
|
||||
y[k]=P1[i][k]; // J1
|
||||
z[k]=P2[i][k]; // J2
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QElNucCroSect::GetFunctions:exact A="<<a<<",i="<<k<<",J1="<<x[k]<<",J2="
|
||||
<<y[k]<<",J3="<<z[k]<<G4endl;
|
||||
#endif
|
||||
}
|
||||
r=L[i]; // Low channel for the J-functions
|
||||
}
|
||||
@@ -2418,6 +2604,10 @@ G4int G4QElectronNuclearCrossSection::GetFunctions(G4double a, G4double* x,
|
||||
y[m]=yi+(P1[k][m]-yi)*b;
|
||||
G4double zi=P2[k1][m];
|
||||
z[m]=zi+(P2[k][m]-zi)*b;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QElNucCroSect::GetFunctions:inter A="<<a<<",i="<<m<<",J1="<<x[k]<<",J2="
|
||||
<<y[k]<<",J3="<<z[k]<<G4endl;
|
||||
#endif
|
||||
}
|
||||
r=L[k];
|
||||
if(L[k1]<r) r=L[k1];
|
||||
|
||||
+603
@@ -0,0 +1,603 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4QGluonString.cc,v 1.1 2006/10/30 10:33:38 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
// ---------------- G4QGluonString class -----------------
|
||||
// by Mikhail Kossov, December 2003.
|
||||
// G4QGluonString class of the CHIPS Simulation Branch in GEANT4
|
||||
// ---------------------------------------------------------------
|
||||
// ****************************************************************************************
|
||||
// ********** This CLASS is temporary moved from the photolepton_hadron directory *********
|
||||
// ****************************************************************************************
|
||||
|
||||
//#define debug
|
||||
//#define pdebug
|
||||
//#define ppdebug
|
||||
|
||||
#include "G4QGluonString.hh"
|
||||
|
||||
// Initialization of static vectors
|
||||
std::vector<G4int> G4QGluonString::ElementZ; // Z of the element(i) in theLastCalc
|
||||
std::vector<G4double> G4QGluonString::ElProbInMat; // SumProbabilityElements in Material
|
||||
std::vector<std::vector<G4int>*> G4QGluonString::ElIsoN; // N of isotope(j) of Element(i)
|
||||
std::vector<std::vector<G4double>*>G4QGluonString::IsoProbInEl;//SumProbabIsotopeInElementI
|
||||
|
||||
G4QGluonString::G4QGluonString(const G4String& processName):G4VDiscreteProcess(processName)
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::Constructor is called"<<G4endl;
|
||||
#endif
|
||||
if (verboseLevel>0) G4cout<<GetProcessName()<<" process is created by CHIPS"<<G4endl;
|
||||
|
||||
G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World with 234 particles
|
||||
G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // Clusterization param's
|
||||
G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime); // Hadronic parameters
|
||||
G4QEnvironment::SetParameters(SolidAngle); // SolAngle of pbar-A secondary mesons capture
|
||||
//@@ Initialize here other parameters
|
||||
}
|
||||
|
||||
G4bool G4QGluonString::manualFlag=false; // If false then standard parameters are used
|
||||
G4double G4QGluonString::Temperature=180.; // Critical Temperature (sensitive at High En)
|
||||
G4double G4QGluonString::SSin2Gluons=0.3; // Supression of s-quarks (in respect to u&d)
|
||||
G4double G4QGluonString::EtaEtaprime=0.3; // Supression of eta mesons (gg->qq/3g->qq)
|
||||
G4double G4QGluonString::freeNuc=0.5; // Percentage of free nucleons on the surface
|
||||
G4double G4QGluonString::freeDib=0.05; // Percentage of free diBaryons on the surface
|
||||
G4double G4QGluonString::clustProb=5.; // Nuclear clusterization parameter
|
||||
G4double G4QGluonString::mediRatio=10.; // medium/vacuum hadronization ratio
|
||||
G4int G4QGluonString::nPartCWorld=152; // The#of particles initialized in CHIPS World
|
||||
G4double G4QGluonString::SolidAngle=0.5; // Part of Solid Angle to capture (@@A-dep.)
|
||||
G4bool G4QGluonString::EnergyFlux=false; // Flag for Energy Flux use (not MultyQuasmon)
|
||||
G4double G4QGluonString::PiPrThresh=141.4; // Pion Production Threshold for gammas
|
||||
G4double G4QGluonString::M2ShiftVir=20000.;// Shift for M2=-Q2=m_pi^2 of the virtualGamma
|
||||
G4double G4QGluonString::DiNuclMass=1880.; // DoubleNucleon Mass for VirtualNormalization
|
||||
|
||||
void G4QGluonString::SetManual() {manualFlag=true;}
|
||||
void G4QGluonString::SetStandard() {manualFlag=false;}
|
||||
|
||||
// Fill the private parameters
|
||||
void G4QGluonString::SetParameters(G4double temper, G4double ssin2g, G4double etaetap,
|
||||
G4double fN, G4double fD, G4double cP, G4double mR,
|
||||
G4int nParCW, G4double solAn, G4bool efFlag,
|
||||
G4double piThresh, G4double mpisq, G4double dinum)
|
||||
{// =============================================================================
|
||||
Temperature=temper;
|
||||
SSin2Gluons=ssin2g;
|
||||
EtaEtaprime=etaetap;
|
||||
freeNuc=fN;
|
||||
freeDib=fD;
|
||||
clustProb=cP;
|
||||
mediRatio=mR;
|
||||
nPartCWorld = nParCW;
|
||||
EnergyFlux=efFlag;
|
||||
SolidAngle=solAn;
|
||||
PiPrThresh=piThresh;
|
||||
M2ShiftVir=mpisq;
|
||||
DiNuclMass=dinum;
|
||||
G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World with 234 particles
|
||||
G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // Clusterization param's
|
||||
G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime); // Hadronic parameters
|
||||
G4QEnvironment::SetParameters(SolidAngle); // SolAngle of pbar-A secondary mesons capture
|
||||
}
|
||||
|
||||
// Destructor
|
||||
|
||||
G4QGluonString::~G4QGluonString() {}
|
||||
|
||||
// Internal E/P conservation 4-Mom & the selected number of neutrons in the Element
|
||||
|
||||
G4LorentzVector G4QGluonString::GetEnegryMomentumConservation()
|
||||
{
|
||||
return EnMomConservation;
|
||||
}
|
||||
|
||||
G4int G4QGluonString::GetNumberOfNeutronsInTarget()
|
||||
{
|
||||
return nOfNeutrons;
|
||||
}
|
||||
|
||||
// output of the function must be in units of length! L=1/sig_V,sig_V=SUM(n(j,i)*sig(j,i)),
|
||||
// where n(i,j) is a number of nuclei of the isotop j of the element i in V=1(lengtUnit^3)
|
||||
// ********** All CHIPS cross sections are calculated in the surface units ************
|
||||
G4double G4QGluonString::GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double, G4ForceCondition* Fc)
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::GetMeanFreePath: Called Fc="<<*Fc<<G4endl;
|
||||
#endif
|
||||
*Fc = NotForced;
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::GetMeanFreePath: Before GetDynPart"<<G4endl;
|
||||
#endif
|
||||
const G4DynamicParticle* incidentParticle = aTrack.GetDynamicParticle();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::GetMeanFreePath: Before GetDef"<<G4endl;
|
||||
#endif
|
||||
G4ParticleDefinition* incidentParticleDefinition=incidentParticle->GetDefinition();
|
||||
if( !IsApplicable(*incidentParticleDefinition))
|
||||
G4cout<<"-W-G4QGluonString::GetMeanFreePath called for NotImplementedParticle"<<G4endl;
|
||||
// Calculate the mean Cross Section for the set of Elements(*Isotopes) in the Material
|
||||
G4double Momentum = incidentParticle->GetTotalMomentum(); // 3-momentum of the Particle
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollis::GetMeanFreePath: BeforeGetMaterial"<<G4endl;
|
||||
#endif
|
||||
const G4Material* material = aTrack.GetMaterial(); // Get the current material
|
||||
const G4double* NOfNucPerVolume = material->GetVecNbOfAtomsPerVolume();
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
G4int nE=material->GetNumberOfElements();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::GetMeanFreePath:"<<nE<<" Elem's in theMaterial"<<G4endl;
|
||||
#endif
|
||||
G4VQCrossSection* CSmanager=0;
|
||||
G4int pPDG=0;
|
||||
if(incidentParticleDefinition == G4Proton::Proton())
|
||||
{
|
||||
CSmanager=G4QProtonNuclearCrossSection::GetPointer();
|
||||
pPDG=2212;
|
||||
} //@@ Make cross-section mahnagers for other mesons & baryons
|
||||
else
|
||||
{
|
||||
G4cerr<<"***G4QGluonString::GetMeanFreePath: Particle isn't implemented"<<G4endl;
|
||||
G4Exception("G4QGluonString::PostStepDoIt:","72",FatalException,"BadProjectile");
|
||||
}
|
||||
|
||||
G4QIsotope* Isotopes = G4QIsotope::Get(); // Pointer to the G4QIsotopes singleton
|
||||
G4double sigma=0.; // Sums over elements for the material
|
||||
G4int IPIE=IsoProbInEl.size(); // How many old elements?
|
||||
if(IPIE) for(G4int ip=0; ip<IPIE; ++ip) // Clean up the SumProb's of Isotopes (SPI)
|
||||
{
|
||||
std::vector<G4double>* SPI=IsoProbInEl[ip]; // Pointer to the SPI vector
|
||||
SPI->clear();
|
||||
delete SPI;
|
||||
std::vector<G4int>* IsN=ElIsoN[ip]; // Pointer to the N vector
|
||||
IsN->clear();
|
||||
delete IsN;
|
||||
}
|
||||
ElProbInMat.clear(); // Clean up the SumProb's of Elements (SPE)
|
||||
ElementZ.clear(); // Clear the body vector for Z of Elements
|
||||
IsoProbInEl.clear(); // Clear the body vector for SPI
|
||||
ElIsoN.clear(); // Clear the body vector for N of Isotopes
|
||||
for(G4int i=0; i<nE; ++i)
|
||||
{
|
||||
G4Element* pElement=(*theElementVector)[i]; // Pointer to the current element
|
||||
G4int Z = static_cast<G4int>(pElement->GetZ()); // Z of the Element
|
||||
ElementZ.push_back(Z); // Remember Z of the Element
|
||||
G4int isoSize=0; // The default for the isoVectorLength is 0
|
||||
G4int indEl=0; // Index of non-trivial element or 0(default)
|
||||
G4IsotopeVector* isoVector=pElement->GetIsotopeVector(); // Get the predefined IsoVect
|
||||
if(isoVector) isoSize=isoVector->size();// Get size of the existing isotopeVector
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::GetMeanFreePath: isovectorLength="<<isoSize<<G4endl; // Result
|
||||
#endif
|
||||
if(isoSize) // The Element has non-trivial abumdance set
|
||||
{
|
||||
indEl=pElement->GetIndex(); // Index of the non-trivial element
|
||||
if(!Isotopes->IsDefined(Z,indEl)) // This index is not defined for this Z: define
|
||||
{
|
||||
std::vector<std::pair<G4int,G4double>*>* newAbund =
|
||||
new std::vector<std::pair<G4int,G4double>*>;
|
||||
G4double* abuVector=pElement->GetRelativeAbundanceVector();
|
||||
for(G4int j=0; j<isoSize; j++) // Calculation of abundance vector for isotopes
|
||||
{
|
||||
G4int N=pElement->GetIsotope(j)->GetN()-Z; // N means A=N+Z !
|
||||
if(pElement->GetIsotope(j)->GetZ()!=Z)G4cerr<<"G4QCaptureAtRest::GetMeanFreePath"
|
||||
<<": Z="<<pElement->GetIsotope(j)->GetZ()<<"#"<<Z<<G4endl;
|
||||
G4double abund=abuVector[j];
|
||||
std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::GetMeanFreePath:p#"<<j<<",N="<<N<<",ab="<<abund<<G4endl;
|
||||
#endif
|
||||
newAbund->push_back(pr);
|
||||
}
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt:pairVectorLength="<<newAbund->size()<<G4endl;
|
||||
#endif
|
||||
indEl=G4QIsotope::Get()->InitElement(Z,indEl,newAbund); // definition of the newInd
|
||||
for(G4int k=0; k<isoSize; k++) delete (*newAbund)[k]; // Cleaning temporary
|
||||
delete newAbund; // Was "new" in the beginning of the name space
|
||||
}
|
||||
}
|
||||
std::vector<std::pair<G4int,G4double>*>* cs= Isotopes->GetCSVector(Z,indEl);//CSPointer
|
||||
std::vector<G4double>* SPI = new std::vector<G4double>; // Pointer to the SPI vector
|
||||
IsoProbInEl.push_back(SPI);
|
||||
std::vector<G4int>* IsN = new std::vector<G4int>; // Pointer to the N vector
|
||||
ElIsoN.push_back(IsN);
|
||||
G4int nIs=cs->size(); // A#Of Isotopes in the Element
|
||||
G4double susi=0.; // sum of CS over isotopes
|
||||
if(nIs) for(G4int j=0; j<nIs; j++) // Calculate CS for eachIsotope of El
|
||||
{
|
||||
std::pair<G4int,G4double>* curIs=(*cs)[j]; // A pointer, which is used twice
|
||||
G4int N=curIs->first; // #of Neuterons in the isotope j of El i
|
||||
IsN->push_back(N); // Remember Min N for the Element
|
||||
G4double CSI=CSmanager->GetCrossSection(true,Momentum,Z,N,pPDG);//CS(j,i) for isotope
|
||||
#ifdef debug
|
||||
G4cout<<"GQC::GMF:X="<<CSI<<",M="<<Momentum<<",Z="<<Z<<",N="<<N<<",P="<<pPDG<<G4endl;
|
||||
#endif
|
||||
curIs->second = CSI; // Remenber the calculated cross-section
|
||||
susi+=CSI; // Make a sum per isotopes
|
||||
SPI->push_back(susi); // Remember summed cross-section
|
||||
} // End of temporary initialization of the cross sections in the G4QIsotope singeltone
|
||||
sigma+=Isotopes->GetMeanCrossSection(Z,indEl)*NOfNucPerVolume[i];//SUM(MeanCS*NOfNperV)
|
||||
ElProbInMat.push_back(sigma);
|
||||
} // End of LOOP over Elements
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCol::GetMeanFrPa: S="<<sigma<<",e="<<photNucBias<<",w="<<weakNucBias<<G4endl;
|
||||
#endif
|
||||
// Check that cross section is not zero and return the mean free path
|
||||
if(sigma > 0.) return 1./sigma; // Mean path [distance]
|
||||
return DBL_MAX; // If Sigma=0, return max value for PATH
|
||||
}
|
||||
|
||||
// Check applicability of the process
|
||||
G4bool G4QGluonString::IsApplicable(const G4ParticleDefinition& particle)
|
||||
{
|
||||
if (particle == *( G4Proton::Proton() )) return true;
|
||||
//else if (particle == *( G4Neutron::Neutron() )) return true;
|
||||
//else if (particle == *( G4PionMinus::PionMinus() )) return true;
|
||||
//else if (particle == *( G4PionPlus::PionPlus() )) return true;
|
||||
//else if (particle == *( G4KaonPlus::KaonPlus() )) return true;
|
||||
//else if (particle == *( G4KaonMinus::KaonMinus() )) return true;
|
||||
//else if (particle == *( G4KaonZeroLong::KaonZeroLong() )) return true;
|
||||
//else if (particle == *( G4KaonZeroShort::KaonZeroShort() )) return true;
|
||||
//else if (particle == *( G4Lambda::Lambda() )) return true;
|
||||
//else if (particle == *( G4SigmaPlus::SigmaPlus() )) return true;
|
||||
//else if (particle == *( G4SigmaMinus::SigmaMinus() )) return true;
|
||||
//else if (particle == *( G4SigmaZero::SigmaZero() )) return true;
|
||||
//else if (particle == *( G4XiMinus::XiMinus() )) return true;
|
||||
//else if (particle == *( G4XiZero::XiZero() )) return true;
|
||||
//else if (particle == *( G4OmegaMinus::OmegaMinus() )) return true;
|
||||
//else if (particle == *( G4AntiNeutron::AntiNeutron() )) return true;
|
||||
//else if (particle == *( G4AntiProton::AntiProton() )) return true;
|
||||
//else if (particle == *( G4AntiLambda::AntiLambda() )) return true;
|
||||
//else if (particle == *( G4AntiSigmaPlus::AntiSigmaPlus() )) return true;
|
||||
//else if (particle == *(G4AntiSigmaMinus::AntiSigmaMinus())) return true;
|
||||
//else if (particle == *( G4AntiSigmaZero::AntiSigmaZero() )) return true;
|
||||
//else if (particle == *( G4AntiXiMinus::AntiXiMinus() )) return true;
|
||||
//else if (particle == *( G4AntiXiZero::AntiXiZero() )) return true;
|
||||
//else if (particle == *(G4AntiOmegaMinus::AntiOmegaMinus())) return true;
|
||||
else G4cerr<<"***G4QGluonString::IsApplicable: PDG?="<<particle.GetPDGEncoding()<<G4endl;
|
||||
#ifdef debug
|
||||
G4cout<<"***G4QGluonString::IsApplicable: PDG="<<particle.GetPDGEncoding()<<G4endl;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
G4VParticleChange* G4QGluonString::PostStepDoIt(const G4Track& track, const G4Step& step)
|
||||
{
|
||||
//static const G4double dpi=M_PI+M_PI; // 2*pi (for Phi distr.) ***changed to twopi***
|
||||
//static const G4double mNeut= G4QPDGCode(2112).GetMass();
|
||||
//static const G4double mNeut2= mNeut*mNeut; // Squared neutron mass
|
||||
//static const G4double mProt= G4QPDGCode(2212).GetMass();
|
||||
//static const G4double mProt2= mProt*mProt; // Squared Proton mass
|
||||
//static const G4double dM=mProt+mNeut; // doubled nucleon mass
|
||||
//static const G4double hdM=dM/2.; // M of the "nucleon"
|
||||
//static const G4double hdM2=hdM*hdM; // M2 of the "nucleon"
|
||||
//static const G4double mPi0 = G4QPDGCode(111).GetMass();
|
||||
//static const G4double mDeut= G4QPDGCode(2112).GetNuclMass(1,1,0);
|
||||
//static const G4double mPi = G4QPDGCode(211).GetMass();
|
||||
//static const G4double tmPi = mPi+mPi; // DoubledMass of the charged pion
|
||||
//static const G4double stmPi= tmPi*tmPi; // SquareDoubledMass of ChargedPion
|
||||
//static const G4double mPPi = mPi+mProt; // Delta threshold
|
||||
//static const G4double mPPi2= mPPi*mPPi; // Delta low threshold for W2
|
||||
//-------------------------------------------------------------------------------------
|
||||
const G4DynamicParticle* projHadron = track.GetDynamicParticle();
|
||||
const G4ParticleDefinition* particle=projHadron->GetDefinition();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: Before the GetMeanFreePath is called"<<G4endl;
|
||||
#endif
|
||||
G4ForceCondition cond=NotForced;
|
||||
GetMeanFreePath(track, 1., &cond); // Just to check that still sig>0
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: After the GetMeanFreePath is called"<<G4endl;
|
||||
#endif
|
||||
G4LorentzVector proj4M=projHadron->Get4Momentum();
|
||||
G4double momentum = projHadron->GetTotalMomentum(); // 3-momentum of the Particle
|
||||
G4double Momentum=proj4M.rho();
|
||||
if(std::fabs(Momentum-momentum)>.001)
|
||||
G4cerr<<"G4QGluonString::PostStepDoIt: P="<<Momentum<<"="<<momentum<<G4endl;
|
||||
#ifdef debug
|
||||
G4double mp=proj4M.m();
|
||||
G4cout<<"G4QGluonString::PostStepDoIt is called, P="<<Momentum<<"="<<momentum<<G4endl;
|
||||
#endif
|
||||
if (!IsApplicable(*particle)) // Check applicability
|
||||
{
|
||||
G4cerr<<"G4QGluonString::PostStepDoIt:Only gam,e+,e-,mu+,mu-,t+,t-,p are implemented."
|
||||
<<G4endl;
|
||||
return 0;
|
||||
}
|
||||
const G4Material* material = track.GetMaterial(); // Get the current material
|
||||
G4int Z=0;
|
||||
const G4ElementVector* theElementVector = material->GetElementVector();
|
||||
G4int nE=material->GetNumberOfElements();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: "<<nE<<" elements in the material."<<G4endl;
|
||||
#endif
|
||||
G4int projPDG=0; // PDG Code prototype for the captured hadron
|
||||
// Not all these particles are implemented yet (see Is Applicable)
|
||||
if (particle == G4Proton::Proton() ) projPDG= 2212;
|
||||
//else if (particle == G4Neutron::Neutron() ) projPDG= 2112;
|
||||
//else if (particle == G4PionMinus::PionMinus() ) projPDG= -211;
|
||||
//else if (particle == G4PionPlus::PionPlus() ) projPDG= 211;
|
||||
//else if (particle == G4KaonPlus::KaonPlus() ) projPDG= 2112;
|
||||
//else if (particle == G4KaonMinus::KaonMinus() ) projPDG= -321;
|
||||
//else if (particle == G4KaonZeroLong::KaonZeroLong() ) projPDG= 130;
|
||||
//else if (particle == G4KaonZeroShort::KaonZeroShort() ) projPDG= 310;
|
||||
//else if (particle == G4TauPlus::TauPlus() ) projPDG= -15;
|
||||
//else if (particle == G4TauMinus::TauMinus() ) projPDG= 15;
|
||||
//else if (particle == G4NeutrinoTau::NeutrinoTau() ) projPDG= 16;
|
||||
//else if (particle == G4AntiNeutrinoTau::AntiNeutrinoTau()) projPDG= -16;
|
||||
//else if (particle == G4Lambda::Lambda() ) projPDG= 3122;
|
||||
//else if (particle == G4SigmaPlus::SigmaPlus() ) projPDG= 3222;
|
||||
//else if (particle == G4SigmaMinus::SigmaMinus() ) projPDG= 3112;
|
||||
//else if (particle == G4SigmaZero::SigmaZero() ) projPDG= 3212;
|
||||
//else if (particle == G4XiMinus::XiMinus() ) projPDG= 3312;
|
||||
//else if (particle == G4XiZero::XiZero() ) projPDG= 3322;
|
||||
//else if (particle == G4OmegaMinus::OmegaMinus() ) projPDG= 3334;
|
||||
//else if (particle == G4AntiNeutron::AntiNeutron() ) projPDG=-2112;
|
||||
//else if (particle == G4AntiProton::AntiProton() ) projPDG=-2212;
|
||||
//else if (particle == G4AntiLambda::AntiLambda() ) projPDG=-3122;
|
||||
//else if (particle == G4AntiSigmaPlus::AntiSigmaPlus() ) projPDG=-3222;
|
||||
//else if (particle == G4AntiSigmaMinus::AntiSigmaMinus() ) projPDG=-3112;
|
||||
//else if (particle == G4AntiSigmaZero::AntiSigmaZero() ) projPDG=-3212;
|
||||
//else if (particle == G4AntiXiMinus::AntiXiMinus() ) projPDG=-3312;
|
||||
//else if (particle == G4AntiXiZero::AntiXiZero() ) projPDG=-3322;
|
||||
//else if (particle == G4AntiOmegaMinus::AntiOmegaMinus() ) projPDG=-3334;
|
||||
//G4int aProjPDG=std::abs(projPDG);
|
||||
#ifdef debug
|
||||
G4int prPDG=particle->GetPDGEncoding();
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: projPDG="<<projPDG<<", stPDG="<<prPDG<<G4endl;
|
||||
#endif
|
||||
if(!projPDG)
|
||||
{
|
||||
G4cerr<<"--Warning--G4QGluonString::PostStepDoIt:Undefined interacting hadron"<<G4endl;
|
||||
return 0;
|
||||
}
|
||||
G4int EPIM=ElProbInMat.size();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollis::PostStDoIt: m="<<EPIM<<",n="<<nE<<",T="<<ElProbInMat[EPIM-1]<<G4endl;
|
||||
#endif
|
||||
G4int i=0;
|
||||
if(EPIM>1)
|
||||
{
|
||||
G4double rnd = ElProbInMat[EPIM-1]*G4UniformRand();
|
||||
for(i=0; i<nE; ++i)
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt:E["<<i<<"]="<<ElProbInMat[i]<<",r="<<rnd<<G4endl;
|
||||
#endif
|
||||
if (rnd<ElProbInMat[i]) break;
|
||||
}
|
||||
if(i>=nE) i=nE-1; // Top limit for the Element
|
||||
}
|
||||
G4Element* pElement=(*theElementVector)[i];
|
||||
Z=static_cast<G4int>(pElement->GetZ());
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: i="<<i<<", Z(element)="<<Z<<G4endl;
|
||||
#endif
|
||||
if(Z<=0)
|
||||
{
|
||||
G4cerr<<"---Warning---G4QGluonString::PostStepDoIt: Element with Z="<<Z<<G4endl;
|
||||
if(Z<0) return 0;
|
||||
}
|
||||
std::vector<G4double>* SPI = IsoProbInEl[i];// Vector of summedProbabilities for isotopes
|
||||
std::vector<G4int>* IsN = ElIsoN[i]; // Vector of "#of neutrons" in the isotope El[i]
|
||||
G4int nofIsot=SPI->size(); // #of isotopes in the element i
|
||||
#ifdef debug
|
||||
G4cout<<"G4QCollis::PosStDoIt:n="<<nofIsot<<",T="<<(*SPI)[nofIsot-1]<<G4endl;
|
||||
#endif
|
||||
G4int j=0;
|
||||
if(nofIsot>1)
|
||||
{
|
||||
G4double rndI=(*SPI)[nofIsot-1]*G4UniformRand(); // Randomize the isotop of the Element
|
||||
for(j=0; j<nofIsot; ++j)
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: SP["<<j<<"]="<<(*SPI)[j]<<", r="<<rndI<<G4endl;
|
||||
#endif
|
||||
if(rndI < (*SPI)[j]) break;
|
||||
}
|
||||
if(j>=nofIsot) j=nofIsot-1; // Top limit for the isotope
|
||||
}
|
||||
G4int N =(*IsN)[j]; ; // Randomized number of neutrons
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: j="<<i<<", N(isotope)="<<N<<G4endl;
|
||||
#endif
|
||||
if(N<0)
|
||||
{
|
||||
G4cerr<<"-Warning-G4QGluonString::PostStepDoIt:Isotope with N="<<Z<<"<0,Z="<<Z<<G4endl;
|
||||
return 0;
|
||||
}
|
||||
nOfNeutrons=N; // Remember it for the energy-momentum check
|
||||
G4double dd=0.025;
|
||||
G4double am=Z+N;
|
||||
G4double sr=std::sqrt(am);
|
||||
G4double dsr=0.01*(sr+sr);
|
||||
if(dsr<dd)dsr=dd;
|
||||
if(manualFlag) G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio);// ManualPa
|
||||
//else if(projPDG==-2212) G4QNucleus::SetParameters(1.-dsr-dsr,dd+dd,5.,10.);//aP CluPars
|
||||
//else if(projPDG==-211) G4QNucleus::SetParameters(.67-dsr,.32-dsr,5.,9.); //Pi- CluPars
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: N="<<N<<" for element with Z="<<Z<<G4endl;
|
||||
#endif
|
||||
if(N<0)
|
||||
{
|
||||
G4cerr<<"---Warning---G4QGluonString::PostStepDoIt:Element with N="<<N<< G4endl;
|
||||
return 0;
|
||||
}
|
||||
aParticleChange.Initialize(track);
|
||||
G4double localtime = track.GetGlobalTime();
|
||||
G4ThreeVector position = track.GetPosition();
|
||||
G4TouchableHandle trTouchable = track.GetTouchableHandle();
|
||||
//
|
||||
G4int targPDG=90000000+Z*1000+N; // PDG Code of the target nucleus
|
||||
// =========================
|
||||
G4QPDGCode targQPDG(targPDG);
|
||||
G4double tM=targQPDG.GetMass();
|
||||
G4QHadronVector* output=new G4QHadronVector;// Prototype of EnvironOutput G4QHadronVector
|
||||
G4double absMom = 0.; // Prototype of absorbed by nucleus Moment
|
||||
G4QHadronVector* leadhs=new G4QHadronVector;// Prototype of QuasmOutput G4QHadronVectorum
|
||||
G4LorentzVector lead4M(0.,0.,0.,0.); // Prototype of LeadingQ 4-momentum
|
||||
EnMomConservation=proj4M+G4LorentzVector(0.,0.,0.,tM); // Total 4-mom of the reaction
|
||||
if(absMom) EnMomConservation+=lead4M; // Add E/M of leading System
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: projPDG="<<projPDG<<", targPDG="<<targPDG<<G4endl;
|
||||
#endif
|
||||
//G4QHadron* pH = new G4QHadron(projPDG,proj4M);
|
||||
// @@@@@@@@@@@@@@@@@@@@@@@@@@ Hrere the CHIPS_QGS must be implemented @@@@@@@@@@@@@@@
|
||||
G4int qNH=leadhs->size();
|
||||
if(absMom)
|
||||
{
|
||||
if(qNH) for(G4int iq=0; iq<qNH; iq++)
|
||||
{
|
||||
G4QHadron* loh=(*leadhs)[iq]; // Pointer to the output hadron
|
||||
output->push_back(loh);
|
||||
}
|
||||
delete leadhs;
|
||||
}
|
||||
// ------------- From here the secondaries are filled -------------------------
|
||||
G4int tNH = output->size(); // A#of hadrons in the output
|
||||
aParticleChange.SetNumberOfSecondaries(tNH);
|
||||
// Now add nuclear fragments
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: "<<tNH<<" particles are generated"<<G4endl;
|
||||
#endif
|
||||
#ifdef ppdebug
|
||||
if(absMom)G4cout<<"G4QGluonString::PostStepDoIt: t="<<tNH<<", q="<<qNH<<G4endl;
|
||||
#endif
|
||||
G4int nOut=output->size(); // Real length of the output @@ Temporary
|
||||
if(tNH==1) // @@ Temporary. Find out why it happened!
|
||||
{
|
||||
G4cout<<"-Warning-G4QGluonString::PostStepDoIt: 1 secondary! absMom="<<absMom;
|
||||
if(absMom) G4cout<<", qNH="<<qNH;
|
||||
G4cout<<", PDG0="<<(*output)[0]->GetPDGCode();
|
||||
G4cout<<G4endl;
|
||||
tNH=0;
|
||||
delete output->operator[](0); // delete the creazy hadron
|
||||
output->pop_back(); // clean up the output vector
|
||||
}
|
||||
if(tNH==2&&2!=nOut) G4cout<<"--Warning--G4QGluonString::PostStepDoIt:2 # "<<nOut<<G4endl;
|
||||
// Deal with ParticleChange final state interface to GEANT4 output of the process
|
||||
//if(tNH==2) for(i=0; i<tNH; i++) // @@ Temporary tNH==2 instead of just tNH
|
||||
if(tNH) for(i=0; i<tNH; i++) // @@ Temporary tNH==2 instead of just tNH
|
||||
{
|
||||
// Note that one still has to take care of Hypernuclei (with Lambda or Sigma inside)
|
||||
// Hypernucleus mass calculation and ion-table interface upgrade => work for Hisaya @@
|
||||
// The decau process for hypernuclei must be developed in GEANT4 (change CHIPS body)
|
||||
G4QHadron* hadr=(*output)[i]; // Pointer to the output hadron
|
||||
G4int PDGCode = hadr->GetPDGCode();
|
||||
G4int nFrag = hadr->GetNFragments();
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QGluonString::AtRestDoIt: H#"<<i<<",PDG="<<PDGCode<<",nF="<<nFrag<<G4endl;
|
||||
#endif
|
||||
if(nFrag) // Skip intermediate (decayed) hadrons
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt: Intermediate particle is found i="<<i<<G4endl;
|
||||
#endif
|
||||
delete hadr;
|
||||
continue;
|
||||
}
|
||||
G4DynamicParticle* theSec = new G4DynamicParticle;
|
||||
G4ParticleDefinition* theDefinition;
|
||||
if (PDGCode==90000001) theDefinition = G4Neutron::Neutron();
|
||||
else if(PDGCode==90001000) theDefinition = G4Proton::Proton();//While it can be in ions
|
||||
else if(PDGCode==91000000) theDefinition = G4Lambda::Lambda();
|
||||
else if(PDGCode==311 || PDGCode==-311)
|
||||
{
|
||||
if(G4UniformRand()>.5) theDefinition = G4KaonZeroLong::KaonZeroLong(); // K_L
|
||||
else theDefinition = G4KaonZeroShort::KaonZeroShort(); // K_S
|
||||
}
|
||||
else if(PDGCode==91000999) theDefinition = G4SigmaPlus::SigmaPlus();
|
||||
else if(PDGCode==90999001) theDefinition = G4SigmaMinus::SigmaMinus();
|
||||
else if(PDGCode==91999000) theDefinition = G4XiMinus::XiMinus();
|
||||
else if(PDGCode==91999999) theDefinition = G4XiZero::XiZero();
|
||||
else if(PDGCode==92998999) theDefinition = G4OmegaMinus::OmegaMinus();
|
||||
else if(PDGCode >80000000) // Defines hypernuclei as normal nuclei (N=N+S Correction!)
|
||||
{
|
||||
G4int aZ = hadr->GetCharge();
|
||||
G4int aA = hadr->GetBaryonNumber();
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QGluonString::AtRestDoIt:Ion Z="<<aZ<<", A="<<aA<<G4endl;
|
||||
#endif
|
||||
theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,aA,0,aZ);
|
||||
}
|
||||
//else theDefinition = G4ParticleTable::GetParticleTable()->FindParticle(PDGCode);
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt:Define particle with PDG="<<PDGCode<<G4endl;
|
||||
#endif
|
||||
theDefinition = G4QPDGToG4Particle::Get()->GetParticleDefinition(PDGCode);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt:AfterParticleDefinition PDG="<<PDGCode<<G4endl;
|
||||
#endif
|
||||
}
|
||||
if(!theDefinition)
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"---Warning---G4QGluonString::PostStepDoIt: drop PDG="<<PDGCode<<G4endl;
|
||||
#endif
|
||||
delete hadr;
|
||||
continue;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt:Name="<<theDefinition->GetParticleName()<<G4endl;
|
||||
#endif
|
||||
theSec->SetDefinition(theDefinition);
|
||||
G4LorentzVector h4M=hadr->Get4Momentum();
|
||||
EnMomConservation-=h4M;
|
||||
#ifdef tdebug
|
||||
G4cout<<"G4QCollis::PSDI:"<<i<<","<<PDGCode<<h4M<<h4M.m()<<EnMomConservation<<G4endl;
|
||||
#endif
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt:#"<<i<<",PDG="<<PDGCode<<",4M="<<h4M<<G4endl;
|
||||
#endif
|
||||
theSec->Set4Momentum(h4M); // ^
|
||||
delete hadr; // <-----<-----------<-------------<---------------------<---------<-----+
|
||||
#ifdef debug
|
||||
G4ThreeVector curD=theSec->GetMomentumDirection(); // ^
|
||||
G4double curM=theSec->GetMass(); // |
|
||||
G4double curE=theSec->GetKineticEnergy()+curM; // ^
|
||||
G4cout<<"G4QCollis::PSDoIt:p="<<curD<<curD.mag()<<",e="<<curE<<",m="<<curM<<G4endl;// |
|
||||
#endif
|
||||
G4Track* aNewTrack = new G4Track(theSec, localtime, position ); // ^
|
||||
aNewTrack->SetTouchableHandle(trTouchable); // |
|
||||
aParticleChange.AddSecondary( aNewTrack ); // |
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt:#"<<i<<" is done"<<G4endl;// |
|
||||
#endif
|
||||
} // |
|
||||
delete output; // instances of the G4QHadrons from the output are already deleted above +
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStDoIt: afterSt="<<aParticleChange.GetTrackStatus()<<G4endl;
|
||||
#endif
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill); // Kill the absorbed particle
|
||||
#ifdef debug
|
||||
G4cout<<"G4QGluonString::PostStepDoIt:*** PostStepDoIt is done ***, P="<<aProjPDG
|
||||
<<", St="<<aParticleChange.GetTrackStatus()<<G4endl;
|
||||
#endif
|
||||
return G4VDiscreteProcess::PostStepDoIt(track, step);
|
||||
}
|
||||
+184
-5
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QMuonNuclearCrossSection.cc,v 1.7 2006/06/29 20:08:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QMuonNuclearCrossSection.cc,v 1.11 2006/12/04 10:44:22 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4QMuonNuclearCrossSection for gamma+A cross sections
|
||||
@@ -39,8 +39,8 @@
|
||||
//=========================================================================================
|
||||
|
||||
//#define debug
|
||||
#define edebug
|
||||
//#define pdebug
|
||||
#define edebug
|
||||
//#define ppdebug
|
||||
//#define tdebug
|
||||
//#define sdebug
|
||||
@@ -58,6 +58,13 @@ G4double G4QMuonNuclearCrossSection::lastH=0.; // LastValue of theHighEnergy A
|
||||
G4double* G4QMuonNuclearCrossSection::lastJ1=0; // Pointer to the LastArray of J1 function
|
||||
G4double* G4QMuonNuclearCrossSection::lastJ2=0; // Pointer to the LastArray of J2 function
|
||||
G4double* G4QMuonNuclearCrossSection::lastJ3=0; // Pointer to the LastArray of J3 function
|
||||
G4int G4QMuonNuclearCrossSection::lastPDG=0; // The last PDG code of the projectile
|
||||
G4int G4QMuonNuclearCrossSection::lastN=0; // The last N of calculated nucleus
|
||||
G4int G4QMuonNuclearCrossSection::lastZ=0; // The last Z of calculated nucleus
|
||||
G4double G4QMuonNuclearCrossSection::lastP=0.; // Last used in cross section Momentum
|
||||
G4double G4QMuonNuclearCrossSection::lastTH=0.; // Last threshold momentum
|
||||
G4double G4QMuonNuclearCrossSection::lastCS=0.; // Last value of the Cross Section
|
||||
G4int G4QMuonNuclearCrossSection::lastI=0; // The last position in the DAMDB
|
||||
|
||||
// Returns Pointer to the G4VQCrossSection class
|
||||
G4VQCrossSection* G4QMuonNuclearCrossSection::GetPointer()
|
||||
@@ -66,6 +73,178 @@ G4VQCrossSection* G4QMuonNuclearCrossSection::GetPointer()
|
||||
return &theCrossSection;
|
||||
}
|
||||
|
||||
// The main member function giving the collision cross section (P is in IU, CS is in mb)
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4QMuonNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
|
||||
G4int tgZ, G4int tgN, G4int pPDG)
|
||||
{
|
||||
static const G4double mmu=105.65839; // Mass of the muon in MeV
|
||||
static const G4double mmu2=mmu*mmu; // Squared Mass of muon in MeV^2
|
||||
static G4int j; // A#0f records found in DB for this projectile
|
||||
static std::vector <G4int> colPDG;// Vector of the projectile PDG code
|
||||
static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
|
||||
static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
|
||||
static std::vector <G4double> colP; // Vector of last momenta for the reaction
|
||||
static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
|
||||
static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
G4double pEn=std::sqrt(pMom*pMom+mmu2)-mmu; // ==> mu-/mu+ kinEnergy
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
|
||||
<<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
|
||||
<<colN.size()<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(std::abs(pPDG)!=13)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // projectile PDG=0 is a mistake (?!) @@
|
||||
}
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
|
||||
{
|
||||
in = false; // By default the isotope haven't be found in AMDB
|
||||
lastP = 0.; // New momentum history (nothing to compare with)
|
||||
lastPDG = pPDG; // The last PDG of the projectile
|
||||
lastN = tgN; // The last N of the calculated nucleus
|
||||
lastZ = tgZ; // The last Z of the calculated nucleus
|
||||
lastI = colN.size(); // Size of the Associative Memory DB in the heap
|
||||
j = 0; // A#0f records found in DB for this projectile
|
||||
if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
|
||||
{ // The nucleus with projPDG is found in AMDB
|
||||
if(colN[i]==tgN && colZ[i]==tgZ)
|
||||
{
|
||||
lastI=i;
|
||||
lastTH =colTH[i]; // Last THreshold (A-dependent)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Energy is below the Threshold value
|
||||
}
|
||||
lastP =colP [i]; // Last Momentum (A-dependent)
|
||||
lastCS =colCS[i]; // Last CrossSect (A-dependent)
|
||||
if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
#endif
|
||||
CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // Update param's only
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
in = true; // This is the case when the isotop is found in DB
|
||||
// Momentum pMom is in IU ! @@ Units
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // read & update
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(lastCS<=0. && pEn>lastTH) // Correct the threshold
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
break; // Go out of the LOOP
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"---G4QMNCrossSec::GetCrosSec:pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
|
||||
<<",Z["<<i<<"]="<<colZ[i]<<",cPDG="<<colPDG[i]<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
j++; // Increment a#0f records found in DB for this pPDG
|
||||
}
|
||||
if(!in) // This nucleus has not been calculated previously
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
|
||||
#endif
|
||||
//!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
|
||||
lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
|
||||
if(lastCS<=0.)
|
||||
{
|
||||
lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
|
||||
#endif
|
||||
if(pEn>lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
colN.push_back(tgN);
|
||||
colZ.push_back(tgZ);
|
||||
colPDG.push_back(pPDG);
|
||||
colP.push_back(pMom);
|
||||
colTH.push_back(lastTH);
|
||||
colCS.push_back(lastCS);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
} // End of creation of the new set of parameters
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
colP[lastI]=pMom;
|
||||
colPDG[lastI]=pPDG;
|
||||
colCS[lastI]=lastCS;
|
||||
}
|
||||
} // End of parameters udate
|
||||
else if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Momentum is below the Threshold Value -> CS=0
|
||||
}
|
||||
else if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
|
||||
lastP=pMom;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QMNCS::GetCroSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
}
|
||||
|
||||
// Gives the threshold energy for different nuclei (min of p- and n-threshold)
|
||||
// *******************************************************************************
|
||||
// *** This function is the same for all lepto- & photo-nuclear reactions, for ***
|
||||
@@ -85,7 +264,7 @@ G4double G4QMuonNuclearCrossSection::ThresholdEnergy(G4int Z, G4int N, G4int)
|
||||
|
||||
G4int A=Z+N;
|
||||
if(A<1) return infEn;
|
||||
else if(A==1) return 135.; // Pi0 threshold for the nucleon
|
||||
else if(A==1) return 160.; // Pi0 threshold in MeV for the proton:T>m+(m^2+2lm)/2M,l=m_mu
|
||||
// CHIPS - Direct GEANT
|
||||
//G4double mT= G4QPDGCode(111).GetNuclMass(Z,N,0);
|
||||
G4double mT= 0.;
|
||||
@@ -2447,7 +2626,7 @@ G4double G4QMuonNuclearCrossSection::GetExchangeEnergy()
|
||||
#endif
|
||||
if(ris<Y[lastL]) // Search in the table
|
||||
{
|
||||
G4int j=lastF;
|
||||
G4int j=lastF;
|
||||
G4double Yj=Y[j]; // It mast be 0 (some times just very small)
|
||||
while (ris>Yj && j<lastL) // Associative search
|
||||
{
|
||||
|
||||
+179
-2
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QNuMuNuclearCrossSection.cc,v 1.9 2006/06/29 20:08:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QNuMuNuclearCrossSection.cc,v 1.10 2006/12/01 10:57:47 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4QNuMuNuclearCrossSection for gamma+A cross sections
|
||||
@@ -56,6 +56,13 @@ G4double G4QNuMuNuclearCrossSection::lastE=0.; // Last used in cross section T
|
||||
G4double* G4QNuMuNuclearCrossSection::lastEN=0; // Pointer to the Energy Scale of TX & QE
|
||||
G4double* G4QNuMuNuclearCrossSection::lastTX=0; // Pointer to the LastArray of TX function
|
||||
G4double* G4QNuMuNuclearCrossSection::lastQE=0; // Pointer to the LastArray of QE function
|
||||
G4int G4QNuMuNuclearCrossSection::lastPDG=0; // The last PDG code of the projectile
|
||||
G4int G4QNuMuNuclearCrossSection::lastN=0; // The last N of calculated nucleus
|
||||
G4int G4QNuMuNuclearCrossSection::lastZ=0; // The last Z of calculated nucleus
|
||||
G4double G4QNuMuNuclearCrossSection::lastP=0.; // Last used in cross section Momentum
|
||||
G4double G4QNuMuNuclearCrossSection::lastTH=0.; // Last threshold momentum
|
||||
G4double G4QNuMuNuclearCrossSection::lastCS=0.; // Last value of the Cross Section
|
||||
G4int G4QNuMuNuclearCrossSection::lastI=0; // The last position in the DAMDB
|
||||
|
||||
// Returns Pointer to the G4VQCrossSection class
|
||||
G4VQCrossSection* G4QNuMuNuclearCrossSection::GetPointer()
|
||||
@@ -64,6 +71,176 @@ G4VQCrossSection* G4QNuMuNuclearCrossSection::GetPointer()
|
||||
return &theCrossSection;
|
||||
}
|
||||
|
||||
// The main member function giving the collision cross section (P is in IU, CS is in mb)
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4QNuMuNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
|
||||
G4int tgZ, G4int tgN, G4int pPDG)
|
||||
{
|
||||
static G4int j; // A#0f records found in DB for this projectile
|
||||
static std::vector <G4int> colPDG;// Vector of the projectile PDG code
|
||||
static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
|
||||
static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
|
||||
static std::vector <G4double> colP; // Vector of last momenta for the reaction
|
||||
static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
|
||||
static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
G4double pEn=pMom;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS:>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
|
||||
<<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
|
||||
<<colN.size()<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pPDG!=14)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // projectile PDG=0 is a mistake (?!) @@
|
||||
}
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
|
||||
{
|
||||
in = false; // By default the isotope haven't be found in AMDB
|
||||
lastP = 0.; // New momentum history (nothing to compare with)
|
||||
lastPDG = pPDG; // The last PDG of the projectile
|
||||
lastN = tgN; // The last N of the calculated nucleus
|
||||
lastZ = tgZ; // The last Z of the calculated nucleus
|
||||
lastI = colN.size(); // Size of the Associative Memory DB in the heap
|
||||
j = 0; // A#0f records found in DB for this projectile
|
||||
if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
|
||||
{ // The nucleus with projPDG is found in AMDB
|
||||
if(colN[i]==tgN && colZ[i]==tgZ)
|
||||
{
|
||||
lastI=i;
|
||||
lastTH =colTH[i]; // Last THreshold (A-dependent)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS:*Found*P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",X=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Energy is below the Threshold value
|
||||
}
|
||||
lastP =colP [i]; // Last Momentum (A-dependent)
|
||||
lastCS =colCS[i]; // Last CrossSect (A-dependent)
|
||||
if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
in = true; // This is the case when the isotop is found in DB
|
||||
// Momentum pMom is in IU ! @@ Units
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::G:UpdaDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // read & update
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(lastCS<=0. && pEn>lastTH) // Correct the threshold
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
break; // Go out of the LOOP
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"---G4QNMNCrossSec::GetCrosSec:pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
|
||||
<<",Z["<<i<<"]="<<colZ[i]<<",cPDG="<<colPDG[i]<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
j++; // Increment a#0f records found in DB for this pPDG
|
||||
}
|
||||
if(!in) // This nucleus has not been calculated previously
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCrSec: CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
|
||||
#endif
|
||||
//!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
|
||||
lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
|
||||
if(lastCS<=0.)
|
||||
{
|
||||
lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCrossSection::GetCrossSect:NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
|
||||
#endif
|
||||
if(pEn>lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCrosSec:New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
colN.push_back(tgN);
|
||||
colZ.push_back(tgZ);
|
||||
colPDG.push_back(pPDG);
|
||||
colP.push_back(pMom);
|
||||
colTH.push_back(lastTH);
|
||||
colCS.push_back(lastCS);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS:1st,P="<<pMom<<"(MeV),X="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
} // End of creation of the new set of parameters
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
colP[lastI]=pMom;
|
||||
colPDG[lastI]=pPDG;
|
||||
colCS[lastI]=lastCS;
|
||||
}
|
||||
} // End of parameters udate
|
||||
else if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Momentum is below the Threshold Value -> CS=0
|
||||
}
|
||||
else if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCS:UpdaCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
|
||||
lastP=pMom;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QNMNCS::GetCrSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
}
|
||||
|
||||
// Gives the threshold energy = the same for all nuclei (@@ can be reduced for hevy nuclei)
|
||||
G4double G4QNuMuNuclearCrossSection::ThresholdEnergy(G4int Z, G4int N, G4int)
|
||||
{
|
||||
|
||||
+178
-1
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4QPhotonNuclearCrossSection for gamma+A cross sections
|
||||
@@ -51,6 +51,13 @@ G4double* G4QPhotonNuclearCrossSection::lastGDR=0; // Pointer to the lastArray o
|
||||
G4double* G4QPhotonNuclearCrossSection::lastHEN=0; // Pointer to the last array of HEn CS
|
||||
G4double G4QPhotonNuclearCrossSection::lastE=0.; // LastUsed in CrossSections TheEnergy
|
||||
G4double G4QPhotonNuclearCrossSection::lastSP=0.; // Last value of ShadowingPomeron(A-dep)
|
||||
G4int G4QPhotonNuclearCrossSection::lastPDG=0; // The last PDG code of the projectile
|
||||
G4int G4QPhotonNuclearCrossSection::lastN=0; // The last N of calculated nucleus
|
||||
G4int G4QPhotonNuclearCrossSection::lastZ=0; // The last Z of calculated nucleus
|
||||
G4double G4QPhotonNuclearCrossSection::lastP=0.; // Last used in cross section Momentum
|
||||
G4double G4QPhotonNuclearCrossSection::lastTH=0.; // Last threshold momentum
|
||||
G4double G4QPhotonNuclearCrossSection::lastCS=0.; // Last value of the Cross Section
|
||||
G4int G4QPhotonNuclearCrossSection::lastI=0; // The last position in the DAMDB
|
||||
|
||||
// Returns Pointer to the G4VQCrossSection class
|
||||
G4VQCrossSection* G4QPhotonNuclearCrossSection::GetPointer()
|
||||
@@ -59,6 +66,176 @@ G4VQCrossSection* G4QPhotonNuclearCrossSection::GetPointer()
|
||||
return &theCrossSection;
|
||||
}
|
||||
|
||||
// The main member function giving the collision cross section (P is in IU, CS is in mb)
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4QPhotonNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
|
||||
G4int tgZ, G4int tgN, G4int pPDG)
|
||||
{
|
||||
static G4int j; // A#0f records found in DB for this projectile
|
||||
static std::vector <G4int> colPDG;// Vector of the projectile PDG code
|
||||
static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
|
||||
static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
|
||||
static std::vector <G4double> colP; // Vector of last momenta for the reaction
|
||||
static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
|
||||
static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
G4double pEn=pMom;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
|
||||
<<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
|
||||
<<colN.size()<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(!pPDG)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // projectile PDG=0 is a mistake (?!) @@
|
||||
}
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
|
||||
{
|
||||
in = false; // By default the isotope haven't be found in AMDB
|
||||
lastP = 0.; // New momentum history (nothing to compare with)
|
||||
lastPDG = pPDG; // The last PDG of the projectile
|
||||
lastN = tgN; // The last N of the calculated nucleus
|
||||
lastZ = tgZ; // The last Z of the calculated nucleus
|
||||
lastI = colN.size(); // Size of the Associative Memory DB in the heap
|
||||
j = 0; // A#0f records found in DB for this projectile
|
||||
if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
|
||||
{ // The nucleus with projPDG is found in AMDB
|
||||
if(colN[i]==tgN && colZ[i]==tgZ)
|
||||
{
|
||||
lastI=i;
|
||||
lastTH =colTH[i]; // Last THreshold (A-dependent)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Energy is below the Threshold value
|
||||
}
|
||||
lastP =colP [i]; // Last Momentum (A-dependent)
|
||||
lastCS =colCS[i]; // Last CrossSect (A-dependent)
|
||||
if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
#endif
|
||||
CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // Update param's only
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
in = true; // This is the case when the isotop is found in DB
|
||||
// Momentum pMom is in IU ! @@ Units
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // read & update
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(lastCS<=0. && pEn>lastTH) // Correct the threshold
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
break; // Go out of the LOOP
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"---G4QPhCrossSec::GetCrosSec:pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
|
||||
<<",Z["<<i<<"]="<<colZ[i]<<",cPDG="<<colPDG[i]<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
j++; // Increment a#0f records found in DB for this pPDG
|
||||
}
|
||||
if(!in) // This nucleus has not been calculated previously
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
|
||||
#endif
|
||||
//!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
|
||||
lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
|
||||
if(lastCS<=0.)
|
||||
{
|
||||
lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
|
||||
#endif
|
||||
if(pEn>lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
colN.push_back(tgN);
|
||||
colZ.push_back(tgZ);
|
||||
colPDG.push_back(pPDG);
|
||||
colP.push_back(pMom);
|
||||
colTH.push_back(lastTH);
|
||||
colCS.push_back(lastCS);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
} // End of creation of the new set of parameters
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
colP[lastI]=pMom;
|
||||
colPDG[lastI]=pPDG;
|
||||
colCS[lastI]=lastCS;
|
||||
}
|
||||
} // End of parameters udate
|
||||
else if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Momentum is below the Threshold Value -> CS=0
|
||||
}
|
||||
else if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
|
||||
lastP=pMom;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPhCS::GetCroSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
}
|
||||
|
||||
// Gives the threshold energy for different nuclei (min of p- and n-threshold)
|
||||
// *******************************************************************************
|
||||
// *** This function is the same for all lepto- & photo-nuclear reactions, for ***
|
||||
|
||||
+182
-4
@@ -25,15 +25,16 @@
|
||||
//
|
||||
//
|
||||
// The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4QProtonNuclearCrossSection for gamma+A cross sections
|
||||
// Created: M.V. Kossov, CERN/ITEP(Moscow), 20-Dec-03
|
||||
// The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Feb-04
|
||||
// ***************************************************************************************
|
||||
// ********** This CLASS is temporary moved from the photolepton_hadron directory *********
|
||||
// ******* DO NOT MAKE ANY CHANGE! With time it'll move back to photolepton...(M.K.) ******
|
||||
// --------------------------------------------------------------------------------
|
||||
// ****************************************************************************************
|
||||
// ***** This HEADER is a property of the CHIPS hadronic package in Geant4 (M. Kosov) *****
|
||||
// *********** DO NOT MAKE ANY CHANGE without approval of Mikhail.Kossov@cern.ch **********
|
||||
// ****************************************************************************************
|
||||
//
|
||||
//#define debug
|
||||
@@ -48,6 +49,13 @@
|
||||
G4double* G4QProtonNuclearCrossSection::lastLEN=0; // Pointer to the lastArray of LowEn CS
|
||||
G4double* G4QProtonNuclearCrossSection::lastHEN=0; // Pointer to the lastArray of HighEn CS
|
||||
G4double G4QProtonNuclearCrossSection::lastSP=0.; // Last value of ShadowingPomeron(A-dep)
|
||||
G4int G4QProtonNuclearCrossSection::lastPDG=0; // The last PDG code of the projectile
|
||||
G4int G4QProtonNuclearCrossSection::lastN=0; // The last N of calculated nucleus
|
||||
G4int G4QProtonNuclearCrossSection::lastZ=0; // The last Z of calculated nucleus
|
||||
G4double G4QProtonNuclearCrossSection::lastP=0.; // Last used in cross section Momentum
|
||||
G4double G4QProtonNuclearCrossSection::lastTH=0.; // Last threshold momentum
|
||||
G4double G4QProtonNuclearCrossSection::lastCS=0.; // Last value of the Cross Section
|
||||
G4int G4QProtonNuclearCrossSection::lastI=0; // The last position in the DAMDB
|
||||
|
||||
// Returns Pointer to the G4VQCrossSection class
|
||||
G4VQCrossSection* G4QProtonNuclearCrossSection::GetPointer()
|
||||
@@ -56,6 +64,176 @@ G4VQCrossSection* G4QProtonNuclearCrossSection::GetPointer()
|
||||
return &theCrossSection;
|
||||
}
|
||||
|
||||
// The main member function giving the collision cross section (P is in IU, CS is in mb)
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4QProtonNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
|
||||
G4int tgZ, G4int tgN, G4int pPDG)
|
||||
{
|
||||
static G4int j; // A#0f records found in DB for this projectile
|
||||
static std::vector <G4int> colPDG;// Vector of the projectile PDG code
|
||||
static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
|
||||
static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
|
||||
static std::vector <G4double> colP; // Vector of last momenta for the reaction
|
||||
static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
|
||||
static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
G4double pEn=pMom;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
|
||||
<<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
|
||||
<<colN.size()<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(!pPDG)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // projectile PDG=0 is a mistake (?!) @@
|
||||
}
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
|
||||
{
|
||||
in = false; // By default the isotope haven't be found in AMDB
|
||||
lastP = 0.; // New momentum history (nothing to compare with)
|
||||
lastPDG = pPDG; // The last PDG of the projectile
|
||||
lastN = tgN; // The last N of the calculated nucleus
|
||||
lastZ = tgZ; // The last Z of the calculated nucleus
|
||||
lastI = colN.size(); // Size of the Associative Memory DB in the heap
|
||||
j = 0; // A#0f records found in DB for this projectile
|
||||
if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
|
||||
{ // The nucleus with projPDG is found in AMDB
|
||||
if(colN[i]==tgN && colZ[i]==tgZ)
|
||||
{
|
||||
lastI=i;
|
||||
lastTH =colTH[i]; // Last THreshold (A-dependent)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Energy is below the Threshold value
|
||||
}
|
||||
lastP =colP [i]; // Last Momentum (A-dependent)
|
||||
lastCS =colCS[i]; // Last CrossSect (A-dependent)
|
||||
if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
#endif
|
||||
CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // Update param's only
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
in = true; // This is the case when the isotop is found in DB
|
||||
// Momentum pMom is in IU ! @@ Units
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // read & update
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(lastCS<=0. && pEn>lastTH) // Correct the threshold
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
break; // Go out of the LOOP
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"---G4QPrCrossSec::GetCrosSec:pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
|
||||
<<",Z["<<i<<"]="<<colZ[i]<<",cPDG="<<colPDG[i]<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
j++; // Increment a#0f records found in DB for this pPDG
|
||||
}
|
||||
if(!in) // This nucleus has not been calculated previously
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
|
||||
#endif
|
||||
//!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
|
||||
lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
|
||||
if(lastCS<=0.)
|
||||
{
|
||||
lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
|
||||
#endif
|
||||
if(pEn>lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
colN.push_back(tgN);
|
||||
colZ.push_back(tgZ);
|
||||
colPDG.push_back(pPDG);
|
||||
colP.push_back(pMom);
|
||||
colTH.push_back(lastTH);
|
||||
colCS.push_back(lastCS);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
} // End of creation of the new set of parameters
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
colP[lastI]=pMom;
|
||||
colPDG[lastI]=pPDG;
|
||||
colCS[lastI]=lastCS;
|
||||
}
|
||||
} // End of parameters udate
|
||||
else if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Momentum is below the Threshold Value -> CS=0
|
||||
}
|
||||
else if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
|
||||
lastP=pMom;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QPrCS::GetCroSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
}
|
||||
|
||||
// The main member function giving the gamma-A cross section (E in GeV, CS in mb)
|
||||
G4double G4QProtonNuclearCrossSection::CalculateCrossSection(G4bool, G4int F, G4int I,
|
||||
G4int, G4int targZ, G4int targN, G4double Momentum)
|
||||
|
||||
+600
@@ -0,0 +1,600 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
|
||||
//#define debug
|
||||
//#define pdebug
|
||||
|
||||
#include "G4QStringChipsParticleLevelInterface.hh"
|
||||
#include "globals.hh"
|
||||
#include <utility>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include "G4KineticTrackVector.hh"
|
||||
#include "G4Nucleon.hh"
|
||||
#include "G4Proton.hh"
|
||||
#include "G4Neutron.hh"
|
||||
#include "G4LorentzRotation.hh"
|
||||
#include "G4HadronicException.hh"
|
||||
// #define CHIPSdebug
|
||||
// #define CHIPSdebug_1
|
||||
|
||||
G4QStringChipsParticleLevelInterface::G4QStringChipsParticleLevelInterface()
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Constructor is called"<<G4endl;
|
||||
#endif
|
||||
theEnergyLossPerFermi = 1.*GeV;
|
||||
nop = 152; // clusters (A<6)
|
||||
fractionOfSingleQuasiFreeNucleons = 0.5; // It is A-dependent (C=.85, U=.40)
|
||||
fractionOfPairedQuasiFreeNucleons = 0.05;
|
||||
clusteringCoefficient = 5.;
|
||||
temperature = 180.;
|
||||
halfTheStrangenessOfSee = 0.3; // = s/d = s/u
|
||||
etaToEtaPrime = 0.3;
|
||||
fusionToExchange = 100.;
|
||||
theInnerCoreDensityCut = 50.;
|
||||
|
||||
if(getenv("ChipsParameterTuning"))
|
||||
{
|
||||
G4cout << "Please enter the energy loss per fermi in GeV"<<G4endl;
|
||||
G4cin >> theEnergyLossPerFermi;
|
||||
theEnergyLossPerFermi *= GeV;
|
||||
G4cout << "Please enter nop"<<G4endl;
|
||||
G4cin >> nop;
|
||||
G4cout << "Please enter the fractionOfSingleQuasiFreeNucleons"<<G4endl;
|
||||
G4cin >> fractionOfSingleQuasiFreeNucleons;
|
||||
G4cout << "Please enter the fractionOfPairedQuasiFreeNucleons"<<G4endl;
|
||||
G4cin >> fractionOfPairedQuasiFreeNucleons;
|
||||
G4cout << "Please enter the clusteringCoefficient"<<G4endl;
|
||||
G4cin >> clusteringCoefficient;
|
||||
G4cout << "Please enter the temperature"<<G4endl;
|
||||
G4cin >> temperature;
|
||||
G4cout << "Please enter halfTheStrangenessOfSee"<<G4endl;
|
||||
G4cin >> halfTheStrangenessOfSee;
|
||||
G4cout << "Please enter the etaToEtaPrime"<<G4endl;
|
||||
G4cin >> etaToEtaPrime;
|
||||
G4cout << "Please enter the fusionToExchange"<<G4endl;
|
||||
G4cin >> fusionToExchange;
|
||||
G4cout << "Please enter cut-off for calculating the nuclear radius in percent"<<G4endl;
|
||||
G4cin >> theInnerCoreDensityCut;
|
||||
}
|
||||
}
|
||||
|
||||
G4HadFinalState* G4QStringChipsParticleLevelInterface::
|
||||
ApplyYourself(const G4HadProjectile& aTrack, G4Nucleus& theNucleus)
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::ApplyYourself is called"<<G4endl;
|
||||
#endif
|
||||
return theModel.ApplyYourself(aTrack, theNucleus);
|
||||
}
|
||||
|
||||
G4ReactionProductVector* G4QStringChipsParticleLevelInterface::
|
||||
Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
|
||||
{
|
||||
static const G4double mProt=G4Proton::Proton()->GetPDGMass();
|
||||
static const G4double mNeut=G4Neutron::Neutron()->GetPDGMass();
|
||||
static const G4double mLamb=G4Lambda::Lambda()->GetPDGMass();
|
||||
#ifdef debug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate is called"<<G4endl;
|
||||
#endif
|
||||
// Protection for non physical conditions
|
||||
|
||||
if(theSecondaries->size() == 1)
|
||||
{
|
||||
G4ReactionProductVector* theFastResult = new G4ReactionProductVector;
|
||||
G4ReactionProduct* theFastSec;
|
||||
theFastSec = new G4ReactionProduct((*theSecondaries)[0]->GetDefinition());
|
||||
G4LorentzVector current4Mom = (*theSecondaries)[0]->Get4Momentum();
|
||||
theFastSec->SetTotalEnergy(current4Mom.t());
|
||||
theFastSec->SetMomentum(current4Mom.vect());
|
||||
theFastResult->push_back(theFastSec);
|
||||
return theFastResult;
|
||||
//throw G4HadronicException(__FILE__,__LINE__,
|
||||
// "G4QStringChipsParticleLevelInterface: Only one particle from String models!");
|
||||
}
|
||||
|
||||
// target properties needed in constructor of quasmon, and for boosting to
|
||||
// target rest frame
|
||||
// remove all nucleons already involved in STRING interaction, to make the ResidualTarget
|
||||
theNucleus->StartLoop();
|
||||
G4Nucleon * aNucleon;
|
||||
G4int resA = 0;
|
||||
G4int resZ = 0;
|
||||
G4ThreeVector hitMomentum(0,0,0);
|
||||
G4double hitMass = 0;
|
||||
unsigned int hitCount = 0;
|
||||
while((aNucleon = theNucleus->GetNextNucleon()))
|
||||
{
|
||||
if(!aNucleon->AreYouHit())
|
||||
{
|
||||
resA++; // Collect A of the ResidNuc
|
||||
resZ+=G4int (aNucleon->GetDefinition()->GetPDGCharge()); // Collect Z of the ResidNuc
|
||||
}
|
||||
else
|
||||
{
|
||||
hitMomentum += aNucleon->GetMomentum().vect(); // Sum 3-mom of StringHadr's
|
||||
hitMass += aNucleon->GetMomentum().m(); // Sum masses of StringHadrs
|
||||
hitCount ++; // Calculate STRING hadrons
|
||||
}
|
||||
}
|
||||
G4int targetPDGCode = 90000000 + 1000*resZ + (resA-resZ); // PDG of theResidualNucleus
|
||||
G4double targetMass = theNucleus->GetMass(); // Its mass
|
||||
targetMass -= hitMass; // subtract masses of knocked out nucleons (binding?! M.K.) E/M
|
||||
G4double targetEnergy = std::sqrt(hitMomentum.mag2()+targetMass*targetMass);
|
||||
// !! @@ Target should be at rest: hitMomentum=(0,0,0) @@ !! M.K. (go to this system)
|
||||
G4LorentzVector targ4Mom(-1.*hitMomentum, targetEnergy);
|
||||
|
||||
// Calculate the mean energy lost
|
||||
std::pair<G4double, G4double> theImpact = theNucleus->RefetchImpactXandY();
|
||||
G4double impactX = theImpact.first;
|
||||
G4double impactY = theImpact.second;
|
||||
G4double inpactPar2 = impactX*impactX + impactY*impactY;
|
||||
|
||||
G4double radius2 = theNucleus->GetNuclearRadius(theInnerCoreDensityCut*perCent);
|
||||
radius2 *= radius2;
|
||||
G4double pathlength = 0.;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: r="<<std::sqrt(radius2)/fermi
|
||||
<<", b="<<std::sqrt(inpactPar2)/fermi<<", R="<<theNucleus->GetOuterRadius()/fermi
|
||||
<<", b/r="<<std::sqrt(inpactPar2/radius2)<<G4endl;
|
||||
#endif
|
||||
if(radius2 - inpactPar2>0) pathlength = 2.*std::sqrt(radius2 - inpactPar2);
|
||||
G4double theEnergyLostInFragmentation = theEnergyLossPerFermi*pathlength/fermi;
|
||||
|
||||
// now select all particles in range
|
||||
std::list<std::pair<G4double, G4KineticTrack *> > theSorted; // Output
|
||||
std::list<std::pair<G4double, G4KineticTrack *> >::iterator current; // Input
|
||||
for(unsigned int secondary = 0; secondary<theSecondaries->size(); secondary++)
|
||||
{
|
||||
G4LorentzVector a4Mom = theSecondaries->operator[](secondary)->Get4Momentum();
|
||||
#ifdef CHIPSdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: ALL STRING particles "
|
||||
<< theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<" "
|
||||
<< theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()<<" "
|
||||
<< a4Mom <<G4endl;
|
||||
#endif
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: in C="
|
||||
<<theSecondaries->operator[](secondary)->GetDefinition()->GetPDGCharge()<<",PDG="
|
||||
<<theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()
|
||||
<<",4M="<<a4Mom<<", current nS="<<theSorted.size()<<G4endl;
|
||||
#endif
|
||||
G4double toSort = a4Mom.rapidity(); // Rapidity is used for the ordering (?!)
|
||||
std::pair<G4double, G4KineticTrack *> it;
|
||||
it.first = toSort;
|
||||
it.second = theSecondaries->operator[](secondary);
|
||||
G4bool inserted = false;
|
||||
for(current = theSorted.begin(); current!=theSorted.end(); current++)
|
||||
{
|
||||
if((*current).first > toSort) // The current is smaller then existing
|
||||
{
|
||||
theSorted.insert(current, it); // It shifts the others up
|
||||
inserted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!inserted) theSorted.push_back(it); // It is bigger than any previous
|
||||
}
|
||||
|
||||
G4LorentzVector proj4Mom(0.,0.,0.,0.);
|
||||
G4int nD = 0;
|
||||
G4int nU = 0;
|
||||
G4int nS = 0;
|
||||
G4int nAD = 0;
|
||||
G4int nAU = 0;
|
||||
G4int nAS = 0;
|
||||
std::list<std::pair<G4double,G4KineticTrack*> >::iterator firstEscape=theSorted.begin();
|
||||
G4double runningEnergy = 0;
|
||||
G4int particleCount = 0;
|
||||
G4LorentzVector theLow = (*(theSorted.begin())).second->Get4Momentum();
|
||||
G4LorentzVector theHigh;
|
||||
|
||||
#ifdef CHIPSdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: CHIPS ENERGY LOST "
|
||||
<<theEnergyLostInFragmentation<<". Sorted rapidities event start"<<G4endl;
|
||||
#endif
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: total CHIPS energy = "
|
||||
<<theEnergyLostInFragmentation<<". Start rapidity sorting nS="<<theSorted.size()
|
||||
<<G4endl;
|
||||
#endif
|
||||
|
||||
G4QHadronVector projHV;
|
||||
std::vector<G4QContent> theContents;
|
||||
std::vector<G4LorentzVector*> theMomenta;
|
||||
G4ReactionProductVector* theResult = new G4ReactionProductVector;
|
||||
G4ReactionProduct* theSec;
|
||||
G4KineticTrackVector* secondaries;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: Absorption nS="
|
||||
<<theSorted.size()<<G4endl;
|
||||
#endif
|
||||
|
||||
for(current = theSorted.begin(); current!=theSorted.end(); current++)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: nq="
|
||||
<<(*current).second->GetDefinition()->GetQuarkContent(3)<<", naq="
|
||||
<<(*current).second->GetDefinition()->GetAntiQuarkContent(3)<<", PDG="
|
||||
<<(*current).second->GetDefinition()->GetPDGEncoding()<<",4M="
|
||||
<<(*current).second->Get4Momentum()<<G4endl;
|
||||
#endif
|
||||
firstEscape = current; // Remember to make decays for the rest
|
||||
G4KineticTrack* aResult = (*current).second;
|
||||
// This is an old (H.P.) solution, which makes an error in En/Mom conservation
|
||||
//
|
||||
// @@ Now it does not include strange particle for the absorption in nuclei (?!) M.K.
|
||||
//if((*current).second->GetDefinition()->GetQuarkContent(3)!=0 ||
|
||||
// (*current).second->GetDefinition()->GetAntiQuarkContent(3) !=0) // Strange quarks
|
||||
//{
|
||||
// G4ParticleDefinition* pdef = aResult->GetDefinition();
|
||||
// secondaries = NULL;
|
||||
// if ( pdef->GetPDGWidth() > 0 && pdef->GetPDGLifeTime() < 5E-17*s )
|
||||
// secondaries = aResult->Decay(); // @@ Decay of only strange resonances (?!) M.K.
|
||||
// if ( secondaries == NULL ) // No decay
|
||||
// {
|
||||
// theSec = new G4ReactionProduct(aResult->GetDefinition());
|
||||
// G4LorentzVector current4Mom = aResult->Get4Momentum();
|
||||
// current4Mom.boost(targ4Mom.boostVector()); // boost from the targetAtRes system
|
||||
// theSec->SetTotalEnergy(current4Mom.t());
|
||||
// theSec->SetMomentum(current4Mom.vect());
|
||||
// theResult->push_back(theSec);
|
||||
// }
|
||||
// else // The decay happened
|
||||
// {
|
||||
// for (unsigned int aSecondary=0; aSecondary<secondaries->size(); aSecondary++)
|
||||
// {
|
||||
// theSec =
|
||||
// new G4ReactionProduct(secondaries->operator[](aSecondary)->GetDefinition());
|
||||
// G4LorentzVector current4Mom=secondaries->operator[](aSecondary)->Get4Momentum();
|
||||
// current4Mom.boost(targ4Mom.boostVector());
|
||||
// theSec->SetTotalEnergy(current4Mom.t());
|
||||
// theSec->SetMomentum(current4Mom.vect());
|
||||
// theResult->push_back(theSec);
|
||||
// }
|
||||
// std::for_each(secondaries->begin(), secondaries->end(), DeleteKineticTrack());
|
||||
// delete secondaries;
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//runningEnergy += (*current).second->Get4Momentum().t();
|
||||
//if((*current).second->GetDefinition() == G4Proton::Proton())
|
||||
// runningEnergy-=G4Proton::Proton()->GetPDGMass();
|
||||
//if((*current).second->GetDefinition() == G4Neutron::Neutron())
|
||||
// runningEnergy-=G4Neutron::Neutron()->GetPDGMass();
|
||||
//if((*current).second->GetDefinition() == G4Lambda::Lambda())
|
||||
// runningEnergy-=G4Lambda::Lambda()->GetPDGMass();
|
||||
//
|
||||
// New solution starts from here (M.Kossov March 2006) [Strange particles included]
|
||||
runningEnergy += aResult->Get4Momentum().t();
|
||||
G4double charge=aResult->GetDefinition()->GetPDGCharge(); // Charge of the particle
|
||||
G4int strang=aResult->GetDefinition()->GetQuarkContent(3);// Its strangeness
|
||||
G4int baryn=aResult->GetDefinition()->GetBaryonNumber(); // Its baryon number
|
||||
if (baryn>0 && charge>0 && strang<1) runningEnergy-=mProt; // For positive baryons
|
||||
else if(baryn>0 && strang<1) runningEnergy-=mNeut; // For neut/neg baryons
|
||||
else if(baryn>0) runningEnergy-=mLamb; // For strange baryons
|
||||
else if(baryn<0) runningEnergy+=mProt; // For anti-particles
|
||||
// ------------ End of the new solution
|
||||
#ifdef CHIPSdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: sorted rapidities "
|
||||
<<(*current).second->Get4Momentum().rapidity()<<G4endl;
|
||||
#endif
|
||||
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: E="<<runningEnergy<<", EL="
|
||||
<<theEnergyLostInFragmentation<<G4endl;
|
||||
#endif
|
||||
|
||||
if(runningEnergy > theEnergyLostInFragmentation) break;
|
||||
|
||||
#ifdef CHIPSdebug
|
||||
G4cout <<"G4QStringChipsParticleLevelInterface::Propagate: ABSORBED STRING particles "
|
||||
<<(*current).second->GetDefinition()->GetPDGCharge()<<" "
|
||||
<< (*current).second->GetDefinition()->GetPDGEncoding()<<" "
|
||||
<< (*current).second->Get4Momentum() <<G4endl;
|
||||
#endif
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate:C="
|
||||
<<current->second->GetDefinition()->GetPDGCharge()<<", PDG="
|
||||
<<current->second->GetDefinition()->GetPDGEncoding()<<", 4M="
|
||||
<<current->second->Get4Momentum()<<G4endl;
|
||||
#endif
|
||||
|
||||
// projectile 4-momentum in target rest frame needed in constructor of QHadron
|
||||
particleCount++;
|
||||
theHigh = (*current).second->Get4Momentum();
|
||||
proj4Mom = (*current).second->Get4Momentum();
|
||||
proj4Mom.boost(-1.*targ4Mom.boostVector()); // Back to the system of nucleusAtRest
|
||||
nD = (*current).second->GetDefinition()->GetQuarkContent(1);
|
||||
nU = (*current).second->GetDefinition()->GetQuarkContent(2);
|
||||
nS = (*current).second->GetDefinition()->GetQuarkContent(3);
|
||||
nAD = (*current).second->GetDefinition()->GetAntiQuarkContent(1);
|
||||
nAU = (*current).second->GetDefinition()->GetAntiQuarkContent(2);
|
||||
nAS = (*current).second->GetDefinition()->GetAntiQuarkContent(3);
|
||||
G4QContent aProjectile(nD, nU, nS, nAD, nAU, nAS);
|
||||
|
||||
#ifdef CHIPSdebug_1
|
||||
G4cout <<G4endl;
|
||||
G4cout <<"G4QStringChipsParticleLevelInterface::Propagate: Quark content: d="<<nD
|
||||
<<", u="<<nU<<", s="<<nS<< "Anti-quark content: anit-d="<<nAD<<", anti-u="<<nAU
|
||||
<<", anti-s="<<nAS<<". G4QContent is constructed"<<endl;
|
||||
#endif
|
||||
|
||||
theContents.push_back(aProjectile);
|
||||
G4LorentzVector* aVec = new G4LorentzVector((1./MeV)*proj4Mom); // @@ MeV is basic
|
||||
|
||||
#ifdef CHIPSdebug_1
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: projectile momentum = "
|
||||
<<*aVec<<G4endl;
|
||||
G4cout << G4endl;
|
||||
#endif
|
||||
|
||||
theMomenta.push_back(aVec);
|
||||
}
|
||||
std::vector<G4QContent> theFinalContents;
|
||||
std::vector<G4LorentzVector*> theFinalMomenta;
|
||||
if(theContents.size()<hitCount || 1) // Looks like the "else" is closed by "|| 1"
|
||||
{
|
||||
for(unsigned int hp = 0; hp<theContents.size(); hp++)
|
||||
{
|
||||
G4QHadron* aHadron = new G4QHadron(theContents[hp], *(theMomenta[hp]) );
|
||||
projHV.push_back(aHadron);
|
||||
}
|
||||
}
|
||||
else // Never come here (!?)
|
||||
{
|
||||
unsigned int hp;
|
||||
for(hp=0; hp<hitCount; hp++) // Initialize the arrays
|
||||
{
|
||||
G4QContent co(0, 0, 0, 0, 0, 0);
|
||||
theFinalContents.push_back(co);
|
||||
G4LorentzVector* mo = new G4LorentzVector(0,0,0,0);
|
||||
theFinalMomenta.push_back(mo);
|
||||
}
|
||||
unsigned int running = 0;
|
||||
while (running<theContents.size())
|
||||
{
|
||||
for(hp = 0; hp<hitCount; hp++)
|
||||
{
|
||||
theFinalContents[hp] +=theContents[running];
|
||||
*(theFinalMomenta[hp])+=*(theMomenta[running]);
|
||||
running++;
|
||||
if(running == theContents.size()) break;
|
||||
}
|
||||
}
|
||||
for(hp = 0; hp<hitCount; hp++)
|
||||
{
|
||||
G4QHadron* aHadron = new G4QHadron(theFinalContents[hp], *theFinalMomenta[hp]);
|
||||
projHV.push_back(aHadron);
|
||||
}
|
||||
}
|
||||
// construct the quasmon
|
||||
size_t i;
|
||||
for (i=0; i<theFinalMomenta.size(); i++) delete theFinalMomenta[i];
|
||||
for (i=0; i<theMomenta.size(); i++) delete theMomenta[i];
|
||||
theFinalMomenta.clear();
|
||||
theMomenta.clear();
|
||||
|
||||
G4QNucleus::SetParameters(fractionOfSingleQuasiFreeNucleons,
|
||||
fractionOfPairedQuasiFreeNucleons,
|
||||
clusteringCoefficient,
|
||||
fusionToExchange);
|
||||
G4Quasmon::SetParameters(temperature, halfTheStrangenessOfSee, etaToEtaPrime);
|
||||
|
||||
#ifdef CHIPSdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: G4QNucleus parameters "
|
||||
<<fractionOfSingleQuasiFreeNucleons<<" "<<fractionOfPairedQuasiFreeNucleons
|
||||
<<" "<<clusteringCoefficient<<G4endl;
|
||||
G4cout<<"G4Quasmon parameters "<<temperature<<" "<<halfTheStrangenessOfSee<<" "
|
||||
<<etaToEtaPrime << G4endl;
|
||||
G4cout<<"The Target PDG code = "<<targetPDGCode<<G4endl;
|
||||
G4cout<<"The projectile momentum = "<<1./MeV*proj4Mom<<G4endl;
|
||||
G4cout<<"The target momentum = "<<1./MeV*targ4Mom<<G4endl;
|
||||
#endif
|
||||
|
||||
// now call chips with this info in place
|
||||
G4QHadronVector* output = 0;
|
||||
if (particleCount!=0 && resA!=0)
|
||||
{
|
||||
// G4QCHIPSWorld aWorld(nop); // Create CHIPS World of nop particles
|
||||
G4QCHIPSWorld::Get()->GetParticles(nop);
|
||||
G4QEnvironment* pan= new G4QEnvironment(projHV, targetPDGCode);
|
||||
try
|
||||
{
|
||||
output = pan->Fragment(); // The main fragmentation member function
|
||||
}
|
||||
catch(G4HadronicException& aR)
|
||||
{
|
||||
G4cerr << "Exception thrown of G4QStringChipsParticleLevelInterface "<<G4endl;
|
||||
G4cerr << " targetPDGCode = "<< targetPDGCode <<G4endl;
|
||||
G4cerr << " The projectile momentum = "<<1./MeV*proj4Mom<<G4endl;
|
||||
G4cerr << " The target momentum = "<<1./MeV*targ4Mom<<G4endl<<G4endl;
|
||||
G4cerr << " Dumping the information in the pojectile list"<<G4endl;
|
||||
for(size_t i=0; i< projHV.size(); i++)
|
||||
{
|
||||
G4cerr <<" Incoming 4-momentum and PDG code of "<<i<<"'th hadron: "
|
||||
<<" "<< projHV[i]->Get4Momentum()<<" "<<projHV[i]->GetPDGCode()<<G4endl;
|
||||
}
|
||||
throw;
|
||||
}
|
||||
// clean up particles
|
||||
std::for_each(projHV.begin(), projHV.end(), DeleteQHadron());
|
||||
projHV.clear();
|
||||
delete pan;
|
||||
}
|
||||
else output = new G4QHadronVector;
|
||||
|
||||
// Fill the result.
|
||||
#ifdef CHIPSdebug
|
||||
G4cout << "NEXT EVENT"<<endl;
|
||||
#endif
|
||||
|
||||
// first decay and add all escaping particles.
|
||||
for(current = firstEscape; current!=theSorted.end(); current++)
|
||||
{
|
||||
G4KineticTrack* aResult = (*current).second;
|
||||
G4ParticleDefinition* pdef=aResult->GetDefinition();
|
||||
secondaries = NULL;
|
||||
if(pdef->GetPDGWidth() > 0 && pdef->GetPDGLifeTime() < 5E-17*s )
|
||||
{
|
||||
secondaries = aResult->Decay(); // @@ Uses standard Decay, which is now wrong!
|
||||
}
|
||||
if ( secondaries == NULL )
|
||||
{
|
||||
theSec = new G4ReactionProduct(aResult->GetDefinition());
|
||||
G4LorentzVector current4Mom = aResult->Get4Momentum();
|
||||
current4Mom.boost(targ4Mom.boostVector());
|
||||
theSec->SetTotalEnergy(current4Mom.t());
|
||||
theSec->SetMomentum(current4Mom.vect());
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
|
||||
<<aResult->GetDefinition()->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
|
||||
#endif
|
||||
theResult->push_back(theSec);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int aSecondary=0; aSecondary<secondaries->size(); aSecondary++)
|
||||
{
|
||||
theSec=new G4ReactionProduct(secondaries->operator[](aSecondary)->GetDefinition());
|
||||
G4LorentzVector current4Mom = secondaries->operator[](aSecondary)->Get4Momentum();
|
||||
current4Mom.boost(targ4Mom.boostVector());
|
||||
theSec->SetTotalEnergy(current4Mom.t());
|
||||
theSec->SetMomentum(current4Mom.vect());
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
|
||||
<<secondaries->operator[](aSecondary)->GetDefinition()->GetPDGEncoding()
|
||||
<<",4M="<<current4Mom<<G4endl;
|
||||
#endif
|
||||
theResult->push_back(theSec);
|
||||
}
|
||||
std::for_each(secondaries->begin(), secondaries->end(), DeleteKineticTrack());
|
||||
delete secondaries;
|
||||
}
|
||||
}
|
||||
std::for_each(theSecondaries->begin(), theSecondaries->end(), DeleteKineticTrack());
|
||||
delete theSecondaries;
|
||||
|
||||
// now add the quasmon output
|
||||
G4int maxParticle=output->size();
|
||||
#ifdef CHIPSdebug
|
||||
G4cout << "Number of particles from string"<<theResult->size()<<G4endl;
|
||||
G4cout << "Number of particles from chips"<<maxParticle<<G4endl;
|
||||
#endif
|
||||
#ifdef pdebug
|
||||
G4cout << "Number of particles from QGS="<<theResult->size()<<G4endl;
|
||||
G4cout << "Number of particles from CHIPS="<<maxParticle<<G4endl;
|
||||
#endif
|
||||
if(maxParticle) for(G4int particle = 0; particle < maxParticle; particle++)
|
||||
{
|
||||
if(output->operator[](particle)->GetNFragments() != 0)
|
||||
{
|
||||
delete output->operator[](particle);
|
||||
continue;
|
||||
}
|
||||
G4int pdgCode = output->operator[](particle)->GetPDGCode();
|
||||
|
||||
|
||||
#ifdef CHIPSdebug
|
||||
G4cerr << "PDG code of chips particle = "<<pdgCode<<G4endl;
|
||||
#endif
|
||||
|
||||
G4ParticleDefinition * theDefinition;
|
||||
// Note that I still have to take care of strange nuclei
|
||||
// For this I need the mass calculation, and a changed interface
|
||||
// for ion-table ==> work for Hisaya @@@@@@@
|
||||
// Then I can sort out the pdgCode. I also need a decau process
|
||||
// for strange nuclei; may be another chips interface
|
||||
if(pdgCode>90000000)
|
||||
{
|
||||
G4int aZ = (pdgCode-90000000)/1000;
|
||||
if (aZ>1000) aZ=aZ%1000; // patch for strange nuclei, to be repaired @@@@
|
||||
G4int anN = pdgCode-90000000-1000*aZ;
|
||||
if(anN>1000) anN=anN%1000; // patch for strange nuclei, to be repaired @@@@
|
||||
if(pdgCode==91000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==92000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==93000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==94000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==95000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==96000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==97000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==98000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(aZ == 0 && anN == 1) theDefinition = G4Neutron::Neutron();
|
||||
else theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,anN+aZ,0,aZ);
|
||||
}
|
||||
else theDefinition = G4ParticleTable::GetParticleTable()->FindParticle(pdgCode);
|
||||
|
||||
#ifdef CHIPSdebug
|
||||
G4cout << "Particle code produced = "<< pdgCode <<G4endl;
|
||||
#endif
|
||||
|
||||
if(theDefinition)
|
||||
{
|
||||
theSec = new G4ReactionProduct(theDefinition);
|
||||
G4LorentzVector current4Mom = output->operator[](particle)->Get4Momentum();
|
||||
current4Mom.boost(targ4Mom.boostVector());
|
||||
theSec->SetTotalEnergy(current4Mom.t());
|
||||
theSec->SetMomentum(current4Mom.vect());
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QStringChipsParticleLevelInterface::Propagate: *OUT* CHIPS PDG="
|
||||
<<theDefinition->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
|
||||
#endif
|
||||
theResult->push_back(theSec);
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cerr << G4endl<<"WARNING: "<<G4endl;
|
||||
G4cerr << "Getting unknown pdgCode from chips in ParticleLevelInterface"<<G4endl;
|
||||
G4cerr << "skipping particle with pdgCode = "<<pdgCode<<G4endl<<G4endl;
|
||||
}
|
||||
|
||||
#ifdef CHIPSdebug
|
||||
G4cout <<"CHIPS particles "<<theDefinition->GetPDGCharge()<<" "
|
||||
<< theDefinition->GetPDGEncoding()<<" "
|
||||
<< output->operator[](particle)->Get4Momentum() <<G4endl;
|
||||
#endif
|
||||
|
||||
delete output->operator[](particle);
|
||||
}
|
||||
delete output;
|
||||
|
||||
#ifdef CHIPSdebug
|
||||
G4cout << "Number of particles"<<theResult->size()<<G4endl;
|
||||
G4cout << G4endl;
|
||||
G4cout << "QUASMON preparation info "
|
||||
<< 1./MeV*proj4Mom<<" "
|
||||
<< 1./MeV*targ4Mom<<" "
|
||||
<< nD<<" "<<nU<<" "<<nS<<" "<<nAD<<" "<<nAU<<" "<<nAS<<" "
|
||||
<< hitCount<<" "
|
||||
<< particleCount<<" "
|
||||
<< theLow<<" "
|
||||
<< theHigh<<" "
|
||||
<< G4endl;
|
||||
#endif
|
||||
|
||||
return theResult;
|
||||
}
|
||||
+182
-3
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4QTauNuclearCrossSection.cc,v 1.7 2006/06/29 20:08:47 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4QTauNuclearCrossSection.cc,v 1.10 2006/12/04 10:44:22 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// G4 Physics class: G4QTauNuclearCrossSection for gamma+A cross sections
|
||||
@@ -58,6 +58,13 @@ G4double G4QTauNuclearCrossSection::lastH=0.; // LastValue of theHighEnergy A-
|
||||
G4double* G4QTauNuclearCrossSection::lastJ1=0; // Pointer to the LastArray of J1 function
|
||||
G4double* G4QTauNuclearCrossSection::lastJ2=0; // Pointer to the LastArray of J2 function
|
||||
G4double* G4QTauNuclearCrossSection::lastJ3=0; // Pointer to the LastArray of J3 function
|
||||
G4int G4QTauNuclearCrossSection::lastPDG=0; // The last PDG code of the projectile
|
||||
G4int G4QTauNuclearCrossSection::lastN=0; // The last N of calculated nucleus
|
||||
G4int G4QTauNuclearCrossSection::lastZ=0; // The last Z of calculated nucleus
|
||||
G4double G4QTauNuclearCrossSection::lastP=0.; // Last used in cross section Momentum
|
||||
G4double G4QTauNuclearCrossSection::lastTH=0.; // Last threshold momentum
|
||||
G4double G4QTauNuclearCrossSection::lastCS=0.; // Last value of the Cross Section
|
||||
G4int G4QTauNuclearCrossSection::lastI=0; // The last position in the DAMDB
|
||||
|
||||
// Returns Pointer to the G4VQCrossSection class
|
||||
G4VQCrossSection* G4QTauNuclearCrossSection::GetPointer()
|
||||
@@ -66,6 +73,178 @@ G4VQCrossSection* G4QTauNuclearCrossSection::GetPointer()
|
||||
return &theCrossSection;
|
||||
}
|
||||
|
||||
// The main member function giving the collision cross section (P is in IU, CS is in mb)
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4QTauNuclearCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
|
||||
G4int tgZ, G4int tgN, G4int pPDG)
|
||||
{
|
||||
static const G4double mtu=1777.; // Mass of a tau lepton in MeV
|
||||
static const G4double mtu2=mtu*mtu; // Squared Mass of a tau-lepton in MeV^2
|
||||
static G4int j; // A#0f records found in DB for this projectile
|
||||
static std::vector <G4int> colPDG;// Vector of the projectile PDG code
|
||||
static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
|
||||
static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
|
||||
static std::vector <G4double> colP; // Vector of last momenta for the reaction
|
||||
static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
|
||||
static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
G4double pEn=std::sqrt(pMom*pMom+mtu2)-mtu; // ==> tau-/tau+ kinEnergy
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
|
||||
<<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
|
||||
<<colN.size()<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(std::abs(pPDG)!=15)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // projectile PDG=0 is a mistake (?!) @@
|
||||
}
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
|
||||
{
|
||||
in = false; // By default the isotope haven't be found in AMDB
|
||||
lastP = 0.; // New momentum history (nothing to compare with)
|
||||
lastPDG = pPDG; // The last PDG of the projectile
|
||||
lastN = tgN; // The last N of the calculated nucleus
|
||||
lastZ = tgZ; // The last Z of the calculated nucleus
|
||||
lastI = colN.size(); // Size of the Associative Memory DB in the heap
|
||||
j = 0; // A#0f records found in DB for this projectile
|
||||
if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
|
||||
{ // The nucleus with projPDG is found in AMDB
|
||||
if(colN[i]==tgN && colZ[i]==tgZ)
|
||||
{
|
||||
lastI=i;
|
||||
lastTH =colTH[i]; // Last THreshold (A-dependent)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Energy is below the Threshold value
|
||||
}
|
||||
lastP =colP [i]; // Last Momentum (A-dependent)
|
||||
lastCS =colCS[i]; // Last CrossSect (A-dependent)
|
||||
if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
#endif
|
||||
CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // Update param's only
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
in = true; // This is the case when the isotop is found in DB
|
||||
// Momentum pMom is in IU ! @@ Units
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::G:UpdatDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // read & update
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(lastCS<=0. && pEn>lastTH) // Correct the threshold
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
break; // Go out of the LOOP
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"---G4QTNCrossSec::GetCrosSec:pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
|
||||
<<",Z["<<i<<"]="<<colZ[i]<<",cPDG="<<colPDG[i]<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
j++; // Increment a#0f records found in DB for this pPDG
|
||||
}
|
||||
if(!in) // This nucleus has not been calculated previously
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
|
||||
#endif
|
||||
//!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
|
||||
lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
|
||||
if(lastCS<=0.)
|
||||
{
|
||||
lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCrossSection::GetCrossSect: NewThresh="<<lastTH<<", T="<<pEn<<G4endl;
|
||||
#endif
|
||||
if(pEn>lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
colN.push_back(tgN);
|
||||
colZ.push_back(tgZ);
|
||||
colPDG.push_back(pPDG);
|
||||
colP.push_back(pMom);
|
||||
colTH.push_back(lastTH);
|
||||
colCS.push_back(lastCS);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
} // End of creation of the new set of parameters
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
colP[lastI]=pMom;
|
||||
colPDG[lastI]=pPDG;
|
||||
colCS[lastI]=lastCS;
|
||||
}
|
||||
} // End of parameters udate
|
||||
else if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Momentum is below the Threshold Value -> CS=0
|
||||
}
|
||||
else if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS:OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCS:UpdatCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
|
||||
lastP=pMom;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4QTNCS::GetCroSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
}
|
||||
|
||||
// Gives the threshold energy for different nuclei (min of p- and n-threshold)
|
||||
// *******************************************************************************
|
||||
// *** This function is the same for all lepto- & photo-nuclear reactions, for ***
|
||||
@@ -85,7 +264,7 @@ G4double G4QTauNuclearCrossSection::ThresholdEnergy(G4int Z, G4int N, G4int)
|
||||
|
||||
G4int A=Z+N;
|
||||
if(A<1) return infEn;
|
||||
else if(A==1) return 135.; // Pi0 threshold for the nucleon
|
||||
else if(A==1) return 1894114.; // Pi0 threshold in MeV for the proton: T>m+(m^2+2lm)/2M
|
||||
// CHIPS - Direct GEANT
|
||||
//G4double mT= G4QPDGCode(111).GetNuclMass(Z,N,0);
|
||||
G4double mT= 0.;
|
||||
|
||||
+321
-32
@@ -25,7 +25,9 @@
|
||||
//
|
||||
|
||||
//#define debug
|
||||
//#define trapdebug
|
||||
//#define pdebug
|
||||
//#define ppdebug
|
||||
|
||||
#include "G4StringChipsParticleLevelInterface.hh"
|
||||
#include "globals.hh"
|
||||
@@ -41,21 +43,38 @@
|
||||
// #define CHIPSdebug
|
||||
// #define CHIPSdebug_1
|
||||
|
||||
#ifdef hdebug_SCPLI
|
||||
const G4int G4StringChipsParticleLevelInterface::nbh=200;
|
||||
G4double G4StringChipsParticleLevelInterface::bhmax=20.;
|
||||
G4double G4StringChipsParticleLevelInterface::ehmax=20.;
|
||||
G4double G4StringChipsParticleLevelInterface::bhdb=0.;
|
||||
G4double G4StringChipsParticleLevelInterface::ehde=0.;
|
||||
G4double G4StringChipsParticleLevelInterface::toth=0.;
|
||||
G4int G4StringChipsParticleLevelInterface::bover=0;
|
||||
G4int G4StringChipsParticleLevelInterface::eover=0;
|
||||
G4int* G4StringChipsParticleLevelInterface::bhis =
|
||||
new G4int[G4StringChipsParticleLevelInterface::nbh];
|
||||
G4int* G4StringChipsParticleLevelInterface::ehis =
|
||||
new G4int[G4StringChipsParticleLevelInterface::nbh];
|
||||
#endif
|
||||
|
||||
G4StringChipsParticleLevelInterface::G4StringChipsParticleLevelInterface()
|
||||
{
|
||||
#ifdef debug
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Constructor is called"<<G4endl;
|
||||
#endif
|
||||
theEnergyLossPerFermi = 1.*GeV;
|
||||
//theEnergyLossPerFermi = 1.*GeV;
|
||||
theEnergyLossPerFermi = 1.5*GeV;
|
||||
nop = 152; // clusters (A<6)
|
||||
fractionOfSingleQuasiFreeNucleons = 0.5; // It is A-dependent (C=.85, U=.40)
|
||||
fractionOfSingleQuasiFreeNucleons = 0.5; // It is A-dependent (C=.85, U=.40) - M.K.
|
||||
fractionOfPairedQuasiFreeNucleons = 0.05;
|
||||
clusteringCoefficient = 5.;
|
||||
temperature = 180.;
|
||||
halfTheStrangenessOfSee = 0.3; // = s/d = s/u
|
||||
etaToEtaPrime = 0.3;
|
||||
fusionToExchange = 100.;
|
||||
theInnerCoreDensityCut = 50.;
|
||||
//theInnerCoreDensityCut = 50.;
|
||||
theInnerCoreDensityCut = 70.;
|
||||
|
||||
if(getenv("ChipsParameterTuning"))
|
||||
{
|
||||
@@ -98,6 +117,19 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
|
||||
static const G4double mProt=G4Proton::Proton()->GetPDGMass();
|
||||
static const G4double mNeut=G4Neutron::Neutron()->GetPDGMass();
|
||||
static const G4double mLamb=G4Lambda::Lambda()->GetPDGMass();
|
||||
static const G4double mKChg=G4KaonPlus::KaonPlus()->GetPDGMass();
|
||||
static const G4double mKZer=G4KaonZero::KaonZero()->GetPDGMass();
|
||||
static const G4double mPiCh=G4PionMinus::PionMinus()->GetPDGMass();
|
||||
static const G4int pcl=4; // clusterization parameter for Energy Flow
|
||||
static const G4QContent ProtQC(1,2,0,0,0,0);
|
||||
static const G4QContent NeutQC(2,1,0,0,0,0);
|
||||
static const G4QContent LambQC(1,1,1,0,0,0);
|
||||
static const G4QContent KPlsQC(0,1,0,0,0,1);
|
||||
static const G4QContent KMinQC(0,0,1,0,1,0);
|
||||
static const G4QContent AKZrQC(1,0,0,0,0,1);
|
||||
static const G4QContent KZerQC(1,0,0,0,0,1);
|
||||
static const G4QContent PiMiQC(1,0,0,0,1,0);
|
||||
static const G4QContent PiPlQC(0,1,0,1,0,0);
|
||||
#ifdef debug
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate is called"<<G4endl;
|
||||
#endif
|
||||
@@ -153,16 +185,27 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
|
||||
G4double impactX = theImpact.first;
|
||||
G4double impactY = theImpact.second;
|
||||
G4double inpactPar2 = impactX*impactX + impactY*impactY;
|
||||
|
||||
G4double radius2 = theNucleus->GetNuclearRadius(theInnerCoreDensityCut*perCent);
|
||||
//G4double radius2 = theNucleus->GetNuclearRadius(theInnerCoreDensityCut*perCent);
|
||||
radius2 *= radius2;
|
||||
G4double pathlength = 0.;
|
||||
#ifdef pdebug
|
||||
#ifdef ppdebug
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate: r="<<std::sqrt(radius2)/fermi
|
||||
<<", b="<<std::sqrt(inpactPar2)/fermi<<", R="<<theNucleus->GetOuterRadius()/fermi
|
||||
<<", b/r="<<std::sqrt(inpactPar2/radius2)<<G4endl;
|
||||
#endif
|
||||
if(radius2 - inpactPar2>0) pathlength = 2.*std::sqrt(radius2 - inpactPar2);
|
||||
#ifdef hdebug_SCPLI
|
||||
toth+=1.; // increment total number of measurements
|
||||
G4double bfm=std::sqrt(inpactPar2)/fermi; // impact parameter
|
||||
G4double efm=pathlength/fermi; // energy absorption length
|
||||
G4int nbi=static_cast<G4int>(bfm/bhdb);
|
||||
G4int nei=static_cast<G4int>(efm/ehde);
|
||||
if(nbi<nbh) bhis[nbi]++;
|
||||
else bover++;
|
||||
if(nei<nbh) ehis[nei]++;
|
||||
else eover++;
|
||||
#endif
|
||||
G4double theEnergyLostInFragmentation = theEnergyLossPerFermi*pathlength/fermi;
|
||||
|
||||
// now select all particles in range
|
||||
@@ -229,6 +272,7 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
|
||||
G4ReactionProductVector* theResult = new G4ReactionProductVector;
|
||||
G4ReactionProduct* theSec;
|
||||
G4KineticTrackVector* secondaries;
|
||||
G4KineticTrackVector* secsec;
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate: Absorption nS="
|
||||
<<theSorted.size()<<G4endl;
|
||||
@@ -359,11 +403,205 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
|
||||
std::vector<G4LorentzVector*> theFinalMomenta;
|
||||
if(theContents.size()<hitCount || 1) // Looks like the "else" is closed by "|| 1"
|
||||
{
|
||||
for(unsigned int hp = 0; hp<theContents.size(); hp++)
|
||||
// Multiquasmon case: each particle creates a quasmon
|
||||
//for(unsigned int hp = 0; hp<theContents.size(); hp++)
|
||||
//{
|
||||
// G4QHadron* aHadron = new G4QHadron(theContents[hp], *(theMomenta[hp]) );
|
||||
// projHV.push_back(aHadron);
|
||||
//}
|
||||
// Energy flow: one Quasmon for each B>0 collection ----------
|
||||
G4QContent EnFlowQC(0,0,0,0,0,0);
|
||||
G4LorentzVector EnFlow4M(0.,0.,0.,0.);
|
||||
//G4bool empty=true;
|
||||
G4int barys=0;
|
||||
G4int stras=0;
|
||||
G4int chars=0;
|
||||
for(G4int hp = theContents.size()-1; hp>=0; hp--)
|
||||
{
|
||||
G4QHadron* aHadron = new G4QHadron(theContents[hp], *(theMomenta[hp]) );
|
||||
G4QContent curQC=theContents[hp];
|
||||
G4int baryn = curQC.GetBaryonNumber();
|
||||
G4int stran = curQC.GetStrangeness();
|
||||
G4int charg = curQC.GetCharge();
|
||||
EnFlowQC += curQC; // Keep collecting energy flow
|
||||
EnFlow4M += *(theMomenta[hp]);
|
||||
barys += baryn; // Collected baryon number
|
||||
stras += stran; // Collected strangeness
|
||||
chars += charg; // Collected charge
|
||||
//empty = false;
|
||||
}
|
||||
if(barys>pcl) // Split in two or more parts (to survive!)
|
||||
{
|
||||
G4int nprt=(barys-1)/pcl+1; // Number of parts (pcl=4: 2:5-8,3:9-12...)
|
||||
G4int curb=barys;
|
||||
while (nprt>0)
|
||||
{
|
||||
nprt--; // One part is going to be created
|
||||
G4int brnm=pcl; // Baryon number of splitting part
|
||||
curb-=brnm; // The residual baryon number
|
||||
G4double prtM=0.; // The resulting GS mass of the part
|
||||
G4double resM=0.; // The resulting GS mass of the residual
|
||||
G4QContent prtQC(0,0,0,0,0,0); // The resulting Quark Content of the part
|
||||
G4int strm=0; // Max strangeness per part (stras=0)
|
||||
if(stras>0) strm=(stras-1)/nprt+1; // Max strangeness per part (stras>0)
|
||||
else if(stras<0) strm=(stras+1)/nprt-1; // Max strangeness per part (stras<0)
|
||||
G4int chgm=0; // Max charge per part (chars=0)
|
||||
if(stras>0) chgm=(chars-1)/nprt+1; // Max strangeness per part (chars>0)
|
||||
else if(stras<0) chgm=(chars+1)/nprt-1; // Max strangeness per part (chars<0)
|
||||
// ---> calculate proposed separated part
|
||||
//@@ Convert it to a CHIPS function (Which class? G4QH::Conctruct?)
|
||||
if(!strm) // --> The total strangness = 0 (n/p/pi-)
|
||||
{
|
||||
if(chgm<0) // (n/pi-)
|
||||
{
|
||||
prtM=(-chgm)*mPiCh+brnm*mNeut;
|
||||
prtQC=(-chgm)*PiMiQC+brnm*NeutQC;
|
||||
}
|
||||
else // (n/p)
|
||||
{
|
||||
prtM=chgm*mProt+(brnm-chgm)*mNeut;
|
||||
prtQC=chgm*ProtQC+(brnm-chgm)*NeutQC;
|
||||
}
|
||||
}
|
||||
else if(strm>=brnm) // ---> BigPositiveStrangeness(L/Pi+/K0/K-)
|
||||
{
|
||||
G4int stmb=strm-brnm;
|
||||
if(chgm<0) // (L/K-/K0)
|
||||
{
|
||||
prtM=(-chgm)*mKChg+brnm*mLamb+std::abs(stmb+chgm)*mKZer;
|
||||
prtQC=(-chgm)*KMinQC+brnm*LambQC;
|
||||
if(stmb>-chgm) prtQC+=(stmb+chgm)*KZerQC;
|
||||
else if(stmb<-chgm) prtQC+=(-stmb-chgm)*AKZrQC;
|
||||
}
|
||||
else // (L/K0/pi+)
|
||||
{
|
||||
prtM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
|
||||
prtQC=chgm*PiPlQC+(strm-brnm)*KZerQC+brnm*LambQC;
|
||||
}
|
||||
}
|
||||
else if(strm>0) // ---> PositiveStrangeness<B (L/n/p/Pi+-)
|
||||
{
|
||||
G4int bmst=brnm-strm;
|
||||
if(chgm<0) // (L/n/Pi-)
|
||||
{
|
||||
prtM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
|
||||
prtQC=(-chgm)*PiMiQC+strm*LambQC+bmst*NeutQC;
|
||||
}
|
||||
else if(chgm>=bmst) // (L/p/Pi+)
|
||||
{
|
||||
prtM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
|
||||
prtQC=(chgm-bmst)*PiPlQC+strm*LambQC+bmst*ProtQC;
|
||||
}
|
||||
else // ch<bmst (L/p/n)
|
||||
{
|
||||
prtM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
|
||||
prtQC=chgm*ProtQC+strm*LambQC+(bmst-chgm)*NeutQC;
|
||||
}
|
||||
}
|
||||
else // ---> NegativeStrangeness (N/K+/aK0/Pi-)
|
||||
{
|
||||
G4int bmst=brnm-strm;
|
||||
if(chgm>=bmst) // (K+/p/Pi+)
|
||||
{
|
||||
prtM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
|
||||
prtQC=(-strm)*KPlsQC+brnm*ProtQC+(chgm-bmst)*PiPlQC;
|
||||
}
|
||||
else if(chgm>=-strm) // (K+/p/n)
|
||||
{
|
||||
prtM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
|
||||
prtQC=(-strm)*KPlsQC+chgm*ProtQC+(brnm-chgm)*NeutQC;
|
||||
}
|
||||
else if(chgm>=0) // (K+/aK0/n)
|
||||
{
|
||||
prtM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
|
||||
prtQC=chgm*KPlsQC+(-chgm-strm)*AKZrQC+brnm*NeutQC;
|
||||
}
|
||||
else // ch<0 (aK0/n/Pi-)
|
||||
{
|
||||
prtM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
|
||||
prtQC=(-strm)*KPlsQC+(-chgm)*PiMiQC+brnm*NeutQC;
|
||||
}
|
||||
}
|
||||
EnFlowQC-=prtQC;
|
||||
chgm=chars-chgm; // Just to keep the same notation
|
||||
strm=stras-strm;
|
||||
brnm=curb;
|
||||
if(!strm) // --> The total strangness = 0 (n/p/pi-)
|
||||
{
|
||||
if(chgm<0) resM=(-chgm)*mPiCh+brnm*mNeut;
|
||||
else resM=chgm*mProt+(brnm-chgm)*mNeut;
|
||||
}
|
||||
else if(strm>=brnm) // ---> BigPositiveStrangeness(L/Pi+/K0/K-)
|
||||
{
|
||||
G4int stmb=strm-brnm;
|
||||
if(chgm<0) resM=(-chgm)*mKChg+brnm*mLamb+std::abs(stmb+chgm)*mKZer;
|
||||
else resM=chgm*mPiCh+(strm-brnm)*mKZer+brnm*mLamb;
|
||||
}
|
||||
else if(strm>0) // ---> PositiveStrangeness<B (L/n/p/Pi+-)
|
||||
{
|
||||
G4int bmst=brnm-strm;
|
||||
if (chgm<0) resM=(-chgm)*mPiCh+strm*mLamb+bmst*mNeut;
|
||||
else if(chgm>=bmst) resM=(chgm-bmst)*mPiCh+strm*mLamb+bmst*mProt;
|
||||
else resM=chgm*mProt+strm*mLamb+(bmst-chgm)*mNeut;
|
||||
}
|
||||
else // ---> NegativeStrangeness (N/K+/aK0/Pi-)
|
||||
{
|
||||
G4int bmst=brnm-strm;
|
||||
if (chgm>=bmst) resM=(-strm)*mKChg+brnm*mProt+(chgm-bmst)*mPiCh;
|
||||
else if(chgm>=-strm) resM=(-strm)*mKChg+chgm*mProt+(brnm-chgm)*mNeut;
|
||||
else if(chgm>=0) resM=chgm*mKChg+(-chgm-strm)*mKZer+brnm*mNeut;
|
||||
else resM=(-strm)*mKChg+(-chgm)*mPiCh+brnm*mNeut;
|
||||
}
|
||||
G4LorentzVector prt4M=(prtM/(prtM+resM))*EnFlow4M;
|
||||
EnFlow4M-=prt4M;
|
||||
EnFlowQC-=prtQC;
|
||||
G4QHadron* aHadron = new G4QHadron(prtQC, prt4M);
|
||||
projHV.push_back(aHadron);
|
||||
if(nprt==1)
|
||||
{
|
||||
G4QHadron* fHadron = new G4QHadron(EnFlowQC, EnFlow4M);
|
||||
projHV.push_back(fHadron);
|
||||
nprt=0;
|
||||
}
|
||||
#ifdef debug
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate: nprt="<<nprt<<G4endl;
|
||||
#endif
|
||||
} // End of WHILE
|
||||
}
|
||||
else
|
||||
{
|
||||
G4QHadron* aHadron = new G4QHadron(EnFlowQC, EnFlow4M);
|
||||
projHV.push_back(aHadron);
|
||||
}
|
||||
// End of Energy Flow ----------------------------------------
|
||||
// Energy flow: one Quasmon for each B>0 collection ---------- too forward
|
||||
//G4QContent EnFlowQC(0,0,0,0,0,0);
|
||||
//G4LorentzVector EnFlow4M(0.,0.,0.,0.);
|
||||
//G4bool empty=true;
|
||||
//G4int barys=0;
|
||||
//for(G4int hp = theContents.size()-1; hp>=0; hp--)
|
||||
//{
|
||||
// G4QContent curQC=theContents[hp];
|
||||
// G4int baryn = curQC.GetBaryonNumber();
|
||||
// if(baryn>0 && barys>0 && !empty) // New baryon and b-positive collection -> fill
|
||||
// {
|
||||
// G4QHadron* aHadron = new G4QHadron(EnFlowQC, EnFlow4M);
|
||||
// projHV.push_back(aHadron);
|
||||
// EnFlowQC = G4QContent(0,0,0,0,0,0);
|
||||
// EnFlow4M = G4LorentzVector(0.,0.,0.,0.);
|
||||
// barys=0;
|
||||
// empty=true;
|
||||
// }
|
||||
// EnFlowQC += curQC; // Keep collecting energy flow
|
||||
// EnFlow4M += *(theMomenta[hp]);
|
||||
// barys += baryn;
|
||||
// empty = false;
|
||||
//}
|
||||
//if(!empty)
|
||||
//{
|
||||
// G4QHadron* aHadron = new G4QHadron(EnFlowQC, EnFlow4M);
|
||||
// projHV.push_back(aHadron);
|
||||
//}
|
||||
// End of Energy Flow One Quasmon for each ----------------------------
|
||||
}
|
||||
else // Never come here (!?)
|
||||
{
|
||||
@@ -459,42 +697,84 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
|
||||
G4KineticTrack* aResult = (*current).second;
|
||||
G4ParticleDefinition* pdef=aResult->GetDefinition();
|
||||
secondaries = NULL;
|
||||
if(pdef->GetPDGWidth() > 0 && pdef->GetPDGLifeTime() < 5E-17*s )
|
||||
//if(pdef->GetPDGWidth() > 0 && pdef->GetPDGLifeTime() < 5E-17*s ) // HPW version
|
||||
if ( pdef->IsShortLived() )
|
||||
{
|
||||
secondaries = aResult->Decay(); // @@ Uses standard Decay, which is now wrong!
|
||||
secondaries = aResult->Decay();
|
||||
for (unsigned int aSecondary=0; aSecondary<secondaries->size(); aSecondary++)
|
||||
{
|
||||
G4KineticTrack* bResult=secondaries->operator[](aSecondary);
|
||||
G4ParticleDefinition* sdef=bResult->GetDefinition();
|
||||
if ( sdef->IsShortLived() )
|
||||
{
|
||||
secsec = bResult->Decay();
|
||||
for (unsigned int bSecondary=0; bSecondary<secsec->size(); bSecondary++)
|
||||
{
|
||||
G4KineticTrack* cResult=secsec->operator[](bSecondary);
|
||||
G4ParticleDefinition* cdef=cResult->GetDefinition();
|
||||
theSec = new G4ReactionProduct(cdef);
|
||||
G4LorentzVector cur4Mom = cResult->Get4Momentum();
|
||||
cur4Mom.boost(targ4Mom.boostVector());
|
||||
theSec->SetTotalEnergy(cur4Mom.t());
|
||||
theSec->SetMomentum(cur4Mom.vect());
|
||||
#ifdef trapdebug
|
||||
if(cdef->GetPDGEncoding()==113) G4cout
|
||||
<<"G4StringChipsParticleLevelInterface::Propagate: *Rho0* QGS dec2 PDG="
|
||||
<<cdef->GetPDGEncoding()<<",4M="<<cur4Mom<<", grandparPDG= "
|
||||
<<pdef->GetPDGEncoding()<<", parPDG= "<<sdef->GetPDGEncoding()<<G4endl;
|
||||
#endif
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS dec2 PDG="
|
||||
<<sdef->GetPDGEncoding()<<",4M="<<cur4Mom<<G4endl;
|
||||
#endif
|
||||
theResult->push_back(theSec);
|
||||
}
|
||||
std::for_each(secsec->begin(), secsec->end(), DeleteKineticTrack());
|
||||
delete secsec;
|
||||
}
|
||||
else
|
||||
{
|
||||
theSec = new G4ReactionProduct(sdef);
|
||||
G4LorentzVector current4Mom = bResult->Get4Momentum();
|
||||
current4Mom.boost(targ4Mom.boostVector());
|
||||
theSec->SetTotalEnergy(current4Mom.t());
|
||||
theSec->SetMomentum(current4Mom.vect());
|
||||
#ifdef trapdebug
|
||||
if(sdef->GetPDGEncoding()==113)
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate:*Rho0* QGS decay PDG="
|
||||
<<sdef->GetPDGEncoding()<<",4M="<<current4Mom<<", parentPDG= "
|
||||
<<pdef->GetPDGEncoding()<<G4endl;
|
||||
//throw G4HadronicException(__FILE__,__LINE__,
|
||||
// "G4StringChipsParticleLevelInterface: Rho0 is found!");
|
||||
#endif
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
|
||||
<<sdef->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
|
||||
#endif
|
||||
theResult->push_back(theSec);
|
||||
}
|
||||
}
|
||||
std::for_each(secondaries->begin(), secondaries->end(), DeleteKineticTrack());
|
||||
delete secondaries;
|
||||
}
|
||||
if ( secondaries == NULL )
|
||||
else
|
||||
{
|
||||
theSec = new G4ReactionProduct(aResult->GetDefinition());
|
||||
G4LorentzVector current4Mom = aResult->Get4Momentum();
|
||||
current4Mom.boost(targ4Mom.boostVector());
|
||||
theSec->SetTotalEnergy(current4Mom.t());
|
||||
theSec->SetMomentum(current4Mom.vect());
|
||||
#ifdef trapdebug
|
||||
if(aResult->GetDefinition()->GetPDGEncoding()==113)
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
|
||||
<<aResult->GetDefinition()->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
|
||||
#endif
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS stable PDG="
|
||||
<<aResult->GetDefinition()->GetPDGEncoding()<<",4M="<<current4Mom<<G4endl;
|
||||
#endif
|
||||
theResult->push_back(theSec);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (unsigned int aSecondary=0; aSecondary<secondaries->size(); aSecondary++)
|
||||
{
|
||||
theSec=new G4ReactionProduct(secondaries->operator[](aSecondary)->GetDefinition());
|
||||
G4LorentzVector current4Mom = secondaries->operator[](aSecondary)->Get4Momentum();
|
||||
current4Mom.boost(targ4Mom.boostVector());
|
||||
theSec->SetTotalEnergy(current4Mom.t());
|
||||
theSec->SetMomentum(current4Mom.vect());
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4StringChipsParticleLevelInterface::Propagate: *OUT* QGS decay PDG="
|
||||
<<secondaries->operator[](aSecondary)->GetDefinition()->GetPDGEncoding()
|
||||
<<",4M="<<current4Mom<<G4endl;
|
||||
#endif
|
||||
theResult->push_back(theSec);
|
||||
}
|
||||
std::for_each(secondaries->begin(), secondaries->end(), DeleteKineticTrack());
|
||||
delete secondaries;
|
||||
}
|
||||
}
|
||||
std::for_each(theSecondaries->begin(), theSecondaries->end(), DeleteKineticTrack());
|
||||
delete theSecondaries;
|
||||
@@ -535,8 +815,15 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
|
||||
if (aZ>1000) aZ=aZ%1000; // patch for strange nuclei, to be repaired @@@@
|
||||
G4int anN = pdgCode-90000000-1000*aZ;
|
||||
if(anN>1000) anN=anN%1000; // patch for strange nuclei, to be repaired @@@@
|
||||
if(pdgCode==91000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==92000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
|
||||
if(pdgCode==90000999) theDefinition = G4PionPlus::PionPlusDefinition();
|
||||
else if(pdgCode==89999001) theDefinition = G4PionMinus::PionMinusDefinition();
|
||||
else if(pdgCode==90999999) theDefinition = G4KaonZero::KaonZeroDefinition();
|
||||
else if(pdgCode==90999000) theDefinition = G4KaonMinus::KaonMinusDefinition();
|
||||
else if(pdgCode==89001000) theDefinition = G4KaonPlus::KaonPlusDefinition();
|
||||
else if(pdgCode==89000001) theDefinition = G4AntiKaonZero::AntiKaonZeroDefinition();
|
||||
else if(pdgCode==91000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==92000000) theDefinition = G4Lambda::LambdaDefinition(); //NLambd?
|
||||
else if(pdgCode==93000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==94000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
else if(pdgCode==95000000) theDefinition = G4Lambda::LambdaDefinition();
|
||||
@@ -565,12 +852,14 @@ Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
|
||||
#endif
|
||||
theResult->push_back(theSec);
|
||||
}
|
||||
#ifdef pdebug
|
||||
else
|
||||
{
|
||||
G4cerr << G4endl<<"WARNING: "<<G4endl;
|
||||
G4cerr <<"G4StringChipsParticleLevelInterface::Propagate: WARNING"<<G4endl;
|
||||
G4cerr << "Getting unknown pdgCode from chips in ParticleLevelInterface"<<G4endl;
|
||||
G4cerr << "skipping particle with pdgCode = "<<pdgCode<<G4endl<<G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CHIPSdebug
|
||||
G4cout <<"CHIPS particles "<<theDefinition->GetPDGCharge()<<" "
|
||||
|
||||
+5
-207
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VQCrossSection.cc,v 1.10 2006/06/29 20:08:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-01 $
|
||||
// $Id: G4VQCrossSection.cc,v 1.13 2006/12/09 14:33:35 mkossov Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
//
|
||||
//
|
||||
// CHIPS virtual class: G4VQCrossSection for the collision cross sections
|
||||
@@ -48,215 +48,11 @@
|
||||
#include "G4VQCrossSection.hh"
|
||||
|
||||
// Initialization of the
|
||||
G4int G4VQCrossSection::lastPDG=0; // The last PDG code of the projectile
|
||||
G4int G4VQCrossSection::lastN=0; // The last N of calculated nucleus
|
||||
G4int G4VQCrossSection::lastZ=0; // The last Z of calculated nucleus
|
||||
G4double G4VQCrossSection::lastTH=0.; // Last threshold momentum
|
||||
G4double G4VQCrossSection::lastCS=0.;// Last value of the Cross Section
|
||||
G4double G4VQCrossSection::lastP=0.; // Last used in cross section TheMomentum
|
||||
//G4int G4VQCrossSection::lastN1=0; // Last used in cross section TheNumOfBin1
|
||||
//G4int G4VQCrossSection::lastF1=0; // Last used in cross section TheFirstBin1
|
||||
//G4int G4VQCrossSection::lastL1=0; // Last used in cross section TheLastBin1
|
||||
//G4int G4VQCrossSection::lastN2=0; // Last used in cross section TheNumOfBin1
|
||||
//G4int G4VQCrossSection::lastF2=0; // Last used in cross section TheFirstBin1
|
||||
//G4int G4VQCrossSection::lastL2=0; // Last used in cross section TheLastBin1
|
||||
//G4double G4VQCrossSection::lastBP=0.; // Last value of the Boundary Momentum
|
||||
//G4double G4VQCrossSection::lastMP=0.; // Last value of the Maximum Momentum
|
||||
|
||||
G4int G4VQCrossSection::lastI=0; // The last position in the DAMDB
|
||||
G4double G4VQCrossSection::tolerance=.001; // The last position in the DAMDB
|
||||
|
||||
// Set the new tolerance (abs(p_old/p_new-1)<tolerance)
|
||||
void G4VQCrossSection::setTolerance(G4double tol)
|
||||
// ============================================
|
||||
{
|
||||
tolerance=tol;
|
||||
}
|
||||
G4double G4VQCrossSection::tolerance=.001; // The relative tolarence for the same CrSec
|
||||
|
||||
// Gives the threshold energy for different isotopes (can be improved in the derived class)
|
||||
G4double G4VQCrossSection::ThresholdEnergy(G4int , G4int, G4int) {return 0.;} // Fake use
|
||||
|
||||
// The main member function giving the collision cross section (P is in IU, CS is in mb)
|
||||
// Make pMom in independent units ! (Now it is MeV)
|
||||
G4double G4VQCrossSection::GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
|
||||
G4int pPDG)
|
||||
{
|
||||
static const G4double mtu=1777.; // Mass of a tau lepton in MeV
|
||||
static const G4double mtu2=mtu*mtu; // Squared Mass of a tau-lepton in MeV^2
|
||||
static const G4double mmu=105.65839; // Mass of the muon in MeV
|
||||
static const G4double mmu2=mmu*mmu; // Squared Mass of muon in MeV^2
|
||||
static const G4double mel=0.5109989; // Mass of the electron in MeV
|
||||
static const G4double mel2=mel*mel; // Squared Mass of the electron in MeV
|
||||
static G4int j; // A#0f records found in DB for this projectile
|
||||
static std::vector <G4int> colPDG;// Vector of the projectile PDG code
|
||||
static std::vector <G4int> colN; // Vector of N for calculated nuclei (isotops)
|
||||
static std::vector <G4int> colZ; // Vector of Z for calculated nuclei (isotops)
|
||||
static std::vector <G4double> colP; // Vector of last momenta for the reaction
|
||||
static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
|
||||
static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
|
||||
// ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
|
||||
G4double pEn=pMom;
|
||||
G4int apPDG=std::abs(pPDG);
|
||||
// @@ if the threshold exists for other particles, then p->T must be genergal (p=0->T=o)
|
||||
if (apPDG==11) pEn=std::sqrt(pMom*pMom+mel2)-mel; // ==> electron/positron kinEnergy
|
||||
else if(apPDG==13) pEn=std::sqrt(pMom*pMom+mmu2)-mmu; // ==> mu-/mu+ kinEnergy
|
||||
else if(apPDG==15) pEn=std::sqrt(pMom*pMom+mtu2)-mtu; // ==> tau-/tau+ kinEnergy
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS:>>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="<<tgN
|
||||
<<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
|
||||
<<colN.size()<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(!pPDG)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // projectile PDG=0 is a mistake (?!) @@
|
||||
}
|
||||
G4bool in=false; // By default the isotope must be found in the AMDB
|
||||
if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)// The nucleus was not the last used isotope
|
||||
{
|
||||
in = false; // By default the isotope haven't be found in AMDB
|
||||
lastP = 0.; // New momentum history (nothing to compare with)
|
||||
lastPDG = pPDG; // The last PDG of the projectile
|
||||
lastN = tgN; // The last N of the calculated nucleus
|
||||
lastZ = tgZ; // The last Z of the calculated nucleus
|
||||
lastI = colN.size(); // Size of the Associative Memory DB in the heap
|
||||
j = 0; // A#0f records found in DB for this projectile
|
||||
if(lastI) for(G4int i=0; i<lastI; i++) if(colPDG[i]==pPDG) // The partType is found
|
||||
{ // The nucleus with projPDG is found in AMDB
|
||||
if(colN[i]==tgN && colZ[i]==tgZ)
|
||||
{
|
||||
lastI=i;
|
||||
lastTH =colTH[i]; // Last THreshold (A-dependent)
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS: *Found* P="<<pMom<<",Threshold="<<lastTH<<",j="<<j<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS: Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Energy is below the Threshold value
|
||||
}
|
||||
lastP =colP [i]; // Last Momentum (A-dependent)
|
||||
lastCS =colCS[i]; // Last CrossSect (A-dependent)
|
||||
if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS:P="<<pMom<<"=Po="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
in = true; // This is the case when the isotop is found in DB
|
||||
// Momentum pMom is in IU ! @@ Units
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",lI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,-1,j,lastPDG,lastZ,lastN,pMom); // read & update
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
if(lastCS<=0. && pEn>lastTH) // Correct the threshold
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
break; // Go out of the LOOP
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"---G4VQCrossSec::GetCrosSec:pPDG="<<pPDG<<",j="<<j<<",N="<<colN[i]
|
||||
<<",Z["<<i<<"]="<<colZ[i]<<",cPDG="<<colPDG[i]<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
j++; // Increment a#0f records found in DB for this pPDG
|
||||
}
|
||||
if(!in) // This nucleus has not been calculated previously
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCrosSec: CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
|
||||
#endif
|
||||
//!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
|
||||
lastCS=CalculateCrossSection(fCS,0,j,lastPDG,lastZ,lastN,pMom); //calculate & create
|
||||
if(lastCS<=0.)
|
||||
{
|
||||
lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCrossSection::GetCrossSection:NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
|
||||
#endif
|
||||
if(pEn>lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
|
||||
#endif
|
||||
lastTH=pEn;
|
||||
}
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
colN.push_back(tgN);
|
||||
colZ.push_back(tgZ);
|
||||
colPDG.push_back(pPDG);
|
||||
colP.push_back(pMom);
|
||||
colTH.push_back(lastTH);
|
||||
colCS.push_back(lastCS);
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS:1st, P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
} // End of creation of the new set of parameters
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS: Update lastI="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
colP[lastI]=pMom;
|
||||
colPDG[lastI]=pPDG;
|
||||
colCS[lastI]=lastCS;
|
||||
}
|
||||
} // End of parameters udate
|
||||
else if(pEn<=lastTH)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS: Current T="<<pEn<<" < Threshold="<<lastTH<<", CS=0"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return 0.; // Momentum is below the Threshold Value -> CS=0
|
||||
}
|
||||
else if(std::fabs(lastP/pMom-1.)<tolerance)
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS: OldCur P="<<pMom<<"="<<pMom<<", CS="<<lastCS*millibarn<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn; // Use theLastCS
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCS:UpdateCur P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",j="<<j<<G4endl;
|
||||
#endif
|
||||
lastCS=CalculateCrossSection(fCS,1,j,lastPDG,lastZ,lastN,pMom); // Only UpdateDB
|
||||
lastP=pMom;
|
||||
}
|
||||
#ifdef pdebug
|
||||
G4cout<<"G4VQCS::GetCrosSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
|
||||
//CalculateCrossSection(fCS,-27,j,lastPDG,lastZ,lastN,pMom); // DUMMY TEST
|
||||
#endif
|
||||
return lastCS*millibarn;
|
||||
}
|
||||
|
||||
G4double G4VQCrossSection::GetDirectPart(G4double) {return 0.;} // Direct interaction
|
||||
|
||||
G4double G4VQCrossSection::GetNPartons(G4double) {return 3.;} // Direct interaction
|
||||
@@ -271,6 +67,8 @@ G4double G4VQCrossSection::GetExchangeQ2(G4double) {return 0.;}
|
||||
|
||||
G4double G4VQCrossSection::GetExchangeT(G4int,G4int,G4int) {return 0.;}
|
||||
|
||||
G4double G4VQCrossSection::GetHMaxT() {return 0.;}
|
||||
|
||||
G4double G4VQCrossSection::GetQEL_ExchangeQ2() {return 0.;}
|
||||
|
||||
G4double G4VQCrossSection::GetNQE_ExchangeQ2() {return 0.;}
|
||||
|
||||
Reference in New Issue
Block a user