Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
+17 -8
View File
@@ -1,11 +1,10 @@
# $Id: GNUmakefile,v 1.26 2003/11/24 12:54:57 gcosmo Exp $
# $Id: GNUmakefile,v 1.30 2004/06/01 15:39:17 gcosmo Exp $
# ----------------------------------------------------------------------
# GNUmakefile for processes library, Gabriele Cosmo 27-Jun-1998
# ----------------------------------------------------------------------
name := G4processes
SUBDIRS = management
SUBDIRS += cuts
SUBDIRS += optical
@@ -30,18 +29,21 @@ SUBLIBS += G4emutils
SUBLIBS += G4xrays
SUBLIBS += G4emlowenergy
SUBDIRS += hadronic/management
SUBDIRS += hadronic/util
SUBDIRS += hadronic/processes
GLOBLIBS = libG4track.lib libG4particles.lib libG4geometry.lib
GLOBLIBS += libG4materials.lib libG4graphics_reps.lib
GLOBLIBS += libG4intercoms.lib libG4global.lib
SUBDIRS += hadronic/cross_sections
SUBDIRS += hadronic/stopping
SUBDIRS += hadronic/management
SUBDIRS += hadronic/models/abrasion
SUBDIRS += hadronic/models/binary_cascade
SUBDIRS += hadronic/models/cascade/cascade
SUBDIRS += hadronic/models/cascade/evaporation
SUBDIRS += hadronic/models/cascade/utils
SUBDIRS += hadronic/models/cascade/cascade
SUBDIRS += hadronic/models/chiral_inv_phase_space/body
SUBDIRS += hadronic/models/chiral_inv_phase_space/interface
SUBDIRS += hadronic/models/coherent_elastic
SUBDIRS += hadronic/models/de_excitation/ablation
SUBDIRS += hadronic/models/de_excitation/evaporation
SUBDIRS += hadronic/models/de_excitation/fermi_breakup
SUBDIRS += hadronic/models/de_excitation/fission
@@ -51,6 +53,7 @@ SUBDIRS += hadronic/models/de_excitation/management
SUBDIRS += hadronic/models/de_excitation/multifragmentation
SUBDIRS += hadronic/models/de_excitation/photon_evaporation
SUBDIRS += hadronic/models/de_excitation/util
SUBDIRS += hadronic/models/em_dissociation
SUBDIRS += hadronic/models/high_energy
SUBDIRS += hadronic/models/im_r_matrix
SUBDIRS += hadronic/models/isotope_production
@@ -58,16 +61,20 @@ SUBDIRS += hadronic/models/leading_particle
SUBDIRS += hadronic/models/low_energy
SUBDIRS += hadronic/models/management
SUBDIRS += hadronic/models/neutron_hp
SUBDIRS += hadronic/models/photolepton_hadron/muon_nuclear
SUBDIRS += hadronic/models/parton_string/diffraction
SUBDIRS += hadronic/models/parton_string/hadronization
SUBDIRS += hadronic/models/parton_string/management
SUBDIRS += hadronic/models/parton_string/qgsm
SUBDIRS += hadronic/models/photolepton_hadron/muon_nuclear
SUBDIRS += hadronic/models/pre_equilibrium/exciton_model
SUBDIRS += hadronic/models/radioactive_decay
SUBDIRS += hadronic/models/theo_high_energy
SUBDIRS += hadronic/models/util
SUBDIRS += hadronic/processes
SUBDIRS += hadronic/stopping
SUBDIRS += hadronic/util
SUBLIBS += G4hadronic_abrasion
SUBLIBS += G4hadronic_xsect
SUBLIBS += G4hadronic_mgt
SUBLIBS += G4hadronic_proc
@@ -99,6 +106,8 @@ SUBLIBS += G4hadronic_deex_management
SUBLIBS += G4hadronic_deex_multifragmentation
SUBLIBS += G4hadronic_deex_photon_evaporation
SUBLIBS += G4hadronic_deex_util
SUBLIBS += G4hadronic_ablation
SUBLIBS += G4hadronic_em_dissociation
SUBLIBS += G4had_preequ_exciton
SUBLIBS += G4had_muon_nuclear
SUBLIBS += G4had_string_diff
+11 -3
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.5 2003/11/08 06:10:48 kurasige Exp $
$Id: History,v 1.8 2004/06/07 13:47:46 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,10 +17,19 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
June 7th, 2004 - G.Cosmo (procuts-V06-01-01)
- Moved usage of statics in inline functions to non-inline to allow
porting for DLLs on Windows. Modified G4ProductionCuts[.hh.cc].
March 31st, 2004 - H.Kurashige (procuts-V06-01-00)
- Modify G4ProductionCutsTable::RetrieveCutsTable to allow
ordering of materials and couples can be different from
one in file
November 8th, 2003 - H.Kurashige (procuts-V05-02-03)
- Fixed bugs in G4VRangeToEnergyConverter (and related class)
- Revised error messages in retreiving ProductionCutsTable
November 7th, 2003 - H.Kurashige (procuts-V05-02-02)
- Revised error messages in retreiving ProductionCutsTable
@@ -29,7 +38,6 @@ November 3th, 2003 - H.Kurashige (procuts-V05-02-01)
- Add verboseLevel in G4ProductionCutsTable
September 19th, 2003 - G.Cosmo (procuts-V05-02-00)
--------------------
- Created new sub-category 'cuts'.
Moved classes from particles/management.
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ProductionCuts.hh,v 1.2 2003/09/19 14:41:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ProductionCuts.hh,v 1.3 2004/06/07 13:47:34 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// ------------------------------------------------------------
@@ -114,34 +114,6 @@ class G4ProductionCuts
};
inline
G4int G4ProductionCuts::GetIndex(const G4String& name)
{
G4int index;
if ( name == "gamma" ) { index = 0; }
else if ( name == "e-" ) { index = 1; }
else if ( name == "e+" ) { index = 2; }
else { index = -1; }
return index;
}
inline
G4int G4ProductionCuts::GetIndex(const G4ParticleDefinition* ptcl)
{
if(!ptcl) return -1;
if(gammaDef==0 && ptcl->GetParticleName()=="gamma") { gammaDef = ptcl; }
if(electDef==0 && ptcl->GetParticleName()=="e-") { electDef = ptcl; }
if(positDef==0 && ptcl->GetParticleName()=="e+") { positDef = ptcl; }
G4int index;
if(ptcl==gammaDef) { index = 0; }
else if(ptcl==electDef) { index = 1; }
else if(ptcl==positDef) { index = 2; }
else { index = -1; }
return index;
}
inline
void G4ProductionCuts::SetProductionCut(G4double cut, G4int index)
{
@@ -215,13 +187,6 @@ void G4ProductionCuts::PhysicsTableUpdated()
isModified = false;
}
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ProductionCutsTable.hh,v 1.2 2003/11/03 02:18:44 kurasige Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ProductionCutsTable.hh,v 1.3 2004/02/03 08:29:35 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// ------------------------------------------------------------
@@ -31,6 +31,10 @@
//
// ------------------------------------------------------------
// First Implementation 05 Oct. 2002 M.Asai
//
// Modified 03 Feb 2004 H.Kurashige
// Modify RetrieveCutsTable to allow ordering of materials and
// couples can be different from one in file (i.e. at storing)
// ------------------------------------------------------------
#ifndef G4ProductionCutsTable_h
@@ -173,6 +177,11 @@ class G4ProductionCutsTable
// Store materialCutsCouple information in files under the specified directory.
virtual G4bool StoreMaterialCutsCoupleInfo(const G4String& directory,
G4bool ascii = false);
// Retreive materialCutsCouple information in files under the specified directory.
virtual G4bool RetrieveMaterialCutsCoupleInfo(const G4String& directory,
G4bool ascii = false);
// check stored materialCutsCouple is consistent with the current detector setup.
virtual G4bool CheckMaterialCutsCoupleInfo(const G4String& directory,
G4bool ascii = false);
@@ -187,6 +196,7 @@ class G4ProductionCutsTable
private:
G4bool firstUse;
G4bool isNeedForRestoreCoupleInfo;
enum { FixedStringLengthForStore = 32 };
public: // with description
+30 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ProductionCuts.cc,v 1.2 2003/09/19 14:45:27 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ProductionCuts.cc,v 1.4 2004/06/07 13:47:35 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// --------------------------------------------------------------
@@ -80,3 +80,31 @@ G4int G4ProductionCuts::operator!=(const G4ProductionCuts &right) const
return (this != &right);
}
G4int G4ProductionCuts::GetIndex(const G4String& name)
{
G4int index;
if ( name == "gamma" ) { index = 0; }
else if ( name == "e-" ) { index = 1; }
else if ( name == "e+" ) { index = 2; }
else { index = -1; }
return index;
}
G4int G4ProductionCuts::GetIndex(const G4ParticleDefinition* ptcl)
{
if(!ptcl) return -1;
if(gammaDef==0 && ptcl->GetParticleName()=="gamma") { gammaDef = ptcl; }
if(electDef==0 && ptcl->GetParticleName()=="e-") { electDef = ptcl; }
if(positDef==0 && ptcl->GetParticleName()=="e+") { positDef = ptcl; }
G4int index;
if(ptcl==gammaDef) { index = 0; }
else if(ptcl==electDef) { index = 1; }
else if(ptcl==positDef) { index = 2; }
else { index = -1; }
return index;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ProductionCutsTable.cc,v 1.4 2003/11/08 06:10:48 kurasige Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ProductionCutsTable.cc,v 1.6 2004/03/31 08:47:05 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// --------------------------------------------------------------
@@ -322,6 +322,7 @@ G4bool G4ProductionCutsTable::RetrieveCutsTable(const G4String& dir,
G4bool ascii)
{
if (!CheckForRetrieveCutsTable(dir, ascii)) return false;
if (isNeedForRestoreCoupleInfo) return RetrieveMaterialCutsCoupleInfo(dir, ascii);
if (!RetrieveCutsInfo(dir, ascii)) return false;
#ifdef G4VERBOSE
if (verboseLevel >1) {
@@ -342,6 +343,7 @@ G4bool G4ProductionCutsTable::RetrieveCutsTable(const G4String& dir,
G4bool G4ProductionCutsTable::CheckForRetrieveCutsTable(const G4String& directory,
G4bool ascii)
{
isNeedForRestoreCoupleInfo = false;
if (!CheckMaterialInfo(directory, ascii)) return false;
if (!CheckMaterialCutsCoupleInfo(directory, ascii)) return false;
return true;
@@ -364,10 +366,12 @@ G4bool G4ProductionCutsTable::StoreMaterialInfo(const G4String& directory,
// check if the file has been opened successfully
if (!fOut) {
if (verboseLevel) {
#ifdef G4VERBOSE
if (verboseLevel>0) {
G4cerr << "G4ProductionCutsTable::StoreMaterialInfo ";
G4cerr << " Can not open file " << fileName << G4endl;
}
#endif
return false;
}
@@ -437,10 +441,12 @@ G4bool G4ProductionCutsTable::CheckMaterialInfo(const G4String& directory,
// check if the file has been opened successfully
if (!fIn) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cerr << "G4ProductionCutsTable::CheckMaterialInfo ";
G4cerr << " Can not open file " << fileName << G4endl;
}
#endif
return false;
}
@@ -455,11 +461,13 @@ G4bool G4ProductionCutsTable::CheckMaterialInfo(const G4String& directory,
keyword = (const char*)(temp);
}
if (key!=keyword) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cout << "G4ProductionCutsTable::CheckMaterialInfo ";
G4cout << " Key word in " << fileName << "= " << keyword ;
G4cout <<"( should be "<< key << ")" <<G4endl;
}
#endif
return false;
}
@@ -473,12 +481,14 @@ G4bool G4ProductionCutsTable::CheckMaterialInfo(const G4String& directory,
fIn.read( (char*)(&nmat), sizeof (G4int));
}
if (nmat!=numberOfMaterial) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cout << "G4ProductionCutsTable::CheckMaterialInfo ";
G4cout << "Number of material is inconsistent "<< G4endl;
G4cout << "Number of materials in " << fileName << "= " << nmat ;
G4cout <<"( should be "<< numberOfMaterial<< ")" <<G4endl;
}
#endif
return false;
}
@@ -486,11 +496,13 @@ G4bool G4ProductionCutsTable::CheckMaterialInfo(const G4String& directory,
for (G4int idx=0; idx<numberOfMaterial ; ++idx){
// check eof
if(fIn.eof()) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cout << "G4ProductionCutsTable::CheckMaterialInfo ";
G4cout << " encountered End of File " ;
G4cout << " at " << idx+1 << "th material "<< G4endl;
}
#endif
fIn.close();
return false;
}
@@ -507,16 +519,19 @@ G4bool G4ProductionCutsTable::CheckMaterialInfo(const G4String& directory,
fIn.read((char*)(&density), sizeof (G4double));
}
if (fIn.fail()) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cout << "G4ProductionCutsTable::CheckMaterialInfo ";
G4cout << " Bad data format ";
G4cout << " at " << idx+1 << "th material "<< G4endl;
}
#endif
fIn.close();
return false;
}
G4double ratio = abs(density/((*matTable)[idx])->GetDensity() );
if ( name != ((*matTable)[idx])->GetName()){
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cout << "G4ProductionCutsTable::CheckMaterialInfo ";
G4cout << " Inconsistent material name ";
@@ -525,9 +540,11 @@ G4bool G4ProductionCutsTable::CheckMaterialInfo(const G4String& directory,
G4cout << "Density:" << std::setiosflags(std::ios::scientific) << density / (g/cm3) << "[g/cm3]"<< G4endl;
G4cout << std::resetiosflags(std::ios::scientific);
}
#endif
fIn.close();
return false;
} else if ((0.999>ratio) || (ratio>1.001) ){
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cout << "G4ProductionCutsTable::CheckMaterialInfo ";
G4cout << " Inconsistent material density" << G4endl;;
@@ -537,6 +554,7 @@ G4bool G4ProductionCutsTable::CheckMaterialInfo(const G4String& directory,
G4cout << "(should be " << ((*matTable)[idx])->GetDensity()/ (g/cm3)<< ")" << " [g/cm3]"<< G4endl;
G4cout << std::resetiosflags(std::ios::scientific);
}
#endif
fIn.close();
return false;
}
@@ -546,6 +564,7 @@ G4bool G4ProductionCutsTable::CheckMaterialInfo(const G4String& directory,
return true;
}
// Store materialCutsCouple information in files under the specified directory.
G4bool G4ProductionCutsTable::StoreMaterialCutsCoupleInfo(const G4String& directory,
@@ -565,10 +584,12 @@ G4bool G4ProductionCutsTable::StoreMaterialCutsCoupleInfo(const G4String& direc
// check if the file has been opened successfully
if (!fOut) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cerr << "G4ProductionCutsTable::StoreMaterialCutsCoupleInfo ";
G4cerr << " Can not open file " << fileName << G4endl;
}
#endif
return false;
}
G4int numberOfCouples = coupleTable.size();
@@ -682,10 +703,12 @@ G4bool G4ProductionCutsTable::CheckMaterialCutsCoupleInfo(const G4String& direc
// check if the file has been opened successfully
if (!fIn) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cerr << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cerr << " Can not open file " << fileName << G4endl;
}
#endif
return false;
}
@@ -705,6 +728,7 @@ G4bool G4ProductionCutsTable::CheckMaterialCutsCoupleInfo(const G4String& direc
G4cout << " Key word in " << fileName << "= " << keyword ;
G4cout <<"( should be "<< key << ")" <<G4endl;
}
fIn.close();
return false;
}
@@ -716,109 +740,267 @@ G4bool G4ProductionCutsTable::CheckMaterialCutsCoupleInfo(const G4String& direc
fIn.read( (char*)(&numberOfCouples), sizeof (G4int));
}
if ( size_t(numberOfCouples) != coupleTable.size()) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << "Number of couples is inconsistent "<< G4endl;
G4cout << "Number of couples in " << fileName << "= " << numberOfCouples;
G4cout <<"( should be "<< coupleTable.size()<< ")" <<G4endl;
}
#endif
fIn.close();
return false;
}
// Loop over all couples
CoupleTableIterator cItr;
for (cItr=coupleTable.begin();cItr!=coupleTable.end();cItr++){
char name[FixedStringLengthForStore];
G4MaterialCutsCouple* aCouple = (*cItr);
// Read in couple information
for (G4int idx=0; idx<numberOfCouples; idx+=1){
// read in index
G4int index;
if (ascii) {
fIn >> index;
} else {
fIn.read( (char*)(&index), sizeof (G4int));
}
// read in index material name
char mat_name[FixedStringLengthForStore];
if (ascii) {
fIn >> name;
fIn >> mat_name;
} else {
fIn.read(name, FixedStringLengthForStore);
fIn.read(mat_name, FixedStringLengthForStore);
}
if ( index != aCouple->GetIndex() ) {
if (verboseLevel >0) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << "Index of couples is inconsistent at ";
G4cout << index << ":" << name << " in " << fileName << G4endl;
G4cout <<" ( should be " << aCouple->GetIndex() << ":" ;
G4cout << aCouple->GetMaterial()->GetName() << ")" << G4endl;
}
return false;
}
if ( name != aCouple->GetMaterial()->GetName() ) {
if (verboseLevel >0) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << "MaterialName is inconsistent at ";
G4cout << index << ":" << name << " in " << fileName << G4endl;
G4cout <<" ( should be " << aCouple->GetIndex() << ":" ;
G4cout << aCouple->GetMaterial()->GetName() << ")" << G4endl;
}
return false;
}
// read in index and region name
char region_name[FixedStringLengthForStore];
if (ascii) {
fIn >> name;
fIn >> region_name;
} else {
fIn.read(name, FixedStringLengthForStore);
fIn.read(region_name, FixedStringLengthForStore);
}
if (!aCouple->IsUsed()){
if ( name != "NONE" ) {
if(verboseLevel>0) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << "Region Name is inconsistent at ";
G4cout << index << ": " << name << " in " << fileName << G4endl;
G4cout <<" ( should be " << aCouple->GetIndex() << ": NONE )" << G4endl;
}
return false;
}
} else {
G4Region* fRegion = fG4RegionStore->GetRegion(name);
if (!IsCoupleUsedInTheRegion(aCouple, fRegion) ){
if(verboseLevel>0) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << "Region Name is inconsistent ";
G4cout << index << ": " << name << " in " << fileName << G4endl;
}
return false;
}
}
// cut value
G4ProductionCuts* aCut = aCouple->GetProductionCuts();
G4double cutValues[NumberOfG4CutIndex];
for (size_t idx=0; idx< NumberOfG4CutIndex; idx++) {
for (size_t i=0; i< NumberOfG4CutIndex; i++) {
if (ascii) {
fIn >> cutValues[idx];
cutValues[idx] *= (mm);
fIn >> cutValues[i];
cutValues[i] *= (mm);
} else {
fIn.read( (char*)(&(cutValues[idx])), sizeof (G4double));
fIn.read( (char*)(&(cutValues[i])), sizeof (G4double));
}
G4double ratio = cutValues[idx]/aCut->GetProductionCut(idx);
if ((0.999>ratio) || (ratio>1.001) ){
if(verboseLevel>0) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << index << ":" << name << " in " << fileName << G4endl;
G4cout << idx << "th CutValue (=" << cutValues[idx]/mm ;
G4cout << "[mm]) is inconsistent in ";
G4cout << "( should be "<< aCut->GetProductionCut(idx)/mm;
G4cout << "[mm]) " << G4endl;
}
// Loop over all couples
CoupleTableIterator cItr;
G4bool fOK = false;
G4MaterialCutsCouple* aCouple =0;
for (cItr=coupleTable.begin();cItr!=coupleTable.end();cItr++){
aCouple = (*cItr);
if ( mat_name != aCouple->GetMaterial()->GetName() ) continue;
if ( region_name == "NONE" ) {
if (aCouple->IsUsed()) continue;
} else {
G4Region* fRegion = fG4RegionStore->GetRegion(region_name);
if (!IsCoupleUsedInTheRegion(aCouple, fRegion) ) continue;
}
G4ProductionCuts* aCut = aCouple->GetProductionCuts();
for (size_t j=0; j< NumberOfG4CutIndex; j++) {
G4double ratio = cutValues[j]/aCut->GetProductionCut(j);
if ((0.999>ratio) || (ratio>1.001) )continue;
}
fOK = true;
break;
}
if (fOK) {
if ( index != aCouple->GetIndex() ) {
isNeedForRestoreCoupleInfo = true;
#ifdef G4VERBOSE
if (verboseLevel >1) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << "Index of couples was modified "<< G4endl;
G4cout << aCouple->GetIndex() << ":" <<aCouple->GetMaterial()->GetName();
G4cout <<" is defined as " ;
G4cout << index << ":" << mat_name << " in " << fileName << G4endl;
}
return false;
#endif
} else {
#ifdef G4VERBOSE
if (verboseLevel >2) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << index << ":" << mat_name << " in " << fileName ;
G4cout << " is consistent with current setup" << G4endl;
}
#endif
}
}else{
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cout << "G4ProductionCutTable::CheckMaterialCutsCoupleInfo ";
G4cout << "Couples is not defined in the current detector setup ";
G4cout << index << ": in " << fileName << G4endl;
G4cout << " material: " << mat_name ;
G4cout << " region: " << region_name << G4endl;
for (size_t ii=0; ii< NumberOfG4CutIndex; ii++) {
G4cout << "cut [" << ii << "]: " << cutValues[ii]/mm;
}
G4cout << G4endl;
}
#endif
fIn.close();
return false;
}
}
fIn.close();
return true;
}
// Retrieve stored materialCutsCouple is consistent with the current detector setup.
G4bool G4ProductionCutsTable::RetrieveMaterialCutsCoupleInfo(const G4String& directory,
G4bool ascii )
{
const G4String fileName = directory + "/" + "couple.dat";
const G4String key = "COUPLE-V2.0";
std::ifstream fIn;
// open input file //
if (!ascii )
fIn.open(fileName,std::ios::in|std::ios::binary);
else
fIn.open(fileName,std::ios::in);
// check if the file has been opened successfully
if (!fIn) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cerr << "G4ProductionCutTable::RetrieveMaterialCutsCoupleInfo ";
G4cerr << " Can not open file " << fileName << G4endl;
}
#endif
return false;
}
char temp[FixedStringLengthForStore];
// key word
G4String keyword;
if (ascii) {
fIn >> keyword;
} else {
fIn.read(temp, FixedStringLengthForStore);
keyword = (const char*)(temp);
}
if (key!=keyword) {
if (verboseLevel >0) {
G4cout << "G4ProductionCutTable::RetrieveMaterialCutsCoupleInfo ";
G4cout << " Key word in " << fileName << "= " << keyword ;
G4cout <<"( should be "<< key << ")" <<G4endl;
}
fIn.close();
return false;
}
// numberOfCouples
G4int numberOfCouples;
if (ascii) {
fIn >> numberOfCouples;
} else {
fIn.read( (char*)(&numberOfCouples), sizeof (G4int));
}
if ( size_t(numberOfCouples) != coupleTable.size()) {
#ifdef G4VERBOSE
if (verboseLevel >0) {
G4cout << "G4ProductionCutTable::RetrieveMaterialCutsCoupleInfo ";
G4cout << "Number of couples is inconsistent "<< G4endl;
G4cout << "Number of couples in " << fileName << "= " << numberOfCouples;
G4cout <<"( should be "<< coupleTable.size()<< ")" <<G4endl;
}
#endif
fIn.close();
return false;
}
// Read in couple information
for (G4int idx=0; idx<numberOfCouples; idx+=1){
// read in index
G4int index;
if (ascii) {
fIn >> index;
} else {
fIn.read( (char*)(&index), sizeof (G4int));
}
// read in index material name
char mat_name[FixedStringLengthForStore];
if (ascii) {
fIn >> mat_name;
} else {
fIn.read(mat_name, FixedStringLengthForStore);
}
// read in index and region name
char region_name[FixedStringLengthForStore];
if (ascii) {
fIn >> region_name;
} else {
fIn.read(region_name, FixedStringLengthForStore);
}
// cut value
G4double cutValues[NumberOfG4CutIndex];
for (size_t i=0; i< NumberOfG4CutIndex; i++) {
if (ascii) {
fIn >> cutValues[i];
cutValues[i] *= (mm);
} else {
fIn.read( (char*)(&(cutValues[i])), sizeof (G4double));
}
}
G4MaterialCutsCouple* aCouple= coupleTable[size_t(idx)];
// set material
G4Material* material = G4Material::GetMaterial(mat_name);
aCouple->SetMaterial(material);
G4ProductionCuts* aCut=0;
// delete attached cut unless this couple is not used
if (!aCouple->IsUsed()){
aCut= aCouple->GetProductionCuts();
if (aCut) delete aCut;
}
if ( region_name == "NONE" ) {
//create production cuts but the couple is not used
aCouple->SetUseFlag(false);
aCut = new G4ProductionCuts();
for (size_t j=0; j< NumberOfG4CutIndex; j++) {
aCut->SetProductionCut(cutValues[j],j);
}
aCouple->SetProductionCuts(aCut);
} else {
//set production cuts in the region to this couple
G4Region* fRegion = fG4RegionStore->GetRegion(region_name);
aCut = fRegion->GetProductionCuts();
if (!aCut) {
// the case no production cuts in the region
aCut = new G4ProductionCuts();
for (size_t j=0; j< NumberOfG4CutIndex; j++) {
aCut->SetProductionCut(cutValues[j],j);
}
}
aCouple->SetProductionCuts(aCut);
}
#ifdef G4VERBOSE
if (verboseLevel >2) {
G4cout << "G4ProductionCutTable::RetrieveMaterialCutsCoupleInfo ";
G4cout << "Couples is modified "<< G4endl;
G4cout << index << ": ";
G4cout << "material: " << mat_name << G4endl;
G4cout << "region: " << region_name << G4endl;
for (size_t ii=0; ii< NumberOfG4CutIndex; ii++) {
G4cout << "cut [" << ii << "]: " << cutValues[ii]/mm<< G4endl;
}
}
#endif
}
fIn.close();
return true;
}
// Store cut values information in files under the specified directory.
G4bool G4ProductionCutsTable::StoreCutsInfo(const G4String& directory,
G4bool ascii)
@@ -968,3 +1150,4 @@ G4bool G4ProductionCutsTable::RetrieveCutsInfo(const G4String& directory,
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.12 2004/03/12 04:46:29 kurasige Exp $
$Id: History,v 1.13 2004/05/08 15:30:19 kurasige Exp $
-------------------------------------------------------------------
=========================================================
@@ -16,6 +16,9 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
- May. 08, 04 H.Kurashige(decay-V06-01-00)
- Change method name for ParticleChange
- Mar. 12, 04 H.Kurashige(decay-V06-00-00)
- Fixed bug in PostStepGPIL in case of stopping during AlongStep actions
+8 -8
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Decay.cc,v 1.16 2003/04/26 18:54:11 vnivanch Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4Decay.cc,v 1.18 2004/05/08 15:30:19 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// --------------------------------------------------------------
@@ -213,8 +213,8 @@ G4VParticleChange* G4Decay::DecayIt(const G4Track& aTrack, const G4Step& )
#endif
fParticleChangeForDecay.SetNumberOfSecondaries(0);
// Kill the parent particle
fParticleChangeForDecay.SetStatusChange( fStopAndKill ) ;
fParticleChangeForDecay.SetLocalEnergyDeposit(0.0);
fParticleChangeForDecay.ProposeTrackStatus( fStopAndKill ) ;
fParticleChangeForDecay.ProposeLocalEnergyDeposit(0.0);
ClearNumberOfInteractionLengthLeft();
return &fParticleChangeForDecay ;
@@ -234,9 +234,9 @@ G4VParticleChange* G4Decay::DecayIt(const G4Track& aTrack, const G4Step& )
// decay channel not found
G4Exception("G4Decay::DoIt : can not determine decay channel ");
} else {
G4int temp = decaychannel->GetVerboseLevel();
// execute DecayIt()
#ifdef G4VERBOSE
G4int temp = decaychannel->GetVerboseLevel();
if (GetVerboseLevel()>1) {
G4cerr << "G4Decay::DoIt : selected decay channel addr:" << decaychannel <<G4endl;
decaychannel->SetVerboseLevel(GetVerboseLevel());
@@ -307,9 +307,9 @@ G4VParticleChange* G4Decay::DecayIt(const G4Track& aTrack, const G4Step& )
delete products;
// Kill the parent particle
fParticleChangeForDecay.SetStatusChange( fStopAndKill ) ;
fParticleChangeForDecay.SetLocalEnergyDeposit(energyDeposit);
fParticleChangeForDecay.SetTimeChange( finalGlobalTime );
fParticleChangeForDecay.ProposeTrackStatus( fStopAndKill ) ;
fParticleChangeForDecay.ProposeLocalEnergyDeposit(energyDeposit);
fParticleChangeForDecay.ProposeGlobalTime( finalGlobalTime );
// reset NumberOfInteractionLengthLeft
ClearNumberOfInteractionLengthLeft();
@@ -1,4 +1,4 @@
$Id: History,v 1.200 2004/03/23 12:45:14 gcosmo Exp $
$Id: History,v 1.203 2004/06/07 07:42:57 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,8 +17,27 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
07.06.2004 G.Cosmo, tag emlowen-V06-01-02
Fix in G4hShellCrossSectionExp for compilation error on WIN32-VC.
01.06.2004 MGP, tag emlowen-V06-01-01
Bug fix for Barkas effect
01.06.2004 MGP, tag emlowen-V06-01-00
Bug fix in energy loss concerning positrons handled by Penelope
19.05.2004 MGP, tag emlowen-V06-00-11
New model for PIXE (by Simona Saliceti)
19.05.2004 MGP, tag emlowen-V06-00-10
First iteration towards new models for photoelectric
angular distribution: design iteration and re-implementation
of re-implementation of non-polarized Sauter-Gavrila
distribution (K-shell approximation)" by Pedro Rodrigues
and Andreia Trindade
23.03.2004 G.Cosmo, tag emlowen-V06-00-09
Fix in G4PenelopeCompton for compilation on WIN32-VC.
Fix in G4PenelopeCompton for compilation error on WIN32-VC.
15.03.2004 MGP, tag emlowen-V06-00-08
Fix in G4PenelopeRayleigh related to PR 605
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4PhotoElectricAngularGenerator462
//
// Author: Andreia Trindade (andreia@lip.pt)
//
// Creation date: 10 May 2004
//
// Modifications:
// 10 May 2003 A. Trindade First implementation acording with new design
//
// Class Description:
//
// Abstract class for PhotoElectricsstrahlung Angular Generator462 Generation
// Further documentation available from http://www.ge.infn.it/geant4/lowE
// -------------------------------------------------------------------
//
#ifndef G4PhotoElectricAngularGenerator462_h
#define G4PhotoElectricAngularGenerator462_h 1
#include "G4VPhotoElectricAngularDistribution.hh"
#include "G4ios.hh"
#include "globals.hh"
class G4PhotoElectricAngularGenerator462 : public G4VPhotoElectricAngularDistribution
{
public:
G4PhotoElectricAngularGenerator462(const G4String& name);
~G4PhotoElectricAngularGenerator462();
G4ThreeVector GetPhotoElectronDirection(G4ThreeVector direction, G4double kineticEnergy);
void PrintGeneratorInformation() const;
protected:
private:
// hide assignment operator
G4PhotoElectricAngularGenerator462 & operator=(const G4PhotoElectricAngularGenerator462 &right);
G4PhotoElectricAngularGenerator462(const G4PhotoElectricAngularGenerator462&);
};
#endif
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4PhotoElectricAngularGeneratorStandard
//
// Creation date: 10 May 2004
//
// Modifications:
// 10 May 2003 P. Rodrigues First implementation acording with new design
//
// Class Description:
//
// Concrete class for PhotoElectric Electron Angular Distribution Generation
// This model is a re-implementation of the Photolectric angular distribution
// developed my M. Maire for the Standard EM Physics G4PhotoElectricEffect
//
// Further documentation available from http://www.ge.infn.it/geant4/lowE
// -------------------------------------------------------------------
//
#ifndef G4PhotoElectricAngularGeneratorStandard_h
#define G4PhotoElectricAngularGeneratorStandard_h 1
#include "G4VPhotoElectricAngularDistribution.hh"
#include "G4ios.hh"
#include "globals.hh"
class G4PhotoElectricAngularGeneratorStandard : public G4VPhotoElectricAngularDistribution
{
public:
G4PhotoElectricAngularGeneratorStandard(const G4String& name);
~G4PhotoElectricAngularGeneratorStandard();
G4ThreeVector GetPhotoElectronDirection(G4ThreeVector direction, G4double kineticEnergy);
void PrintGeneratorInformation() const;
protected:
private:
// hide assignment operator
G4PhotoElectricAngularGeneratorStandard & operator=(const G4PhotoElectricAngularGeneratorStandard &right);
G4PhotoElectricAngularGeneratorStandard(const G4PhotoElectricAngularGeneratorStandard&);
};
#endif
@@ -0,0 +1,78 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4VPhotoElectricAngularDistribution
//
// Author: Pedro Rodrigues (psilva@lip.pt)
// Andreia Trindade (andreia@lip.pt)
//
// Creation date: 10 May 2004
//
// Modifications:
// 10 May 2004 A. Trindade First implementation acording with new design
//
// Class Description:
//
// Abstract class for PhotoElectricsstrahlung Angular Distribution Generation
// Further documentation available from http://www.ge.infn.it/geant4/lowE
// -------------------------------------------------------------------
//
#ifndef G4VPhotoElectricAngularDistribution_h
#define G4VPhotoElectricAngularDistribution_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4ThreeVector.hh"
class G4VPhotoElectricAngularDistribution
{
public:
G4VPhotoElectricAngularDistribution(const G4String& name);
virtual ~G4VPhotoElectricAngularDistribution();
virtual G4ThreeVector GetPhotoElectronDirection(G4ThreeVector direction, G4double kineticEnergy) = 0;
virtual void PrintGeneratorInformation() const = 0;
protected:
private:
// hide assignment operator
G4VPhotoElectricAngularDistribution & operator=(const G4VPhotoElectricAngularDistribution &right);
G4VPhotoElectricAngularDistribution(const G4VPhotoElectricAngularDistribution&);
};
#endif
@@ -64,12 +64,20 @@ public:
G4double mass,
G4double deltaEnergy) const;
protected:
virtual std::vector<G4double> Probabilities(G4int Z,
virtual std::vector<G4double> GetCrossSection(G4int Z,
G4double incidentEnergy,
G4double mass,
G4double deltaEnergy) const = 0;
G4double deltaEnergy,
G4bool testFlag = false) const =0;
//protected:
virtual std::vector<G4double> Probabilities(G4int Z,
G4double incidentEnergy,
G4double mass,
G4double deltaEnergy) const = 0;
private:
// Hide copy constructor and assignment operator
@@ -85,6 +85,7 @@
#include "G4IonYangFluctuationModel.hh"
#include "G4AtomicDeexcitation.hh"
#include "G4MaterialCutsCouple.hh"
#include <map>
class G4VEMDataSet;
class G4ShellVacancy;
@@ -272,6 +273,7 @@ private:
G4VLowEnergyModel* theNuclearStoppingModel;
G4VLowEnergyModel* theIonChuFluctuationModel;
G4VLowEnergyModel* theIonYangFluctuationModel;
std::map<G4int,G4double,std::less<G4int> > totalCrossSectionMap;
// name of parametrisation table of electron stopping power
G4String theProtonTable;
@@ -307,7 +309,7 @@ private:
G4VhShellCrossSection* shellCS;
std::vector<G4VEMDataSet*> zFluoDataVector;
G4bool theFluo;
G4bool expFlag;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -34,7 +34,7 @@
// 23 Oct 2001 A. Mantero 1st implementation
// 24 Oct 2001 MGP Cleaned up
// 29 Oct 2001 VI Add delta energy
//
// 22 Apr 2004 S.Saliceti Add GetCrossSection method
// -------------------------------------------------------------------
// Class Description:
@@ -56,12 +56,18 @@ public:
virtual ~G4hShellCrossSection();
virtual std::vector<G4double> GetCrossSection(G4int Z,
G4double incidentEnergy,
G4double mass,
G4double deltaEnergy,
G4bool testFlag = false) const;
protected:
virtual std::vector<G4double> Probabilities(G4int Z,
G4double incidentEnergy,
G4double mass,
G4double deltaEnergy) const;
G4double incidentEnergy,
G4double mass,
G4double deltaEnergy) const;
private:
@@ -0,0 +1,87 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4hShellCrossSectionExp
//
// Author: Simona Saliceti (simona.saliceti@ge.infn.it)
//
// History:
// -----------
// From 23 Oct 2001 A. Mantero G4hShellCrossSection
// 30/03/2004 Simona Saliceti 1st implementation
// -------------------------------------------------------------------
// Class Description:
// Empiric Model for shell cross sections in proton ionisation
// -------------------------------------------------------------------
// $Id: G4hShellCrossSectionExp.hh,v 1.1 2004/04/27 09:45:48 saliceti Exp $
// GEANT4 tag $Name: geant4-06-02 $
#ifndef G4HSHELLCROSSSECTIONEXP_HH
#define G4HSHELLCROSSSECTIONEXP_HH 1
#include "globals.hh"
#include "G4VhShellCrossSection.hh"
#include "G4hShellCrossSectionExpData.hh"
class G4hShellCrossSectionExp : public G4VhShellCrossSection
{
public:
G4hShellCrossSectionExp();
virtual ~G4hShellCrossSectionExp();
virtual std::vector<G4double> GetCrossSection(G4int Z,
G4double incidentEnergy,
G4double mass,
G4double deltaEnergy,
G4bool testFlag = false) const;
void SetTotalCS(G4double);
protected:
virtual std::vector<G4double> Probabilities(G4int Z,
G4double incidentEnergy,
G4double mass,
G4double deltaEnergy) const;
private:
G4double GetCrossSectionExp(G4int Z,
G4double incidentEnergy) const;
// Hide copy constructor and assignment operator
G4hShellCrossSectionExp(const G4hShellCrossSectionExp&);
G4hShellCrossSectionExp & operator = (const G4hShellCrossSectionExp &right);
G4hShellCrossSectionExpData* kShellData;
G4double atomTotalCrossSection;
};
#endif
@@ -0,0 +1,154 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// Author: Simona Saliceti (Simona.Saliceti@ge.infn.it)
//
// History:
// -----------
// 22 Apr 2004 First committed to cvs
//
// -------------------------------------------------------------------
// Class description:
// Low Energy Electromagnetic Physics
// Fluorescence data set: shell identifiers, transition probabilities,
// transition energies
// Further documentation available from http://www.ge.infn.it/geant4/lowE
// -------------------------------------------------------------------
// $Id: G4hShellCrossSectionExpData.hh,v 1.1 2004/04/27 09:45:48 saliceti Exp $
// GEANT4 tag $Name: geant4-06-02 $
#ifndef G4hShellCrossSectionExpData_HH
#define G4hShellCrossSectionExpData_HH 1
#include "globals.hh"
#include <vector>
#include <map>
class G4hShellCrossSectionExpData
{
public:
G4hShellCrossSectionExpData();
~G4hShellCrossSectionExpData();
std::vector<G4double>* GetParam(G4int);
private:
void FillVectorValues();
void FillParameterMap();
inline void InitializeVector(std::vector<G4double> &vect, G4double value1, G4double value2, G4double value3) const;
std::map<G4int,std::vector<G4double>*,std::less<G4int> > parameterMap;
std::vector<G4double> parameter6C;
std::vector<G4double> parameter7N ;
std::vector<G4double> parameter8O ;
std::vector<G4double> parameter9F ;
std::vector<G4double> parameter10Ne;
std::vector<G4double> parameter11Na;
std::vector<G4double> parameter12Mg;
std::vector<G4double> parameter13Al;
std::vector<G4double> parameter14Si;
std::vector<G4double> parameter15P ;
std::vector<G4double> parameter16S ;
std::vector<G4double> parameter17Cl;
std::vector<G4double> parameter18Ar;
std::vector<G4double> parameter19K ;
std::vector<G4double> parameter20Ca;
std::vector<G4double> parameter21Sc;
std::vector<G4double> parameter22Ti;
std::vector<G4double> parameter23V ;
std::vector<G4double> parameter24Cr;
std::vector<G4double> parameter25Mn;
std::vector<G4double> parameter26Fe;
std::vector<G4double> parameter27Co;
std::vector<G4double> parameter28Ni;
std::vector<G4double> parameter29Cu;
std::vector<G4double> parameter30Zn;
std::vector<G4double> parameter31Ga;
std::vector<G4double> parameter32Ge;
std::vector<G4double> parameter33As;
std::vector<G4double> parameter34Se;
std::vector<G4double> parameter35Br;
std::vector<G4double> parameter36Kr;
std::vector<G4double> parameter37Rb;
std::vector<G4double> parameter38Sr;
std::vector<G4double> parameter39Y ;
std::vector<G4double> parameter40Zr;
std::vector<G4double> parameter41Nb;
std::vector<G4double> parameter42Mo;
std::vector<G4double> parameter43Tc;
std::vector<G4double> parameter44Ru;
std::vector<G4double> parameter45Rh;
std::vector<G4double> parameter46Pd;
std::vector<G4double> parameter47Ag;
std::vector<G4double> parameter48Cd;
std::vector<G4double> parameter49In;
std::vector<G4double> parameter50Sn;
std::vector<G4double> parameter51Sb;
std::vector<G4double> parameter52Te;
std::vector<G4double> parameter53I ;
std::vector<G4double> parameter54Xe;
std::vector<G4double> parameter55Cs;
std::vector<G4double> parameter56Ba;
std::vector<G4double> parameter57La;
std::vector<G4double> parameter58Ce;
std::vector<G4double> parameter59Pr;
std::vector<G4double> parameter60Nd;
std::vector<G4double> parameter61Pm;
std::vector<G4double> parameter62Sm;
std::vector<G4double> parameter63Eu;
std::vector<G4double> parameter64Gd;
std::vector<G4double> parameter65Tb;
std::vector<G4double> parameter66Dy;
std::vector<G4double> parameter67Ho;
std::vector<G4double> parameter68Er;
std::vector<G4double> parameter69Tm;
std::vector<G4double> parameter70Yb;
std::vector<G4double> parameter71Lu;
std::vector<G4double> parameter72Hf;
std::vector<G4double> parameter73Ta;
std::vector<G4double> parameter74W ;
std::vector<G4double> parameter75Re;
std::vector<G4double> parameter76Os;
std::vector<G4double> parameter77Ir;
std::vector<G4double> parameter78Pt;
std::vector<G4double> parameter79Au;
std::vector<G4double> parameter80Hg;
std::vector<G4double> parameter81Tl;
std::vector<G4double> parameter82Pb;
std::vector<G4double> parameter83Bi;
std::vector<G4double> parameter84Po;
std::vector<G4double> parameter85At;
std::vector<G4double> parameter86Rn;
std::vector<G4double> parameter87Fr;
std::vector<G4double> parameter88Ra;
std::vector<G4double> parameter89Ac;
std::vector<G4double> parameter90Th;
std::vector<G4double> parameter91Pa;
std::vector<G4double> parameter92U ;
};
#endif
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4PenelopeBremsstrahlung.cc,v 1.14 2003/11/18 17:29:43 pia Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4PenelopeBremsstrahlung.cc,v 1.15 2004/06/01 15:07:10 pandola Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// --------------------------------------------------------------
//
@@ -38,6 +38,7 @@
// 23.05.2003 MGP - Removed memory leak (fix in destructor)
// 07.11.2003 L.Pandola - Bug fixed in LoadAngularData()
// 11.11.2003 L.Pandola - Code review: use std::map for angular data
// 01.06.2004 L.Pandola - StopButAlive for positrons on PostStepDoIt
//
//----------------------------------------------------------------
@@ -55,7 +56,7 @@
#include "G4MaterialCutsCouple.hh"
#include "G4DataVector.hh"
#include "G4ProductionCutsTable.hh"
#include "G4ProcessManager.hh"
G4PenelopeBremsstrahlung::G4PenelopeBremsstrahlung(const G4String& nam)
: G4eLowEnergyLoss(nam),
@@ -66,7 +67,6 @@ G4PenelopeBremsstrahlung::G4PenelopeBremsstrahlung(const G4String& nam)
angularData = new std::map<G4int,G4PenelopeBremsstrahlungAngular*>;
cutForPhotons = 0.;
verboseLevel = 0;
}
@@ -321,11 +321,12 @@ G4VParticleChange* G4PenelopeBremsstrahlung::PostStepDoIt(const G4Track& track,
G4String excep = "Not found the angular data for material " + material->GetName();
G4Exception(excep);
}
G4PenelopeBremsstrahlungAngular* elementAngularData = angularData->find(Z)->second;
//Check if the loaded angular data are right
//G4cout << "Material Z: " << elementAngularData->GetAtomicNumber() << " !!" << G4endl;
//G4cout << "Material Z: " << angularData->find(Z)->second->GetAtomicNumber() << " !!" << G4endl;
// Sample gamma angle (Z - axis along the parent particle).
G4double dirZ = elementAngularData->ExtractCosTheta(kineticEnergy,tGamma);
G4double dirZ = angularData->find(Z)->second->ExtractCosTheta(kineticEnergy,tGamma);
G4double totalEnergy = kineticEnergy + electron_mass_c2;
G4double phi = twopi * G4UniformRand();
G4double sinTheta = sqrt(1. - dirZ*dirZ);
@@ -336,7 +337,7 @@ G4VParticleChange* G4PenelopeBremsstrahlung::PostStepDoIt(const G4Track& track,
G4ThreeVector electronDirection = track.GetMomentumDirection();
gammaDirection.rotateUz(electronDirection);
//
// Update the incident particle
//
@@ -358,7 +359,27 @@ G4VParticleChange* G4PenelopeBremsstrahlung::PostStepDoIt(const G4Track& track,
aParticleChange.SetNumberOfSecondaries(1);
G4double norm = 1./sqrt(finalX*finalX + finalY*finalY + finalZ*finalZ);
aParticleChange.SetMomentumChange(finalX*norm, finalY*norm, finalZ*norm);
aParticleChange.SetEnergyChange( finalEnergy );
const G4ParticleDefinition* particle = track.GetDefinition();
if (finalEnergy > 0.)
{
aParticleChange.SetEnergyChange(finalEnergy) ;
}
else
{
aParticleChange.SetEnergyChange(0.) ;
if (particle->GetProcessManager()->GetAtRestProcessVector()->size())
//In this case there is at least one AtRest process
{
aParticleChange.SetStatusChange(fStopButAlive);
}
else
{
aParticleChange.SetStatusChange(fStopAndKill);
}
}
// create G4DynamicParticle object for the gamma
G4DynamicParticle* aGamma= new G4DynamicParticle (G4Gamma::Gamma(),
@@ -421,8 +442,7 @@ void G4PenelopeBremsstrahlung::LoadAngularData()
G4int Z = (G4int)((*theElementVector)[iel]->GetZ());
//if the material is not present yet --> insert it in the map
if (!(angularData->count(Z))) {
G4PenelopeBremsstrahlungAngular* elementAngular = new G4PenelopeBremsstrahlungAngular(Z);
angularData->insert(std::make_pair(Z,elementAngular));
angularData->insert(std::make_pair(Z,new G4PenelopeBremsstrahlungAngular(Z)));
//G4cout << "Loaded......... Z= " << Z << G4endl;
}
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4PenelopeIonisation.cc,v 1.12 2004/03/18 13:44:44 pandola Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4PenelopeIonisation.cc,v 1.13 2004/06/01 15:09:12 pandola Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// --------------------------------------------------------------
//
@@ -46,6 +46,7 @@
// 10.03.04 L.Pandola Bug fixed with reference system of delta rays
// 17.03.04 L.Pandola Removed unnecessary calls to pow(a,b)
// 18.03.04 L.Pandola Bug fixed in the destructor
// 01.06.04 L.Pandola StopButAlive for positrons on PostStepDoIt
// --------------------------------------------------------------
#include "G4PenelopeIonisation.hh"
@@ -65,6 +66,7 @@
#include "G4Gamma.hh"
#include "G4Positron.hh"
#include "G4ProductionCutsTable.hh"
#include "G4ProcessManager.hh"
G4PenelopeIonisation::G4PenelopeIonisation(const G4String& nam)
: G4eLowEnergyLoss(nam),
@@ -329,7 +331,15 @@ G4VParticleChange* G4PenelopeIonisation::PostStepDoIt(const G4Track& track,
else
{
aParticleChange.SetEnergyChange(0.) ;
aParticleChange.SetStatusChange(fStopAndKill);
if (aParticleType->GetProcessManager()->GetAtRestProcessVector()->size())
//In this case there is at least one AtRest process
{
aParticleChange.SetStatusChange(fStopButAlive);
}
else
{
aParticleChange.SetStatusChange(fStopAndKill);
}
}
//Generate the delta day
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4PhotoElectricAngularGenerator462
//
// Author: Andreia Trindade (andreia@lip.pt)
//
// Creation date: 10 May 2004
//
// Modifications:
// 10 May 2003 A. Trindade First implementation acording with new design
//
// Class Description:
//
// Concrete class for PhotoElectric Electron Angular Distribution Generation - ( < 4.6.2 model)
//
// Class Description: End
//
// -------------------------------------------------------------------
//
//
#include "G4PhotoElectricAngularGenerator462.hh"
#include "Randomize.hh"
//
G4PhotoElectricAngularGenerator462::G4PhotoElectricAngularGenerator462(const G4String& name):G4VPhotoElectricAngularDistribution(name)
{;}
//
G4PhotoElectricAngularGenerator462::~G4PhotoElectricAngularGenerator462()
{;}
//
G4ThreeVector G4PhotoElectricAngularGenerator462::GetPhotoElectronDirection(G4ThreeVector direction, G4double)
{
return direction;
}
//
void G4PhotoElectricAngularGenerator462::PrintGeneratorInformation() const
{
G4cout << "\n" << G4endl;
G4cout << "Simple Photoelectric Angular Generator" << G4endl;
G4cout << "Photoelectron is emmited with the same direction " << G4endl;
G4cout << "than the incident photon (see Physics Reference Manual) \n" << G4endl;
}
@@ -0,0 +1,112 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4PhotoElectricAngularGeneratorStandard
//
// Creation date: 10 May 2004
//
// Modifications:
// 10 May 2003 P. Rodrigues First implementation acording with new design
//
// Class Description:
//
// Concrete class for PhotoElectric Electron Angular Distribution Generation
// This model is a re-implementation of the Photolectric angular distribution
// developed my M. Maire for the Standard EM Physics G4PhotoElectricEffect
//
// Class Description: End
//
// -------------------------------------------------------------------
//
//
#include "G4PhotoElectricAngularGeneratorStandard.hh"
#include "Randomize.hh"
//
G4PhotoElectricAngularGeneratorStandard::G4PhotoElectricAngularGeneratorStandard(const G4String& name):G4VPhotoElectricAngularDistribution(name)
{;}
//
G4PhotoElectricAngularGeneratorStandard::~G4PhotoElectricAngularGeneratorStandard()
{;}
//
G4ThreeVector G4PhotoElectricAngularGeneratorStandard::GetPhotoElectronDirection(G4ThreeVector direction, G4double eKineticEnergy)
{
// Compute Theta distribution of the emitted electron, with respect to the
// incident Gamma.
// The Sauter-Gavrila distribution for the K-shell is used. (adapted from G4PhotoElectricEffect)
G4double costeta = 1.;
G4double Phi = twopi * G4UniformRand();
G4double cosphi = cos(Phi);
G4double sinphi = sin(Phi);
G4double sinteta = 0;
G4double gamma = 1. + eKineticEnergy/electron_mass_c2;
if (gamma > 5.) {
G4ThreeVector direction (sinteta*cosphi, sinteta*sinphi, costeta);
return costeta;
}
G4double beta = sqrt(gamma*gamma-1.)/gamma;
G4double b = 0.5*gamma*(gamma-1.)*(gamma-2);
G4double rndm,term,greject,grejsup;
if (gamma < 2.) grejsup = gamma*gamma*(1.+b-beta*b);
else grejsup = gamma*gamma*(1.+b+beta*b);
do { rndm = 1.-2*G4UniformRand();
costeta = (rndm+beta)/(rndm*beta+1.);
term = 1.-beta*costeta;
greject = (1.-costeta*costeta)*(1.+b*term)/(term*term);
} while(greject < G4UniformRand()*grejsup);
sinteta = sqrt(1.-costeta*costeta);
G4ThreeVector photoelectrondirection (sinteta*cosphi, sinteta*sinphi, costeta);
photoelectrondirection.rotateUz(direction);
return photoelectrondirection;
}
//
void G4PhotoElectricAngularGeneratorStandard::PrintGeneratorInformation() const
{
G4cout << "\n" << G4endl;
G4cout << "" << G4endl;
G4cout << "Re-implementation of the photolectric angular distribution" << G4endl;
G4cout << "developed my M. Maire for the Standard EM Physics G4PhotoElectricEffect" << G4endl;
G4cout << "It computes the theta distribution of the emitted electron, with respect to the" << G4endl;
G4cout << "incident Gamma, using the Sauter-Gavrila distribution for the K-shell\n" << G4endl;
}
@@ -0,0 +1,63 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4VPhotoElectricAngularDistribution
//
// Author: Andreia Trindade (andreia@lip.pt)
// Pedro Rodrigues (psilva@lip.pt)
//
// Creation date: 10 May 2004
//
// Modifications:
//
// Class Description:
//
// Abstract base class for PhotoElectricsstrahlung Angular Distribution Generation
//
// Class Description: End
// -------------------------------------------------------------------
//
//
#include "G4VPhotoElectricAngularDistribution.hh"
//
G4VPhotoElectricAngularDistribution::G4VPhotoElectricAngularDistribution(const G4String& ) // name
{;}
//
G4VPhotoElectricAngularDistribution::~G4VPhotoElectricAngularDistribution()
{;}
void G4VPhotoElectricAngularDistribution::PrintGeneratorInformation() const
{;}
//
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4eLowEnergyLoss.cc,v 1.31 2003/06/16 17:00:36 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4eLowEnergyLoss.cc,v 1.32 2004/06/01 14:03:55 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -----------------------------------------------------------
// GEANT 4 class implementation file
@@ -58,6 +58,7 @@
// 03/06/02 MGP - Restore fStopAndKill
// 28/10/02 VI Optimal binning for dE/dx
// 21/01/03 VI cut per region
// 01/06/04 VI check if stopped particle has AtRest processes
//
// --------------------------------------------------------------
@@ -451,7 +452,8 @@ G4VParticleChange* G4eLowEnergyLoss::AlongStepDoIt( const G4Track& trackData,
if (finalT <= 0. )
{
finalT = 0.;
aParticleChange.SetStatusChange(fStopAndKill);
if(Charge > 0.0) aParticleChange.SetStatusChange(fStopButAlive);
else aParticleChange.SetStatusChange(fStopAndKill);
}
G4double edep = E - finalT;
@@ -89,6 +89,7 @@
// 12 Apr 2003 V.Ivanchenko Cut per region for fluo AlongStep
// 18 Apr 2003 V.Ivanchenko finalRange redefinition
// 26 Apr 2003 V.Ivanchenko fix for stepLimit
// 28 May 2004 V.Ivanchenko fix for ionisation of antiprotons in complex materials
// -----------------------------------------------------------------------
@@ -932,7 +933,7 @@ G4VParticleChange* G4hLowEnergyIonisation::AlongStepDoIt(
}
// stop particle if the kinetic energy <= MinKineticEnergy
if (finalT <= MinKineticEnergy ) {
if (finalT*massRatio <= MinKineticEnergy ) {
finalT = 0.0;
if(!particle->GetDefinition()->GetProcessManager()->
@@ -1060,14 +1061,15 @@ G4double G4hLowEnergyIonisation::AntiProtonParametrisedDEDX(
// The proton model is used + Barkas correction
} else {
if(kineticEnergy < protonLowEnergy) {
eloss = theProtonModel->TheValue(G4Proton::Proton(),material,protonLowEnergy);
eloss = theProtonModel->TheValue(G4Proton::Proton(),material,protonLowEnergy)
* sqrt(kineticEnergy/protonLowEnergy) ;
// Parametrisation
} else {
eloss = theProtonModel->TheValue(G4Proton::Proton(),material,
kineticEnergy);
}
if(theBarkas) eloss -= 2.0*BarkasTerm(material, kineticEnergy);
//if(theBarkas) eloss -= 2.0*BarkasTerm(material, kineticEnergy);
}
// Delta rays energy
@@ -51,6 +51,16 @@ G4hShellCrossSection::~G4hShellCrossSection()
{ }
std::vector<G4double> G4hShellCrossSection::GetCrossSection(G4int Z,
G4double incidentEnergy,
G4double mass,
G4double deltaEnergy,
G4bool) const
{
return Probabilities(Z,incidentEnergy,mass,deltaEnergy);
}
std::vector<G4double> G4hShellCrossSection::Probabilities(
G4int Z,
G4double incidentEnergy,
@@ -0,0 +1,145 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4hShellCrossSectionExp.cc
//
// Author: Simona Saliceti (simona.saliceti@ge.infn.it)
//
// History:
// -----------
// From 23 Oct 2001 A. Mantero G4hShellCrossSection
// 30/03/2004 Simona Saliceti 1st implementation
// -------------------------------------------------------------------
// Class Description:
// Empiric Model for shell cross sections in proton ionisation
// -------------------------------------------------------------------
// $Id: G4hShellCrossSectionExp.cc,v 1.2 2004/06/07 07:42:45 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
#include "globals.hh"
#include <vector>
#include "G4hShellCrossSectionExp.hh"
#include "G4AtomicTransitionManager.hh"
#include "G4Electron.hh"
#include "G4hShellCrossSectionExpData.hh"
#include "G4Proton.hh"
#include "G4ParticleDefinition.hh"
G4hShellCrossSectionExp::G4hShellCrossSectionExp()
{
kShellData = new G4hShellCrossSectionExpData();
}
G4hShellCrossSectionExp::~G4hShellCrossSectionExp()
{ }
std::vector<G4double> G4hShellCrossSectionExp::GetCrossSection(G4int Z,
G4double incidentEnergy,
G4double mass,
G4double deltaEnergy,
G4bool testFlag) const
{
mass = 0.0;
deltaEnergy = 0.0;
std::vector<G4double> aCrossSection;
// Fill the vector of cross sections with the value just calculated
aCrossSection.push_back(GetCrossSectionExp(Z,incidentEnergy));
if (testFlag)
{
G4cout <<"Element: " <<Z<<" Particle Energy: "<<incidentEnergy/MeV<<" MeV" <<G4endl;
G4cout <<"Cross Section: "<<aCrossSection[0]/barn<<" barns"<< G4endl;
}
return aCrossSection;
}
//This function calculated the cross section with the Empiric model
G4double G4hShellCrossSectionExp::GetCrossSectionExp(G4int Z,
G4double incidentEnergy) const
{
// Vector that stores the calculated cross-sections for each shell:
G4double crossSectionsInBarn = 0.0;
G4double crossSections = 0.0;
std::vector<G4double>* parVec = kShellData->GetParam(Z);
std::vector<G4double>::iterator i = (*parVec).begin();
G4double a = *i;
G4double b = *(i+1);
G4double c = *(i+2);
G4double incidentEnergyInMeV = incidentEnergy/MeV;
if(Z<26 && Z>=6 && Z!=17)
{
crossSectionsInBarn = a*(pow(b,(1./incidentEnergyInMeV)))*(pow(incidentEnergyInMeV,c));
}
else if(Z<66 && Z>=26 || Z==17)
{
crossSectionsInBarn = exp(a+(b/incidentEnergyInMeV)+(c*log(incidentEnergyInMeV)));
}
else if(Z<=92 && Z>=66)
{
crossSectionsInBarn = (pow(incidentEnergyInMeV,a))*exp(b-(c*incidentEnergyInMeV));
}
else
{
G4cout << "Error: there is not that Z" << G4endl;
}
crossSections = crossSectionsInBarn*barn;
return crossSections;
}
// This function gives the atomic cross section of k shell only
void G4hShellCrossSectionExp::SetTotalCS(G4double value)
{
atomTotalCrossSection = value;
}
//A new implementation of Probability to calculate the cross section probability for k shell only
std::vector<G4double> G4hShellCrossSectionExp::Probabilities(
G4int Z,
G4double incidentEnergy,
G4double hMass,
G4double deltaEnergy
) const
{
hMass = 0.0;
deltaEnergy = 0.0;
std::vector<G4double> kProbability;
kProbability.push_back(GetCrossSectionExp(Z,incidentEnergy)/atomTotalCrossSection);
kProbability.push_back(1 - kProbability[1]);
return kProbability;
}
@@ -0,0 +1,251 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
//
// Author: Simona Saliceti (simona.saliceti@ge.infn.it)
//
// History:
// -----------
// 22 Apr 2004 First committed to cvs
//
// -------------------------------------------------------------------
// $Id: G4hShellCrossSectionExpData.cc,v 1.1 2004/04/27 09:45:49 saliceti Exp $
// GEANT4 tag $Name: geant4-06-02 $
#include "G4hShellCrossSectionExpData.hh"
#include <fstream>
#include <strstream>
G4hShellCrossSectionExpData::G4hShellCrossSectionExpData()
{
FillVectorValues();
FillParameterMap();
}
G4hShellCrossSectionExpData::~G4hShellCrossSectionExpData()
{
std::map< G4int,std::vector<G4double>*,std::less<G4int> >::iterator pos;
for (pos = parameterMap.begin(); pos != parameterMap.end(); ++pos)
{
std::vector<G4double>* dataSet = (*pos).second;
delete dataSet;
}
}
inline void G4hShellCrossSectionExpData::InitializeVector(std::vector<G4double> &vect, G4double value1, G4double value2, G4double value3) const
{
vect.push_back(value1);
vect.push_back(value2);
vect.push_back(value3);
}
void G4hShellCrossSectionExpData::FillVectorValues()
{
InitializeVector(parameter6C, 25965819., 0.1974268719, -0.9746342);
InitializeVector(parameter7N, 14254204., 0.09584816998, -0.8908825);
InitializeVector(parameter8O, 14257000., 0.9582500E-01, -0.8909900);
InitializeVector(parameter9F, 5628098., 0.2221402E-01, -0.7857742);
InitializeVector(parameter10Ne, 3866500., 0.9298651E-02, -0.7569925);
InitializeVector(parameter11Na, 2816614., 0.3161790E-02, -0.7429561);
InitializeVector(parameter12Mg, 2113709., 0.9267687E-03, -0.7342144);
InitializeVector(parameter13Al, 1647127., 0.2344573E-03, -0.7305032);
InitializeVector(parameter14Si, 1267490., 0.5787061E-04, -0.7184879);
InitializeVector(parameter15P, 1035792., 0.1101495E-04, -0.7199858);
InitializeVector(parameter16S, 825871.6, 0.2326387E-05, -0.7095044);
InitializeVector(parameter17Cl, 13.41653, -14.66877, -0.7017217);
InitializeVector(parameter18Ar, 555038.1, 0.6543986E-07, -0.6968985);
InitializeVector(parameter19K, 469063.8, 0.8876799E-08, -0.6940991);
InitializeVector(parameter20Ca, 405918.4, 0.9881247E-09, -0.6953619);
InitializeVector(parameter21Sc, 351611.0, 0.1054022E-09, -0.6950487);
InitializeVector(parameter22Ti, 313223.2, 0.8541349E-11, -0.6984913);
InitializeVector(parameter23V, 257752.3, 0.1092866E-11, -0.6841001);
InitializeVector(parameter24Cr, 230064.8, 0.7874358E-13, -0.6862135);
InitializeVector(parameter25Mn, 151740.8, 0.7988999E-13, -0.6279536);
InitializeVector(parameter26Fe, 12.21083, -35.54018, -0.7140945);
InitializeVector(parameter27Co, 12.14600, -38.73178, -0.7229655);
InitializeVector(parameter28Ni, 12.10570, -42.25900, -0.7354265);
InitializeVector(parameter29Cu, 11.87911, -44.37304, -0.7089269);
InitializeVector(parameter30Zn, 11.86411, -48.35208, -0.7252861);
InitializeVector(parameter31Ga, 11.66042, -50.73798, -0.7029260);
InitializeVector(parameter32Ge, 11.66824, -55.26208, -0.7218891);
InitializeVector(parameter33As, 11.47804, -57.94218, -0.7016547);
InitializeVector(parameter34Se, 11.30017, -60.70304, -0.6836499);
InitializeVector(parameter35Br, 11.32571, -65.77174, -0.7042627);
InitializeVector(parameter36Kr, 10.44025, -61.74093, -0.5383769);
InitializeVector(parameter37Rb, 10.27499, -64.44025, -0.5236434);
InitializeVector(parameter38Sr, 10.31786, -69.83844, -0.5475903);
InitializeVector(parameter39Y, 10.14157, -72.55550, -0.5302060);
InitializeVector(parameter40Zr, 10.03310, -76.52999, -0.5243382);
InitializeVector(parameter41Nb, 10.03804, -81.38335, -0.5404782);
InitializeVector(parameter42Mo, 9.872166, -84.24110, -0.5245091);
InitializeVector(parameter43Tc, 9.941685, -90.72401, -0.5503877);
InitializeVector(parameter44Ru, 9.771618, -93.50847, -0.5334178);
InitializeVector(parameter45Rh, 9.819192, -99.99145, -0.5543751);
InitializeVector(parameter46Pd, 9.680034, -103.5450, -0.5387755);
InitializeVector(parameter47Ag, 9.703977, -109.8104, -0.5550457);
InitializeVector(parameter48Cd, 9.548004, -113.0565, -0.5399088);
InitializeVector(parameter49In, 9.378392, -115.8466, -0.5226109);
InitializeVector(parameter50Sn, 9.406608, -122.6137, -0.5386317);
InitializeVector(parameter51Sb, 9.254029, -125.8533, -0.5238908);
InitializeVector(parameter52Te, 9.311451, -133.6049, -0.5440237);
InitializeVector(parameter53I, 9.158569, -136.7913, -0.5291739);
InitializeVector(parameter54Xe, 9.011420, -140.1908, -0.5150210);
InitializeVector(parameter55Cs, 9.112158, -149.6160, -0.5411919);
InitializeVector(parameter56Ba, 7.696734, -124.4350, -0.3181673);
InitializeVector(parameter57La, 7.728227, -130.9067, -0.3348193);
InitializeVector(parameter58Ce, 7.595518, -134.1356, -0.3233585);
InitializeVector(parameter59Pr, 7.451400, -136.9318, -0.3102762);
InitializeVector(parameter60Nd, 7.493138, -144.0968, -0.3273972);
InitializeVector(parameter61Pm, 7.358854, -147.1354, -0.3155824);
InitializeVector(parameter62Sm, 7.231769, -150.3722, -0.3048225);
InitializeVector(parameter63Eu, 7.060385, -152.3517, -0.2873322);
InitializeVector(parameter64Gd, 7.179881, -161.9544, -0.3162093);
InitializeVector(parameter65Tb, 7.048202, -164.9670, -0.3046019);
InitializeVector(parameter66Dy, 1.962871, -4.620275, 0.5748519E-02);
InitializeVector(parameter67Ho, 1.992797, -4.863559, 0.5772170E-02);
InitializeVector(parameter68Er, 2.013621, -5.068997, 0.5749294E-02);
InitializeVector(parameter69Tm, 2.026489, -5.243042, 0.5671808E-02);
InitializeVector(parameter70Yb, 1.946252, -5.047087, 0.5011610E-02);
InitializeVector(parameter71Lu, 1.968246, -5.253083, 0.5007004E-02);
InitializeVector(parameter72Hf, 1.980888, -5.421401, 0.4949681E-02);
InitializeVector(parameter73Ta, 1.925043, -5.310529, 0.4504530E-02);
InitializeVector(parameter74W, 1.939689, -5.484359, 0.4464923E-02);
InitializeVector(parameter75Re, 1.951746, -5.645718, 0.4415765E-02);
InitializeVector(parameter76Os, 2.249802, -6.974045, 0.5965646E-02);
InitializeVector(parameter77Ir, 2.257475, -7.121614, 0.5873831E-02);
InitializeVector(parameter78Pt, 2.262231, -7.255240, 0.5769194E-02);
InitializeVector(parameter79Au, 2.188981, -7.080360, 0.5161316E-02);
InitializeVector(parameter80Hg, 2.199681, -7.233214, 0.5111361E-02);
InitializeVector(parameter81Tl, 2.211119, -7.389515, 0.5064001E-02);
InitializeVector(parameter82Pb, 2.204573, -7.468263, 0.4934075E-02);
InitializeVector(parameter83Bi, 2.148083, -7.348053, 0.4494417E-02);
InitializeVector(parameter84Po, 2.154512, -7.479838, 0.4433237E-02);
InitializeVector(parameter85At, 2.164621, -7.626572, 0.4388465E-02);
InitializeVector(parameter86Rn, 2.288465, -8.212229, 0.5807703E-02);
InitializeVector(parameter87Fr, 2.294291, -8.336506, 0.5753172E-02);
InitializeVector(parameter88Ra, 2.318430, -8.525764, 0.5849121E-02);
InitializeVector(parameter89Ac, 2.306637, -8.578354, 0.5672658E-02);
InitializeVector(parameter90Th, 2.254484, -8.479531, 0.5163647E-02);
InitializeVector(parameter91Pa, 2.246310, -8.540535, 0.5044748E-02);
InitializeVector(parameter92U, 2.276106, -8.748476, 0.5186345E-02);
}
void G4hShellCrossSectionExpData::FillParameterMap()
{
parameterMap [6] = &parameter6C ;
parameterMap [7] = &parameter7N ;
parameterMap [8] = &parameter8O ;
parameterMap [9] = &parameter9F ;
parameterMap [10] = &parameter10Ne;
parameterMap [11] = &parameter11Na;
parameterMap [12] = &parameter12Mg;
parameterMap [13] = &parameter13Al;
parameterMap [14] = &parameter14Si;
parameterMap [15] = &parameter15P ;
parameterMap [16] = &parameter16S ;
parameterMap [17] = &parameter17Cl;
parameterMap [18] = &parameter18Ar;
parameterMap [19] = &parameter19K ;
parameterMap [20] = &parameter20Ca;
parameterMap [21] = &parameter21Sc;
parameterMap [22] = &parameter22Ti;
parameterMap [23] = &parameter23V ;
parameterMap [24] = &parameter24Cr;
parameterMap [25] = &parameter25Mn;
parameterMap [26] = &parameter26Fe;
parameterMap [27] = &parameter27Co;
parameterMap [28] = &parameter28Ni;
parameterMap [29] = &parameter29Cu;
parameterMap [30] = &parameter30Zn;
parameterMap [31] = &parameter31Ga;
parameterMap [32] = &parameter32Ge;
parameterMap [33] = &parameter33As;
parameterMap [34] = &parameter34Se;
parameterMap [35] = &parameter35Br;
parameterMap [36] = &parameter36Kr;
parameterMap [37] = &parameter37Rb;
parameterMap [38] = &parameter38Sr;
parameterMap [39] = &parameter39Y ;
parameterMap [40] = &parameter40Zr;
parameterMap [41] = &parameter41Nb;
parameterMap [42] = &parameter42Mo;
parameterMap [43] = &parameter43Tc;
parameterMap [44] = &parameter44Ru;
parameterMap [45] = &parameter45Rh;
parameterMap [46] = &parameter46Pd;
parameterMap [47] = &parameter47Ag;
parameterMap [48] = &parameter48Cd;
parameterMap [49] = &parameter49In;
parameterMap [50] = &parameter50Sn;
parameterMap [51] = &parameter51Sb;
parameterMap [52] = &parameter52Te;
parameterMap [53] = &parameter53I ;
parameterMap [54] = &parameter54Xe;
parameterMap [55] = &parameter55Cs;
parameterMap [56] = &parameter56Ba;
parameterMap [57] = &parameter57La;
parameterMap [58] = &parameter58Ce;
parameterMap [59] = &parameter59Pr;
parameterMap [60] = &parameter60Nd;
parameterMap [61] = &parameter61Pm;
parameterMap [62] = &parameter62Sm;
parameterMap [63] = &parameter63Eu;
parameterMap [64] = &parameter64Gd;
parameterMap [65] = &parameter65Tb;
parameterMap [66] = &parameter66Dy;
parameterMap [67] = &parameter67Ho;
parameterMap [68] = &parameter68Er;
parameterMap [69] = &parameter69Tm;
parameterMap [70] = &parameter70Yb;
parameterMap [71] = &parameter71Lu;
parameterMap [72] = &parameter72Hf;
parameterMap [73] = &parameter73Ta;
parameterMap [74] = &parameter74W ;
parameterMap [75] = &parameter75Re;
parameterMap [76] = &parameter76Os;
parameterMap [77] = &parameter77Ir;
parameterMap [78] = &parameter78Pt;
parameterMap [79] = &parameter79Au;
parameterMap [80] = &parameter80Hg;
parameterMap [81] = &parameter81Tl;
parameterMap [82] = &parameter82Pb;
parameterMap [83] = &parameter83Bi;
parameterMap [84] = &parameter84Po;
parameterMap [85] = &parameter85At;
parameterMap [86] = &parameter86Rn;
parameterMap [87] = &parameter87Fr;
parameterMap [88] = &parameter88Ra;
parameterMap [89] = &parameter89Ac;
parameterMap [90] = &parameter90Th;
parameterMap [91] = &parameter91Pa;
parameterMap [92] = &parameter92U ;
}
std::vector<G4double>* G4hShellCrossSectionExpData::GetParam(G4int Z)
{
return parameterMap[Z];
}
+10 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.66 2004/03/02 17:45:03 vnivanch Exp $
$Id: History,v 1.68 2004/05/27 16:43:08 vnivanch Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,15 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
27 May 04: V.Ivant (muons-V06-01-01)
- Set default regime of MuIonisation integral
- Minor fix in differential cross section for MuPairProduction
28 April 04: V.Ivant (muons-V06-01-00)
- MuPairProduction: fix minor energy non-conservation, fix
problem of calculation of maximumum energy transfer for
compounds
02 March 04: V.Ivant (muons-V06-00-02)
- Minor fix in initialisation of MuPairProductionModel
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuBremsstrahlung.hh,v 1.19 2004/02/10 18:07:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4MuBremsstrahlung.hh,v 1.21 2004/05/07 16:47:15 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuIonisation.hh,v 1.19 2004/02/10 18:07:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4MuIonisation.hh,v 1.21 2004/05/07 16:47:15 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuPairProduction.hh,v 1.18 2004/02/10 18:07:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4MuPairProduction.hh,v 1.21 2004/05/07 16:47:16 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -47,6 +47,7 @@
// 08-08-03 STD substitute standard (V.Ivanchenko)
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
// 21-01-04 Migrade to G4ParticleChangeForLoss (V.Ivanchenko)
// 28-04-04 Fix minor bug in energy balance (V.Ivanchenko)
//
// Class Description:
//
@@ -181,6 +182,7 @@ inline void G4MuPairProduction::SecondariesPostStep(
elpos = (*newp)[1];
fParticleChange.AddSecondary(elpos);
kinEnergy -= elpos->GetKineticEnergy();
kinEnergy -= 2.0*electron_mass_c2;
delete newp;
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuPairProductionModel.hh,v 1.11 2004/02/10 18:07:23 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4MuPairProductionModel.hh,v 1.12 2004/04/28 14:39:43 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -120,7 +120,7 @@ protected:
//private:
public:
G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut);
G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut, G4double tmax);
G4double ComputeMicroscopicCrossSection(G4double tkin,
G4double Z,
@@ -131,7 +131,7 @@ public:
G4double pairEnergy);
private:
const G4Element* SelectRandomAtom(G4double dt, G4int it, G4int iy,
const G4Element* SelectRandomAtom(G4double kinEnergy, G4double dt, G4int it,
const G4MaterialCutsCouple* couple);
void MakeSamplingTables();
@@ -215,12 +215,14 @@ void G4MuPairProductionModel::SetCurrentElement(G4double Z)
inline
G4double G4MuPairProductionModel::InterpolatedIntegralCrossSection(G4double dt, G4double dz,
G4int iz, G4int it, G4int iy, G4double z)
G4int iz, G4int it, G4int iy, G4double z)
{
G4double fac = 1./(zdat[iz] *(zdat[iz] +1.));
G4double fac1 = 1./(zdat[iz-1]*(zdat[iz-1]+1.));
G4double f0 = fac1*proba[iz-1][it-1][iy] + (fac*proba[iz][it-1][iy]-fac1*proba[iz-1][it-1][iy])*dz;
G4double f1 = fac1*proba[iz-1][it ][iy] + (fac*proba[iz][it ][iy]-fac1*proba[iz-1][it ][iy])*dz;
G4double f0 = fac1*proba[iz-1][it-1][iy] +
(fac*proba[iz][it-1][iy]-fac1*proba[iz-1][it-1][iy])*dz;
G4double f1 = fac1*proba[iz-1][it ][iy] +
(fac*proba[iz][it ][iy]-fac1*proba[iz-1][it ][iy])*dz;
return (f0 + (f1-f0)*dt)*z*(z+1.);
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuIonisation.cc,v 1.40 2004/02/15 17:46:55 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4MuIonisation.cc,v 1.42 2004/05/27 17:29:35 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -60,6 +60,7 @@
// 08-08-03 STD substitute standard (V.Ivanchenko)
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
// 10-02-04 Calculation of radiative corrections using R.Kokoulin model (V.Ivanchenko)
// 27-05-04 Set integral to be a default regime (V.Ivanchenko)
//
// -------------------------------------------------------------------
//
@@ -90,7 +91,6 @@ G4MuIonisation::G4MuIonisation(const G4String& name)
SetLambdaBinning(120);
SetMinKinEnergy(0.1*keV);
SetMaxKinEnergy(100.0*TeV);
SetIntegral(false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -106,12 +106,7 @@ void G4MuIonisation::InitialiseProcess()
mass = theParticle->GetPDGMass();
SetSecondaryParticle(G4Electron::Electron());
if(IsIntegral()) {
flucModel = new G4BohrFluctuations();
} else {
flucModel = new G4UniversalFluctuation();
}
flucModel = new G4UniversalFluctuation();
G4VEmModel* em = new G4BraggModel();
em->SetLowEnergyLimit(0.1*keV);
@@ -126,6 +121,8 @@ void G4MuIonisation::InitialiseProcess()
em2->SetHighEnergyLimit(100.0*TeV);
AddEmModel(3, em2, flucModel);
SetStepLimits(0.2, 1.0*mm);
ratio = electron_mass_c2/mass;
isInitialised = true;
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MuPairProductionModel.cc,v 1.17 2004/03/02 17:45:03 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4MuPairProductionModel.cc,v 1.19 2004/05/05 18:45:42 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -46,6 +46,8 @@
// 8 integration points in ComputeDMicroscopicCrossSection
// 12-01-04 Take min cut of e- and e+ not its sum (V.Ivanchenko)
// 10-02-04 Update parameterisation using R.Kokoulin model (V.Ivanchenko)
// 28-04-04 For complex materials repeat calculation of max energy for each
// material (V.Ivanchenko)
//
// Class Description:
@@ -141,7 +143,7 @@ G4bool G4MuPairProductionModel::IsInCharge(const G4ParticleDefinition* p)
void G4MuPairProductionModel::Initialise(const G4ParticleDefinition*,
const G4DataVector&)
{
{
if (!samplingTablesAreFilled) MakeSamplingTables();
}
@@ -153,10 +155,7 @@ G4double G4MuPairProductionModel::ComputeDEDX(const G4MaterialCutsCouple* couple
G4double cutEnergy)
{
G4double dedx = 0.0;
if (minPairEnergy >= cutEnergy || kineticEnergy <= lowestKinEnergy) return dedx;
G4double tmax = MaxSecondaryEnergy(particle, kineticEnergy);
G4double cut = std::min(cutEnergy,tmax);
if (cutEnergy <= minPairEnergy || kineticEnergy <= lowestKinEnergy) return dedx;
const G4Material* material = couple->GetMaterial();
const G4ElementVector* theElementVector = material->GetElementVector();
@@ -166,7 +165,10 @@ G4double G4MuPairProductionModel::ComputeDEDX(const G4MaterialCutsCouple* couple
// loop for elements in the material
for (size_t i=0; i<material->GetNumberOfElements(); i++) {
G4double Z = (*theElementVector)[i]->GetZ();
G4double loss = ComputMuPairLoss(Z, kineticEnergy, cut);
SetCurrentElement(Z);
G4double tmax = MaxSecondaryEnergy(particle, kineticEnergy);
G4double cut = std::min(cutEnergy,tmax);
G4double loss = ComputMuPairLoss(Z, kineticEnergy, cut, tmax);
dedx += loss*theAtomicNumDensityVector[i];
}
if (dedx < 0.) dedx = 0.;
@@ -176,15 +178,14 @@ G4double G4MuPairProductionModel::ComputeDEDX(const G4MaterialCutsCouple* couple
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4MuPairProductionModel::ComputMuPairLoss(G4double Z,
G4double tkin, G4double cutEnergy)
G4double tkin, G4double cutEnergy,
G4double tmax)
{
SetCurrentElement(Z);
G4double loss = 0.0;
G4double tmax = MaxSecondaryEnergy(particle, tkin);
G4double cut = cutEnergy;
if(tmax <= cutEnergy) cut = tmax;
if(cut <= minPairEnergy) return loss;
if(tmax <= cutEnergy || cut <= minPairEnergy) return loss;
// calculate the rectricted loss
// numerical integration in log(PairEnergy)
@@ -283,7 +284,7 @@ G4double G4MuPairProductionModel::ComputeDMicroscopicCrossSection(
G4double a3 = 1. - alf;
if (a3 <= 0.) return cross;
// zeta calculation
// zeta calculation
G4double bbb,g1,g2;
if( Z < 1.5 ) { bbb = bbbh ; g1 = g1h ; g2 = g2h ; }
else { bbb = bbbtf; g1 = g1tf; g2 = g2tf; }
@@ -367,10 +368,9 @@ G4double G4MuPairProductionModel::CrossSection(const G4MaterialCutsCouple* coupl
G4double maxEnergy)
{
G4double cross = 0.0;
G4double tmax = std::min(maxEnergy, MaxSecondaryEnergy(particle, kineticEnergy));
G4double cut = std::max(cutEnergy, minPairEnergy);
if (kineticEnergy <= lowestKinEnergy) return cross;
if (cut >= tmax || kineticEnergy <= lowestKinEnergy) return cross;
maxEnergy += particleMass;
const G4Material* material = couple->GetMaterial();
const G4ElementVector* theElementVector = material->GetElementVector();
@@ -378,10 +378,15 @@ G4double G4MuPairProductionModel::CrossSection(const G4MaterialCutsCouple* coupl
for (size_t i=0; i<material->GetNumberOfElements(); i++) {
G4double Z = (*theElementVector)[i]->GetZ();
G4double cr = ComputeMicroscopicCrossSection(kineticEnergy, Z, cut)
- ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax);
SetCurrentElement(Z);
G4double tmax = std::min(maxEnergy,MaxSecondaryEnergy(particle, kineticEnergy));
G4double cut = std::max(minPairEnergy,cutEnergy);
if(cut < tmax) {
G4double cr = ComputeMicroscopicCrossSection(kineticEnergy, Z, cut)
- ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax);
cross += theAtomNumDensityVector[i] * cr;
cross += theAtomNumDensityVector[i] * cr;
}
}
return cross;
}
@@ -461,26 +466,26 @@ std::vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
if(it == ntdat) it--;
G4double dt = log(kineticEnergy/tdat[it-1])/log(tdat[it]/tdat[it-1]);
// select randomly one element constituing the material
G4int iymin = 0;
G4int iymax = nbiny-1;
const G4Element* anElement = SelectRandomAtom(kineticEnergy, dt, it, couple);
SetCurrentElement(anElement->GetZ());
G4double maxPairEnergy = MaxSecondaryEnergy(particle,kineticEnergy);
G4double maxEnergy = std::min(tmax, maxPairEnergy);
G4double minEnergy = std::min(maxEnergy, cut);
G4int iymin = 0;
G4int iymax = nbiny;
if( minEnergy > minPairEnergy)
{
G4double xc = log(minEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy);
iymin = (G4int)((log(xc) - ymin)/dy);
if(iymin >= nbiny) iymin = nbiny-1;
xc = log(maxEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy);
iymax = (G4int)((log(xc) - ymin)/dy) + 1;
if(iymax > nbiny) iymax = nbiny;
if(iymax >= nbiny) iymax = nbiny-1;
}
// select randomly one element constituing the material
const G4Element* anElement = SelectRandomAtom(dt, it, iymin, couple);
SetCurrentElement(anElement->GetZ());
// sample e-e+ energy, pair energy first
G4int iz, iy;
@@ -509,14 +514,14 @@ std::vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
if(PairEnergy > maxEnergy) PairEnergy = maxEnergy;
// sample r=(E+-E-)/PairEnergy ( uniformly .....)
G4double rmax = (1.-6.*particleMass*particleMass/(totalEnergy*
(totalEnergy-PairEnergy)))
G4double rmax =
(1.-6.*particleMass*particleMass/(totalEnergy*(totalEnergy-PairEnergy)))
*sqrt(1.-minPairEnergy/PairEnergy);
G4double r = rmax * (-1.+2.*G4UniformRand()) ;
// compute energies from PairEnergy,r
G4double ElectronEnergy=(1.-r)*PairEnergy/2. ;
G4double PositronEnergy=(1.+r)*PairEnergy/2. ;
G4double ElectronEnergy = (1.-r)*PairEnergy*0.5;
G4double PositronEnergy = PairEnergy - ElectronEnergy;
// angles of the emitted particles ( Z - axis along the parent particle)
// (mean theta for the moment)
@@ -558,7 +563,8 @@ std::vector<G4DynamicParticle*>* G4MuPairProductionModel::SampleSecondaries(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const G4Element* G4MuPairProductionModel::SelectRandomAtom(G4double dt, G4int it, G4int iy,
const G4Element* G4MuPairProductionModel::SelectRandomAtom(
G4double kinEnergy, G4double dt, G4int it,
const G4MaterialCutsCouple* couple)
{
// select randomly 1 element within the material
@@ -580,11 +586,18 @@ const G4Element* G4MuPairProductionModel::SelectRandomAtom(G4double dt, G4int it
size_t i;
for (i=0; i<nElements; i++) {
G4double Z = ((*theElementVector)[i])->GetZ();
SetCurrentElement(Z);
G4double maxPairEnergy = MaxSecondaryEnergy(particle,kinEnergy);
G4int iz;
for(iz=1; iz<nzdat; iz++) {if(Z <= zdat[iz]) break;}
if(iz == nzdat) iz--;
G4double dz = log(Z/zdat[iz-1])/log(zdat[iz]/zdat[iz-1]);
G4double xc = log(kinEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy);
G4int iy = (G4int)((log(xc) - ymin)/dy);
if(iy >= nbiny) iy = nbiny-1;
G4double sigtot = InterpolatedIntegralCrossSection(dt, dz, iz, it, nbiny, Z);
G4double sigcut = InterpolatedIntegralCrossSection(dt, dz, iz, it, iy, Z);
sum += (sigtot - sigcut)*theAtomNumDensityVector[i];
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.6 2003/10/03 15:39:18 gcosmo Exp $
# $Id: GNUmakefile,v 1.7 2004/04/02 09:03:51 grichine Exp $
# --------------------------------------------------------------------
# GNUmakefile for electromagnetic sub-library. John Allison, 25/6/98.
# --------------------------------------------------------------------
@@ -14,6 +14,7 @@ include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/HEPGeometry/include \
-I$(G4BASE)/global/HEPNumerics/include \
-I$(G4BASE)/geometry/management/include \
-I$(G4BASE)/geometry/volumes/include \
-I$(G4BASE)/geometry/navigation/include \
@@ -1,4 +1,4 @@
$Id: History,v 1.112 2004/03/15 12:18:42 maire Exp $
$Id: History,v 1.117 2004/06/07 13:51:57 gcosmo Exp $
-------------------------------------------------------------------
=========================================================
@@ -16,6 +16,25 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
07 Jun 04: G.Cosmo (stand-V06-01-03)
- G4PAIxSection.cc: fix in constructor for compilation error in VC++ 6.0
- Moved usage of statics in inline functions to non-inline to allow
porting for DLLs on Windows. Modified files:
G4PAIonisation[.icc.cc], G4SynchrotronRadiation[.hh.cc].
27 May 04: V.Ivant (stand-V06-01-02)
- Set integral regime to be default for G4ionIonisation and G4hIonisation
- Exclude G4PAIwithPhotons and G4InitXscPAI classes previously included
by mistake but still under development ...
27 May 04: V.Ivant (stand-V06-01-01)
- (V.Grichine) Updated and optimise PAI model
- (L.Urban) Minor fix in G4eBremsstrahlung - units properly used
04 May 04: V.Ivant (stand-V06-01-00)
- (V.Grichine) Updated PAI model - use precise integrator,
add photon emission, add G4PAIwithPhotons and G4PAIxSection classes
15 Mar 04: mma (stand-V06-00-04)
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4AnnihiToMuPair.hh,v 1.3 2004/03/10 16:48:44 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4AnnihiToMuPair.hh,v 1.5 2004/05/07 16:52:42 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// ------------ G4AnnihiToMuPair physics process ------
// by H.Burkhardt, S. Kelner and R. Kokoulin, November 2002
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4GammaConversionToMuons.hh,v 1.4 2004/03/10 16:48:45 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4GammaConversionToMuons.hh,v 1.6 2004/05/11 18:22:20 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// ------------ G4GammaConversionToMuons physics process ------
// by H.Burkhardt, S. Kelner and R. Kokoulin, April 2002
@@ -0,0 +1,263 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4PAIPhotonModel
//
// Author: V. Grichine based on Vladimir Ivanchenko code
//
// Creation date: 05.10.2003
//
// Modifications:
//
//
// Class Description:
//
// Implementation of PAI model of energy loss and
// delta-electron production by heavy charged particles
// -------------------------------------------------------------------
//
#ifndef G4PAIPhotonModel_h
#define G4PAIPhotonModel_h 1
#include <vector>
#include "G4VEmModel.hh"
#include "globals.hh"
#include "G4VEmFluctuationModel.hh"
class G4PhysicsLogVector;
class G4PhysicsTable;
class G4Region;
class G4MaterialCutsCouple;
class G4PAIPhotonModel : public G4VEmModel, public G4VEmFluctuationModel
{
public:
G4PAIPhotonModel(const G4ParticleDefinition* p = 0, const G4String& nam = "PAI");
~G4PAIPhotonModel();
void Initialise(const G4ParticleDefinition*, const G4DataVector&);
void InitialiseMe(const G4ParticleDefinition*) {};
G4double HighEnergyLimit(const G4ParticleDefinition* p);
G4double LowEnergyLimit(const G4ParticleDefinition* p);
void SetHighEnergyLimit(G4double e) {fHighKinEnergy = e;};
void SetLowEnergyLimit(G4double e) {fLowKinEnergy = e;};
G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
G4bool IsInCharge(const G4ParticleDefinition*);
G4double ComputeDEDX(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy);
G4double CrossSection(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxEnergy);
G4DynamicParticle* SampleSecondary(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
std::vector<G4DynamicParticle*>* SampleSecondaries(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double maxEnergy);
G4double MaxSecondaryEnergy(const G4DynamicParticle*);
G4double SampleFluctuations(const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&,
G4double&);
G4double Dispersion( const G4Material*,
const G4DynamicParticle*,
G4double&,
G4double&);
void DefineForRegion(const G4Region* r) ;
void ComputeSandiaPhotoAbsCof();
void BuildPAIonisationTable();
void BuildLambdaVector(const G4MaterialCutsCouple* matCutsCouple);
G4double GetdNdxCut( G4int iPlace, G4double transferCut);
G4double GetdNdxPhotonCut( G4int iPlace, G4double transferCut);
G4double GetdNdxPlasmonCut( G4int iPlace, G4double transferCut);
G4double GetdEdxCut( G4int iPlace, G4double transferCut);
G4double GetPostStepTransfer(G4PhysicsTable*, G4PhysicsLogVector*,
G4int iPlace, G4double scaledTkin );
G4double GetAlongStepTransfer(G4PhysicsTable*, G4PhysicsLogVector*,
G4int iPlace, G4double scaledTkin, G4double cof );
G4double GetEnergyTransfer(G4PhysicsTable*, G4int iPlace,
G4double position, G4int iTransfer );
protected:
G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kinEnergy);
private:
void SetParticle(const G4ParticleDefinition* p);
// hide assignment operator
G4PAIPhotonModel & operator=(const G4PAIPhotonModel &right);
G4PAIPhotonModel(const G4PAIPhotonModel&);
// The vector over proton kinetic energies: the range of gammas
G4double fLowestKineticEnergy;
G4double fHighestKineticEnergy;
G4int fTotBin;
G4int fMeanNumber;
G4PhysicsLogVector* fProtonEnergyVector ;
// vectors
G4PhysicsTable* fPAItransferTable;
std::vector<G4PhysicsTable*> fPAIxscBank;
G4PhysicsTable* fPAIphotonTable;
std::vector<G4PhysicsTable*> fPAIphotonBank;
G4PhysicsTable* fPAIplasmonTable;
std::vector<G4PhysicsTable*> fPAIplasmonBank;
G4PhysicsTable* fPAIdEdxTable;
std::vector<G4PhysicsTable*> fPAIdEdxBank;
std::vector<const G4MaterialCutsCouple*> fMaterialCutsCoupleVector;
std::vector<const G4Region*> fPAIRegionVector;
size_t fMatIndex ;
G4double** fSandiaPhotoAbsCof ;
G4int fSandiaIntervalNumber ;
G4PhysicsLogVector* fdEdxVector ;
std::vector<G4PhysicsLogVector*> fdEdxTable ;
G4PhysicsLogVector* fLambdaVector ;
std::vector<G4PhysicsLogVector*> fLambdaTable ;
G4PhysicsLogVector* fdNdxCutVector ;
std::vector<G4PhysicsLogVector*> fdNdxCutTable ;
G4PhysicsLogVector* fdNdxCutPhotonVector ;
std::vector<G4PhysicsLogVector*> fdNdxCutPhotonTable ;
G4PhysicsLogVector* fdNdxCutPlasmonVector ;
std::vector<G4PhysicsLogVector*> fdNdxCutPlasmonTable ;
const G4ParticleDefinition* fParticle;
G4double fMass;
G4double fSpin;
G4double fChargeSquare;
G4double fRatio;
G4double fHighKinEnergy;
G4double fLowKinEnergy;
G4double fTwoln10;
G4double fBg2lim;
G4double fTaulim;
G4double fQc;
};
/////////////////////////////////////////////////////////////////////
inline G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition*,
G4double kinEnergy)
{
G4double gamma= kinEnergy/fMass + 1.0;
G4double tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
(1. + 2.0*gamma*fRatio + fRatio*fRatio);
return tmax;
}
/////////////////////////////////////////////////////////////////////////
inline G4double G4PAIPhotonModel::MaxSecondaryEnergy(const G4DynamicParticle* dp)
{
G4double kineticEnergy = dp->GetKineticEnergy();
G4double gamma= kineticEnergy/fMass + 1.0;
G4double tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
(1. + 2.0*gamma*fRatio + fRatio*fRatio);
return tmax;
}
///////////////////////////////////////////////////////////////
inline void G4PAIPhotonModel::DefineForRegion(const G4Region* r)
{
// G4Region* rPAI = r;
// fPAIRegionVector.push_back(rPAI);
fPAIRegionVector.push_back(r);
}
#endif
@@ -83,166 +83,6 @@ G4PAIonisation::GetContinuousStepLimit( const G4Track& track ,
return Step ;
}
/////////////////////////////////////////////////////////////////////////
//
//
inline G4double G4PAIonisation::
GetMeanFreePath( const G4Track& trackData,
G4double,
G4ForceCondition* condition )
{
// G4cout<<"G4PAIonisation::GetMeanFreePath is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double charge, charge2, mass, massRatio, kinE, gamma, scaledE, meanFreePath ;
G4double E1, E2, W, W1, W2, primaryIon ;
*condition = NotForced ;
G4Material* aMaterial = trackData.GetMaterial() ;
if( aMaterial->GetIndex() != fMatIndex ) meanFreePath = DBL_MAX ;
else
{
const G4DynamicParticle* aParticle = trackData.GetDynamicParticle() ;
kinE = aParticle->GetKineticEnergy() ;
mass = aParticle->GetDefinition()->GetPDGMass() ;
gamma = 1.0 + kinE/mass ;
if(gamma < 1.2) return meanFreePath = DBL_MAX ;
charge = aParticle->GetDefinition()->GetPDGCharge() ;
charge2 = charge*charge ;
massRatio = proton_mass_c2/mass ;
scaledE = kinE*massRatio ;
for(iTkin=0;iTkin<G4PAIonisation::GetBinNumber();iTkin++)
{
// if(scaledE < GetProtonEnergyVector()->GetLowEdgeEnergy(iTkin)) // <= ?
if(scaledE < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) // <= ?
{
break ;
}
}
iPlace = iTkin - 1 ;
if(iTkin == G4PAIonisation::GetBinNumber()) // Fermi plato, try from left
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace))(0)/charge2 ;
}
else
{
if(iTkin == 0) // Tkin is too small, trying from right only
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace+1))(0)/charge2 ;
}
else
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledE)*W ;
W2 = (scaledE - E1)*W ;
primaryIon = (*(*fPAItransferBank)(iPlace ))(0)*W1 +
(*(*fPAItransferBank)(iPlace+1))(0)*W2 ;
meanFreePath = 1.0/primaryIon/charge2 ;
}
}
// meanFreePath = DBL_MAX ;
}
return meanFreePath ;
}
/////////////////////////////////////////////////////////////////////////
//
//
inline G4double G4PAIonisation::
GetFreePath( G4double scaledTkin, G4double charge2 )
{
// G4cout<<"G4PAIonisation::GetFreePath is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double meanFreePath ;
G4double E1, E2, W, W1, W2, primaryIon ;
for( iTkin = 0 ; iTkin < G4PAIonisation::GetBinNumber() ; iTkin++ )
{
if(scaledTkin < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1 ;
if(iTkin == G4PAIonisation::GetBinNumber()) // Fermi plato, try from left
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace))(0)/charge2 ;
}
else
{
if(iTkin == 0) // Tkin is too small, trying from right only
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace+1))(0)/charge2 ;
}
else
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledTkin)*W ;
W2 = (scaledTkin - E1)*W ;
primaryIon = (*(*fPAItransferBank)(iPlace ))(0)*W1 +
(*(*fPAItransferBank)(iPlace+1))(0)*W2 ;
meanFreePath = 1.0/primaryIon/charge2 ;
}
}
// meanFreePath = DBL_MAX ;
return meanFreePath ;
}
/////////////////////////////////////////////////////////////////////////
//
//
inline G4double G4PAIonisation::
GetdEdx( G4double scaledTkin, G4double charge2 )
{
// G4cout<<"G4PAIonisation::GetdEdx is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double dEdx ;
G4double E1, E2, W, W1, W2 ;
for( iTkin = 0 ; iTkin < G4PAIonisation::GetBinNumber() ; iTkin++ )
{
if(scaledTkin < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1 ;
if(iTkin == G4PAIonisation::GetBinNumber()) // Fermi plato, try from left
{
dEdx = (*(*theLossTable)(iPlace))(0)*charge2 ;
}
else
{
if(iTkin == 0) // Tkin is too small, trying from right only
{
dEdx = (*(*theLossTable)(iPlace+1))(0)*charge2 ;
}
else
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledTkin)*W ;
W2 = (scaledTkin - E1)*W ;
dEdx = (*(*theLossTable)(iPlace))(0)*W1 + (*(*theLossTable)(iPlace+1))(0)*W2;
dEdx *= charge2 ;
}
}
return dEdx ;
}
//////////////////////////////////////////////////////////////////////
//
//
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PAIxSection.hh,v 1.10 2003/10/19 15:21:22 grichine Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4PAIxSection.hh,v 1.11 2004/04/02 10:51:12 grichine Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// G4PAIxSection.hh -- header file
@@ -59,20 +59,25 @@
#include"G4SandiaTable.hh"
class G4MaterialCutsCouple;
class G4Sandiatable;
class G4PAIxSection
{
public:
// Constructors
G4PAIxSection( G4MaterialCutsCouple* matCC);
G4PAIxSection( G4int materialIndex,
G4PAIxSection( G4int materialIndex,
G4double maxEnergyTransfer ) ;
G4PAIxSection( G4int materialIndex, // for proton loss table
G4PAIxSection( G4int materialIndex, // for proton loss table
G4double maxEnergyTransfer,
G4double betaGammaSq ,
G4double** photoAbsCof, G4int intNumber ) ;
G4PAIxSection( G4int materialIndex, // test constructor
G4PAIxSection( G4int materialIndex, // test constructor
G4double maxEnergyTransfer,
G4double betaGammaSq ) ;
@@ -188,6 +193,7 @@ const G4int fRefGammaNumber ; // The number of gamma for creation of spline (15
G4int fIntervalNumber ; // The number of energy intervals
G4double fNormalizationCof ; // Normalization cof for PhotoAbsorptionXsection
// G4double fBetaGammaSq ; // (beta*gamma)^2
G4double fDensity ; // Current density
@@ -196,6 +202,9 @@ G4int fSplineNumber ; // Current size of spline
// Arrays of Sandia coefficients
G4OrderedTable* fMatSandiaMatrix;
G4SandiaTable* fSandia;
G4double* fEnergyInterval ;
G4double* fA1 ;
G4double* fA2 ;
@@ -204,6 +213,7 @@ G4double* fA4 ;
static
const G4int fMaxSplineSize ; // Max size of output splain arrays = 500
/* ******************
G4double* fSplineEnergy ; // energy points of splain
G4double* fRePartDielectricConst ; // Real part of dielectric const
@@ -212,6 +222,8 @@ G4double* fIntegralTerm ; // Integral term in PAI cross section
G4double* fDifPAIxSection ; // Differential PAI cross section
G4double* fIntegralPAIxSection ; // Integral PAI cross section ?
*/ ///////////////
G4double fSplineEnergy[500] ; // energy points of splain
G4double fRePartDielectricConst[500] ; // Real part of dielectric const
G4double fImPartDielectricConst[500] ; // Imaginary part of dielectric const
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SynchrotronRadiation.hh,v 1.9 2004/03/10 16:48:45 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4SynchrotronRadiation.hh,v 1.10 2004/06/07 13:49:51 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -91,9 +91,8 @@ class G4SynchrotronRadiation : public G4VDiscreteProcess
G4bool IsApplicable(const G4ParticleDefinition&);
static G4double GetLambdaConst() { return fLambdaConst ; } ;
static G4double GetEnergyConst() { return fEnergyConst ; } ;
static G4double GetLambdaConst();
static G4double GetEnergyConst();
protected:
@@ -133,85 +132,6 @@ class G4SynchrotronRadiation : public G4VDiscreteProcess
};
////////////////////////// INLINE METHODS /////////////////////////////
//
// gives the MeanFreePath in GEANT4 internal units
//
inline G4double
G4SynchrotronRadiation::GetMeanFreePath( const G4Track& trackData,
G4double,
G4ForceCondition* condition)
{
const G4DynamicParticle* aDynamicParticle;
G4Material* aMaterial;
G4double MeanFreePath;
//G4bool isOutRange ;
*condition = NotForced ;
aDynamicParticle = trackData.GetDynamicParticle();
aMaterial = trackData.GetMaterial();
G4double gamma = aDynamicParticle->GetTotalEnergy()/
(aDynamicParticle->GetMass() ) ;
G4double KineticEnergy = aDynamicParticle->GetKineticEnergy();
if (KineticEnergy < LowestKineticEnergy || gamma<1.0e3)
{
MeanFreePath = DBL_MAX ;
}
else
{
G4TransportationManager* transportMgr;
G4FieldManager* globalFieldMgr;
transportMgr = G4TransportationManager::GetTransportationManager() ;
globalFieldMgr = transportMgr->GetFieldManager() ;
G4bool FieldExists = globalFieldMgr->DoesFieldExist() ;
G4ThreeVector FieldValue;
const G4Field* pField = 0 ;
if (FieldExists)
{
pField = globalFieldMgr->GetDetectorField() ;
G4ThreeVector globPosition = trackData.GetPosition() ;
G4double globPosVec[3], FieldValueVec[3] ;
globPosVec[0] = globPosition.x() ;
globPosVec[1] = globPosition.y() ;
globPosVec[2] = globPosition.z() ;
pField->GetFieldValue( globPosVec, FieldValueVec ) ;
FieldValue = G4ThreeVector( FieldValueVec[0],
FieldValueVec[1],
FieldValueVec[2] ) ;
G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum) ;
G4double perpB = unitMcrossB.mag() ;
G4double beta = aDynamicParticle->GetTotalMomentum()/
(aDynamicParticle->GetTotalEnergy() ) ;
if(perpB > 0.0)
{
MeanFreePath = fLambdaConst*beta/perpB ;
}
else
{
MeanFreePath = DBL_MAX ;
}
}
else
{
MeanFreePath = DBL_MAX ;
}
}
return MeanFreePath;
}
inline G4bool
G4SynchrotronRadiation::IsApplicable( const G4ParticleDefinition& particle )
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4eBremsstrahlung.hh,v 1.21 2004/01/21 18:05:22 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4eBremsstrahlung.hh,v 1.23 2004/05/07 16:52:42 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4ionIonisation.hh,v 1.23 2004/01/21 18:05:22 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4ionIonisation.hh,v 1.24 2004/05/10 18:46:48 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -168,8 +168,7 @@ inline G4double G4ionIonisation::MaxSecondaryEnergy(const G4DynamicParticle* dyn
inline G4double G4ionIonisation::GetMeanFreePath(const G4Track& track,
G4double step,
G4ForceCondition* cond)
G4double, G4ForceCondition*)
{
G4double mRatio = proton_mass_c2/track.GetDynamicParticle()->GetMass();
G4double q_2 = EffectiveChargeSquare(track);
@@ -178,7 +177,7 @@ inline G4double G4ionIonisation::GetMeanFreePath(const G4Track& track,
SetChargeSquare(q_2);
SetChargeSquareRatio(q_2);
return G4VEnergyLossProcess::GetMeanFreePath(track, step, cond);
return G4VEnergyLossProcess::GetMeanFreePath(track, 0.0, 0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
File diff suppressed because it is too large Load Diff
@@ -158,6 +158,166 @@ G4double G4PAIonisation::GetMaxKineticEnergy() {return HighestKineticEnergy;}
G4double G4PAIonisation::GetMinKineticEnergy() {return LowestKineticEnergy;}
G4int G4PAIonisation::GetBinNumber() {return TotBin;}
/////////////////////////////////////////////////////////////////////////
//
// GetMeanFreePath
G4double
G4PAIonisation::GetMeanFreePath( const G4Track& trackData,
G4double,
G4ForceCondition* condition )
{
// G4cout<<"G4PAIonisation::GetMeanFreePath is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double charge, charge2, mass, massRatio, kinE, gamma, scaledE, meanFreePath ;
G4double E1, E2, W, W1, W2, primaryIon ;
*condition = NotForced ;
G4Material* aMaterial = trackData.GetMaterial() ;
if( aMaterial->GetIndex() != fMatIndex ) meanFreePath = DBL_MAX ;
else
{
const G4DynamicParticle* aParticle = trackData.GetDynamicParticle() ;
kinE = aParticle->GetKineticEnergy() ;
mass = aParticle->GetDefinition()->GetPDGMass() ;
gamma = 1.0 + kinE/mass ;
if(gamma < 1.2) return meanFreePath = DBL_MAX ;
charge = aParticle->GetDefinition()->GetPDGCharge() ;
charge2 = charge*charge ;
massRatio = proton_mass_c2/mass ;
scaledE = kinE*massRatio ;
for(iTkin=0;iTkin<G4PAIonisation::GetBinNumber();iTkin++)
{
// if(scaledE < GetProtonEnergyVector()->GetLowEdgeEnergy(iTkin)) // <= ?
if(scaledE < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) // <= ?
{
break ;
}
}
iPlace = iTkin - 1 ;
if(iTkin == G4PAIonisation::GetBinNumber()) // Fermi plato, try from left
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace))(0)/charge2 ;
}
else
{
if(iTkin == 0) // Tkin is too small, trying from right only
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace+1))(0)/charge2 ;
}
else
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledE)*W ;
W2 = (scaledE - E1)*W ;
primaryIon = (*(*fPAItransferBank)(iPlace ))(0)*W1 +
(*(*fPAItransferBank)(iPlace+1))(0)*W2 ;
meanFreePath = 1.0/primaryIon/charge2 ;
}
}
// meanFreePath = DBL_MAX ;
}
return meanFreePath ;
}
/////////////////////////////////////////////////////////////////////////
//
// GetFreePath
G4double
G4PAIonisation::GetFreePath( G4double scaledTkin, G4double charge2 )
{
// G4cout<<"G4PAIonisation::GetFreePath is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double meanFreePath ;
G4double E1, E2, W, W1, W2, primaryIon ;
for( iTkin = 0 ; iTkin < G4PAIonisation::GetBinNumber() ; iTkin++ )
{
if(scaledTkin < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1 ;
if(iTkin == G4PAIonisation::GetBinNumber()) // Fermi plato, try from left
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace))(0)/charge2 ;
}
else
{
if(iTkin == 0) // Tkin is too small, trying from right only
{
meanFreePath = 1.0/(*(*fPAItransferBank)(iPlace+1))(0)/charge2 ;
}
else
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledTkin)*W ;
W2 = (scaledTkin - E1)*W ;
primaryIon = (*(*fPAItransferBank)(iPlace ))(0)*W1 +
(*(*fPAItransferBank)(iPlace+1))(0)*W2 ;
meanFreePath = 1.0/primaryIon/charge2 ;
}
}
// meanFreePath = DBL_MAX ;
return meanFreePath ;
}
/////////////////////////////////////////////////////////////////////////
//
// GetdEdx
G4double
G4PAIonisation::GetdEdx( G4double scaledTkin, G4double charge2 )
{
// G4cout<<"G4PAIonisation::GetdEdx is called"<<G4endl ;
G4int iTkin, iPlace ;
G4double dEdx ;
G4double E1, E2, W, W1, W2 ;
for( iTkin = 0 ; iTkin < G4PAIonisation::GetBinNumber() ; iTkin++ )
{
if(scaledTkin < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
}
iPlace = iTkin - 1 ;
if(iTkin == G4PAIonisation::GetBinNumber()) // Fermi plato, try from left
{
dEdx = (*(*theLossTable)(iPlace))(0)*charge2 ;
}
else
{
if(iTkin == 0) // Tkin is too small, trying from right only
{
dEdx = (*(*theLossTable)(iPlace+1))(0)*charge2 ;
}
else
{
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
W = 1.0/(E2 - E1) ;
W1 = (E2 - scaledTkin)*W ;
W2 = (scaledTkin - E1)*W ;
dEdx = (*(*theLossTable)(iPlace))(0)*W1 + (*(*theLossTable)(iPlace+1))(0)*W2;
dEdx *= charge2 ;
}
}
return dEdx ;
}
/////////////////////////////////////////////////////////////////////////
//
// Calculate Sandia table photo absorption cross section coefficients for
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4PAIxSection.cc,v 1.17 2003/10/19 15:21:22 grichine Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4PAIxSection.cc,v 1.19 2004/06/07 07:33:21 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// G4PAIxSection.cc -- class implementation file
@@ -35,6 +35,7 @@
// R&D: Vladimir.Grichine@cern.ch
//
// History:
//
// 13.05.03 V. Grichine, bug fixed for maxEnergyTransfer > max interval energy
// 28.05.01 V.Ivanchenko minor changes to provide ANSI -wall compilation
// 17.05.01 V. Grichine, low energy extension down to 10*keV of proton
@@ -50,6 +51,9 @@
#include "G4ios.hh"
#include "G4Poisson.hh"
#include "G4Material.hh"
#include "G4MaterialCutsCouple.hh"
#include "G4SandiaTable.hh"
/* ******************************************************************
@@ -82,6 +86,33 @@ const G4int G4PAIxSection::fMaxSplineSize = 500 ; // Max size of output spline
// Constructor
//
G4PAIxSection::G4PAIxSection(G4MaterialCutsCouple* matCC)
{
fDensity = matCC->GetMaterial()->GetDensity();
G4int matIndex = matCC->GetMaterial()->GetIndex();
fSandia = new G4SandiaTable(matIndex);
G4int i, j;
fMatSandiaMatrix = new G4OrderedTable();
for (i = 0; i < fSandia->GetMaxInterval()-1; i++)
{
fMatSandiaMatrix->push_back(new G4DataVector(5,0.));
}
for (i = 0; i < fSandia->GetMaxInterval()-1; i++)
{
(*(*fMatSandiaMatrix)[i])[0] = fSandia->GetSandiaMatTable(i,0);
for(j = 1; j < 5 ; j++)
{
(*(*fMatSandiaMatrix)[i])[j] = fSandia->GetSandiaMatTable(i,j)*fDensity;
}
}
}
G4PAIxSection::G4PAIxSection(G4int materialIndex,
G4double maxEnergyTransfer)
{
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SynchrotronRadiation.cc,v 1.9 2004/03/10 16:48:46 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4SynchrotronRadiation.cc,v 1.10 2004/06/07 13:49:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
@@ -75,6 +75,95 @@ G4SynchrotronRadiation::~G4SynchrotronRadiation()
// GEANT4 internal units.
//
G4double G4SynchrotronRadiation::GetLambdaConst()
{
return fLambdaConst;
}
G4double G4SynchrotronRadiation::GetEnergyConst()
{
return fEnergyConst;
}
G4double
G4SynchrotronRadiation::GetMeanFreePath( const G4Track& trackData,
G4double,
G4ForceCondition* condition)
{
// gives the MeanFreePath in GEANT4 internal units
const G4DynamicParticle* aDynamicParticle;
G4Material* aMaterial;
G4double MeanFreePath;
//G4bool isOutRange ;
*condition = NotForced ;
aDynamicParticle = trackData.GetDynamicParticle();
aMaterial = trackData.GetMaterial();
G4double gamma = aDynamicParticle->GetTotalEnergy()/
(aDynamicParticle->GetMass() ) ;
G4double KineticEnergy = aDynamicParticle->GetKineticEnergy();
if (KineticEnergy < LowestKineticEnergy || gamma<1.0e3)
{
MeanFreePath = DBL_MAX ;
}
else
{
G4TransportationManager* transportMgr;
G4FieldManager* globalFieldMgr;
transportMgr = G4TransportationManager::GetTransportationManager() ;
globalFieldMgr = transportMgr->GetFieldManager() ;
G4bool FieldExists = globalFieldMgr->DoesFieldExist() ;
G4ThreeVector FieldValue;
const G4Field* pField = 0 ;
if (FieldExists)
{
pField = globalFieldMgr->GetDetectorField() ;
G4ThreeVector globPosition = trackData.GetPosition() ;
G4double globPosVec[3], FieldValueVec[3] ;
globPosVec[0] = globPosition.x() ;
globPosVec[1] = globPosition.y() ;
globPosVec[2] = globPosition.z() ;
pField->GetFieldValue( globPosVec, FieldValueVec ) ;
FieldValue = G4ThreeVector( FieldValueVec[0],
FieldValueVec[1],
FieldValueVec[2] ) ;
G4ThreeVector unitMomentum = aDynamicParticle->GetMomentumDirection();
G4ThreeVector unitMcrossB = FieldValue.cross(unitMomentum) ;
G4double perpB = unitMcrossB.mag() ;
G4double beta = aDynamicParticle->GetTotalMomentum()/
(aDynamicParticle->GetTotalEnergy() ) ;
if(perpB > 0.0)
{
MeanFreePath = fLambdaConst*beta/perpB ;
}
else
{
MeanFreePath = DBL_MAX ;
}
}
else
{
MeanFreePath = DBL_MAX ;
}
}
return MeanFreePath;
}
G4VParticleChange*
G4SynchrotronRadiation::PostStepDoIt(const G4Track& trackData,
const G4Step& stepData )
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4eBremsstrahlungModel.cc,v 1.15 2003/11/20 18:22:31 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4eBremsstrahlungModel.cc,v 1.16 2004/05/20 19:46:14 urban Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -43,6 +43,7 @@
// 27-01-03 Make models region aware (V.Ivanchenko)
// 13-02-03 Add name (V.Ivanchenko)
// 09-05-03 Fix problem of supression function + optimise sampling (V.Ivanchenko)
// 20-05-04 Correction to ensure unit independence (L.Urban)
//
// Class Description:
//
@@ -340,7 +341,7 @@ G4double G4eBremsstrahlungModel::ComputeBremLoss(G4double Z, G4double T,
}
}
G4double xx = log10(T);
G4double xx = log10(T/MeV);
G4double fl = 1.;
if (xx <= xlim)
@@ -542,7 +543,7 @@ G4double G4eBremsstrahlungModel::CrossSectionPerAtom(G4double kineticEnergy,
}
}
G4double xx = log10(kineticEnergy) ;
G4double xx = log10(kineticEnergy/MeV) ;
G4double fs = 1. ;
if (xx <= xlim) {
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4hIonisation.cc,v 1.50 2003/11/12 16:23:42 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4hIonisation.cc,v 1.51 2004/05/27 17:23:02 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -66,6 +66,7 @@
// 04-08-03 Set integral=false to be default (V.Ivanchenko)
// 08-08-03 STD substitute standard (V.Ivanchenko)
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
// 27-05-04 Set integral to be a default regime (V.Ivanchenko)
//
// -------------------------------------------------------------------
//
@@ -96,7 +97,6 @@ G4hIonisation::G4hIonisation(const G4String& name)
SetMinKinEnergy(0.1*keV);
SetMaxKinEnergy(100.0*TeV);
SetVerboseLevel(0);
SetIntegral(false);
mass = 0.0;
ratio = 0.0;
}
@@ -120,11 +120,7 @@ void G4hIonisation::InitialiseProcess()
em->SetLowEnergyLimit(0.1*keV);
em->SetHighEnergyLimit(2.0*MeV*massFactor);
if(IsIntegral()) {
flucModel = new G4BohrFluctuations();
} else {
flucModel = new G4UniversalFluctuation();
}
flucModel = new G4UniversalFluctuation();
AddEmModel(1, em, flucModel);
G4VEmModel* em1 = new G4BetheBlochModel();
@@ -132,6 +128,8 @@ void G4hIonisation::InitialiseProcess()
em1->SetHighEnergyLimit(100.0*TeV);
AddEmModel(2, em1, flucModel);
SetStepLimits(0.2, 1.0*mm);
isInitialised = true;
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4ionIonisation.cc,v 1.21 2003/11/12 16:23:42 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4ionIonisation.cc,v 1.23 2004/05/27 17:22:56 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -42,6 +42,7 @@
// 18-04-03 Use IonFluctuations (V.Ivanchenko)
// 03-08-03 Add effective charge (V.Ivanchenko)
// 12-11-03 G4EnergyLossSTD -> G4EnergyLossProcess (V.Ivanchenko)
// 27-05-04 Set integral to be a default regime (V.Ivanchenko)
//
//
// -------------------------------------------------------------------
@@ -95,11 +96,10 @@ void G4ionIonisation::InitialiseProcess()
em1->SetHighEnergyLimit(100.0*TeV);
AddEmModel(2, em1, flucModel);
SetIntegral(false);
chargeLowLimit = 0.1;
energyLowLimit = 250.*MeV;
energyLowLimit = 25.*MeV;
SetLinearLossLimit(0.15);
//SetStepLimits(0.1, 0.1*mm);
SetStepLimits(0.1, 0.1*mm);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -265,7 +265,7 @@ G4double G4ionIonisation::EffectiveCharge(const G4ParticleDefinition* p,
chargeCorrection = s * (1.0 + 0.5*(1.0/q - 1.0)*log(1.0 + lambda*lambda)/(vF*vF) );
}
// G4cout << "G4ionIonisation: charge= " << charge << " q= " << q
// << " chargeCor= " << chargeCorrection << G4endl;
// << " chargeCor= " << chargeCorrection << G4endl;
return charge*q;
}
+46 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.141 2004/03/15 12:15:03 maire Exp $
$Id: History,v 1.151 2004/05/26 15:21:16 vnivanch Exp $
-------------------------------------------------------------------
=========================================================
@@ -16,7 +16,52 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
26 May 04: V.Ivanchenko (utils-V06-01-07)
- Critical fix in msc to avoid crash in case of use of G4hLowEnergyIonisation
for ions together with msc
17 May 04: V.Ivanchenko (utils-V06-01-06)
- Update integral method taking into account 1 peak in cross section
- Add options to G4EmProcessOptions
- Fix minor problem at initialisation
10 May 04: V.Ivanchenko (utils-V06-01-05)
- Add method GetCurrentRange
- Add additional initialisation to fluctuations
- Fix in printout format
04 May 04: V.Ivanchenko (utils-V06-01-04)
- Use dynamic change for simulation of multiple scattering angle
- Use trancate range table for estimation of energy loss inside
msc model.
26 April 04: V.Ivanchenko (utils-V06-01-03)
- Reduce aria of applicability of the model for simulation
of fluctuations at very small steps to provide less step dependent
results.
23 April 04: L.Urban (utils-V06-01-02)
- changes in G4MscModel: t->z and z->t transformations (true length
to geometrical length and back) have been completely rewritten,
change in the angular distribution for e+/e-
( correction to the Highland formula) + some technical changes
==> results are closer to data, step dependence decreased. Effect
the resolution of sampling calorimeters
05 April 04: V.Ivant (utils-V06-01-01)
- G4VEnergyLossProcess: Update calulation of energy loss from tables
(important for proton energies about 1 MeV);
- Fluctuations: smooth out sampling of Gaussian fluctuations,
when sigma is much bigger than energy loss.
31 March 04: V.Ivant (utils-V06-01-00)
- G4VEnergyLossProcess: Fix a problem of retrieve tables if PreciseRange
is absent
15 March 04: V.Ivant (utils-V06-00-09)
- G4VEnergyLossProcess: Fix a problem of energy below lowestKinEnergy
15 March 04: mma (utils-V06-00-08)
12 March 04: V.Ivant
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4BohrFluctuations.hh,v 1.5 2003/10/16 13:06:39 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4BohrFluctuations.hh,v 1.6 2004/05/11 15:35:06 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -106,6 +106,8 @@ inline G4double G4BohrFluctuations::Dispersion(
G4double& tmax,
G4double& length)
{
if(!particle) InitialiseMe(dp->GetDefinition());
G4double electronDensity = material->GetElectronDensity();
kineticEnergy = dp->GetKineticEnergy();
G4double gam = kineticEnergy/particleMass + 1.0;
@@ -0,0 +1,136 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4EmMultiModel.hh,v 1.1 2004/05/03 13:13:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class header file
//
//
// File name: G4EmMultiModel
//
// Author: Vladimir Ivanchenko
//
// Creation date: 03.05.2004
//
// Modifications:
//
//
//
// Class Description:
//
// Energy loss model using several G4VEmModels
// -------------------------------------------------------------------
//
#ifndef G4EmMultiModel_h
#define G4EmMultiModel_h 1
#include "globals.hh"
#include "G4VEmModel.hh"
#include <vector>
class G4Region;
class G4PhysicsTable;
class G4DynamicParticle;
class G4EmMultiModel : public G4VEmModel
{
public:
G4EmMultiModel(const G4String& nam = "MultiModel");
~G4EmMultiModel();
void Initialise(const G4ParticleDefinition*, const G4DataVector&);
G4double HighEnergyLimit(const G4ParticleDefinition*) {return highKinEnergy;};
G4double LowEnergyLimit(const G4ParticleDefinition*) {return lowKinEnergy;};
void SetHighEnergyLimit(G4double e) {highKinEnergy = e;};
void SetLowEnergyLimit(G4double e) {lowKinEnergy = e;};
G4double MinEnergyCut(const G4ParticleDefinition*,
const G4MaterialCutsCouple*);
G4bool IsInCharge(const G4ParticleDefinition*);
G4double ComputeDEDX(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy);
G4double CrossSection(const G4MaterialCutsCouple*,
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxEnergy);
G4DynamicParticle* SampleSecondary(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double tmax);
std::vector<G4DynamicParticle*>* SampleSecondaries(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double tmin,
G4double tmax);
G4double MaxSecondaryEnergy(const G4DynamicParticle* dynParticle);
void DefineForRegion(const G4Region*);
void SetDynamicParticle(const G4DynamicParticle*);
void AddModel(G4VEmModel*, G4double tmin, G4double tmax);
protected:
G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kineticEnergy);
private:
// hide assignment operator
G4EmMultiModel & operator=(const G4EmMultiModel &right);
G4EmMultiModel(const G4EmMultiModel&);
G4int nModels;
std::vector<G4VEmModel*> model;
G4DataVector tsecmin;
G4DataVector cross_section;
G4double highKinEnergy;
G4double lowKinEnergy;
};
#endif
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4EmProcessOptions.hh,v 1.1 2004/02/27 17:59:06 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4EmProcessOptions.hh,v 1.2 2004/05/17 09:46:55 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// -------------------------------------------------------------------
@@ -52,6 +52,7 @@
#include "globals.hh"
class G4LossTableManager;
class G4Region;
class G4EmProcessOptions
{
@@ -90,6 +91,12 @@ public:
void SetVerbose(G4int val, const G4String& name = "all");
void SetLambdaFactor(G4double val);
void ActivateFluorescence(G4bool val, const G4Region* r = 0);
void ActivateAugerElectronProduction(G4bool val, const G4Region* r = 0);
private:
G4EmProcessOptions & operator=(const G4EmProcessOptions &right);
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4LossTableManager.hh,v 1.21 2004/02/27 17:54:48 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4LossTableManager.hh,v 1.24 2004/05/12 12:25:26 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// -------------------------------------------------------------------
@@ -102,6 +102,11 @@ public:
G4double kineticEnergy,
const G4MaterialCutsCouple *couple);
G4double GetTrancatedRange(
const G4ParticleDefinition *aParticle,
G4double kineticEnergy,
const G4MaterialCutsCouple *couple);
G4double GetEnergy(
const G4ParticleDefinition *aParticle,
G4double range,
@@ -259,7 +264,32 @@ inline G4double G4LossTableManager::GetDEDX(
if(currentLoss) x = currentLoss->GetDEDX(kineticEnergy, couple);
else x = G4EnergyLossTables::GetDEDX(currentParticle,kineticEnergy,couple,false);
return x;
// return currentLoss->GetDEDX(kineticEnergy, couple);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
inline G4double G4LossTableManager::GetTrancatedRange(
const G4ParticleDefinition *aParticle,
G4double kineticEnergy,
const G4MaterialCutsCouple *couple)
{
if(aParticle != currentParticle) {
currentParticle = aParticle;
std::map<PD, G4VEnergyLossProcess*, std::less<PD> >::const_iterator pos;
if ((pos = loss_map.find(currentParticle)) != loss_map.end()) {
currentLoss = (*pos).second;
} else {
currentLoss = 0;
// ParticleHaveNoLoss(aParticle);
}
}
G4double x;
if(currentLoss) {
x = currentLoss->GetRangeForLoss(kineticEnergy, couple);
} else {
x = G4EnergyLossTables::GetRange(currentParticle,kineticEnergy,couple,false);
}
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
@@ -280,10 +310,12 @@ inline G4double G4LossTableManager::GetRange(
}
}
G4double x;
if(currentLoss) x = currentLoss->GetRange(kineticEnergy, couple);
else x = G4EnergyLossTables::GetRange(currentParticle,kineticEnergy,couple,false);
if(currentLoss) {
x = currentLoss->GetRange(kineticEnergy, couple);
} else {
x = G4EnergyLossTables::GetRange(currentParticle,kineticEnergy,couple,false);
}
return x;
// return currentLoss->GetRange(kineticEnergy, couple);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -305,9 +337,9 @@ inline G4double G4LossTableManager::GetEnergy(
}
G4double x;
if(currentLoss) x = currentLoss->GetKineticEnergy(range, couple);
else x = G4EnergyLossTables::GetPreciseEnergyFromRange(currentParticle,range,couple,false);
else x = G4EnergyLossTables::GetPreciseEnergyFromRange(currentParticle,
range,couple,false);
return x;
// return currentLoss->GetKineticEnergy(range, couple);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MscModel.hh,v 1.9 2004/03/10 08:38:39 urban Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4MscModel.hh,v 1.11 2004/04/29 18:40:52 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -44,6 +44,9 @@
// 26-11-03 new data member currentRange (L.Urban)
// 01-03-04 changes in data members + signature changed in SampleCosineTheta
// 11-03-04 changes in data members (L.Urban)
// 23-04-04 changes in data members and in signature of SampleCosineTheta
// (L.Urban)
//
// Class Description:
//
@@ -115,13 +118,14 @@ public:
G4double TrueStepLength(G4double geomStepLength);
G4double SampleCosineTheta(G4double trueStepLength,G4double KineticEnergy,
G4double lambda);
G4double SampleCosineTheta(G4double trueStepLength,G4double KineticEnergy);
G4double SampleDisplacement();
G4double MaxSecondaryEnergy(const G4DynamicParticle*) {return 0.0;};
void SetDynamicParticle(const G4DynamicParticle*);
protected:
G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
@@ -159,8 +163,8 @@ private:
G4double xsi;
G4double lambda0;
G4double parlowen ;
G4double tPathLength;
G4double par1,par2,par3 ;
G4bool samplez;
@@ -172,6 +176,13 @@ private:
};
inline void G4MscModel::SetDynamicParticle(const G4DynamicParticle* dp)
{
particle = dp->GetDefinition();
mass = dp->GetMass();
charge = dp->GetCharge()/eplus;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4UniversalFluctuation.hh,v 1.10 2003/11/06 17:18:36 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4UniversalFluctuation.hh,v 1.12 2004/05/11 15:35:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -108,12 +108,10 @@ private:
G4double minNumberInteractionsBohr;
G4double theBohrBeta2;
G4double minLoss;
G4double problim;
G4double sumalim;
G4double alim;
G4double nmaxCont1;
G4double nmaxCont2;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VEmModel.hh,v 1.17 2004/03/01 14:16:57 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4VEmModel.hh,v 1.19 2004/04/29 18:40:52 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -43,8 +43,8 @@
// 23-07-03 Replace G4Material by G4MaterialCutCouple in dE/dx and CrossSection
// calculation (V.Ivanchenko)
// 01-03-04 L.Urban signature changed in SampleCosineTheta
// 23-04-04 L.urban signature of SampleCosineTheta changed back
//
//
// Class Description:
//
@@ -130,13 +130,15 @@ public:
virtual G4double TrueStepLength(G4double geomStepLength) {return geomStepLength;};
virtual G4double SampleCosineTheta(G4double,G4double,G4double ) {return 1.0;};
// trueStepLength + Tkin + lambda
virtual G4double SampleCosineTheta(G4double,G4double ) {return 1.0;};
// trueStepLength + Tkin
virtual G4double SampleDisplacement() {return 0.0;};
virtual void DefineForRegion(const G4Region*) {};
virtual void SetDynamicParticle(const G4DynamicParticle*) {};
protected:
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VEmProcess.hh,v 1.3 2004/03/06 13:47:20 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4VEmProcess.hh,v 1.4 2004/05/17 09:46:56 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -101,12 +101,10 @@ public:
virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
// True for all charged particles
virtual
void BuildPhysicsTable(const G4ParticleDefinition&);
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
// Build physics table during initialisation
virtual void PrintInfoDefinition();
// Print out of the class parameters
G4PhysicsTable* BuildLambdaTable();
@@ -144,7 +142,7 @@ public:
void UpdateEmModel(const G4String&, G4double, G4double);
// Define new energy range for the model identified by the name
G4double GetLambda(G4double kineticEnergy, const G4MaterialCutsCouple* couple);
G4double GetLambda(G4double& kinEnergy, const G4MaterialCutsCouple* couple);
// It returns the Lambda of the process
G4double MicroscopicCrossSection(G4double kineticEnergy,
@@ -161,18 +159,21 @@ public:
const G4ParticleDefinition* Particle() const;
const G4ParticleDefinition* SecondaryParticle() const;
void ActivateFluorescence(G4bool, const G4Region* r = 0);
void ActivateAugerElectronProduction(G4bool, const G4Region* r = 0);
void SetLambdaFactor(G4double val);
protected:
void SetParticle(const G4ParticleDefinition* p);
void SetSecondaryParticle(const G4ParticleDefinition* p);
virtual
G4double GetMeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
virtual G4double GetMeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
virtual
G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*);
virtual G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*);
virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*,
const G4Material*, G4double cut) = 0;
@@ -190,6 +191,10 @@ private:
void DefineMaterial(const G4MaterialCutsCouple* couple);
G4double GetLambda(G4double kinEnergy);
void ComputeLambda(G4double kinEnergy);
// hide assignment operator
G4VEmProcess(G4VEmProcess &);
@@ -203,6 +208,8 @@ private:
// tables and vectors
G4PhysicsTable* theLambdaTable;
G4double* theEnergyOfCrossSectionMax;
G4double* theCrossSectionMax;
const G4ParticleDefinition* particle;
const G4ParticleDefinition* baseParticle;
@@ -218,9 +225,12 @@ private:
G4double minKinEnergy;
G4double maxKinEnergy;
G4double lambdaFactor;
G4double preStepLambda;
G4double preStepMFP;
G4double preStepKinEnergy;
G4double mfpKinEnergy;
G4bool integral;
G4bool meanFreePath;
@@ -235,7 +245,44 @@ inline void G4VEmProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
currentCouple = couple;
currentMaterial = couple->GetMaterial();
currentMaterialIndex = couple->GetIndex();
if(integral && !meanFreePath) ResetNumberOfInteractionLengthLeft();
if(integral && (!meanFreePath || preStepKinEnergy < mfpKinEnergy))
ResetNumberOfInteractionLengthLeft();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4double x = 0.0;
if(theLambdaTable) x = GetLambda(kineticEnergy);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::GetLambda(G4double e)
{
G4bool b;
return (((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEmProcess::ComputeLambda(G4double e)
{
meanFreePath = false;
mfpKinEnergy = 0.0;
G4double emax = theEnergyOfCrossSectionMax[currentMaterialIndex];
if (e <= emax) preStepLambda = GetLambda(e);
else {
e *= lambdaFactor;
if(e > emax) {
mfpKinEnergy = e;
preStepLambda = GetLambda(e);
} else preStepLambda = theCrossSectionMax[currentMaterialIndex];
}
}
@@ -244,18 +291,16 @@ inline void G4VEmProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
inline G4double G4VEmProcess::GetMeanFreePath(const G4Track& track, G4double,
G4ForceCondition*)
{
DefineMaterial(track.GetMaterialCutsCouple());
preStepKinEnergy = track.GetKineticEnergy();
DefineMaterial(track.GetMaterialCutsCouple());
if (meanFreePath) {
G4bool b;
preStepLambda = (((*theLambdaTable)[currentMaterialIndex])->
GetValue(preStepKinEnergy, b));
if (integral) meanFreePath = false;
if (integral) ComputeLambda(preStepKinEnergy);
else preStepLambda = GetLambda(preStepKinEnergy);
if(0.0 < preStepLambda) preStepMFP = 1.0/preStepLambda;
else preStepMFP = DBL_MAX;
}
G4double x = DBL_MAX;
if(0.0 < preStepLambda) x = 1.0/preStepLambda;
// G4cout << GetProcessName() << ": e= " << preStepKinEnergy << " mfp= " << x << G4endl;
return x;
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<<" mfp= "<<preStepMFP<<G4endl;
return preStepMFP;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -289,56 +334,6 @@ inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEmProcess::SetLambdaBinning(G4int nbins)
{
nLambdaBins = nbins;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEmProcess::SetMinKinEnergy(G4double e)
{
minKinEnergy = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::MinKinEnergy() const
{
return minKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEmProcess::SetMaxKinEnergy(G4double e)
{
maxKinEnergy = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::MaxKinEnergy() const
{
return maxKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::GetLambda(G4double kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4double x = DBL_MAX;
G4bool b;
if(theLambdaTable) {
G4double y = (((*theLambdaTable)[currentMaterialIndex])->GetValue(kineticEnergy, b));
if(y > 0.0) x = 1.0/y;
}
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEmProcess::GetMeanLifeTime(const G4Track&,
G4ForceCondition*)
{
@@ -347,7 +342,7 @@ inline G4double G4VEmProcess::GetMeanLifeTime(const G4Track&,
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VParticleChange* G4VEmProcess::AtRestDoIt(const G4Track&,
inline G4VParticleChange* G4VEmProcess::AtRestDoIt(const G4Track&,
const G4Step&)
{
return 0;
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VEnergyLossProcess.hh,v 1.9 2004/03/11 14:43:14 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4VEnergyLossProcess.hh,v 1.21 2004/05/17 09:46:56 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -79,7 +79,6 @@ class G4ParticleDefinition;
class G4VEmModel;
class G4VEmFluctuationModel;
class G4DataVector;
//class G4VParticleChange;
class G4PhysicsTable;
class G4PhysicsVector;
class G4VSubCutoffProcessor;
@@ -118,8 +117,7 @@ public:
virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
// True for all charged particles
virtual
void BuildPhysicsTable(const G4ParticleDefinition&);
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
// Build physics table during initialisation
virtual void PrintInfoDefinition();
@@ -134,9 +132,6 @@ public:
G4PhysicsTable* BuildLambdaSubTable();
void SetParticles(const G4ParticleDefinition*,
const G4ParticleDefinition*);
void SetParticle(const G4ParticleDefinition* p);
void SetBaseParticle(const G4ParticleDefinition* p);
void SetSecondaryParticle(const G4ParticleDefinition* p);
@@ -191,62 +186,71 @@ public:
void AddSubCutoffProcessor(G4VSubCutoffProcessor*, const G4Region* region = 0);
// Add subcutoff processor for the region
virtual void SetSubCutoff(G4bool) {};
virtual void ActivateFluorescence(G4bool, const G4Region* region = 0);
virtual void ActivateAugerElectronProduction(G4bool, const G4Region* region = 0);
// Activate deexcitation code
virtual void SetSubCutoff(G4bool);
void SetDEDXTable(G4PhysicsTable* p);
G4PhysicsTable* DEDXTable() const {return theDEDXTable;};
G4PhysicsTable* DEDXTable() const;
void SetRangeTable(G4PhysicsTable* pRange);
G4PhysicsTable* RangeTable() const {return thePreciseRangeTable;};
void SetPreciseRangeTable(G4PhysicsTable* pRange);
G4PhysicsTable* PreciseRangeTable() const;
void SetRangeTableForLoss(G4PhysicsTable* p);
G4PhysicsTable* RangeTableForLoss() const {return theRangeTableForLoss;};
G4PhysicsTable* RangeTableForLoss() const;
void SetInverseRangeTable(G4PhysicsTable* p);
G4PhysicsTable* InverseRangeTable() const {return theInverseRangeTable;};
G4PhysicsTable* InverseRangeTable() const;
void SetSecondaryRangeTable(G4PhysicsTable* p);
void SetLambdaTable(G4PhysicsTable* p);
G4PhysicsTable* LambdaTable() {return theLambdaTable;};
G4PhysicsTable* LambdaTable();
void SetSubLambdaTable(G4PhysicsTable* p);
G4PhysicsTable* SubLambdaTable() {return theSubLambdaTable;};
G4PhysicsTable* SubLambdaTable();
G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple* couple);
G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple* couple);
G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple* couple);
G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple* couple);
G4double GetLambda(G4double kineticEnergy, const G4MaterialCutsCouple* couple);
G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple* couple);
// It returns the MeanFreePath of the process
G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple,
const G4DynamicParticle* dp,
G4double& length);
G4double length);
G4double MicroscopicCrossSection(G4double kineticEnergy,
const G4MaterialCutsCouple* couple);
// It returns the MeanFreePath of the process for a (energy, material)
void SetLinearLossLimit(G4double val) {linLossLimit = val;};
void SetLinearLossLimit(G4double val);
void SetLossFluctuations(G4bool val) {lossFluctuationFlag = val;};
void SetLossFluctuations(G4bool val);
void SetIntegral(G4bool val);
G4bool IsIntegral() const {return integral;}
G4bool IsIntegral() const;
void SetRandomStep(G4bool val) {rndmStepFlag = val;};
void SetRandomStep(G4bool val);
void SetMinSubRange(G4double val) {minSubRange = val;};
void SetMinSubRange(G4double val);
void SetStepLimits(G4double v1, G4double v2);
void SetStepFunction(G4double v1, G4double v2);
G4bool TablesAreBuilt() const {return tablesAreBuilt;};
void SetLambdaFactor(G4double val);
G4int NumberOfSubCutoffRegions() const {return nSCoffRegions;};
G4bool TablesAreBuilt() const;
G4int NumberOfSubCutoffRegions() const;
G4double MeanFreePath(const G4Track& track,
G4double previousStepSize,
@@ -257,25 +261,22 @@ public:
G4double currentMinimumStep,
G4double& currentSafety);
void ResetNumberOfInteractionLengthLeft();
void ResetNumberOfInteractionLengthLeft();
// reset (determine the value of)NumberOfInteractionLengthLeft
protected:
virtual
G4double GetMeanFreePath(const G4Track& track,
virtual G4double GetMeanFreePath(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
virtual
G4double GetContinuousStepLimit(const G4Track& track,
virtual G4double GetContinuousStepLimit(const G4Track& track,
G4double previousStepSize,
G4double currentMinimumStep,
G4double& currentSafety);
virtual
const G4ParticleDefinition* DefineBaseParticle(
const G4ParticleDefinition*) {return 0;};
const G4ParticleDefinition* DefineBaseParticle(const G4ParticleDefinition*);
virtual
G4PhysicsVector* DEDXPhysicsVector(const G4MaterialCutsCouple*);
@@ -294,19 +295,21 @@ protected:
virtual G4double MaxSecondaryEnergy(const G4DynamicParticle* dp) = 0;
G4VEmModel* SelectModel(G4double& kinEnergy);
G4VEmModel* SelectModel(G4double kinEnergy);
G4VSubCutoffProcessor* SubCutoffProcessor(size_t index);
size_t CurrentMaterialCutsCoupleIndex() const {return currentMaterialIndex;};
size_t CurrentMaterialCutsCoupleIndex() const;
void SetMassRatio(G4double val) {massRatio = val;};
void SetMassRatio(G4double val);
void SetReduceFactor(G4double val) {reduceFactor = val;};
void SetReduceFactor(G4double val);
void SetChargeSquare(G4double val) {chargeSquare = val;};
void SetChargeSquare(G4double val);
void SetChargeSquareRatio(G4double val) {chargeSqRatio = val;};
void SetChargeSquareRatio(G4double val);
G4double GetCurrentRange() const;
private:
@@ -320,7 +323,11 @@ private:
G4double GetPreciseRange(G4double kineticEnergy);
G4double GetKineticEnergyForLoss(G4double range);
G4double GetLambda(G4double scaledKinEnergy);
void ComputeLambda(G4double scaledKinEnergy);
G4double ScaledKinEnergyForLoss(G4double range);
// hide assignment operator
@@ -342,15 +349,17 @@ private:
std::vector<G4int> idxSCoffRegions;
// tables and vectors
G4PhysicsTable* theDEDXTable;
G4PhysicsTable* theRangeTableForLoss;
G4PhysicsTable* thePreciseRangeTable;
G4PhysicsTable* theSecondaryRangeTable;
G4PhysicsTable* theInverseRangeTable;
G4PhysicsTable* theLambdaTable;
G4PhysicsTable* theSubLambdaTable;
G4double* theDEDXAtMaxEnergy;
G4double* theRangeAtMaxEnergy;
G4PhysicsTable* theDEDXTable;
G4PhysicsTable* theRangeTableForLoss;
G4PhysicsTable* thePreciseRangeTable;
G4PhysicsTable* theSecondaryRangeTable;
G4PhysicsTable* theInverseRangeTable;
G4PhysicsTable* theLambdaTable;
G4PhysicsTable* theSubLambdaTable;
G4double* theDEDXAtMaxEnergy;
G4double* theRangeAtMaxEnergy;
G4double* theEnergyOfCrossSectionMax;
G4double* theCrossSectionMax;
const G4DataVector* theCuts;
@@ -379,6 +388,7 @@ private:
G4double chargeSqRatio;
G4double preStepLambda;
G4double preStepMFP;
G4double fRange;
G4double preStepKinEnergy;
G4double preStepScaledEnergy;
@@ -388,13 +398,15 @@ private:
G4double finalRange;
G4double defaultRoverRange;
G4double defaultIntegralRange;
G4double lambdaFactor;
G4double mfpKinEnergy;
G4bool lossFluctuationFlag;
G4bool rndmStepFlag;
G4bool hasRestProcess;
G4bool tablesAreBuilt;
G4bool integral;
G4bool meanFreePath;
G4bool lossFluctuationFlag;
G4bool rndmStepFlag;
G4bool hasRestProcess;
G4bool tablesAreBuilt;
G4bool integral;
G4bool meanFreePath;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -408,7 +420,8 @@ inline void G4VEnergyLossProcess::DefineMaterial(const G4MaterialCutsCouple* cou
currentMaterialIndex = couple->GetIndex();
minStepLimit = std::min(finalRange,
currentCouple->GetProductionCuts()->GetProductionCut(idxG4ElectronCut));
if(integral && !meanFreePath) ResetNumberOfInteractionLengthLeft();
if(integral && (!meanFreePath || preStepScaledEnergy < mfpKinEnergy))
ResetNumberOfInteractionLengthLeft();
}
}
@@ -418,19 +431,15 @@ inline G4double G4VEnergyLossProcess::GetDEDX(G4double& kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4bool b;
G4double e = kineticEnergy*massRatio;
G4double x = ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
if(e < minKinEnergy) x *= sqrt(e/minKinEnergy);
return x;
return GetDEDXForLoss(kineticEnergy);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetDEDXForLoss(G4double kineticEnergy)
inline G4double G4VEnergyLossProcess::GetDEDXForLoss(G4double e)
{
G4bool b;
G4double e = kineticEnergy*massRatio;
e *= massRatio;
G4double x = ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
if(e < minKinEnergy) x *= sqrt(e/minKinEnergy);
return x;
@@ -443,18 +452,18 @@ inline G4double G4VEnergyLossProcess::GetRange(G4double& kineticEnergy,
{
DefineMaterial(couple);
G4double x = DBL_MAX;
if(thePreciseRangeTable) x = GetPreciseRange(kineticEnergy);
else if(theRangeTableForLoss) x = GetRangeForLoss(kineticEnergy);
if(thePreciseRangeTable) x = GetPreciseRange(kineticEnergy);
else if(theRangeTableForLoss) x = GetRangeForLoss(kineticEnergy);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetPreciseRange(G4double kineticEnergy)
inline G4double G4VEnergyLossProcess::GetPreciseRange(G4double e)
{
G4bool b;
G4double x;
G4double e = kineticEnergy*massRatio;
e *= massRatio;
if (e < maxKinEnergyForRange) {
x = ((*thePreciseRangeTable)[currentMaterialIndex])->GetValue(e, b);
@@ -469,10 +478,21 @@ inline G4double G4VEnergyLossProcess::GetPreciseRange(G4double kineticEnergy)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetRangeForLoss(G4double kineticEnergy)
inline G4double G4VEnergyLossProcess::GetRangeForLoss(G4double& kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4double x = DBL_MAX;
if(theRangeTableForLoss) x = GetRangeForLoss(kineticEnergy);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetRangeForLoss(G4double e)
{
G4bool b;
G4double e = kineticEnergy*massRatio;
e *= massRatio;
G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b);
if(e < minKinEnergy) x *= sqrt(e/minKinEnergy);
return x*reduceFactor;
@@ -483,33 +503,16 @@ inline G4double G4VEnergyLossProcess::GetRangeForLoss(G4double kineticEnergy)
inline G4double G4VEnergyLossProcess::GetKineticEnergy(G4double& range,
const G4MaterialCutsCouple* couple)
{
G4double del = fRange - range;
G4double e = minKinEnergy;
if(couple == currentCouple && del > 0.0 && del < fRange*linLossLimit) {
e = preStepKinEnergy - del*GetDEDXForLoss(preStepKinEnergy);
if(e < 0.0) e = 0.0;
} else {
DefineMaterial(couple);
G4double r = range/reduceFactor;
G4PhysicsVector* v = (*theInverseRangeTable)[currentMaterialIndex];
G4double rmin = v->GetLowEdgeEnergy(0);
if(r <= rmin) {
r /= rmin;
e *= r*r;
} else {
G4bool b;
e = v->GetValue(r, b);
}
e /= massRatio;
}
DefineMaterial(couple);
G4double r = range/reduceFactor;
G4double e = ScaledKinEnergyForLoss(r)/massRatio;
return e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetKineticEnergyForLoss(G4double range)
inline G4double G4VEnergyLossProcess::ScaledKinEnergyForLoss(G4double r)
{
G4double r = range/reduceFactor;
G4PhysicsVector* v = (*theInverseRangeTable)[currentMaterialIndex];
G4double rmin = v->GetLowEdgeEnergy(0);
G4double e = minKinEnergy;
@@ -520,7 +523,7 @@ inline G4double G4VEnergyLossProcess::GetKineticEnergyForLoss(G4double range)
G4bool b;
e = v->GetValue(r, b);
}
return e/massRatio;
return e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -528,7 +531,7 @@ inline G4double G4VEnergyLossProcess::GetKineticEnergyForLoss(G4double range)
inline G4double G4VEnergyLossProcess::GetDEDXDispersion(
const G4MaterialCutsCouple *couple,
const G4DynamicParticle* dp,
G4double& length)
G4double length)
{
DefineMaterial(couple);
G4double tmax = MaxSecondaryEnergy(dp);
@@ -539,22 +542,56 @@ inline G4double G4VEnergyLossProcess::GetDEDXDispersion(
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4double x = 0.0;
if(theLambdaTable) x = GetLambda(kineticEnergy*massRatio);
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetLambda(G4double e)
{
G4bool b;
return chargeSqRatio*(((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::ComputeLambda(G4double e)
{
meanFreePath = false;
mfpKinEnergy = 0.0;
G4double emax = theEnergyOfCrossSectionMax[currentMaterialIndex];
if (e <= emax) preStepLambda = GetLambda(e);
else {
e *= lambdaFactor;
if(e > emax) {
mfpKinEnergy = e;
preStepLambda = GetLambda(e);
} else preStepLambda = theCrossSectionMax[currentMaterialIndex];
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetMeanFreePath(const G4Track& track,
G4double, G4ForceCondition*)
{
DefineMaterial(track.GetMaterialCutsCouple());
preStepKinEnergy = track.GetKineticEnergy();
preStepScaledEnergy = preStepKinEnergy*massRatio;
DefineMaterial(track.GetMaterialCutsCouple());
if (meanFreePath) {
G4bool b;
preStepLambda = (((*theLambdaTable)[currentMaterialIndex])->
GetValue(preStepScaledEnergy, b)) * chargeSqRatio;
if (integral) meanFreePath = false;
if (integral) ComputeLambda(preStepScaledEnergy);
else preStepLambda = GetLambda(preStepScaledEnergy);
if(0.0 < preStepLambda) preStepMFP = 1.0/preStepLambda;
else preStepMFP = DBL_MAX;
}
G4double x = DBL_MAX;
if(0.0 < preStepLambda) x = 1.0/preStepLambda;
// G4cout << GetProcessName() << ": e= " << preStepKinEnergy << " mfp= " << x << G4endl;
return x;
// G4cout<<GetProcessName()<<": e= "<<preStepKinEnergy<<" mfp= "<<preStepMFP<<G4endl;
return preStepMFP;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -572,8 +609,8 @@ inline G4double G4VEnergyLossProcess::GetContinuousStepLimit(const G4Track&,
if(x > minStepLimit && y < currentMinStep ) {
x = y + minStepLimit*(1.0 - dRoverRange)*(2.0 - minStepLimit/fRange);
if(x >fRange || x<minStepLimit) G4cout << "!!! StepLimit problem!!!" << G4endl;
if(rndmStepFlag) x = minStepLimit + G4UniformRand()*(x-minStepLimit);
//if(x >fRange || x<minStepLimit) G4cout << "!!! StepLimit problem!!!" << G4endl;
//if(rndmStepFlag) x = minStepLimit + G4UniformRand()*(x-minStepLimit);
}
}
return x;
@@ -590,7 +627,7 @@ inline void G4VEnergyLossProcess::ResetNumberOfInteractionLengthLeft()
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VEmModel* G4VEnergyLossProcess::SelectModel(G4double& kinEnergy)
inline G4VEmModel* G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
{
return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
}
@@ -618,79 +655,6 @@ inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() con
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins)
{
nDEDXBins = nbins;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetDEDXBinningForPreciseRange(G4int nbins)
{
nDEDXBinsForRange = nbins;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins)
{
nLambdaBins = nbins;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::MinKinEnergy() const
{
return minKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e)
{
minKinEnergy = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e)
{
maxKinEnergy = e;
if(e < maxKinEnergyForRange) maxKinEnergyForRange = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetMaxKinEnergyForPreciseRange(G4double e)
{
maxKinEnergyForRange = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::MaxKinEnergy() const
{
return maxKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetLambda(G4double kineticEnergy,
const G4MaterialCutsCouple* couple)
{
DefineMaterial(couple);
G4double x = DBL_MAX;
G4bool b;
if(theLambdaTable) {
G4double y = (((*theLambdaTable)[currentMaterialIndex])->
GetValue(kineticEnergy*massRatio, b));
if(y > 0.0) x = 1.0/y;
}
return x;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4VSubCutoffProcessor* G4VEnergyLossProcess::SubCutoffProcessor(size_t index)
{
G4VSubCutoffProcessor* p = 0;
@@ -698,6 +662,97 @@ inline G4VSubCutoffProcessor* G4VEnergyLossProcess::SubCutoffProcessor(size_t in
return p;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
{
return theDEDXTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::PreciseRangeTable() const
{
return thePreciseRangeTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
{
return theRangeTableForLoss;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
{
return theInverseRangeTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()
{
return theLambdaTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()
{
return theSubLambdaTable;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4bool G4VEnergyLossProcess::IsIntegral() const
{
return integral;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const
{
return currentMaterialIndex;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetMassRatio(G4double val)
{
massRatio = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetReduceFactor(G4double val)
{
reduceFactor = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetChargeSquare(G4double val)
{
chargeSquare = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline void G4VEnergyLossProcess::SetChargeSquareRatio(G4double val)
{
chargeSqRatio = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
inline G4double G4VEnergyLossProcess::GetCurrentRange() const
{
return fRange;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#endif
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VMultipleScattering.hh,v 1.16 2004/01/21 18:05:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4VMultipleScattering.hh,v 1.19 2004/05/25 11:30:08 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -45,6 +45,7 @@
// part of calculations for all charged particles
//
// 26-11-03 bugfix in AlongStepDoIt (L.Urban)
// 25-05-04 add protection against case when range is less than steplimit (V.Ivanchenko)
// -------------------------------------------------------------------
//
@@ -275,9 +276,11 @@ inline G4double G4VMultipleScattering::GetContinuousStepLimit(
DefineMaterial(track.GetMaterialCutsCouple());
G4double e = track.GetKineticEnergy();
SelectModel(e);
if(!theLambdaTable) currentModel->SetDynamicParticle(track.GetDynamicParticle());
const G4ParticleDefinition* p = track.GetDefinition();
lambda0 = GetLambda(p, e);
currentRange = G4LossTableManager::Instance()->GetRange(p,e,currentCouple);
currentRange = G4LossTableManager::Instance()->GetTrancatedRange(p,e,currentCouple);
if(currentRange < currentMinimalStep) currentRange = currentMinimalStep;
truePathLength = TruePathLengthLimit(track,lambda0,currentMinimalStep);
//G4cout << "StepLimit: tpl= " << truePathLength << " lambda0= "
// << lambda0 << " range= " << currentRange
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4BohrFluctuations.cc,v 1.7 2003/10/24 14:00:25 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4BohrFluctuations.cc,v 1.9 2004/05/11 15:35:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -60,7 +60,7 @@ G4BohrFluctuations::G4BohrFluctuations(const G4String& nam)
minNumberInteractionsBohr(10.0),
minFraction(0.2),
xmin(0.2),
minLoss(0.000001*eV)
minLoss(0.001*eV)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -89,6 +89,7 @@ G4double G4BohrFluctuations::SampleFluctuations(const G4Material* material,
if(meanLoss <= minLoss) return meanLoss;
G4double siga = Dispersion(material,dp,tmax,length);
G4double loss = meanLoss;
G4double navr = minNumberInteractionsBohr;
// Gaussian fluctuation
@@ -97,10 +98,11 @@ G4double G4BohrFluctuations::SampleFluctuations(const G4Material* material,
navr = meanLoss*meanLoss/siga;
if (navr < minNumberInteractionsBohr) gauss = false;
}
// G4cout << "### meanLoss= " << meanLoss << " navr= " << navr << " sig= " << sqrt(siga) << G4endl;
if(gauss) {
// Increase fluctuations for big fractional energy loss
if ( meanLoss > minFraction*kineticEnergy ) {
G4double gam = (kineticEnergy - meanLoss)/particleMass + 1.0;
G4double b2 = 1.0 - 1.0/(gam*gam);
@@ -111,17 +113,26 @@ G4double G4BohrFluctuations::SampleFluctuations(const G4Material* material,
}
siga = sqrt(siga);
G4double lossmax = meanLoss+meanLoss;
G4double twomeanLoss = meanLoss + meanLoss;
do {
loss = G4RandGauss::shoot(meanLoss,siga);
} while (0.0 > loss || loss > lossmax);
if(twomeanLoss < siga) {
G4double x;
do {
loss = twomeanLoss*G4UniformRand();
x = (loss - meanLoss)/siga;
} while (1.0 - 0.5*x*x < G4UniformRand());
} else {
do {
loss = G4RandGauss::shoot(meanLoss,siga);
} while (0.0 > loss || loss > twomeanLoss);
}
// Poisson fluctuations
} else {
G4double n = (G4double)(G4Poisson(navr));
loss = meanLoss*n/navr;
}
return loss;
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4EmModelManager.cc,v 1.22 2004/01/27 11:21:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4EmModelManager.cc,v 1.23 2004/05/10 18:45:33 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -321,7 +321,7 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
if(0 < verboseLevel) {
G4cout << "New G4RegionModels set with " << n << " models for region <"
<< region->GetName() << "> Elow(MeV)= ";
<< region->GetName() << "> Elow(MeV)= ";
for(G4int ii=0; ii<n; ii++) {G4cout << eLow[ii]/MeV << " ";}
G4cout << G4endl;
}
@@ -344,8 +344,7 @@ const G4DataVector* G4EmModelManager::Initialise(const G4ParticleDefinition* p,
G4cout << "G4EmModelManager::Initialise() for "
<< material->GetName()
<< " indexOfCouple= " << i
<< " indexOfRegion= " << reg
<< " indexOfRegion= " << reg
<< " indexOfRegion= " << reg
<< G4endl;
}
@@ -0,0 +1,293 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4EmMultiModel.cc,v 1.1 2004/05/03 13:13:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4EmMultiModel
//
// Author: Vladimir Ivanchenko
//
// Creation date: 03.05.2004
//
// Modifications:
//
// Class Description:
//
// Energy loss model using several G4VEmModels
// -------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "G4EmMultiModel.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4EmMultiModel::G4EmMultiModel(const G4String& nam)
: G4VEmModel(nam),
nModels(0)
{
highKinEnergy = 100.0*GeV;
lowKinEnergy = 0.1*keV;
model.clear();
tsecmin.clear();
cross_section.clear();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4EmMultiModel::~G4EmMultiModel()
{
if(nModels) {
for(G4int i=0; i<nModels; i++) {
delete model[i];
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4EmMultiModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector& cuts)
{
if(nModels) {
for(G4int i=0; i<nModels; i++) {
(model[i])->Initialise(p, cuts);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4EmMultiModel::MinEnergyCut(const G4ParticleDefinition* p,
const G4MaterialCutsCouple* couple)
{
G4double cut = DBL_MAX;
if(nModels) {
cut = (model[0])->MinEnergyCut(p, couple);
}
return cut;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool G4EmMultiModel::IsInCharge(const G4ParticleDefinition* p)
{
G4bool yes = true;
if(nModels) {
for(G4int i=0; i<nModels; i++) {
G4bool x = (model[i])->IsInCharge(p);
if( !x ) yes = false;
}
}
return yes;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4EmMultiModel::ComputeDEDX(const G4MaterialCutsCouple* couple,
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double cutEnergy)
{
G4double dedx = 0.0;
if(nModels) {
dedx = (model[0])->ComputeDEDX(couple, p, cutEnergy, kineticEnergy);
}
return dedx;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4EmMultiModel::CrossSection(const G4MaterialCutsCouple* couple,
const G4ParticleDefinition* p,
G4double kineticEnergy,
G4double cutEnergy,
G4double maxKinEnergy)
{
G4double cross = 0.0;
G4double t1 = cutEnergy;
G4double t2 = cutEnergy;
if(nModels) {
for(G4int i=0; i<nModels; i++) {
t1 = std::max(t2, tsecmin[i]);
t2 = std::min(maxKinEnergy, tsecmin[i+1]);
cross += (model[i])->CrossSection(couple, p, kineticEnergy, t1, t2);
}
}
return cross;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4DynamicParticle* G4EmMultiModel::SampleSecondary(
const G4MaterialCutsCouple*,
const G4DynamicParticle*,
G4double,
G4double)
{
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
std::vector<G4DynamicParticle*>* G4EmMultiModel::SampleSecondaries(
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* dp,
G4double tmin,
G4double maxEnergy)
{
std::vector<G4DynamicParticle*>* vdp = 0;
if(nModels) {
G4int i;
G4double cross = 0.0;
G4double t1 = tmin;
G4double t2 = tmin;
for(i=0; i<nModels; i++) {
t1 = std::max(t2, tsecmin[i]);
t2 = std::min(maxEnergy, tsecmin[i+1]);
cross += (model[i])->CrossSection(couple, dp->GetDefinition(),
dp->GetKineticEnergy(), t1, t2);
cross_section[i] = cross;
}
cross *= G4UniformRand();
t2 = tmin;
for(i=0; i<nModels; i++) {
t1 = std::max(t2, tsecmin[i]);
t2 = std::min(maxEnergy, tsecmin[i+1]);
if(cross <= cross_section[i]) {
vdp = (model[i])->SampleSecondaries(couple, dp, t1, t2);
break;
}
}
}
return vdp;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4EmMultiModel:: MaxSecondaryEnergy(const G4DynamicParticle* dp)
{
G4double tmax = 0.0;
if(nModels) {
tmax = (model[0])-> MaxSecondaryEnergy(dp);
}
return tmax;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4EmMultiModel:: MaxSecondaryEnergy(const G4ParticleDefinition*,
G4double kinEnergy)
{
G4cout << "Warning! G4EmMultiModel::"
<< "MaxSecondaryEnergy(const G4ParticleDefinition*,G4double kinEnergy)"
<< " should not be used!" << G4endl;
return kinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4EmMultiModel::DefineForRegion(const G4Region* r)
{
if(nModels) {
for(G4int i=0; i<nModels; i++) {(model[i])->DefineForRegion(r);}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4EmMultiModel::SetDynamicParticle(const G4DynamicParticle* dp)
{
if(nModels) {
for(G4int i=0; i<nModels; i++) {(model[i])->SetDynamicParticle(dp);}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4EmMultiModel::AddModel(G4VEmModel* p, G4double tmin, G4double tmax)
{
if(tmin < tmax && 0.0 < tmin) {
if(nModels == 0) {
tsecmin.push_back(tmin);
tsecmin.push_back(tmax);
cross_section.push_back(0.0);
model.push_back(p);
nModels++;
} else {
G4int i, j;
G4bool increment = false;
for(i=0; i<nModels; i++) {
if(tmin < tsecmin[i]) {
G4double t2 = std::min(tsecmin[i+1],tmax);
if(tmin < t2) {
tsecmin.push_back(0.0);
cross_section.push_back(0.0);
model.push_back(0);
for(j=nModels; j>i; j--) {
model[j] = model[j-1];
tsecmin[j+1] = tsecmin[j];
}
model[i] = p;
tsecmin[i+1] = t2;
tsecmin[i] = tmin;
increment = true;
}
} else if(i == nModels-1) {
G4double t1 = std::min(tsecmin[i+1],tmin);
G4double t2 = std::max(tsecmin[i+1],tmax);
if(t1 < t2) {
tsecmin.push_back(t2);
cross_section.push_back(0.0);
model.push_back(p);
increment = true;
}
}
}
if(increment) nModels++;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4EmProcessOptions.cc,v 1.1 2004/02/27 17:59:06 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4EmProcessOptions.cc,v 1.2 2004/05/17 09:46:56 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -48,6 +48,7 @@
#include "G4VEmProcess.hh"
#include "G4VEnergyLossProcess.hh"
#include "G4VMultipleScattering.hh"
#include "G4Region.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -341,3 +342,63 @@ void G4EmProcessOptions::SetVerbose(G4int val, const G4String& name)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4EmProcessOptions::SetLambdaFactor(G4double val)
{
const std::vector<G4VEnergyLossProcess*>& v =
theManager->GetEnergyLossProcessVector();
std::vector<G4VEnergyLossProcess*>::const_iterator itr;
for(itr = v.begin(); itr != v.end(); itr++) {
G4VEnergyLossProcess* p = *itr;
if(p) p->SetLambdaFactor(val);
}
const std::vector<G4VEmProcess*>& w =
theManager->GetEmProcessVector();
std::vector<G4VEmProcess*>::const_iterator itp;
for(itp = w.begin(); itp != w.end(); itp++) {
G4VEmProcess* q = *itp;
if(q) q->SetLambdaFactor(val);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4EmProcessOptions::ActivateFluorescence(G4bool val, const G4Region* r)
{
const std::vector<G4VEnergyLossProcess*>& v =
theManager->GetEnergyLossProcessVector();
std::vector<G4VEnergyLossProcess*>::const_iterator itr;
for(itr = v.begin(); itr != v.end(); itr++) {
G4VEnergyLossProcess* p = *itr;
if(p) p->ActivateFluorescence(val,r);
}
const std::vector<G4VEmProcess*>& w =
theManager->GetEmProcessVector();
std::vector<G4VEmProcess*>::const_iterator itp;
for(itp = w.begin(); itp != w.end(); itp++) {
G4VEmProcess* q = *itp;
if(q) q->ActivateFluorescence(val,r);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4EmProcessOptions::ActivateAugerElectronProduction(G4bool val, const G4Region* r)
{
const std::vector<G4VEnergyLossProcess*>& v =
theManager->GetEnergyLossProcessVector();
std::vector<G4VEnergyLossProcess*>::const_iterator itr;
for(itr = v.begin(); itr != v.end(); itr++) {
G4VEnergyLossProcess* p = *itr;
if(p) p->ActivateAugerElectronProduction(val,r);
}
const std::vector<G4VEmProcess*>& w =
theManager->GetEmProcessVector();
std::vector<G4VEmProcess*>::const_iterator itp;
for(itp = w.begin(); itp != w.end(); itp++) {
G4VEmProcess* q = *itp;
if(q) q->ActivateAugerElectronProduction(val,r);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4IonFluctuations.cc,v 1.8 2003/11/12 10:24:18 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4IonFluctuations.cc,v 1.9 2004/05/11 15:35:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -66,7 +66,7 @@ G4IonFluctuations::G4IonFluctuations(const G4String& nam)
theBohrBeta2(50.0*keV/proton_mass_c2),
minFraction(0.2),
xmin(0.2),
minLoss(0.000001*eV)
minLoss(0.001*eV)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -99,13 +99,11 @@ G4double G4IonFluctuations::SampleFluctuations(const G4Material* material,
particle = dp->GetDefinition();
charge = particle->GetPDGCharge()/eplus;
}
particleMass = dp->GetMass();
G4double q = dp->GetCharge()/eplus;
chargeSquare = q*q;
chargeSqRatio = chargeSquare/(charge*charge);
G4double siga = Dispersion(material,dp,tmax,length);
G4double loss = meanLoss;
G4double navr = minNumberInteractionsBohr;
// Gaussian fluctuation
@@ -141,6 +139,7 @@ G4double G4IonFluctuations::SampleFluctuations(const G4Material* material,
G4double n = (G4double)(G4Poisson(navr));
loss = meanLoss*n/navr;
}
// G4cout << "meanLoss= " << meanLoss << " loss= " << loss << G4endl;
return loss;
}
@@ -153,6 +152,11 @@ G4double G4IonFluctuations::Dispersion(
G4double& tmax,
G4double& length)
{
particleMass = dp->GetMass();
G4double q = dp->GetCharge()/eplus;
chargeSquare = q*q;
chargeSqRatio = chargeSquare/(charge*charge);
G4double electronDensity = material->GetElectronDensity();
kineticEnergy = dp->GetKineticEnergy();
// G4cout << "e= " << kineticEnergy << " m= " << particleMass
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4LossTableManager.cc,v 1.42 2004/03/10 11:34:52 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4LossTableManager.cc,v 1.44 2004/05/12 12:25:26 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -364,7 +364,7 @@ void G4LossTableManager::BuildPhysicsTable(const G4ParticleDefinition* aParticle
G4VEnergyLossProcess* em = loss_vector[j];
em->Initialise();
em->SetDEDXTable(hIonisation->DEDXTable());
em->SetRangeTable(hIonisation->RangeTable());
em->SetPreciseRangeTable(hIonisation->PreciseRangeTable());
em->SetRangeTableForLoss(hIonisation->RangeTableForLoss());
em->SetInverseRangeTable(hIonisation->InverseRangeTable());
em->SetLambdaTable(hIonisation->LambdaTable());
@@ -390,7 +390,7 @@ void G4LossTableManager::BuildPhysicsTable(const G4ParticleDefinition* aParticle
tables_are_built[i] = true;
em->Initialise();
em->SetDEDXTable(hIonisation->DEDXTable());
em->SetRangeTable(hIonisation->RangeTable());
em->SetPreciseRangeTable(hIonisation->PreciseRangeTable());
em->SetRangeTableForLoss(hIonisation->RangeTableForLoss());
em->SetInverseRangeTable(hIonisation->InverseRangeTable());
em->SetLambdaTable(hIonisation->LambdaTable());
@@ -479,7 +479,7 @@ void G4LossTableManager::RetrievePhysicsTables(const G4ParticleDefinition* aPart
tables_are_built[j] = true;
em->Initialise();
em->SetDEDXTable(theLoss->DEDXTable());
em->SetRangeTable(theLoss->RangeTable());
em->SetPreciseRangeTable(theLoss->PreciseRangeTable());
em->SetRangeTableForLoss(theLoss->RangeTableForLoss());
em->SetInverseRangeTable(theLoss->InverseRangeTable());
em->SetLambdaTable(theLoss->LambdaTable());
@@ -606,7 +606,7 @@ G4VEnergyLossProcess* G4LossTableManager::BuildTables(const G4ParticleDefinition
}
newlist.clear();
range = tableBuilder->BuildRangeTable(dedxForRange);
em->SetRangeTable(range);
em->SetPreciseRangeTable(range);
delete dedxForRange;
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MscModel.cc,v 1.15 2004/03/10 08:38:39 urban Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4MscModel.cc,v 1.17 2004/04/29 18:40:54 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -56,6 +56,8 @@
// energy dependence calculations has been simplified,
// 11-03-04 corrections in GeomPathLength,TrueStepLength,
// SampleCosineTheta
// 23-04-04 true -> geom and geom -> true transformation has been
// rewritten, changes in the angular distribution (L.Urban)
// Class Description:
//
@@ -114,12 +116,16 @@ void G4MscModel::Initialise(const G4ParticleDefinition* p,
const G4DataVector&)
{
// set values of some data members
xsi = facxsi*2.8215 ;
b = 1. ;
sigmafactor = twopi*classic_electr_radius*classic_electr_radius;
particle = p;
mass = particle->GetPDGMass();
charge = particle->GetPDGCharge()/eplus;
b = 1. ;
if(mass <= electron_mass_c2)
xsi = facxsi*2.22 ;
else
xsi = facxsi*2.70 ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -418,7 +424,8 @@ G4double G4MscModel::GeomPathLength(
currentRadLength = couple->GetMaterial()->GetRadlen();
lambda0 = lambda;
parlowen = 0. ;
par1 = -1. ;
par2 = par3 = 0. ;
tPathLength = truePathLength;
// this correction needed to run MSC with eIoni and eBrem inactivated
@@ -434,9 +441,11 @@ G4double G4MscModel::GeomPathLength(
if (tPathLength < range*dtrl) {
zmean = lambda0*(1.-exp(-tau));
if(tau < taulim) zmean = tPathLength*(1.-0.5*tPathLength/lambda0) ;
} else if((T0 < mass) || (tPathLength > 0.9*range)) {
parlowen = 1.+range/lambda0 ;
zmean = range*(1.-exp(parlowen*log(1.-tPathLength/range)))/parlowen ;
} else if(T0 < mass) {
par1 = 1./range ;
par2 = 1./(par1*lambda0) ;
par3 = 1.+par2 ;
zmean = (1.-exp(par3*log(1.-tPathLength/range)))/(par1*par3) ;
} else {
G4LossTableManager* theManager = G4LossTableManager::Instance();
G4double T1 = theManager->GetEnergy(particle,range-tPathLength,couple);
@@ -447,9 +456,10 @@ G4double G4MscModel::GeomPathLength(
} else {
lambda1 = CrossSection(couple,particle,T1,0.0,1.0);
}
G4double lambdaeff = 2./(1./lambda0+1./lambda1) ;
zmean = lambdaeff*(1.-exp(-tPathLength/lambdaeff));
par1 = (lambda0-lambda1)/(lambda0*tPathLength) ;
par2 = 1./(par1*lambda0) ;
par3 = 1.+par2 ;
zmean = (1.-exp(par3*log(lambda1/lambda0)))/(par1*par3) ;
}
// sample z
@@ -479,85 +489,108 @@ G4double G4MscModel::TrueStepLength(G4double geomStepLength)
trueLength = geomStepLength;
if(geomStepLength > lambda0*tausmall)
{
if(parlowen == 0.)
if(par1 < 0.)
trueLength = -lambda0*log(1.-geomStepLength/lambda0) ;
else
{
if(parlowen*geomStepLength/currentRange < 1.)
trueLength = currentRange*
(1.-exp(log(1.-parlowen*geomStepLength/currentRange)/parlowen)) ;
if(par1*par3*geomStepLength < 1.)
trueLength = (1.-exp(log(1.-par1*par3*geomStepLength)/par3))/par1 ;
else
trueLength = currentRange ;
}
}
if(trueLength > tPathLength) trueLength = tPathLength;
if(trueLength < geomStepLength) trueLength = geomStepLength;
if(trueLength > currentRange) trueLength = currentRange ;
if(trueLength < geomStepLength) trueLength = geomStepLength;
return trueLength;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4MscModel::SampleCosineTheta(G4double trueStepLength, G4double KineticEnergy,
G4double lambda)
G4double G4MscModel::SampleCosineTheta(G4double trueStepLength,
G4double KineticEnergy)
{
currentKinEnergy = sqrt(currentKinEnergy*KineticEnergy) ;
G4double cth = 1. ;
G4double tau = trueStepLength/lambda0 ;
if(trueStepLength < currentRange*dtrl)
currentTau = trueStepLength/lambda;
else
currentTau = 0.5*trueStepLength*(1./lambda0+1./lambda) ;
if(trueStepLength >= currentRange*dtrl)
tau = -par2*log(1.-par1*trueStepLength) ;
currentTau = tau ;
if(trueStepLength < stepmin)
cth = exp(-currentTau) ;
cth = exp(-tau) ;
else
{
if (currentTau > taubig) cth = -1.+2.*G4UniformRand();
else if (currentTau >= tausmall)
if (tau > taubig) cth = -1.+2.*G4UniformRand();
else if (tau >= tausmall)
{
if(currentTau > taubig) cth = -1.+2.*G4UniformRand();
else
{
const G4double c_highland = 13.6*MeV, corr_highland=0.038 ;
const G4double xx0low = 1.e-6;
G4double a ;
// for all particles take the width of the central part
// from the Highland formula
// (Particle Physics Booklet, July 2002, eq. 26.10)
const G4double c_highland = 13.6*MeV, corr_highland=0.038 ;
G4double Q = abs(charge) ;
G4double xx0 = trueStepLength/currentRadLength;
G4double betacp = currentKinEnergy*(currentKinEnergy+2.*mass)/
(currentKinEnergy+mass) ;
G4double betacp = sqrt(currentKinEnergy*(currentKinEnergy+2.*mass)*
KineticEnergy*(KineticEnergy+2.*mass)/
((currentKinEnergy+mass)*(KineticEnergy+mass))) ;
G4double theta0 = c_highland*Q*sqrt(xx0)/betacp ;
if(xx0 > xx0low)
theta0 *= (1.+corr_highland*log(xx0)) ;
else
// protection for small thickness
theta0 *= (1.+corr_highland*log(xx0low)) ;
// correction term
G4double y ;
// for muons/hadron as in Highland's formula
if(mass > electron_mass_c2)
{
y = log(xx0) ;
theta0 *= (1.+corr_highland*y) ;
}
// for e+/e-
else
{
// corr. factor has been modified between xx0low and xx0high
// and below xx0low for e+/e- only ************************
const G4double xx0high = 1., xx0low = 1.e-3 ;
// quadratic corr.factor from Hanson's msc data (Au, 15.7 MeV e)
const G4double corrq1 = 0.01273, corrq2 = -0.006840 ;
const G4double corrlow = 0.05 ; // from some backscattering data
const G4double fach = 1.+corr_highland*log(xx0high),
facl = fach*(1.+log(xx0low/xx0high)*
(corrq1+log(xx0low/xx0high)*corrq2)) ;
if(xx0 >= xx0high)
{
y = log(xx0) ;
theta0 *= (1.+corr_highland*y) ;
}
else if(xx0 >= xx0low)
{
y = log(xx0/xx0high) ;
theta0 *= fach*(1.+y*(corrq1+y*corrq2)) ;
}
else
{
y = log(xx0/xx0low) ;
theta0 *= facl*(1.+corrlow*y) ;
}
}
if (theta0 > taulim) a = 0.5/(1.-cos(theta0)) ;
else a = 1.0/(theta0*theta0) ;
if(theta0 > taulim) a = 0.5/(1.-cos(theta0)) ;
else a = 1.0/(theta0*theta0) ;
G4double xmeanth = exp(-currentTau);
G4double xmeanth = exp(-tau);
G4double xmeanth1 = 1.-xmeanth ;
if(currentTau < taulim) xmeanth1 = currentTau ;
if(currentTau < taulim) xmeanth1 = tau ;
const G4double x1fac1 = exp(-xsi) ;
const G4double x1fac2 = (1.-(1.+xsi)*x1fac1)/(1.-x1fac1) ;
const G4double x1fac3 = 1.3 ; // x1fac3 >= 1. !!!!!!!!!
// exponent c is fixed to 2. in f2(x) now (tail) ~1/(b-x)**2
const G4double wb = 1.-2./xsi ;
const G4double x1fac3 = 1.3 ;
G4double ea,eaa,xmean1 ;
G4double b1 = 2., bx = 2.,
xmean2 = 0. ;
G4double c = 2.,b1 = 2., bx = 2.,
eb1 = b1, ebx = b1, xmean2 = 0. ;
G4double prob = 1., qprob ;
G4double x0 = 1.-xsi/a;
G4double oneminusx0=xsi/a ;
@@ -596,16 +629,21 @@ G4double G4MscModel::SampleCosineTheta(G4double trueStepLength, G4double Kinetic
eaa = 1.-ea ;
xmean1 = 1.-x1fac2/a ;
b = 1.-wb*xsi/a ;
// from continuity of the 1st derivatives
c = a*(b-x0) ;
if(c == 1.) c=1.000001 ;
if(c == 2.) c=2.000001 ;
b1 = b+1. ;
bx = (1.-wb)*xsi/a ;
xmean2 = b-b1*bx*log(b1/bx)/oneplusx0 ;
bx = b-x0 ;
eb1=exp((c-1.)*log(b1)) ;
ebx=exp((c-1.)*log(bx)) ;
xmean2 = (x0*eb1+ebx+(eb1*bx-b1*ebx)/(2.-c))/(eb1-ebx) ;
G4double f1x0 = a*ea/eaa ;
G4double f2x0 ;
f2x0 = b1/(oneplusx0*bx) ;
G4double f2x0 = (c-1.)*eb1*ebx/(eb1-ebx)/
exp(c*log(b-x0)) ;
// from continuity at x=x0
prob = f2x0/(f1x0+f2x0) ;
// from xmean = xmeanth
@@ -625,13 +663,12 @@ G4double G4MscModel::SampleCosineTheta(G4double trueStepLength, G4double Kinetic
if (G4UniformRand() < prob)
cth = 1.+log(ea+G4UniformRand()*eaa)/a ;
else
cth = b-b1*bx/(bx+oneplusx0*G4UniformRand()) ;
cth = b-b1*bx/exp(log(ebx-G4UniformRand()*(ebx-eb1))/(c-1.)) ;
}
else
{
cth = -1.+2.*G4UniformRand();
}
}
}
}
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4MultipleScattering.cc,v 1.46 2003/11/12 16:11:56 urban Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4MultipleScattering.cc,v 1.47 2004/04/23 05:52:08 urban Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -----------------------------------------------------------------------------
// 16/05/01 value of cparm changed , L.Urban
@@ -60,6 +60,7 @@
// method
// 28-03-03 Move to model design (V.Ivanchenko)
// 08-08-03 STD substitute standard (V.Ivanchenko)
// 23-04-04 value of data member dtrl changed from 0.15 to 0.05 (L.Urban)
//
// -----------------------------------------------------------------------------
//
@@ -75,7 +76,7 @@ G4MultipleScattering::G4MultipleScattering(const G4String& processName)
: G4VMultipleScattering(processName),
totBins(120),
facrange(0.199),
dtrl(0.15),
dtrl(0.05),
NuclCorrPar (0.0615),
FactPar(0.40),
facxsi(1.0),
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4UniversalFluctuation.cc,v 1.15 2004/02/06 11:59:21 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// $Id: G4UniversalFluctuation.cc,v 1.20 2004/05/11 15:35:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -42,6 +42,7 @@
// 16-10-03 Changed interface to Initialisation (V.Ivanchenko)
// 07-11-03 Fix problem of rounding of double in G4UniversalFluctuations
// 06-02-04 Add control on big sigma > 2*meanLoss (V.Ivanchenko)
// 26-04-04 Comment out the case of very small step (V.Ivanchenko)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -61,14 +62,13 @@ G4UniversalFluctuation::G4UniversalFluctuation(const G4String& nam)
particle(0),
minNumberInteractionsBohr(10.0),
theBohrBeta2(50.0*keV/proton_mass_c2),
minLoss(0.000001*eV),
problim(0.01),
minLoss(0.001*eV),
sumalim(0.01),
alim(10.),
nmaxCont1(4.),
nmaxCont2(16.)
{
lastMaterial = 0;
sumalim = -log(problim);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -97,46 +97,48 @@ G4double G4UniversalFluctuation::SampleFluctuations(const G4Material* material,
// calculate actual loss from the mean loss
// The model used to get the fluctuation is essentially the same
// as in Glandz in Geant3.
// shortcut for very very small loss
// G4cout << "### Mean loss= " << meanLoss << G4endl;
// shortcut for very very small loss
if(meanLoss < minLoss) return meanLoss;
if(dp->GetDefinition() != particle) {
particleMass = dp->GetMass();
G4double q = dp->GetCharge();
chargeSquare = q*q;
}
if(!particle) InitialiseMe(dp->GetDefinition());
ipotFluct = material->GetIonisation()->GetMeanExcitationEnergy();
G4double gam = (dp->GetKineticEnergy())/particleMass + 1.0;
G4double gam2 = gam*gam;
G4double beta2 = 1.0 - 1.0/gam2;
G4double tau = dp->GetKineticEnergy()/particleMass;
G4double gam = tau + 1.0;
G4double gam2 = gam*gam;
G4double beta2 = tau*(tau + 2.0)/gam2;
// Validity range for delta electron cross section
G4double loss, siga;
// G4cout << "### tmax= " << tmax << " kappa= " << minNumberInteractionsBohr << " l= " << length << G4endl;
// Gaussian fluctuation
// G4cout << "tmax= " << tmax << " kappa= " << minNumberInteractionsBohr << " l= " << length << G4endl;
// Gaussian fluctuation
if(meanLoss >= minNumberInteractionsBohr*tmax || tmax <= ipotFluct*minNumberInteractionsBohr)
{
electronDensity = material->GetElectronDensity();
siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
* electronDensity * chargeSquare ;
siga = sqrt(siga);
G4double twomeanLoss = meanLoss + meanLoss;
if(twomeanLoss < siga) {
loss = twomeanLoss*G4UniformRand();
G4double x;
do {
loss = twomeanLoss*G4UniformRand();
x = (loss - meanLoss)/siga;
} while (1.0 - 0.5*x*x < G4UniformRand());
} else {
do {
loss = G4RandGauss::shoot(meanLoss,siga);
} while (loss < 0. || loss > twomeanLoss);
}
// G4cout << "de= " << meanLoss << " fluc= " << loss-meanLoss << " sig= " << siga << G4endl;
//G4cout << "### meanLoss= " << meanLoss << " fluc= " << loss-meanLoss << " sig= " << siga << G4endl;
return loss;
}
// Non Gaussian fluctuation
// Non Gaussian fluctuation
if(material != lastMaterial) {
f1Fluct = material->GetIonisation()->GetF1fluct();
@@ -153,7 +155,7 @@ G4double G4UniversalFluctuation::SampleFluctuations(const G4Material* material,
G4double p1,p2,p3;
G4double w1 = tmax/ipotFluct;
G4double w2 = log(2.*electron_mass_c2*(gam2 - 1.0));
G4double w2 = log(2.*electron_mass_c2*beta2*gam2);
G4double C = meanLoss*(1.-rateFluct)/(w2-ipotLogFluct-beta2);
@@ -165,11 +167,11 @@ G4double G4UniversalFluctuation::SampleFluctuations(const G4Material* material,
if(a3 < 0.) a3 = 0.;
G4double suma = a1+a2+a3;
loss = 0. ;
if(suma < sumalim) // very small Step
{
//G4cout << "A very small step" << G4endl;
G4double e0 = material->GetIonisation()->GetEnergy0fluct();
if(tmax == ipotFluct)
@@ -209,11 +211,12 @@ G4double G4UniversalFluctuation::SampleFluctuations(const G4Material* material,
for(G4int i=0; i<ip3; i++) {
loss += 1./(1.-w*G4UniformRand()) ;
}
loss *= e0*corrfac ;
}
loss *= e0*corrfac ;
}
}
// Not so small Step
} else {
} else {
//G4cout << "Excitation alim= " << alim << " a1= " << a1 << " a2= " << a2 << G4endl;
// excitation type 1
if(a1>alim) {
siga=sqrt(a1) ;
@@ -232,12 +235,12 @@ G4double G4UniversalFluctuation::SampleFluctuations(const G4Material* material,
// smearing to avoid unphysical peaks
if(p2 > 0.)
loss += (1.-2.*G4UniformRand())*e2Fluct;
loss += (1.-2.*G4UniformRand())*e2Fluct;
else if (loss>0.)
loss += (1.-2.*G4UniformRand())*e1Fluct;
if(loss < 0.) loss = 0.0;
// ionisation .......................................
// ionisation
if(a3 > 0.) {
if(a3>alim) {
siga=sqrt(a3) ;
@@ -265,7 +268,7 @@ G4double G4UniversalFluctuation::SampleFluctuations(const G4Material* material,
if (p3 > na) {
w2 = alfa*ipotFluct;
G4double w = (tmax-w2)/tmax;
G4double w = (tmax-w2)/tmax;
G4int nb = G4int(p3-na);
for (G4int k=0; k<nb; k++) {
lossc += w2/(1.-w*G4UniformRand());
@@ -274,25 +277,27 @@ G4double G4UniversalFluctuation::SampleFluctuations(const G4Material* material,
}
loss += lossc;
}
}
}
//G4cout << "### Final loss= " << loss << G4endl;
return loss;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4UniversalFluctuation::Dispersion(
const G4Material* material,
G4double G4UniversalFluctuation::Dispersion(
const G4Material* material,
const G4DynamicParticle* dp,
G4double& tmax,
G4double& tmax,
G4double& length)
{
if(!particle) InitialiseMe(dp->GetDefinition());
electronDensity = material->GetElectronDensity();
G4double gam = (dp->GetKineticEnergy())/particleMass + 1.0;
G4double gam = (dp->GetKineticEnergy())/particleMass + 1.0;
G4double beta2 = 1.0 - 1.0/(gam*gam);
G4double siga = (1.0/beta2 - 0.5) * twopi_mc2_rcl2 * tmax * length
* electronDensity * chargeSquare;
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VEmProcess.cc,v 1.4 2004/03/01 13:06:26 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4VEmProcess.cc,v 1.5 2004/05/17 09:46:57 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -71,10 +71,14 @@
G4VEmProcess::G4VEmProcess(const G4String& name, G4ProcessType type):
G4VRestDiscreteProcess(name, type),
theLambdaTable(0),
theEnergyOfCrossSectionMax(0),
theCrossSectionMax(0),
particle(0),
secondaryParticle(0),
currentCouple(0),
nLambdaBins(90),
lambdaFactor(0.1),
mfpKinEnergy(0.0),
integral(true),
meanFreePath(true)
{
@@ -91,7 +95,8 @@ G4VEmProcess::G4VEmProcess(const G4String& name, G4ProcessType type):
G4VEmProcess::~G4VEmProcess()
{
if(theLambdaTable) theLambdaTable->clearAndDestroy();
theLambdaTable = 0;
if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax;
if(theCrossSectionMax) delete [] theCrossSectionMax;
modelManager->Clear();
delete modelManager;
(G4LossTableManager::Instance())->DeRegister(this);
@@ -102,6 +107,8 @@ G4VEmProcess::~G4VEmProcess()
void G4VEmProcess::Initialise()
{
if(theLambdaTable) theLambdaTable->clearAndDestroy();
if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax;
if(theCrossSectionMax) delete [] theCrossSectionMax;
theLambdaTable = 0;
modelManager->Clear();
theCuts = modelManager->Initialise(particle,secondaryParticle,2.,verboseLevel);
@@ -163,6 +170,8 @@ G4PhysicsTable* G4VEmProcess::BuildLambdaTable()
size_t numOfCouples = theCoupleTable->GetTableSize();
G4PhysicsTable* theTable = new G4PhysicsTable(numOfCouples);
theEnergyOfCrossSectionMax = new G4double [numOfCouples];
theCrossSectionMax = new G4double [numOfCouples];
for(size_t i=0; i<numOfCouples; i++) {
@@ -171,6 +180,20 @@ G4PhysicsTable* G4VEmProcess::BuildLambdaTable()
G4PhysicsVector* aVector = LambdaPhysicsVector(couple);
modelManager->FillLambdaVector(aVector, couple);
G4double e, s, emax = 0.0;
G4bool b;
G4double smax = 0.0;
for (G4int j=0; j<nLambdaBins; j++) {
e = aVector->GetLowEdgeEnergy(j);
s = aVector->GetValue(e,b);
if(s > smax) {
smax = s;
emax = e;
}
}
theEnergyOfCrossSectionMax[i] = emax;
theCrossSectionMax[i] = smax;
// Insert vector for this material into the table
theTable->insert(aVector) ;
}
@@ -228,12 +251,8 @@ G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
// Integral approach
if (integral) {
G4bool b;
G4double postStepLambda =
(((*theLambdaTable)[currentMaterialIndex])->GetValue(finalT,b));
if(preStepLambda*G4UniformRand() > postStepLambda)
return G4VRestDiscreteProcess::PostStepDoIt(track,step);
if(preStepLambda*G4UniformRand() > GetLambda(finalT))
return G4VRestDiscreteProcess::PostStepDoIt(track,step);
}
G4VEmModel* currentModel = SelectModel(finalT);
@@ -399,4 +418,58 @@ G4bool G4VEmProcess::RetrievePhysicsTable(G4ParticleDefinition* part,
return yes;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEmProcess::SetLambdaBinning(G4int nbins)
{
nLambdaBins = nbins;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEmProcess::SetMinKinEnergy(G4double e)
{
minKinEnergy = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4VEmProcess::MinKinEnergy() const
{
return minKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEmProcess::SetMaxKinEnergy(G4double e)
{
maxKinEnergy = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4VEmProcess::MaxKinEnergy() const
{
return maxKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEmProcess::ActivateFluorescence(G4bool, const G4Region*)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEmProcess::ActivateAugerElectronProduction(G4bool, const G4Region*)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEmProcess::SetLambdaFactor(G4double val)
{
if(val > 0.0 && val <= 1.0) lambdaFactor = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VEnergyLossProcess.cc,v 1.10 2004/03/12 11:42:57 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4VEnergyLossProcess.cc,v 1.22 2004/05/17 09:46:57 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -70,6 +70,8 @@
// 27-02-04 Fix problem of loss in low presure gases, cleanup precise range
// calculation, use functions ForLoss in AlongStepDoIt (V.Ivanchenko)
// 10-03-04 Fix a problem of Precise Range table (V.Ivanchenko)
// 19-03-04 Fix a problem energy below lowestKinEnergy (V.Ivanchenko)
// 31-03-04 Fix a problem of retrieve tables (V.Ivanchenko)
//
// Class Description:
//
@@ -96,6 +98,7 @@
#include "G4VParticleChange.hh"
#include "G4Gamma.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4Proton.hh"
#include "G4VSubCutoffProcessor.hh"
#include "G4ProcessManager.hh"
@@ -120,6 +123,8 @@ G4VEnergyLossProcess::G4VEnergyLossProcess(const G4String& name, G4ProcessType t
theSubLambdaTable(0),
theDEDXAtMaxEnergy(0),
theRangeAtMaxEnergy(0),
theEnergyOfCrossSectionMax(0),
theCrossSectionMax(0),
particle(0),
baseParticle(0),
secondaryParticle(0),
@@ -131,6 +136,8 @@ G4VEnergyLossProcess::G4VEnergyLossProcess(const G4String& name, G4ProcessType t
minSubRange(0.1),
defaultRoverRange(0.2),
defaultIntegralRange(1.0),
lambdaFactor(0.1),
mfpKinEnergy(0.0),
lossFluctuationFlag(true),
rndmStepFlag(false),
hasRestProcess(true),
@@ -192,9 +199,11 @@ void G4VEnergyLossProcess::Clear()
if(theInverseRangeTable) theInverseRangeTable->clearAndDestroy();
if(theLambdaTable) theLambdaTable->clearAndDestroy();
if(theSubLambdaTable) theSubLambdaTable->clearAndDestroy();
if(theDEDXAtMaxEnergy) delete [] theDEDXAtMaxEnergy;
if(theRangeAtMaxEnergy) delete [] theRangeAtMaxEnergy;
}
if(theDEDXAtMaxEnergy) delete [] theDEDXAtMaxEnergy;
if(theRangeAtMaxEnergy) delete [] theRangeAtMaxEnergy;
if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax;
if(theCrossSectionMax) delete [] theCrossSectionMax;
theDEDXTable = 0;
thePreciseRangeTable = 0;
@@ -205,6 +214,8 @@ void G4VEnergyLossProcess::Clear()
theSubLambdaTable = 0;
theDEDXAtMaxEnergy = 0;
theRangeAtMaxEnergy = 0;
theEnergyOfCrossSectionMax = 0,
theCrossSectionMax = 0,
tablesAreBuilt = false;
}
@@ -286,6 +297,7 @@ void G4VEnergyLossProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
{
currentCouple = 0;
preStepLambda = 0.0;
preStepMFP = DBL_MAX;
if(0 < verboseLevel) {
G4cout << "========================================================" << G4endl;
G4cout << "### G4VEnergyLossProcess::BuildPhysicsTable() for "
@@ -333,30 +345,6 @@ void G4VEnergyLossProcess::BuildPhysicsTable(const G4ParticleDefinition& part)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetParticles(const G4ParticleDefinition* p1,
const G4ParticleDefinition* p2)
{
particle = p1;
baseParticle = p2;
G4bool yes = true;
if(particle && baseParticle) {
if((particle->GetPDGMass() < MeV && baseParticle->GetPDGMass() > MeV) ||
(particle->GetPDGMass() > MeV && baseParticle->GetPDGMass() < MeV)) yes = false;
}
if(!yes) {
G4cout << "Warning in G4VEnergyLossProcess::SetParticle: "
<< particle->GetParticleName()
<< " losses cannot be obtained from "
<< baseParticle->GetParticleName()
<< " losses" << G4endl;
} else {
DefineBaseParticle(p1);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p, G4VEmFluctuationModel* fluc,
const G4Region* region)
{
@@ -373,10 +361,11 @@ void G4VEnergyLossProcess::UpdateEmModel(const G4String& nam, G4double emin, G4d
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::AddSubCutoffProcessor(G4VSubCutoffProcessor* p,
const G4Region* r)
const G4Region* r)
{
if( !p ) {
G4cout << "G4VEnergyLossProcess::AddSubCutoffProcessor WARNING: no SubCutoffProcessor defined." << G4endl;
G4cout << "G4VEnergyLossProcess::AddSubCutoffProcessor WARNING: no SubCutoffProcessor defined."
<< G4endl;
return;
}
G4RegionStore* regionStore = G4RegionStore::GetInstance();
@@ -594,7 +583,6 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
// Get the actual (true) Step length
G4double length = step.GetStepLength();
G4double eloss = 0.0;
// G4bool b;
/*
if(-1 < verboseLevel) {
@@ -620,24 +608,18 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
// Long step
} else {
G4double x = (GetRangeForLoss(preStepKinEnergy) - length)/reduceFactor;
G4double postStepScaledEnergy = GetKineticEnergyForLoss(x);
if (preStepScaledEnergy > postStepScaledEnergy)
eloss = (preStepScaledEnergy - postStepScaledEnergy)/massRatio;
else
eloss = GetDEDXForLoss(preStepKinEnergy)*length;
G4double r = GetRangeForLoss(preStepKinEnergy)/reduceFactor;
G4double x = r - length/reduceFactor;
eloss = (ScaledKinEnergyForLoss(r) - ScaledKinEnergyForLoss(x))/massRatio;
/*
if(-1 < verboseLevel) {
G4bool b;
G4cout << "fRange(mm)= " << fRange/mm
<< " xPost(mm)= " << x/mm
G4cout << "rPre(mm)= " << r/mm
<< " rPost(mm)= " << x/mm
<< " ePre(MeV)= " << preStepScaledEnergy/MeV
<< " ePost(MeV)= " << postStepScaledEnergy/MeV
<< " eloss(MeV)= " << eloss/MeV
<< " eloss0(MeV)= " << (((*theDEDXTable)[currentMaterialIndex])->
GetValue(preStepScaledEnergy, b))*length*chargeSqRatio
<< " eloss0(MeV)= " << GetDEDXForLoss(preStepKinEnergy)*length/MeV
<< G4endl;
}
*/
@@ -654,17 +636,12 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
G4bool b;
//G4cout << *theDEDXTable << G4endl;
G4cout << "eloss(MeV)= " << eloss/MeV
<< " eloss0(MeV)= " << (((*theDEDXTable)[currentMaterialIndex])->
GetValue(preStepScaledEnergy, b))*length*chargeSqRatio
<< " r0(mm)= " << (((*theRangeTableForLoss)[currentMaterialIndex])->
GetValue(preStepScaledEnergy, b))
<< " eloss0(MeV)= " << GetDEDXForLoss(preStepKinEnergy)*length
<< " r0(mm)= " << GetRangeForLoss(preStepKinEnergy)
<< " tmax= " << tmax
<< " e-eloss= " << preStepKinEnergy-eloss
// << " mat= " << currentMaterial
// << " matIdx= " << currentMaterialIndex
// << " preCouple= " << (step.GetPreStepPoint())->GetMaterialCutsCouple()
// << " postCouple= " << (step.GetPostStepPoint())->GetMaterialCutsCouple()
// << " rangeTable= " << theRangeTableForLoss
<< G4endl;
}
*/
@@ -687,6 +664,21 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
}
*/
G4double finalT = preStepKinEnergy - eloss;
if (finalT <= lowestKinEnergy) {
finalT = 0.0;
if (hasRestProcess) fParticleChange.SetStatusChange(fStopButAlive);
else fParticleChange.SetStatusChange(fStopAndKill);
}
eloss = preStepKinEnergy-finalT;
fParticleChange.SetProposedKineticEnergy(finalT);
// Subcutoff and/or deexcitation
std::vector<G4Track*>* newp =
SecondariesAlongStep(step, tmax, eloss, preStepScaledEnergy);
@@ -702,36 +694,26 @@ G4VParticleChange* G4VEnergyLossProcess::AlongStepDoIt(const G4Track& track,
t = (*newp)[i];
e = t->GetKineticEnergy();
const G4ParticleDefinition* pd = t->GetDefinition();
if (pd != G4Gamma::Gamma() && pd != G4Electron::Electron() ) e += pd->GetPDGMass();
if (pd != G4Positron::Positron() ) e += electron_mass_c2;
if (e > eloss) e = eloss;
preStepKinEnergy -= e;
eloss -= e;
pParticleChange->AddSecondary(t);
}
}
delete newp;
}
preStepKinEnergy -= eloss;
/*
if(-1 < verboseLevel) {
G4cout << "eloss(MeV)= " << eloss/MeV
G4cout << "Final value eloss(MeV)= " << eloss/MeV
<< " preStepKinEnergy= " << preStepKinEnergy
<< " postStepKinEnergy= " << finalT
<< " lossFlag= " << lossFluctuationFlag
<< G4endl;
}
*/
if (preStepKinEnergy <= lowestKinEnergy) {
eloss += preStepKinEnergy;
preStepKinEnergy = 0.0;
if (hasRestProcess) fParticleChange.SetStatusChange(fStopButAlive);
else fParticleChange.SetStatusChange(fStopAndKill);
}
fParticleChange.SetProposedKineticEnergy(preStepKinEnergy);
fParticleChange.SetLocalEnergyDeposit(eloss);
return &fParticleChange;
@@ -748,11 +730,7 @@ G4VParticleChange* G4VEnergyLossProcess::PostStepDoIt(const G4Track& track,
// Integral approach
if (integral) {
G4bool b;
G4double postStepLambda = chargeSqRatio*
(((*theLambdaTable)[currentMaterialIndex])->GetValue(postStepScaledEnergy,b));
if(preStepLambda*G4UniformRand() > postStepLambda)
if(preStepLambda*G4UniformRand() > GetLambda(postStepScaledEnergy))
return G4VContinuousDiscreteProcess::PostStepDoIt(track,step);
}
@@ -837,15 +815,15 @@ void G4VEnergyLossProcess::PrintInfoDefinition()
void G4VEnergyLossProcess::SetDEDXTable(G4PhysicsTable* p)
{
if(theDEDXTable) theDEDXTable->clearAndDestroy();
if(theDEDXTable && !baseParticle) theDEDXTable->clearAndDestroy();
theDEDXTable = p;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetRangeTable(G4PhysicsTable* p)
void G4VEnergyLossProcess::SetPreciseRangeTable(G4PhysicsTable* p)
{
if(thePreciseRangeTable) thePreciseRangeTable->clearAndDestroy();
if(thePreciseRangeTable && !baseParticle) thePreciseRangeTable->clearAndDestroy();
if(theDEDXAtMaxEnergy) delete [] theDEDXAtMaxEnergy;
if(theRangeAtMaxEnergy) delete [] theRangeAtMaxEnergy;
@@ -853,7 +831,8 @@ void G4VEnergyLossProcess::SetRangeTable(G4PhysicsTable* p)
if(p) {
size_t n = p->length();
G4PhysicsVector* pv = (*p)[0];
G4double emax = pv->GetLowEdgeEnergy(pv->GetVectorLength());
// G4double emax = pv->GetLowEdgeEnergy(pv->GetVectorLength());
G4double emax = maxKinEnergyForRange;
G4bool b;
theDEDXAtMaxEnergy = new G4double [n];
theRangeAtMaxEnergy = new G4double [n];
@@ -874,7 +853,7 @@ void G4VEnergyLossProcess::SetRangeTable(G4PhysicsTable* p)
void G4VEnergyLossProcess::SetRangeTableForLoss(G4PhysicsTable* p)
{
if(theRangeTableForLoss) theRangeTableForLoss->clearAndDestroy();
if(theRangeTableForLoss && !baseParticle) theRangeTableForLoss->clearAndDestroy();
theRangeTableForLoss = p;
}
@@ -889,7 +868,7 @@ void G4VEnergyLossProcess::SetSecondaryRangeTable(G4PhysicsTable* p)
void G4VEnergyLossProcess::SetInverseRangeTable(G4PhysicsTable* p)
{
if(theInverseRangeTable) theInverseRangeTable->clearAndDestroy();
if(theInverseRangeTable && !baseParticle) theInverseRangeTable->clearAndDestroy();
theInverseRangeTable = p;
}
@@ -897,16 +876,46 @@ void G4VEnergyLossProcess::SetInverseRangeTable(G4PhysicsTable* p)
void G4VEnergyLossProcess::SetLambdaTable(G4PhysicsTable* p)
{
if(theLambdaTable) theLambdaTable->clearAndDestroy();
if(theLambdaTable && !baseParticle) theLambdaTable->clearAndDestroy();
theLambdaTable = p;
tablesAreBuilt = true;
if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax;
if(theCrossSectionMax) delete [] theCrossSectionMax;
if(p) {
size_t n = p->length();
G4PhysicsVector* pv = (*p)[0];
size_t nb = pv->GetVectorLength();
G4double emax = pv->GetLowEdgeEnergy(nb);
G4double e, s, smax = 0.0;
theEnergyOfCrossSectionMax = new G4double [n];
theCrossSectionMax = new G4double [n];
G4bool b;
for (size_t i=0; i<n; i++) {
pv = (*p)[i];
smax = 0.0;
for (size_t j=0; j<nb; j++) {
e = pv->GetLowEdgeEnergy(j);
s = pv->GetValue(e,b);
if(s > smax) {
smax = s;
emax = e;
}
}
theEnergyOfCrossSectionMax[i] = emax;
theCrossSectionMax[i] = smax;
// G4cout << "i= " << i << " e2(MeV)= " << emax/MeV
// << " lambda= " << smax << G4endl;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetSubLambdaTable(G4PhysicsTable* p)
{
if(theSubLambdaTable) theSubLambdaTable->clearAndDestroy();
if(theSubLambdaTable && !baseParticle) theSubLambdaTable->clearAndDestroy();
theSubLambdaTable = p;
if (nSCoffRegions) {
for (G4int i=0; i<nSCoffRegions; i++) {
@@ -1195,7 +1204,7 @@ G4bool G4VEnergyLossProcess::RetrievePhysicsTable(G4ParticleDefinition* part,
yes = table->ExistPhysicsTable(filename);
if(yes) yes = table->RetrievePhysicsTable(filename,ascii);
if(yes) {
SetRangeTable(table);
SetPreciseRangeTable(table);
if (-1 < verboseLevel) {
G4cout << "Precise Range table for " << particleName << " is retrieved from <"
<< filename << ">"
@@ -1203,11 +1212,8 @@ G4bool G4VEnergyLossProcess::RetrievePhysicsTable(G4ParticleDefinition* part,
}
} else {
table->clearAndDestroy();
if(fpi) {
res = false;
G4cout << "Precise Range table for loss for " << particleName << " does not exist"
<< G4endl;
}
G4cout << "Precise Range table for loss for " << particleName << " does not exist"
<< G4endl;
}
filename = GetPhysicsTableFileName(part,directory,"InverseRange",ascii);
@@ -1275,8 +1281,8 @@ G4bool G4VEnergyLossProcess::RetrievePhysicsTable(G4ParticleDefinition* part,
}
if(res) PrintInfoDefinition();
else {
G4cout << "### BuildPhysicsTable will be requested for " << GetProcessName()
<< " for " << particleName << G4endl;
G4cout << "### BuildPhysicsTable will be requested for " << GetProcessName()
<< " for " << particleName << G4endl;
}
}
tablesAreBuilt = true;
@@ -1287,6 +1293,135 @@ G4bool G4VEnergyLossProcess::RetrievePhysicsTable(G4ParticleDefinition* part,
return res;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetLinearLossLimit(G4double val)
{
linLossLimit = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)
{
lossFluctuationFlag = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetSubCutoff(G4bool)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetRandomStep(G4bool val)
{
rndmStepFlag = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetMinSubRange(G4double val)
{
minSubRange = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool G4VEnergyLossProcess::TablesAreBuilt() const
{
return tablesAreBuilt;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const
{
return nSCoffRegions;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const G4ParticleDefinition* G4VEnergyLossProcess::DefineBaseParticle(
const G4ParticleDefinition*)
{
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins)
{
nDEDXBins = nbins;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetDEDXBinningForPreciseRange(G4int nbins)
{
nDEDXBinsForRange = nbins;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins)
{
nLambdaBins = nbins;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4VEnergyLossProcess::MinKinEnergy() const
{
return minKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetMinKinEnergy(G4double e)
{
minKinEnergy = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e)
{
maxKinEnergy = e;
if(e < maxKinEnergyForRange) maxKinEnergyForRange = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetMaxKinEnergyForPreciseRange(G4double e)
{
maxKinEnergyForRange = e;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4VEnergyLossProcess::MaxKinEnergy() const
{
return maxKinEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::ActivateFluorescence(G4bool, const G4Region*)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::ActivateAugerElectronProduction(G4bool, const G4Region*)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4VEnergyLossProcess::SetLambdaFactor(G4double val)
{
if(val > 0.0 && val <= 1.0) lambdaFactor = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -20,8 +20,8 @@
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: G4VMultipleScattering.cc,v 1.22 2004/03/01 12:17:07 urban Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: G4VMultipleScattering.cc,v 1.23 2004/04/23 05:52:07 urban Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
// -------------------------------------------------------------------
//
@@ -42,6 +42,7 @@
// 03-11-03 Fix initialisation problem in RetrievePhysicsTable (V.Ivanchenko)
// 04-11-03 Update PrintInfoDefinition (V.Ivanchenko)
// 01-03-04 SampleCosineTheta signature changed
// 22-04-04 SampleCosineTheta signature changed back to original
//
// Class Description:
//
@@ -180,12 +181,8 @@ G4VParticleChange* G4VMultipleScattering::PostStepDoIt(const G4Track& track,
G4double kineticEnergy = track.GetKineticEnergy();
G4double truestep = step.GetStepLength();
G4double lambda = GetLambda(track.GetDynamicParticle()->GetDefinition(),
kineticEnergy) ;
if (kineticEnergy > 0.0) {
G4double cth = currentModel->SampleCosineTheta(truestep,kineticEnergy,lambda);
G4double cth = currentModel->SampleCosineTheta(truestep,kineticEnergy);
G4double sth = sqrt(1.-cth*cth);
G4double phi = twopi*G4UniformRand();
G4double dirx = sth*cos(phi);
@@ -206,8 +203,6 @@ G4VParticleChange* G4VMultipleScattering::PostStepDoIt(const G4Track& track,
}
*/
// G4cout << "PostStep: sth= " << sth << " trueLength= " << truestep << " tLast= " << truePathLength << G4endl;
if (latDisplasment) {
G4double safety = step.GetPostStepPoint()->GetSafety();
@@ -215,8 +210,6 @@ G4VParticleChange* G4VMultipleScattering::PostStepDoIt(const G4Track& track,
G4double r = currentModel->SampleDisplacement();
if (r > safety) r = safety;
// G4cout << "r= " << r << " safety= " << safety << G4endl;
// sample direction of lateral displacement
G4double phi = twopi*G4UniformRand();
G4double dirx = cos(phi);
+8 -2
View File
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.16 2003/11/24 12:54:22 gcosmo Exp $
# $Id: GNUmakefile,v 1.19 2004/06/01 05:37:34 hpw Exp $
# ----------------------------------------------------------------
# GNUmakefile for hadronic processes library. G.Folger 10-Dec-97.
# ----------------------------------------------------------------
@@ -12,6 +12,7 @@ SUBDIRS += cross_sections
SUBDIRS += stopping
SUBDIRS += models/abrasion
SUBDIRS += models/binary_cascade
SUBDIRS += models/cascade/evaporation
SUBDIRS += models/cascade/utils
@@ -28,6 +29,8 @@ SUBDIRS += models/de_excitation/management
SUBDIRS += models/de_excitation/multifragmentation
SUBDIRS += models/de_excitation/photon_evaporation
SUBDIRS += models/de_excitation/util
SUBDIRS += models/de_excitation/ablation
SUBDIRS += models/em_dissociation
SUBDIRS += models/high_energy
SUBDIRS += models/im_r_matrix
SUBDIRS += models/isotope_production
@@ -45,7 +48,8 @@ SUBDIRS += models/radioactive_decay
SUBDIRS += models/theo_high_energy
SUBDIRS += models/util
SUBLIBS = G4hadronic_xsect
SUBLIBS = G4hadronic_abrasion
SUBLIBS += G4hadronic_xsect
SUBLIBS += G4hadronic_mgt
SUBLIBS += G4hadronic_proc
SUBLIBS += G4hadronic_stop
@@ -76,6 +80,8 @@ SUBLIBS += G4hadronic_deex_management
SUBLIBS += G4hadronic_deex_multifragmentation
SUBLIBS += G4hadronic_deex_photon_evaporation
SUBLIBS += G4hadronic_deex_util
SUBLIBS += G4hadronic_ablation
SUBLIBS += G4hadronic_em_dissociation
SUBLIBS += G4had_preequ_exciton
SUBLIBS += G4had_muon_nuclear
SUBLIBS += G4had_string_diff
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.4 2003/11/01 16:18:27 hpw Exp $
# $Id: GNUmakefile,v 1.5 2004/05/27 11:08:05 flei Exp $
# ----------------------------------------------------------------
# GNUmakefile for hadronic management library. G.Folger 10-Dec-97
# ----------------------------------------------------------------
@@ -25,6 +25,7 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/particles/hadrons/ions/include \
-I$(G4BASE)/processes/management/include \
-I$(G4BASE)/processes/hadronic/util/include \
-I$(G4BASE)/processes/hadronic/models/util/include \
-I$(G4BASE)/materials/include
include $(G4INSTALL)/config/common.gmk
@@ -0,0 +1,103 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4EMDissociationCrossSection_h
#define G4EMDissociationCrossSection_h 1
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4EMDissociationCrossSection.hh
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 17 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "G4VCrossSectionDataSet.hh"
#include "G4DynamicParticle.hh"
#include "G4Element.hh"
#include "G4ParticleDefinition.hh"
#include "G4EMDissociationSpectrum.hh"
#include "G4PhysicsFreeVector.hh"
#include "globals.hh"
////////////////////////////////////////////////////////////////////////////////
//
class G4EMDissociationCrossSection : public G4VCrossSectionDataSet
{
public:
G4EMDissociationCrossSection ();
~G4EMDissociationCrossSection ();
virtual G4bool IsApplicable (const G4DynamicParticle *, const G4Element *);
virtual G4double GetCrossSection (const G4DynamicParticle *,
const G4Element *, G4double);
G4PhysicsFreeVector *GetCrossSectionForProjectile
(G4double, G4double, G4double, G4double, G4double, G4double);
G4PhysicsFreeVector *GetCrossSectionForTarget
(G4double, G4double, G4double, G4double, G4double, G4double);
G4double GetWilsonProbabilityForProtonDissociation
(G4double, G4double);
virtual void BuildPhysicsTable (const G4ParticleDefinition &)
{}
virtual void DumpPhysicsTable (const G4ParticleDefinition &)
{G4cout << "G4EMDissociationCrossSection: uses formula" <<G4endl;}
private:
private:
G4EMDissociationSpectrum *thePhotonSpectrum;
G4double r0;
G4double J;
G4double Qprime;
G4double epsilon;
G4double xd;
};
////////////////////////////////////////////////////////////////////////////////
//
#endif
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4EMDissociationSpectrum_h
#define G4EMDissociationSpectrum_h 1
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4EMDissociationSpectrum.hh
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "G4Bessel.hh"
#include "globals.hh"
////////////////////////////////////////////////////////////////////////////////
//
class G4EMDissociationSpectrum
{
public:
G4EMDissociationSpectrum ();
~G4EMDissociationSpectrum ();
G4double GetGeneralE1Spectrum (G4double, G4double, G4double);
G4double GetGeneralE2Spectrum (G4double, G4double, G4double);
G4double GetClosestApproach
(const G4double, const G4double, G4double, G4double, G4double);
private:
G4Bessel *bessel;
};
////////////////////////////////////////////////////////////////////////////////
//
#endif
@@ -0,0 +1,109 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4GeneralSpaceNNCrossSection_h
#define G4GeneralSpaceNNCrossSection_h
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4TESAGeneralNNCrossSection.hh
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// 4 June 2004, J.P. Wellisch, CERN
// trivial porting issue to windows.
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// Class Description
//
//
// Class Description - End
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "G4VCrossSectionDataSet.hh"
#include "G4ProtonInelasticCrossSection.hh"
#include <iostream>
#include "G4IonProtonCrossSection.hh"
#include "G4TripathiLightCrossSection.hh"
#include "G4TripathiCrossSection.hh"
#include "G4IonsShenCrossSection.hh"
#include "globals.hh"
////////////////////////////////////////////////////////////////////////////////
//
class G4GeneralSpaceNNCrossSection : public G4VCrossSectionDataSet
{
public:
G4GeneralSpaceNNCrossSection ();
~G4GeneralSpaceNNCrossSection ();
virtual G4bool IsApplicable(const G4DynamicParticle* theProjectile,
const G4Element* theTarget);
virtual G4double GetCrossSection(const G4DynamicParticle* theProjectile,
const G4Element* theTarget, G4double theTemperature);
virtual void BuildPhysicsTable(const G4ParticleDefinition&)
{;}
virtual void DumpPhysicsTable(const G4ParticleDefinition&)
{G4cout << "G4GeneralSpaceNNCrossSection: uses formula"<<G4endl;}
private:
G4ProtonInelasticCrossSection *protonInelastic;
G4IonProtonCrossSection *ionProton;
G4TripathiLightCrossSection *TripathiLight;
G4TripathiCrossSection *TripathiGeneral;
G4IonsShenCrossSection *Shen;
};
////////////////////////////////////////////////////////////////////////////////
//
#endif
@@ -52,7 +52,7 @@ class G4IonProtonCrossSection : public G4VCrossSectionDataSet
virtual
G4double GetCrossSection(const G4DynamicParticle* aPart,
const G4Element*anEle, G4double aTemperature)
const G4Element*, G4double )
{
G4ProtonInelasticCrossSection theForward;
G4double result = theForward.GetCrossSection(aPart->GetKineticEnergy(),
@@ -67,7 +67,7 @@ class G4IonProtonCrossSection : public G4VCrossSectionDataSet
virtual
void DumpPhysicsTable(const G4ParticleDefinition&)
{G4cout << "G4IonProtonCrossSection: uses formula"<<endl;}
{G4cout << "G4IonProtonCrossSection: uses formula"<<G4endl;}
};
@@ -29,6 +29,7 @@
#include "G4PionMinus.hh"
#include "G4PionPlus.hh"
#include "G4PiData.hh"
#include "G4HadTmpUtil.hh"
class G4PiNuclearCrossSection : public G4VCrossSectionDataSet
{
@@ -41,7 +42,7 @@ class G4PiNuclearCrossSection : public G4VCrossSectionDataSet
G4bool result = false;
if(aParticle->GetDefinition() == G4PionMinus::PionMinus()) result=true;
if(aParticle->GetDefinition() == G4PionPlus::PionPlus()) result=true;
if(anElement->GetZ() == 1) result = false;
if(G4lrint(anElement->GetZ()) == 1) result = false;
if(aParticle->GetKineticEnergy() > 999.9*GeV) result=false;
return result;
}
@@ -0,0 +1,101 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4TripathiLightCrossSection_h
#define G4TripathiLightCrossSection_h
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4TripathiLightCrossSection.hh
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// Class Description
// Implementation of formulas of Tripathi, Cucinotta and Wilson, NASA Technical
// Paper TP-1999-209726 to calculate cross-sections for nuclear-nuclear
// inelastic scattering for light nuclear systems.
//
// Class Description - End
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#include "globals.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4WilsonRadius.hh"
///////////////////////////////////////////////////////////////////////////////
//
class G4TripathiLightCrossSection : public G4VCrossSectionDataSet
{
public:
G4TripathiLightCrossSection();
~G4TripathiLightCrossSection();
virtual G4bool IsApplicable(const G4DynamicParticle* theProjectile,
const G4Element* theTarget);
virtual G4double GetCrossSection(const G4DynamicParticle* theProjectile,
const G4Element* theTarget, G4double theTemperature);
virtual void BuildPhysicsTable(const G4ParticleDefinition&)
{}
virtual void DumpPhysicsTable(const G4ParticleDefinition&)
{G4cout << "G4TripathiLightCrossSection: uses formula"<<G4endl;}
void SetLowEnergyCheck (G4bool);
private:
G4WilsonRadius *theWilsonRadius;
G4double r_0;
G4double third;
G4bool lowEnergyCheck;
};
///////////////////////////////////////////////////////////////////////////////
//
#endif
@@ -0,0 +1,243 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4EMDissociationCrossSection.cc
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 17 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "G4EMDissociationCrossSection.hh"
#include "G4PhysicsFreeVector.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "globals.hh"
////////////////////////////////////////////////////////////////////////////////
//
G4EMDissociationCrossSection::G4EMDissociationCrossSection ()
{
//
//
// This function makes use of the class which can sample the virtual photon
// spectrum, G4EMDissociationSpectrum.
//
thePhotonSpectrum = new G4EMDissociationSpectrum();
//
//
// Define other constants.
//
r0 = 1.18 * fermi;
J = 36.8 * MeV;
Qprime = 17.0 * MeV;
epsilon = 0.0768;
xd = 0.25;
}
////////////////////////////////////////////////////////////////////////////////
//
G4EMDissociationCrossSection::~G4EMDissociationCrossSection()
{
delete thePhotonSpectrum;
}
////////////////////////////////////////////////////////////////////////////////
//
G4bool G4EMDissociationCrossSection::IsApplicable
(const G4DynamicParticle *theDynamicParticle, const G4Element* theElement)
{
//
//
// The condition for the applicability of this class is that the projectile
// must be an ion and the target must have more than one nucleon. In reality
// the value of A for either the projectile or target could be much higher,
// since for cases where both he projectile and target are medium to small
// Z, the probability of the EMD process is, I think, VERY small.
//
if (G4ParticleTable::GetParticleTable()->GetIonTable()->
IsIon(theDynamicParticle->GetDefinition()) && theElement->GetN() > 1.0)
return true;
else
return false;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4EMDissociationCrossSection::GetCrossSection
(const G4DynamicParticle *theDynamicParticle, const G4Element* theElement,
G4double )
{
//
//
// Get relevant information about the projectile and target (A, Z) and
// velocity of the projectile.
//
G4ParticleDefinition *definitionP = theDynamicParticle->GetDefinition();
G4double AP = definitionP->GetBaryonNumber();
G4double ZP = definitionP->GetPDGCharge();
G4double b = theDynamicParticle->Get4Momentum().beta();
// G4double bsq = b * b;
G4double AT = theElement->GetN();
G4double ZT = theElement->GetZ();
G4double bmin = thePhotonSpectrum->GetClosestApproach(AP, ZP, AT, ZT, b);
//
//
// Calculate the cross-section for the projectile and then the target. The
// information is returned in a G4PhysicsFreeVector, which separates out the
// cross-sections for the E1 and E2 moments of the virtual photon field, and
// the energies (GDR and GQR).
//
G4PhysicsFreeVector *theProjectileCrossSections =
GetCrossSectionForProjectile (AP, ZP, AT, ZT, b, bmin);
G4double crossSection =
(*theProjectileCrossSections)[0]+(*theProjectileCrossSections)[1];
delete theProjectileCrossSections;
G4PhysicsFreeVector *theTargetCrossSections =
GetCrossSectionForTarget (AP, ZP, AT, ZT, b, bmin);
crossSection +=
(*theTargetCrossSections)[0]+(*theTargetCrossSections)[1];
delete theTargetCrossSections;
return crossSection;
}
////////////////////////////////////////////////////////////////////////////////
//
G4PhysicsFreeVector *
G4EMDissociationCrossSection::GetCrossSectionForProjectile (G4double AP,
G4double ZP, G4double AT, G4double ZT, G4double b, G4double bmin)
{
//
//
// Use Wilson et al's approach to calculate the cross-sections due to the E1
// and E2 moments of the field at the giant dipole and quadrupole resonances
// respectively, Note that the algorithm is traditionally applied to the
// EMD break-up of the projectile in the field of the target, as is implemented
// here.
//
// Initialise variables and calculate the energies for the GDR and GQR.
//
G4double AProot3 = pow(AP,1.0/3.0);
G4double u = 3.0 * J / Qprime / AProot3;
G4double R0 = r0 * AProot3;
G4double E_GDR = hbarc / sqrt(0.7*amu_c2*R0*R0/8.0/J*
(1.0 + u - (1.0 + epsilon + 3.0*u)/(1.0 + epsilon + u)*epsilon));
G4double E_GQR = 63.0 * MeV / AProot3;
//
//
// Determine the virtual photon spectra at these energies.
//
G4double ZTsq = ZT * ZT;
G4double nE1 = ZTsq *
thePhotonSpectrum->GetGeneralE1Spectrum(E_GDR, b, bmin);
G4double nE2 = ZTsq *
thePhotonSpectrum->GetGeneralE2Spectrum(E_GQR, b, bmin);
//
//
// Now calculate the cross-section of the projectile for interaction with the
// E1 and E2 fields.
//
G4double sE1 = 60.0 * millibarn * MeV * (AP-ZP)*ZP/AP;
G4double sE2 = 0.22 * microbarn / MeV * ZP * AProot3 * AProot3;
if (AP > 100.0) sE2 *= 0.9;
else if (AP > 40.0) sE2 *= 0.6;
else sE2 *= 0.3;
//
//
// ... and multiply with the intensity of the virtual photon spectra to get
// the probability of interaction.
//
G4PhysicsFreeVector *theCrossSectionVector = new G4PhysicsFreeVector(2);
theCrossSectionVector->PutValue(0, E_GDR, sE1*nE1);
theCrossSectionVector->PutValue(1, E_GQR, sE2*nE2*E_GQR*E_GQR);
return theCrossSectionVector;
}
////////////////////////////////////////////////////////////////////////////////
//
G4PhysicsFreeVector *
G4EMDissociationCrossSection::GetCrossSectionForTarget (G4double AP,
G4double ZP, G4double AT, G4double ZT, G4double b, G4double bmin)
{
//
//
// This is a cheaky little member function to calculate the probability of
// EMD for the target in the field of the projectile ... just by reversing the
// A and Z's for the participants.
//
return GetCrossSectionForProjectile (AT, ZT, AP, ZP, b, bmin);
}
////////////////////////////////////////////////////////////////////////////////
//
G4double
G4EMDissociationCrossSection::GetWilsonProbabilityForProtonDissociation
(G4double A, G4double Z)
{
//
//
// This is a simple algorithm to choose whether a proton or neutron is ejected
// from the nucleus in the EMD interaction.
//
G4double p = 0.0;
if (Z < 6.0)
p = 0.5;
else if (Z < 8.0)
p = 0.6;
else if (Z < 14.0)
p = 0.7;
else
{
G4double p1 = (G4double) Z / (G4double) A;
G4double p2 = 1.95*exp(-0.075*Z);
if (p1 < p2) p = p1;
else p = p2;
}
return p;
}
////////////////////////////////////////////////////////////////////////////////
//
@@ -0,0 +1,118 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4EMDissociationSpectrum.cc
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "G4EMDissociationSpectrum.hh"
#include "globals.hh"
////////////////////////////////////////////////////////////////////////////////
//
G4EMDissociationSpectrum::G4EMDissociationSpectrum ()
{
bessel = new G4Bessel();
}
////////////////////////////////////////////////////////////////////////////////
//
G4EMDissociationSpectrum::~G4EMDissociationSpectrum ()
{
delete bessel;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4EMDissociationSpectrum::GetGeneralE1Spectrum
(G4double Eg, G4double b, G4double bmin)
{
G4double b2 = b*b;
G4double g = 1.0/sqrt(1.0-b2);
G4double xi = Eg * bmin / g / b / hbarc;
G4double K0 = bessel->K0(xi);
G4double K1 = bessel->K1(xi);
G4double n = 2.0 * fine_structure_const / pi / b2 / Eg *
(xi*K0*K1 - xi*xi*b2/2.0*(K1*K1-K0*K0));
return n;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4EMDissociationSpectrum::GetGeneralE2Spectrum
(G4double Eg, G4double b, G4double bmin)
{
G4double b2 = b * b;
G4double b4 = b2 * b2;
G4double g = 1.0/sqrt(1.0-b2);
G4double xi = Eg * bmin / g / b / hbarc;
G4double K0 = bessel->K0(xi);
G4double K1 = bessel->K1(xi);
G4double n = 2.0 * fine_structure_const / pi / b4 / Eg *
(2.0*(1.0-b2)*K1*K1 + xi*pow((2.0-b2),2.0)*K0*K1 -
xi*xi*b4/2.0*(K1*K1-K0*K0));
return n;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4EMDissociationSpectrum::GetClosestApproach
(const G4double AP, const G4double ZP, G4double AT, G4double ZT, G4double b)
{
G4double bsq = b * b;
G4double g = 1.0/sqrt(1-bsq);
G4double AProot3 = pow(AP,1.0/3.0);
G4double ATroot3 = pow(AT,1.0/3.0);
G4double bc = 1.34 * fermi * (AProot3+ATroot3 - 0.75 *(1.0/AProot3+1.0/ATroot3));
// G4double a0 = ZP * ZT * classic_electr_radius/bsq;
G4double a0 = ZP * ZT * elm_coupling / (AT*AP*amu_c2/(AT+AP)) / bsq;
G4double bmin = 1.25 * bc + halfpi*a0/g;
return bmin;
}
////////////////////////////////////////////////////////////////////////////////
//
@@ -0,0 +1,197 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4GeneralSpaceNNCrossSection.cc
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "G4GeneralSpaceNNCrossSection.hh"
#include "G4DynamicParticle.hh"
#include "G4Element.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include <iomanip>
////////////////////////////////////////////////////////////////////////////////
//
G4GeneralSpaceNNCrossSection::G4GeneralSpaceNNCrossSection ()
{
protonInelastic = new G4ProtonInelasticCrossSection();
ionProton = new G4IonProtonCrossSection();
TripathiGeneral = new G4TripathiCrossSection();
TripathiLight = new G4TripathiLightCrossSection();
Shen = new G4IonsShenCrossSection();
return;
}
////////////////////////////////////////////////////////////////////////////////
//
G4GeneralSpaceNNCrossSection::~G4GeneralSpaceNNCrossSection ()
{
delete protonInelastic;
delete ionProton;
delete TripathiGeneral;
delete TripathiLight;
delete Shen;
}
////////////////////////////////////////////////////////////////////////////////
//
G4bool G4GeneralSpaceNNCrossSection::IsApplicable
(const G4DynamicParticle* theProjectile, const G4Element* theTarget)
{
G4bool result = protonInelastic->IsApplicable(theProjectile, theTarget);
if (!result)
{
result = ionProton->IsApplicable(theProjectile, theTarget);
if (!result)
{
result = TripathiGeneral->IsApplicable(theProjectile, theTarget);
if (!result)
result = Shen->IsApplicable(theProjectile, theTarget);
}
}
return result;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4GeneralSpaceNNCrossSection::GetCrossSection
(const G4DynamicParticle* theProjectile, const G4Element* theTarget,
G4double theTemperature)
{
G4double result = 0.0;
const G4double AT = theTarget->GetN();
const G4double ZT = theTarget->GetZ();
const G4double AP = theProjectile->GetDefinition()->GetBaryonNumber();
const G4double ZP = theProjectile->GetDefinition()->GetPDGCharge();
if (verboseLevel >= 2)
{
G4cout <<"In G4GeneralSpaceNNCrossSection::GetCrossSection" <<G4endl;
G4cout <<"Projectile A = " <<std::setw(8) <<AP
<<" Z = " <<std::setw(8) <<ZP
<<" Energy = " <<theProjectile->GetKineticEnergy()/AP
<<" MeV/nuc" <<G4endl;
G4cout <<"Target A = " <<std::setw(8) <<AT
<<" Z = " <<std::setw(8) <<ZT
<<G4endl;
}
if (theProjectile->GetDefinition()==G4Proton::Proton())
{
if (ZT>5)
{
result = protonInelastic->
GetCrossSection(theProjectile, theTarget, theTemperature);
if (verboseLevel >= 2)
G4cout <<"Selecting G4ProtonInelasticCrossSection" <<G4endl;
}
else
{
result = TripathiLight->
GetCrossSection(theProjectile, theTarget, theTemperature);
if (verboseLevel >= 2)
G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
}
}
else if (AT==1 && ZT==1)
{
if (ZP>5)
{
result = ionProton->
GetCrossSection(theProjectile, theTarget, theTemperature);
if (verboseLevel >= 2)
G4cout <<"Selecting G4IonProtonCrossSection" <<G4endl;
}
else
{
result = TripathiLight->
GetCrossSection(theProjectile, theTarget, theTemperature);
if (verboseLevel >= 2)
G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
}
}
else
{
if (TripathiLight->IsApplicable(theProjectile, theTarget))
{
result = TripathiLight->
GetCrossSection(theProjectile, theTarget, theTemperature);
if (verboseLevel >= 2)
G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
}
else if (TripathiGeneral->IsApplicable(theProjectile, theTarget))
{
result = TripathiGeneral->
GetCrossSection(theProjectile, theTarget, theTemperature);
if (verboseLevel >= 2)
G4cout <<"Selecting G4TripathiCrossSection" <<G4endl;
}
else if (Shen->IsApplicable(theProjectile, theTarget))
{
result = Shen->
GetCrossSection(theProjectile, theTarget, theTemperature);
if (verboseLevel >= 2)
G4cout <<"Selecting G4IonsShenCrossSection" <<G4endl;
}
}
if (verboseLevel >= 2)
{
G4cout <<"Cross-section = " <<result/millibarn <<" mbarn" <<G4endl;
G4cout <<G4endl;
}
return result;
}
////////////////////////////////////////////////////////////////////////////////
//
@@ -21,7 +21,7 @@
// ********************************************************************
//
//
// GEANT4 tag $Name: geant4-06-00-patch-01 $
// GEANT4 tag $Name: geant4-06-02 $
//
//
// G4 Hadron Physics class G4HadronCrossSections
@@ -582,7 +582,7 @@ G4float G4HadronCrossSections::csin[PSIZE][TSIZE] = {
22.000 , 23.500 , 24.800 , 25.800 , 26.500 ,
27.000 , 27.500 , 28.000 , 30.000 , 31.000 ,
32.000 , 32.500 , 32.500 , 33.000 , 33.500 ,
34.000} ,
33.500} ,
{1500.0 , 1160.0 , 310.00 , 230.00 , 178.00 , //15
153.00 , 134.00 , 124.00 , 113.00 , 106.00 ,
@@ -22,6 +22,8 @@
//
#include "G4PiNuclearCrossSection.hh"
#include "G4HadronicException.hh"
#include "G4HadTmpUtil.hh"
#include "G4ping.hh"
// by J.P Wellisch, Sun Sep 15 2002.
// Implements P2-90-158;
@@ -52,7 +54,7 @@
const G4double G4PiNuclearCrossSection::na_p_t[22] = {210, 320, 530, 795, 960, 1035, 1050, 1040, 1007, 957, 918, 865, 773, 685, 636, 598, 575, 565, 578, 590, 598, 610};
const G4double G4PiNuclearCrossSection::na_p_in[22] = {115, 210, 340, 495, 585, 630, 645, 637, 605, 572, 550, 505, 455, 410, 401, 388, 383, 393, 405, 414, 418, 422};
const G4double G4PiNuclearCrossSection::e3_1[31] = {.02, .04, .06, .08, .1, .12, .14, .16, .18, .2, .22, .25, .3, .35, .4, .45, .5, .6, .7, .8, .9, 1., 2., 3., 5., 10., 20., 50., 100., 500., 1000.};
const G4double G4PiNuclearCrossSection::e3_1[31] = {.02, .04, .06, .08, .1, .12, .14, .16, .18, .2, .22, .25, .3, .35, .4, .45, .5, .6, .7, .8, .9, 1., 2., 3., 5., 10., 20., 50., 100., 500., 1000.};
const G4double G4PiNuclearCrossSection::al_m_t[31] = {532, 637, 832, 1057, 1207, 1230, 1210, 1174, 1133, 1095, 1038, 970, 890, 807, 750, 710, 675, 665, 670, 673, 678, 682, 618, 574, 546, 520, 507, 495, 488, 488, 488};
const G4double G4PiNuclearCrossSection::al_m_in[31] = {300, 360, 495, 665, 750, 765, 750, 730, 700, 660, 615, 570, 520, 490, 470, 450, 448, 450, 450, 452, 456, 460, 408, 392, 376, 356, 347, 338, 332, 332, 332};
const G4double G4PiNuclearCrossSection::al_p_t[21] = {225, 350, 616, 945, 1122, 1175, 1157, 1128, 1088, 1045, 988, 935, 870, 787, 730, 690, 660, 652, 660, 668, 678};
@@ -60,44 +62,47 @@
const G4double G4PiNuclearCrossSection::ca_m_t[31] = {800, 980, 1240, 1460, 1570, 1600, 1580, 1535, 1475, 1425, 1375, 1295, 1200, 1083, 1000, 948, 915, 895, 900, 908, 915, 922, 856, 795, 740, 705, 682, 660, 660, 660, 660};
const G4double G4PiNuclearCrossSection::ca_m_in[31] = {470, 550, 620, 860, 955, 960, 920, 860, 820, 780, 740, 665, 637, 615, 600, 590, 600, 608, 610, 615, 550, 525, 510, 488, 470, 450, 450, 450, 450};
const G4double G4PiNuclearCrossSection::ca_p_t[23] = {275, 445, 790, 1195, 1440, 1485, 1475, 1435, 1385, 1335, 1295, 1245, 1160, 1050, 970, 923, 895, 877, 887, 897, 904, 913, 855};
const G4double G4PiNuclearCrossSection::ca_p_in[23] = {160, 315, 500, 745, 870, 905, 900, 860, 810, 770, 740, 710, 640, 617, 595, 585, 575, 575, 590, 600, 602, 608, 550};
const G4double G4PiNuclearCrossSection::ca_p_in[23] = {160, 315, 500, 745, 870, 905, 900, 860, 810, 770, 740, 710, 640, 617, 595, 585, 575, 575, 590, 600, 602, 608, 510}; // last number is 500 in org, changed to make things smooth.
const G4double G4PiNuclearCrossSection::e4[32] = {0.02, 0.04, 0.06, 0.08, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.22, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 5, 10, 20, 50, 100, 500, 1000};
const G4double G4PiNuclearCrossSection::fe_m_t[32] = {1175, 1363, 1670, 1950, 2050, 2040, 1975, 1886, 1834, 1773, 1720, 1635, 1474, 1380, 1269, 1225, 1182, 1162, 1159, 1162, 1178, 1190, 1197, 1102, 1035, 975, 945, 925, 905, 905, 905, 905};
const G4double G4PiNuclearCrossSection::fe_m_in[32] = {625, 725, 910, 1180, 1275, 1250, 1200, 1150, 1100, 1040, 995, 925, 825, 810, 780, 760, 745, 740, 740, 740, 750, 760, 765, 690, 660, 635, 615, 600, 585, 585, 585, 585};
const G4double G4PiNuclearCrossSection::fe_p_t[25] = {330, 575, 1010, 1500, 1837, 1875, 1820, 1751, 1691, 1636, 1690, 1450, 1396, 1305, 1219, 1190, 1148, 1138, 1134, 1144, 1163, 1175, 1183, 1198, 1135};
const G4double G4PiNuclearCrossSection::fe_p_in[25] = {210, 410, 707, 1010, 1125, 1150, 1100, 1070, 1010, 960, 920, 776, 780, 760, 750, 740, 720, 725, 725, 730, 740, 750, 755, 690, 660};
const G4double G4PiNuclearCrossSection::e4[32] = {0.02, 0.04, 0.06, 0.08, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.22, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 5, 10, 20, 50, 100, 500, 1000};
const G4double G4PiNuclearCrossSection::fe_m_t[32] = {1175, 1363, 1670, 1950, 2050, 2040, 1975, 1886, 1834, 1773, 1720, 1635, 1474, 1380, 1269, 1225, 1182, 1162, 1159, 1162, 1178, 1190, 1197, 1102, 1135, 975, 945, 925, 905, 905, 905, 905};
const G4double G4PiNuclearCrossSection::fe_m_in[32] = {625, 725, 910, 1180, 1275, 1250, 1200, 1150, 1100, 1040, 995, 925, 825, 810, 780, 760, 745, 740, 740, 740, 750, 760, 765, 690, 660, 635, 615, 600, 585, 585, 585, 585};
const G4double G4PiNuclearCrossSection::fe_p_t[25] = {330, 575, 1010, 1500, 1837, 1875, 1820, 1751, 1691, 1636, 1690, 1450, 1396, 1305, 1219, 1190, 1148, 1138, 1134, 1144, 1163, 1175, 1183, 1198, 1135};
const G4double G4PiNuclearCrossSection::fe_p_in[25] = {210, 410, 707, 1010, 1125, 1150, 1100, 1070, 1010, 960, 920, 776, 780, 760, 750, 740, 720, 725, 725, 730, 740, 750, 755, 690, 660};
const G4double G4PiNuclearCrossSection::cu_m_t[32] = {1400, 1600, 1875, 2088, 2200, 2220, 2175, 2125, 2075, 2012, 1950, 1855, 1670, 1530, 1430, 1370, 1315, 1315, 1315, 1330, 1345, 1360, 1365, 1250, 1185, 1128, 1070, 1035, 1010, 1010, 1010, 1010};
const G4double G4PiNuclearCrossSection::cu_m_in[32] = {725, 840, 1020, 1200, 1295, 1300, 1267, 1240, 1213, 1175, 1125, 1042, 950, 900, 860, 840, 830, 832, 835, 840, 850, 860, 865, 785, 735, 705, 680, 650, 630, 630, 630, 630};
const G4double G4PiNuclearCrossSection::cu_p_t[25] = {355, 605, 1120, 1630, 1940, 2010, 2010, 1980, 1925, 1895, 1830, 1730, 1585, 1490, 1400, 1340, 1290, 1290, 1290, 1310, 1330, 1345, 1350, 1240, 1185};
const G4double G4PiNuclearCrossSection::cu_p_in[25] = {230, 425, 780, 1025, 1155, 1190, 1190, 1180, 1125, 1100, 1050, 1000, 900, 870, 835, 815, 810, 812, 815, 825, 840, 850, 855, 780, 735};
const G4double G4PiNuclearCrossSection::e5[34] = {0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.22, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 5, 10, 20, 50, 100, 500, 1000};
const G4double G4PiNuclearCrossSection::cu_m_in[32] = {725, 840, 1020, 1200, 1295, 1300, 1267, 1240, 1213, 1175, 1125, 1042, 950, 900, 860, 840, 830, 832, 835, 840, 850, 860, 865, 785, 735, 705, 680, 650, 630, 630, 630, 630};
const G4double G4PiNuclearCrossSection::cu_p_t[25] = {355, 605, 1120, 1630, 1940, 2010, 2010, 1980, 1925, 1895, 1830, 1730, 1585, 1490, 1400, 1340, 1290, 1290, 1290, 1310, 1330, 1345, 1350, 1240, 1185};
const G4double G4PiNuclearCrossSection::cu_p_in[25] = {230, 425, 780, 1025, 1155, 1190, 1190, 1180, 1125, 1100, 1050, 1000, 900, 870, 835, 815, 810, 812, 815, 825, 840, 850, 855, 780, 735};
const G4double G4PiNuclearCrossSection::e5[34] = {0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.22, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 5, 10, 20, 50, 100, 500, 1000};
const G4double G4PiNuclearCrossSection::mo_m_t[34] = {2430, 2610, 2710, 2790, 2880, 2940, 2965, 2970, 2970, 2920, 2840, 2720, 2570, 2500, 2365, 2200, 2050, 1926, 1825, 1768, 1749, 1750, 1778, 1789, 1808, 1690, 1645, 1530, 1492, 1450, 1425, 1425, 1425, 1425};
const G4double G4PiNuclearCrossSection::mo_m_in[34] = {925, 1125, 1250, 1375, 1500, 1600, 1680, 1750, 1770, 1730, 1660, 1580, 1500, 1450, 1330, 1250, 1190, 1140, 1100, 1075, 1075, 1070, 1088, 1095, 1110, 1035, 1005, 940, 917, 880, 860, 860, 860, 860};
const G4double G4PiNuclearCrossSection::mo_p_t[27] = {410, 730, 1110, 1530, 1920, 2200, 2385, 2520, 2600, 2630, 2575, 2470, 2320, 2285, 2185, 2053, 1945, 1852, 1776, 1719, 1710, 1716, 1746, 1759, 1778, 1675, 1645};
const G4double G4PiNuclearCrossSection::mo_p_in[27] = {270, 540, 825, 975, 1140, 1285, 1400, 1480, 1555, 1580, 1525, 1470, 1360, 1340, 1255, 1160, 1120, 1085, 1060, 1045, 1045, 1045, 1065, 1075, 1090, 1025, 1005};
const G4double G4PiNuclearCrossSection::mo_p_t[27] = {410, 730, 1110, 1530, 1920, 2200, 2385, 2520, 2600, 2630, 2575, 2470, 2320, 2285, 2185, 2053, 1945, 1852, 1776, 1719, 1710, 1716, 1746, 1759, 1778, 1675, 1645};
const G4double G4PiNuclearCrossSection::mo_p_in[27] = {270, 540, 825, 975, 1140, 1285, 1400, 1480, 1555, 1580, 1525, 1470, 1360, 1340, 1255, 1160, 1120, 1085, 1060, 1045, 1045, 1045, 1065, 1075, 1090, 1025, 1005};
const G4double G4PiNuclearCrossSection::cd_m_t[34] = {3060, 3125, 3170, 3220, 3255, 3280, 3290, 3260, 3270, 3200, 3120, 3080, 3090, 2920, 2810, 2640, 2362, 2230, 2115, 2050, 2020, 2025, 2040, 2070, 2100, 1900, 1795, 1740, 1675, 1645, 1625, 1620, 1620, 1620};
const G4double G4PiNuclearCrossSection::cd_m_in[34] = {1025, 1275, 1440, 1625, 1740, 1800, 1880, 1920, 1980, 1920, 1850, 1810, 1720, 1650, 1560, 1450, 1330, 1290, 1245, 1210, 1200, 1200, 1205, 1205, 1230, 1130, 1085, 1060, 1000, 985, 975, 970, 970, 970};
const G4double G4PiNuclearCrossSection::cd_p_t[28] = {455, 780, 1170, 1700, 2120, 2400, 2600, 2720, 2820, 2840, 2800, 2760, 2720, 2640, 2560, 2450, 2252, 2130, 2035, 1985, 1970, 1975, 2005, 2035, 2070, 1880, 1785, 1740};
const G4double G4PiNuclearCrossSection::cd_p_in[28] = {310, 580, 880, 1060, 1270, 1400, 1530, 1610, 1660, 1680, 1640, 1600, 1560, 1500, 1430, 1330, 1280, 1230, 1200, 1180, 1170, 1175, 1180, 1180, 1210, 1120, 1080, 1060};
const G4double G4PiNuclearCrossSection::e6[35] = {0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.16, 0.8, 0.2, 0.22, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 5, 10, 20, 50, 100, 500, 1000};
const G4double G4PiNuclearCrossSection::sn_m_t[35] = {3000, 3180, 3250, 3300, 3300, 3410, 3470, 3450, 3410, 3350, 3280, 3200, 3120, 3050, 2900, 2630, 2500, 2325, 2190, 2100, 2060, 2055, 2055, 2055, 2067, 2085, 2000, 1900, 1835, 1770, 1720, 1700, 1695, 1695, 1695};
const G4double G4PiNuclearCrossSection::cd_m_in[34]= {1025, 1275, 1440, 1625, 1740, 1800, 1880, 1920, 1980, 1920, 1850, 1810, 1720, 1650, 1560, 1450, 1330, 1290, 1245, 1210, 1200, 1200, 1205, 1205, 1230, 1130, 1085, 1060, 1000, 985, 975, 970, 970, 970};
const G4double G4PiNuclearCrossSection::cd_p_t[28] = {455, 780, 1170, 1700, 2120, 2400, 2600, 2720, 2820, 2840, 2800, 2760, 2720, 2640, 2560, 2450, 2252, 2130, 2035, 1985, 1970, 1975, 2005, 2035, 2070, 1880, 1795, 1740};
const G4double G4PiNuclearCrossSection::cd_p_in[28] = {310, 580, 880, 1060, 1270, 1400, 1530, 1610, 1660, 1680, 1640, 1600, 1560, 1500, 1430, 1330, 1280, 1230, 1200, 1180, 1170, 1175, 1180, 1180, 1210, 1120, 1085, 1060};
const G4double G4PiNuclearCrossSection::e6[35] = {0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.22, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 5, 10, 20, 50, 100, 500, 1000};
const G4double G4PiNuclearCrossSection::sn_m_t[35] = {3000, 3180, 3250, 3300, 3300, 3410, 3470, 3450, 3410, 3350, 3280, 3200, 3120, 3050, 2900, 2630, 2500, 2325, 2190, 2100, 2060, 2055, 2055, 2055, 2067, 2085, 2000, 1900, 1835, 1770, 1720, 1700, 1695, 1695, 1695};
const G4double G4PiNuclearCrossSection::sn_m_in[35] = {1050, 1350, 1520, 1650, 1800, 1980, 2070, 2120, 2090, 2050, 1980, 1920, 1830, 1770, 1670, 1500, 1435, 1350, 1300, 1230, 1220, 1235, 1235, 1235, 1237, 1240, 1160, 1120, 1090, 1065, 1040, 1020, 1015, 1015, 1015};
const G4double G4PiNuclearCrossSection::sn_p_t[29] = {465, 800, 1200, 1760, 2170, 2480, 2730, 2885, 2970, 2980, 2970, 2890, 2840, 2790, 2620, 2450, 2335, 2205, 2080, 2020, 2010, 1990, 1990, 2015, 2030, 2045, 1980, 1890, 1835};
const G4double G4PiNuclearCrossSection::sn_p_in[29] = {315, 590, 880, 1220, 1460, 1580, 1700, 1770, 1810, 1810, 1800, 1730, 1680, 1630, 1530, 1400, 1335, 1270, 1210, 1180, 1190, 1190, 1190, 1205, 1210, 1210, 1150, 1115, 1090};
const G4double G4PiNuclearCrossSection::w_m_t[35] = {5200, 5115, 5025, 4975, 4900, 4850, 4780, 4725, 4600, 4490, 4355, 4255, 4125, 4040, 3830, 3580, 3330, 3110, 2955, 2860, 2852, 2845, 2885, 2900, 2915, 2940, 2800, 2660, 2580, 2490, 2460, 2425, 2420, 2420, 2420};
const G4double G4PiNuclearCrossSection::w_m_in[35] = {1450, 1850, 2100, 2350, 2550, 2700, 2825, 2900, 2850, 2750, 2630, 2525, 2400, 2300, 2200, 2070, 1880, 1770, 1715, 1680, 1680, 1680, 1685, 1690, 1700, 1720, 1635, 1560, 1530, 1460, 1440, 1410, 1410, 1410, 1410};
const G4double G4PiNuclearCrossSection::w_p_t[30] = {480, 900, 1500, 2350, 3020, 3420, 3650, 3775, 3875, 3830, 3750, 3700, 3630, 3550, 3550, 3290, 3070, 2890, 2840, 2730, 2725, 2720, 2770, 2805, 2828, 2865, 2770, 2640, 2570, 2490};
const G4double G4PiNuclearCrossSection::w_p_in[30] = {325, 680, 990, 1500, 1850, 2150, 2250, 2300, 2350, 233, 2280, 2230, 2200, 2120, 2130, 900, 1780, 1670, 1635, 1600, 1602, 1605, 1610, 1615, 1630, 1660, 1620, 1550, 1525, 1460};
const G4double G4PiNuclearCrossSection::e7[35] = {0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.22, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 5, 10, 20, 50, 100, 500, 1000};
const G4double G4PiNuclearCrossSection::pb_m_t[35] = {5890, 5700, 5610, 5580, 5550, 5480, 5400, 5300, 5100, 4930, 4750, 4600, 4400, 4280, 4170, 3915, 3650, 3470, 3260, 3150, 3120, 3070, 3085, 3100, 3120, 3160, 3070, 2930, 2820, 2750, 2710, 2655, 2640, 2640, 2640};
const G4double G4PiNuclearCrossSection::sn_p_t[29] = { 465, 800, 1200, 1760, 2170, 2480, 2730, 2885, 2970, 2980, 2970, 2890, 2840, 2790, 2620, 2450, 2335, 2205, 2080, 2020, 2010, 1990, 1990, 2015, 2030, 2045, 1980, 1890, 1835};
const G4double G4PiNuclearCrossSection::sn_p_in[29] = { 315, 590, 880, 1220, 1460, 1580, 1700, 1770, 1810, 1810, 1800, 1730, 1680, 1630, 1530, 1400, 1335, 1270, 1210, 1180, 1190, 1190, 1190, 1205, 1210, 1210, 1150, 1115, 1090};
const G4double G4PiNuclearCrossSection::w_m_t[35] = {5200, 5115, 5025, 4975, 4900, 4850, 4780, 4725, 4600, 4490, 4355, 4255, 4125, 4040, 3830, 3580, 3330, 3110, 2955, 2860, 2852, 2845, 2885, 2900, 2915, 2940, 2800, 2660, 2570, 2490, 2460, 2425, 2420, 2420, 2420};
const G4double G4PiNuclearCrossSection::w_m_in[35] = {1450, 1850, 2100, 2350, 2550, 2700, 2825, 2900, 2850, 2750, 2630, 2525, 2400, 2300, 2200, 2070, 1880, 1770, 1715, 1680, 1680, 1680, 1685, 1690, 1700, 1720, 1635, 1560, 1530, 1460, 1440, 1410, 1410, 1410, 1410};
const G4double G4PiNuclearCrossSection::w_p_t[30] = { 480, 900, 1500, 2350, 3020, 3420, 3650, 3775, 3875, 3830, 3750, 3700, 3630, 3550, 3550, 3290, 3070, 2890, 2840, 2730, 2725, 2720, 2770, 2805, 2828, 2865, 2770, 2640, 2570, 2490};
const G4double G4PiNuclearCrossSection::w_p_in[30] = { 325, 680, 990, 1500, 1850, 2150, 2250, 2300, 2350, 2330, 2280, 2230, 2200, 2120, 2130, 1900, 1780, 1670, 1635, 1600, 1602, 1605, 1610, 1615, 1630, 1660, 1620, 1550, 1530, 1460};
const G4double G4PiNuclearCrossSection::e7[35] = {0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.22, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 5, 10, 20, 50, 100, 500, 1000};
const G4double G4PiNuclearCrossSection::pb_m_t[35] = {5890, 5700, 5610, 5580, 5550, 5480, 5400, 5300, 5100, 4930, 4750, 4600, 4400, 4280, 4170, 3915, 3650, 3470, 3260, 3150, 3120, 3070, 3085, 3100, 3120, 3160, 3070, 2930, 2820, 2750, 2710, 2655, 2640, 2640, 2640};
const G4double G4PiNuclearCrossSection::pb_m_in[35] = {1575, 2025, 2300, 2575, 2850, 3000, 3115, 3180, 3080, 2940, 2800, 2670, 2550, 2450, 2370, 2220, 2110, 2000, 1920, 1880, 1850, 1800, 1805, 1810, 1820, 1840, 1800, 1720, 1640, 1620, 1570, 1530, 1530, 1530, 1530};
const G4double G4PiNuclearCrossSection::pb_p_t[30] = {515, 940, 1500, 2400, 3270, 3750, 4050, 4140, 4260, 4200, 4080, 3990, 3990, 3810, 3730, 3520, 3370, 3186, 3110, 3010, 2990, 2985, 3005, 3020, 3040, 3080, 3020, 2905, 2790, 2790};
const G4double G4PiNuclearCrossSection::pb_p_in[30] = {348, 707, 1040, 1650, 2100, 2400, 2580, 2640, 2650, 2520, 2410, 230, 2250, 2190, 2130, 2000, 1930, 1870, 1830, 1790, 1770, 1765, 1775, 1780, 1790, 1800, 1775, 1710, 1620, 1620};
const G4double G4PiNuclearCrossSection::u_m_t[35] = {7080, 6830, 6650, 6530, 6400, 6280, 6100, 5840, 5660, 5520, 5330, 5160, 4990, 4810, 4630, 4323, 4130, 3870, 3700, 3550, 3490, 3465, 3467, 3475, 3495, 3515, 3440, 3360, 3150, 3040, 2985, 2955, 2940, 2940, 2940};
const G4double G4PiNuclearCrossSection::u_m_in[35] = {1740, 2220, 2500, 2820, 3080, 3300, 3420, 3500, 3420, 3330, 3200, 3060, 2940, 2850, 2710, 2470, 2380, 2250, 2160, 2080, 2040, 2045, 2047, 2050, 2055, 2060, 2010, 1980, 1830, 1780, 1735, 1710, 1700, 1700, 1700};
const G4double G4PiNuclearCrossSection::u_p_t[30] = {485, 960, 1580, 2700, 3550, 4050, 4320, 4420, 4620, 4660, 4580, 4470, 4350, 4295, 4187, 3938, 3755, 3573, 3450, 3342, 3310, 3295, 3310, 3330, 3375, 3405, 3350, 3338, 3135, 3040};
const G4double G4PiNuclearCrossSection::u_p_in[30] = {334, 720, 1020, 1560, 2100, 2300, 2550, 2700, 2880, 2880, 2760, 2660, 2550, 2510, 2430, 2270, 2130, 2060, 2000, 1970, 1950, 1950, 1960, 1960, 1970, 1980, 1950, 1978, 1830, 1780};
const G4double G4PiNuclearCrossSection::pb_p_t[30] = { 515, 940, 1500, 2400, 3270, 3750, 4050, 4140, 4260, 4200, 4080, 3990, 3990, 3810, 3730, 3520, 3370, 3186, 3110, 3010, 2990, 2985, 3005, 3020, 3040, 3080, 3020, 2905, 2790, 2750};
const G4double G4PiNuclearCrossSection::pb_p_in[30] = { 348, 707, 1040, 1650, 2100, 2400, 2580, 2640, 2650, 2520, 2410, 2300, 2250, 2190, 2130, 2000, 1930, 1870, 1830, 1790, 1770, 1765, 1775, 1780, 1790, 1800, 1775, 1710, 1620, 1620};
const G4double G4PiNuclearCrossSection::u_m_t[35] = {7080, 6830, 6650, 6530, 6400, 6280, 6100, 5840, 5660, 5520, 5330, 5160, 4990, 4810, 4630, 4323, 4130, 3870, 3700, 3550, 3490, 3465, 3467, 3475, 3495, 3515, 3440, 3360, 3150, 3040, 2985, 2955, 2940, 2940, 2940};
const G4double G4PiNuclearCrossSection::u_m_in[35] = {1740, 2220, 2500, 2820, 3080, 3300, 3420, 3500, 3420, 3330, 3200, 3060, 2940, 2850, 2710, 2470, 2380, 2250, 2160, 2080, 2040, 2045, 2047, 2050, 2055, 2060, 2010, 1980, 1830, 1780, 1735, 1710, 1700, 1700, 1700};
const G4double G4PiNuclearCrossSection::u_p_t[30] = { 485, 960, 1580, 2700, 3550, 4050, 4320, 4420, 4620, 4660, 4580, 4470, 4350, 4295, 4187, 3938, 3755, 3573, 3450, 3342, 3310, 3295, 3310, 3330, 3375, 3405, 3350, 3338, 3135, 3040};
const G4double G4PiNuclearCrossSection::u_p_in[30] = { 334, 720, 1020, 1560, 2100, 2300, 2550, 2700, 2880, 2880, 2760, 2660, 2550, 2510, 2430, 2270, 2130, 2060, 2000, 1970, 1950, 1950, 1960, 1960, 1970, 1980, 1950, 1978, 1830, 1780};
G4PiNuclearCrossSection::
G4PiNuclearCrossSection()
@@ -167,6 +172,8 @@ GetCrossSection(const G4DynamicParticle* aParticle,
G4double )
{
// precondition
G4ping debug("debug_PiNuclearCrossSection");
using namespace std;
G4bool ok = false;
if(aParticle->GetDefinition() == G4PionMinus::PionMinus()) ok=true;
if(aParticle->GetDefinition() == G4PionPlus::PionPlus()) ok=true;
@@ -180,9 +187,12 @@ GetCrossSection(const G4DynamicParticle* aParticle,
// body
G4double result = 0;
G4int Z=static_cast<G4int>(anElement->GetZ()+.001);
G4int Z=G4lrint(anElement->GetZ());
debug.push_back(Z);
size_t it=0;
while(it<theZ.size() && Z>theZ[it]) it++;
debug.push_back(theZ[it]);
debug.push_back(kineticEnergy);
if(Z > theZ[it])
{
throw G4HadronicException(__FILE__, __LINE__,
@@ -195,6 +205,8 @@ GetCrossSection(const G4DynamicParticle* aParticle,
if(theZ[it]==Z)
{
result = thePimData[it]->ReactionXSection(kineticEnergy);
debug.push_back("D1 ");
debug.push_back(result);
}
else
{
@@ -203,6 +215,12 @@ GetCrossSection(const G4DynamicParticle* aParticle,
x2 = thePimData[it]->ReactionXSection(kineticEnergy);
Z2 = theZ[it];
result = Interpolate(Z1, Z2, Z, x1, x2);
debug.push_back("D2 ");
debug.push_back(x1);
debug.push_back(x2);
debug.push_back(Z1);
debug.push_back(Z2);
debug.push_back(result);
}
}
else
@@ -215,6 +233,8 @@ GetCrossSection(const G4DynamicParticle* aParticle,
theData = &thePipData;
}
result = theData->operator[](it)->ReactionXSection(kineticEnergy);
debug.push_back("D3 ");
debug.push_back(result);
}
else
{
@@ -233,9 +253,16 @@ GetCrossSection(const G4DynamicParticle* aParticle,
x2 = theHData->operator[](it)->ReactionXSection(kineticEnergy);
Z2 = theZ[it];
result = Interpolate(Z1, Z2, Z, x1, x2);
debug.push_back("D4 ");
debug.push_back(x1);
debug.push_back(x2);
debug.push_back(Z1);
debug.push_back(Z2);
debug.push_back(result);
}
}
debug.dump();
return result;
}
@@ -72,9 +72,32 @@ GetCrossSection(const G4DynamicParticle* aPart,
G4double Energy = kineticEnergy/projectileAtomicNumber;
// done
G4double D = 2.77-(8.0E-3*targetAtomicNumber)+(1.8E-5*targetAtomicNumber*targetAtomicNumber)
//
// Note that this correction to G4TripathiCrossSection is just to accurately
// reflect Tripathi's algorithm. However, if you're using alpha particles/protons
// consider using the more accurate G4TripathiLightCrossSection, which
// Tripathi developed specifically for light systems.
//
G4double D;
if (nProjProtons==1 && projectileAtomicNumber==1)
{
D = 2.05;
}
else if (nProjProtons==2 && projectileAtomicNumber==4)
{
D = 2.77-(8.0E-3*targetAtomicNumber)+(1.8E-5*targetAtomicNumber*targetAtomicNumber)
- 0.8/(1+exp((250.-Energy)/75.));
D = 1.75;
}
else
{
//
// This is the original value used in the G4TripathiCrossSection implementation,
// and was used for all projectile/target conditions. I'm not touching this,
// althoughJudging from Tripathi's paper, this is valid for cases where the
// nucleon density changes little with A.
//
D = 1.75;
}
// done
G4double C_E = D * (1-exp(-Energy/40.)) - 0.292*exp(-Energy/792.)*cos(0.229*pow(Energy, 0.453));
@@ -94,5 +117,5 @@ GetCrossSection(const G4DynamicParticle* aPart,
if(result < 0) result = 0;
return result*m2;
}
@@ -0,0 +1,307 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4TripathiLightCrossSection.cc
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
///////////////////////////////////////////////////////////////////////////////
//
#include "G4TripathiLightCrossSection.hh"
#include "G4WilsonRadius.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
///////////////////////////////////////////////////////////////////////////////
//
G4TripathiLightCrossSection::G4TripathiLightCrossSection ()
{
//
//
// Constructor only needs to instantiate the object which provides functions
// to calculate the nuclear radius, and some other constants used to
// calculate cross-sections.
//
theWilsonRadius = new G4WilsonRadius();
r_0 = 1.1 * fermi;
third = 1.0/3.0;
//
//
// The following variable is set to true if
// G4TripathiLightCrossSection::GetCrossSection is going to be called from
// within G4TripathiLightCrossSection::GetCrossSection to check whether the
// cross-section is behaviing anomalously in the low-energy region.
//
lowEnergyCheck = false;
}
///////////////////////////////////////////////////////////////////////////////
//
G4TripathiLightCrossSection::~G4TripathiLightCrossSection ()
{
//
//
// Destructor just needs to delete the pointer to the G4WilsonRadius object.
//
delete theWilsonRadius;
}
///////////////////////////////////////////////////////////////////////////////
//
G4bool G4TripathiLightCrossSection::IsApplicable
(const G4DynamicParticle* theProjectile, const G4Element* theTarget)
{
G4bool result = false;
const G4double AT = theTarget->GetN();
const G4double ZT = theTarget->GetZ();
const G4double ZP = theProjectile->GetDefinition()->GetPDGCharge();
const G4double AP = theProjectile->GetDefinition()->GetBaryonNumber();
if (theProjectile->GetKineticEnergy()/
theProjectile->GetDefinition()->GetBaryonNumber()<10.0*GeV &&
((AT==1 && ZT==1) || (AP==1 && ZP==1) ||
(AT==1 && ZT==0) || (AP==1 && ZP==0) ||
(AT==2 && ZT==1) || (AP==2 && ZP==1) ||
(AT==3 && ZT==2) || (AP==3 && ZP==2) ||
(AT==4 && ZT==2) || (AP==4 && ZP==2))) result = true;
return result;
}
///////////////////////////////////////////////////////////////////////////////
//
G4double G4TripathiLightCrossSection::GetCrossSection
(const G4DynamicParticle* theProjectile, const G4Element* theTarget,
G4double /* theTemperature*/)
{
//
//
// Initialise the result.
G4double result = 0.0;
//
//
// Get details of the projectile and target (nucleon number, atomic number,
// kinetic enery and energy/nucleon.
//
const G4double AT = theTarget->GetN();
const G4double ZT = theTarget->GetZ();
const G4double EA = theProjectile->GetKineticEnergy()/MeV;
const G4double AP = theProjectile->GetDefinition()->GetBaryonNumber();
const G4double ZP = theProjectile->GetDefinition()->GetPDGCharge();
G4double E = EA / AP;
//
//
// Determine target mass and energy within the centre-of-mass frame.
//
G4double mT = G4ParticleTable::GetParticleTable()
->GetIonTable()
->GetIonMass(static_cast<G4int>(ZT), static_cast<G4int>(AT));
G4LorentzVector pT(0.0, 0.0, 0.0, mT);
G4LorentzVector pP(theProjectile->Get4Momentum());
pT = pT + pP;
G4double E_cm = (pT.mag()-mT-pP.m())/MeV;
//
//
// Determine nuclear radii. Note that the r_p and r_T are defined differently
// from Wilson et al.
//
G4WilsonRadius theWilsonNuclearRadius;
G4double r_rms_p = theWilsonRadius->GetWilsonRMSRadius(AP);
G4double r_rms_t = theWilsonRadius->GetWilsonRMSRadius(AT);
G4double r_p = 1.29*r_rms_p;
G4double r_t = 1.29*r_rms_t;
G4double Radius = (r_p + r_t)/fermi + 1.2*(pow(AT, third) + pow(AP, third))/
pow(E_cm, third);
G4double B = 1.44 * ZP * ZT / Radius;
//
//
// Now determine other parameters associated with the parametric
// formula, depending upon the projectile and target.
//
G4double T1 = 0.0;
G4double D = 0.0;
G4double G = 0.0;
if ((AT==1 && ZT==1) || (AP==1 && ZP==1))
{
T1 = 23.0;
D = 1.85 + 0.16/(1+exp((500.0-E)/200.0));
}
else if ((AT==1 && ZT==0) || (AP==1 && ZP==0))
{
T1 = 18.0;
D = 1.85 + 0.16/(1+exp((500.0-E)/200.0));
}
else if ((AT==2 && ZT==1) || (AP==2 && ZP==1))
{
T1 = 23.0;
D = 1.65 + 0.1/(1+exp((500.0-E)/200.0));
}
else if ((AT==3 && ZT==2) || (AP==3 && ZP==2))
{
T1 = 40.0;
D = 1.55;
}
else if (AP==4 && ZP==2)
{
if (AT==4 && ZT==2) {T1 = 40.0; G = 300.0;}
else if (ZT==4) {T1 = 25.0; G = 300.0;}
else if (ZT==7) {T1 = 40.0; G = 500.0;}
else if (ZT==13) {T1 = 25.0; G = 300.0;}
else if (ZT==26) {T1 = 40.0; G = 300.0;}
else {T1 = 40.0; G = 75.0;}
D = 2.77 - 8.0E-3*AT + 1.8E-5*AT*AT-0.8/(1.0+exp((250.0-E)/G));
}
else if (AT==4 && ZT==2)
{
if (AP==4 && ZP==2) {T1 = 40.0; G = 300.0;}
else if (ZP==4) {T1 = 25.0; G = 300.0;}
else if (ZP==7) {T1 = 40.0; G = 500.0;}
else if (ZP==13) {T1 = 25.0; G = 300.0;}
else if (ZP==26) {T1 = 40.0; G = 300.0;}
else {T1 = 40.0; G = 75.0;}
D = 2.77 - 8.0E-3*AP + 1.8E-5*AP*AP-0.8/(1.0+exp((250.0-E)/G));
}
//
//
// C_E, S, deltaE, X1, S_L and X_m correspond directly with the original
// formulae of Tripathi et al in his report.
//
G4double C_E = D*(1.0-exp(-E/T1)) -
0.292*exp(-E/792.0)*cos(0.229*pow(E,0.453));
G4double S = pow(AP,third)*pow(AT,third)/(pow(AP,third) + pow(AT,third));
G4double deltaE = 0.0;
G4double X1 = 0.0;
if (AT >= AP)
{
deltaE = 1.85*S + 0.16*S/pow(E_cm,third) - C_E + 0.91*(AT-2.0*ZT)*ZP/AT/AP;
X1 = 2.83 - 3.1E-2*AT + 1.7E-4*AT*AT;
}
else
{
deltaE = 1.85*S + 0.16*S/pow(E_cm,third) - C_E + 0.91*(AP-2.0*ZP)*ZT/AT/AP;
X1 = 2.83 - 3.1E-2*AP + 1.7E-4*AP*AP;
}
G4double S_L = 1.2 + 1.6*(1.0-exp(-E/15.0));
G4double X_m = 1.0 - X1*exp(-E/X1*S_L);
//
//
// R_c is also highly dependent upon the A and Z of the projectile and
// target.
//
G4double R_c = 1.0;
if (AP==1 && ZP==1)
{
if (AT==2 && ZT==1) R_c = 13.5;
else if (AT==3 && ZT==2) R_c = 21.0;
else if (AT==4 && ZT==2) R_c = 27.0;
else if (ZT==3) R_c = 2.2;
}
else if (AT==1 && ZT==1)
{
if (AP==2 && ZP==1) R_c = 13.5;
else if (AP==3 && ZP==2) R_c = 21.0;
else if (AP==4 && ZP==2) R_c = 27.0;
else if (ZP==3) R_c = 2.2;
}
else if (AP==2 && ZP==1)
{
if (AT==2 && ZT==1) R_c = 13.5;
else if (AT==4 && ZT==2) R_c = 13.5;
else if (AT==12 && ZT==6) R_c = 6.0;
}
else if (AT==2 && ZT==1)
{
if (AP==2 && ZP==1) R_c = 13.5;
else if (AP==4 && ZP==2) R_c = 13.5;
else if (AP==12 && ZP==6) R_c = 6.0;
}
else if ((AP==4 && ZP==2 && (ZT==73 || ZT==79)) ||
(AT==4 && ZT==2 && (ZP==73 || ZP==79))) R_c = 0.6;
//
//
// Find the total cross-section. Check that it's value is positive, and if
// the energy is less that 10 MeV/nuc, find out if the cross-section is
// increasing with decreasing energy. If so this is a sign that the function
// is behaving badly at low energies, and the cross-section should be
// set to zero.
//
result = pi * r_0*r_0 *
pow((pow(AT,third) + pow(AP,third) + deltaE),2.0) *
(1.0 - R_c*B/E_cm) * X_m;
if (!lowEnergyCheck)
{
if (result < 0.0)
result = 0.0;
else if (E < 6.0*MeV)
{
G4double f = 0.95;
G4DynamicParticle slowerProjectile = *theProjectile;
slowerProjectile.SetKineticEnergy(f * EA * MeV);
G4TripathiLightCrossSection theTripathiLightCrossSection;
theTripathiLightCrossSection.SetLowEnergyCheck(true);
G4double resultp =
theTripathiLightCrossSection.GetCrossSection
(&slowerProjectile, theTarget, 0.0);
if (resultp >result) result = 0.0;
}
}
return result;
}
///////////////////////////////////////////////////////////////////////////////
//
void G4TripathiLightCrossSection::SetLowEnergyCheck (G4bool aLowEnergyCheck)
{
lowEnergyCheck = aLowEnergyCheck;
}
///////////////////////////////////////////////////////////////////////////////
//
@@ -49,6 +49,7 @@
#include "G4Delete.hh"
#include "G4CrossSectionDataStore.hh"
#include "G4HadronicException.hh"
#include "G4Fuzzy.hh"
class G4Track;
class G4Step;
@@ -97,6 +98,15 @@ class G4ParticleChange;
return anIsoResult;
}
// use this with bool only
static G4bool AlwaysKillLeadingHadron(G4Fuzzy aB=G4Fuzzy())
{
static G4Fuzzy state = G4Fuzzy();
if(getenv("AlwaysKillLeadingHadron")) return true;
if (!aB.first) state = aB;
return state.second;
}
void BiasCrossSectionByFactor(G4double aScale)
{
xBiasOn = true;
@@ -49,9 +49,7 @@
#include "G4HadReentrentException.hh"
#include "G4HadronicInteractionWrapper.hh"
#ifndef G4HadSignalHandler_off
#include "G4HadSignalHandler.hh"
#endif
#include "G4HadSignalHandler.hh"
//@@ add model name info, once typeinfo available #include <typeinfo.h>
@@ -63,8 +61,8 @@
}
}
G4IsoParticleChange * G4HadronicProcess::theIsoResult = 0;
G4IsoParticleChange * G4HadronicProcess::theOldIsoResult = 0;
G4IsoParticleChange * G4HadronicProcess::theIsoResult = NULL;
G4IsoParticleChange * G4HadronicProcess::theOldIsoResult = NULL;
G4bool G4HadronicProcess::isoIsEnabled = true;
void G4HadronicProcess::
@@ -95,9 +93,7 @@
theBias.end(),
G4Delete());
if(theOldIsoResult) delete theOldIsoResult;
if(theIsoResult) delete theIsoResult;
theOldIsoResult=0;
theIsoResult=0;
// if(theIsoResult) delete theIsoResult;
}
void G4HadronicProcess::RegisterMe( G4HadronicInteraction *a )
@@ -320,6 +316,16 @@ GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
#ifndef G4HadSignalHandler_off
G4HadSignalHandler aHandler(G4HadronicProcess_local::G4HadronicProcessHandler_1);
#endif
if(aTrack.GetTrackStatus() != fAlive)
{
G4cerr << "G4HadronicProcess: track in unusable state - "
<<aTrack.GetTrackStatus()<<G4endl;
G4cerr << "G4HadronicProcess: returning unchanged track "<<G4endl;
G4Exception("G4HadronicProcess", "001", JustWarning, "bailing out");
theTotalResult->Clear();
theTotalResult->Initialize(aTrack);
return theTotalResult;
}
const G4DynamicParticle *aParticle = aTrack.GetDynamicParticle();
G4Material *aMaterial = aTrack.GetMaterial();
G4double originalEnergy = aParticle->GetKineticEnergy();
@@ -467,19 +473,15 @@ GetMeanFreePath(const G4Track &aTrack, G4double, G4ForceCondition *)
const G4Nucleus & aNucleus)
{
// get the PC from iso-production
if(theOldIsoResult)
{
delete theOldIsoResult;
theOldIsoResult=0;
}
if(theOldIsoResult) delete theOldIsoResult;
if(theIsoResult) delete theIsoResult;
theIsoResult = new G4IsoParticleChange;
G4bool done = false;
G4IsoResult * anIsoResult = 0;
G4IsoResult * anIsoResult = NULL;
for(unsigned int i=0; i<theProductionModels.size(); i++)
{
anIsoResult = theProductionModels[i]->GetIsotope(aTrack, aNucleus);
if(anIsoResult!=0)
if(anIsoResult!=NULL)
{
done = true;
break;
@@ -597,6 +599,7 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
<<G4endl;
}
*/
// if(GetProcessName() != "LElastic") std::cout << "Debug -1 "<<aR->GetStatusChange()<<std::endl;
if(aR->GetStatusChange()==stopAndKill)
{
if( xBiasOn && G4UniformRand()<XBiasSurvivalProbability() )
@@ -634,11 +637,13 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
go_wild(aR->GetMomentumChange().z()))
{
G4Exception("G4HadronicProcess", "007", FatalException,
"survivine track received NaN momentum.");
"surviving track received NaN momentum.");
}
G4DynamicParticle * aNew = new G4DynamicParticle(aT.GetDefinition(),
aR->GetEnergyChange(),
aR->GetMomentumChange());
G4double newM=aT.GetDefinition()->GetPDGMass();
G4double newE=aR->GetEnergyChange() + newM;
G4double newP=sqrt(newE*newE - newM*newM);
G4DynamicParticle * aNew =
new G4DynamicParticle(aT.GetDefinition(), newE, newP*aR->GetMomentumChange());
G4HadSecondary * theSec = new G4HadSecondary(aNew, newWeight);
aR->AddSecondary(theSec);
}
@@ -662,16 +667,42 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
}
else
{
G4cerr << "Track status is "<< aR->GetStatusChange()<<G4endl;
G4Exception("G4HadronicProcess", "007", FatalException,
"use of unsupported track-status.");
G4cerr << "Track status is "<< aR->GetStatusChange()<<G4endl;
G4Exception("G4HadronicProcess", "007", FatalException,
"use of unsupported track-status.");
}
if(GetProcessName() != "LElastic"
&&
AlwaysKillLeadingHadron()
&&
theTotalResult->GetStatusChange()==fAlive
&&
aR->GetStatusChange()==isAlive)
{
G4double newWeight = theTotalResult->GetWeightChange();
G4double newM=aT.GetDefinition()->GetPDGMass();
G4double newE=aR->GetEnergyChange() + newM;
G4double newP=sqrt(newE*newE - newM*newM);
G4DynamicParticle * aNew =
new G4DynamicParticle(aT.GetDefinition(), newE, newP*aR->GetMomentumChange());
// std::cout << "Debug 0 "<<aR->GetNumberOfSecondaries()<<std::endl;
//std::cout << "Debug 1 "<<aR->GetEnergyChange()<<" "<< aNew->GetTotalEnergy() <<std::endl;
//std::cout << "Debug 2 "<<aR->GetMomentumChange()<<" "<< aNew->GetMomentum() << std::endl;
//std::cout << "Debug 3 "<<newWeight<<std::endl;
//std::cout << std::endl;
G4HadSecondary * theSec = new G4HadSecondary(aNew, newWeight);
aR->AddSecondary(theSec);
aR->SetStatusChange(stopAndKill);
theTotalResult->SetStatusChange(fStopAndKill);
theTotalResult->SetEnergyChange( 0.0 );
//std::cout << "Debug 4 "<< aR->GetNumberOfSecondaries() <<std::endl;
}
theTotalResult->SetLocalEnergyDeposit(aR->GetLocalEnergyDeposit());
theTotalResult->SetNumberOfSecondaries(aR->GetNumberOfSecondaries());
for(G4int i=0; i<aR->GetNumberOfSecondaries(); i++)
{
//std::cout << "Debug 5 "<< aR->GetNumberOfSecondaries() <<std::endl;
G4LorentzVector theM = aR->GetSecondary(i)->GetParticle()->Get4Momentum();
theM.rotate(rotation, it);
theM*=aR->GetTrafoToLab();
@@ -696,16 +727,16 @@ void G4HadronicProcess::FillTotalResult(G4HadFinalState * aR, const G4Track & aT
G4double newWeight = aT.GetWeight()*aR->GetSecondary(i)->GetWeight();
//static G4double pinelcount=0;
if(xBiasOn) newWeight *= XBiasSecondaryWeight();
/* G4cout << "#### ParticleDebug "
<<GetProcessName()<<" "
<<aR->GetSecondary(i)->GetParticle()->GetDefinition()->GetParticleName()<<" "
<<aScaleFactor<<" "
<<XBiasSurvivalProbability()<<" "
<<XBiasSecondaryWeight()<<" "
<<aT.GetWeight()<<" "
<<aR->GetSecondary(i)->GetWeight()<<" "
<<aR->GetSecondary(i)->GetParticle()<<" "
<<G4endl;*/
// G4cout << "#### ParticleDebug "
// <<GetProcessName()<<" "
// <<aR->GetSecondary(i)->GetParticle()->GetDefinition()->GetParticleName()<<" "
// <<aScaleFactor<<" "
// <<XBiasSurvivalProbability()<<" "
// <<XBiasSecondaryWeight()<<" "
// <<aT.GetWeight()<<" "
// <<aR->GetSecondary(i)->GetWeight()<<" "
// <<aR->GetSecondary(i)->GetParticle()->Get4Momentum()<<" "
// <<G4endl;
track->SetWeight(newWeight);
G4double trackDeb = track->GetKineticEnergy();
if( ( trackDeb<0
+9 -3
View File
@@ -1,11 +1,12 @@
# $Id: GNUmakefile,v 1.13 2003/11/24 12:54:22 gcosmo Exp $
# $Id: GNUmakefile,v 1.16 2004/06/01 05:37:56 hpw Exp $
# --------------------------------------------------------------
# GNUmakefile for hadronic models library. G.Folger 10-Dec-97
# --------------------------------------------------------------
name := G4hadronic_models
SUBDIRS = binary_cascade
SUBDIRS = abrasion
SUBDIRS += binary_cascade
SUBDIRS += cascade/evaporation
SUBDIRS += cascade/utils
SUBDIRS += cascade/cascade
@@ -21,6 +22,8 @@ SUBDIRS += de_excitation/management
SUBDIRS += de_excitation/multifragmentation
SUBDIRS += de_excitation/photon_evaporation
SUBDIRS += de_excitation/util
SUBDIRS += de_excitation/ablation
SUBDIRS += em_dissociation
SUBDIRS += high_energy
SUBDIRS += im_r_matrix
SUBDIRS += isotope_production
@@ -38,7 +41,8 @@ SUBDIRS += radioactive_decay
SUBDIRS += theo_high_energy
SUBDIRS += util
SUBLIBS = G4hadronic_binary
SUBLIBS = G4hadronic_abrasion
SUBLIBS += G4hadronic_binary
SUBLIBS += G4hadronic_coherent_elastic
SUBLIBS += G4hadronic_HE
SUBLIBS += G4had_im_r_matrix
@@ -64,6 +68,8 @@ SUBLIBS += G4hadronic_deex_management
SUBLIBS += G4hadronic_deex_multifragmentation
SUBLIBS += G4hadronic_deex_photon_evaporation
SUBLIBS += G4hadronic_deex_util
SUBLIBS += G4hadronic_ablation
SUBLIBS += G4hadronic_em_dissociation
SUBLIBS += G4had_preequ_exciton
SUBLIBS += G4had_muon_nuclear
SUBLIBS += G4had_string_diff
@@ -0,0 +1,50 @@
# $Id: GNUmakefile,v 1.2 2004/05/28 13:00:45 hpw Exp $
# -----------------------------------------------------------
# GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96.
# -----------------------------------------------------------
name := G4hadronic_abrasion
ifndef G4INSTALL
G4INSTALL = ../../../../..
endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/HEPNumerics/include \
-I$(G4BASE)/global/HEPGeometry/include \
-I$(G4BASE)/track/include \
-I$(G4BASE)/geometry/volumes/include \
-I$(G4BASE)/geometry/magneticfield/include \
-I$(G4BASE)/geometry/management/include \
-I$(G4BASE)/processes/management/include \
-I$(G4BASE)/processes/hadronic/management/include/ \
-I$(G4BASE)/processes/hadronic/util/include \
-I$(G4BASE)/processes/hadronic/processes/include \
-I$(G4BASE)/processes/hadronic/cross_sections/include \
-I$(G4BASE)/processes/hadronic/models/management/include \
-I$(G4BASE)/processes/hadronic/models/util/include \
-I$(G4BASE)/processes/hadronic/models/im_r_matrix/include \
-I$(G4BASE)/processes/hadronic/models/ablation/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/util/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/evaporation/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/fermi_breakup/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/photon_evaporation/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/multifragmentation/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/handler/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/management/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/ablation/include \
-I$(G4BASE)/processes/hadronic/models/pre_equilibrium/exciton_model/include \
-I$(G4BASE)/particles/management/include \
-I$(G4BASE)/particles/leptons/include \
-I$(G4BASE)/particles/bosons/include \
-I$(G4BASE)/particles/hadrons/mesons/include \
-I$(G4BASE)/particles/hadrons/barions/include \
-I$(G4BASE)/particles/hadrons/ions/include \
-I$(G4BASE)/particles/shortlived/include \
-I$(G4BASE)/materials/include
include $(G4INSTALL)/config/common.gmk
@@ -0,0 +1,95 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4NuclearAbrasionGeometry_h
#define G4NuclearAbrasionGeometry_h 1
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4NuclearAbrasionGeometry.hh
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 18 November 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "globals.hh"
////////////////////////////////////////////////////////////////////////////////
//
class G4NuclearAbrasionGeometry
{
public:
G4NuclearAbrasionGeometry (G4double AP, G4double AT, G4double r);
~G4NuclearAbrasionGeometry ();
void SetPeripheralThreshold (G4double);
G4double GetPeripheralThreshold ();
G4double F ();
G4double P ();
G4double GetExcitationEnergyOfProjectile ();
G4double GetExcitationEnergyOfTarget ();
private:
G4double AP;
G4double AT;
G4double rP;
G4double rT;
G4double r;
G4double n;
G4double b;
G4double m;
G4double Q;
G4double S;
G4double T;
G4double R;
G4double U;
G4double rth;
G4double B;
};
#endif
@@ -0,0 +1,152 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4WilsonAbrasionModel_h
#define G4WilsonAbrasionModel_h
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4WilsonAbrasionModel.hh
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// Class Description
//
//
// Class Description - End
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "globals.hh"
#include "G4HadronicInteraction.hh"
#include "G4WilsonAblationModel.hh"
#include "G4ExcitationHandler.hh"
#include "G4HadFinalState.hh"
#include "G4Track.hh"
#include "G4Nucleus.hh"
#include "G4Fragment.hh"
#include "G4HadProjectile.hh"
////////////////////////////////////////////////////////////////////////////////
//
class G4WilsonAbrasionModel : public G4HadronicInteraction
{
public:
G4WilsonAbrasionModel (G4bool useAblation1 = false);
G4WilsonAbrasionModel (G4ExcitationHandler *);
~G4WilsonAbrasionModel ();
G4WilsonAbrasionModel(const G4WilsonAbrasionModel &right);
const G4WilsonAbrasionModel& operator=(G4WilsonAbrasionModel &right);
virtual G4HadFinalState *ApplyYourself
(const G4HadProjectile &, G4Nucleus &);
void SetVerboseLevel (G4int);
void SetUseAblation (G4bool);
G4bool GetUseAblation ();
void SetConserveMomentum (G4bool);
G4bool GetConserveMomentum ();
void SetExcitationHandler (G4ExcitationHandler *);
G4ExcitationHandler *GetExcitationHandler ();
private:
void PrintWelcomeMessage ();
G4Fragment *GetAbradedNucleons (G4int, G4double, G4double, G4double);
G4double GetNucleonInducedExcitation (G4double, G4double, G4double);
void SetConserveEnergy (G4bool);
G4bool GetConserveEnergy ();
private:
G4double r0sq;
G4double npK;
G4bool useAblation;
G4WilsonAblationModel *theAblation;
G4ExcitationHandler *theExcitationHandler;
G4ExcitationHandler *theExcitationHandlerx;
G4bool conserveEnergy;
G4bool conserveMomentum;
G4double B;
G4double third;
};
////////////////////////////////////////////////////////////////////////////////
//
inline void G4WilsonAbrasionModel::SetExcitationHandler
(G4ExcitationHandler *aExcitationHandler)
{theExcitationHandler = aExcitationHandler;}
inline G4ExcitationHandler *G4WilsonAbrasionModel::GetExcitationHandler ()
{return theExcitationHandler;}
inline G4bool G4WilsonAbrasionModel::GetUseAblation ()
{return useAblation;}
inline void G4WilsonAbrasionModel::SetConserveEnergy (G4bool conserveEnergy1)
{conserveEnergy = conserveEnergy1;}
inline G4bool G4WilsonAbrasionModel::GetConserveEnergy ()
{return conserveEnergy;}
inline void G4WilsonAbrasionModel::SetConserveMomentum
(G4bool conserveMomentum1)
{conserveMomentum = conserveMomentum1;}
inline G4bool G4WilsonAbrasionModel::GetConserveMomentum ()
{return conserveMomentum;}
inline void G4WilsonAbrasionModel::SetVerboseLevel (G4int verboseLevel1)
{
verboseLevel = verboseLevel1;
if (useAblation)
theAblation->SetVerboseLevel(verboseLevel);
}
////////////////////////////////////////////////////////////////////////////////
//
#endif
@@ -0,0 +1,227 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4NuclearAbrasionGeometry.cc
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 18 November 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// 4 June 2004, J.P. Wellisch, CERN, Switzerland
// resolving technical portability issues.
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "G4NuclearAbrasionGeometry.hh"
#include "G4WilsonRadius.hh"
////////////////////////////////////////////////////////////////////////////////
//
G4NuclearAbrasionGeometry::G4NuclearAbrasionGeometry (G4double AP1,
G4double AT1, G4double r1)
{
//
//
// Initialise variables for interaction geometry.
//
G4WilsonRadius aR;
AP = AP1;
AT = AT1;
rP = aR.GetWilsonRadius(AP);
rT = aR.GetWilsonRadius(AT);
r = r1;
n = rP / (rP + rT);
b = r / (rP + rT);
m = rT / rP;
Q = (1.0 - b)/n;
S = Q * Q;
T = S * Q;
R = sqrt(m*n);
U = 1.0/m - 2.0;
//
//
// Initialise the threshold radius-ratio at which interactions are considered
// peripheral or central.
//
rth = 2.0/3.0;
B = 10.0 * MeV;
}
////////////////////////////////////////////////////////////////////////////////
//
G4NuclearAbrasionGeometry::~G4NuclearAbrasionGeometry ()
{;}
////////////////////////////////////////////////////////////////////////////////
//
void G4NuclearAbrasionGeometry::SetPeripheralThreshold (G4double rth1)
{if (rth1 > 0.0 && rth1 <= 1.0) rth = rth1;}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4NuclearAbrasionGeometry::GetPeripheralThreshold ()
{return rth;}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4NuclearAbrasionGeometry::P ()
{
//
//
// Initialise the value for P, then determine the actual value depending upon
// whether the projectile is larger or smaller than the target and these radii
// in relation to the impact parameter.
//
G4double P = 0.0;
if (rT > rP)
{
if (rT-rP<=r && r<=rT+rP) P = 0.125*R*U*S - 0.125*(0.5*R*U+1.0)*T;
else P = -1.0;
}
else
{
if (rP-rT<=r && r<=rP+rT) P = 0.125*R*U*S - 0.125*(0.5*sqrt(n/m)*U-
(sqrt(1.0-m*m)/n - 1.0)*sqrt((2.0-m)/pow(m,5.0)))*T;
else P = (sqrt(1.0-m*m)/n-1.0)*sqrt(1.0-b*b/n/n);
}
if (!(P <= 1.0 && P>= -1.0))
{
if (P > 1.0) P = 1.0;
else P = -1.0;
}
return P;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4NuclearAbrasionGeometry::F ()
{
//
//
// Initialise the value for F, then determine the actual value depending upon
// whether the projectile is larger or smaller than the target and these radii
// in relation to the impact parameter.
//
G4double F = 0.0;
if (rT > rP)
{
if (rT-rP<=r && r<=rT+rP) F = 0.75*R*S - 0.125*(3.0*R-1.0)*T;
else F = 1.0;
}
else
{
if (rP-rT<=r && r<=rP+rT) F = 0.75*R*S - 0.125*(3.0*sqrt(n/m)-
(1.0-pow(1.0-m*m,3.0/2.0))*sqrt(1.0-pow(1.0-m,2.0))/pow(m,3.0))*T;
else F = (1.0-pow(1.0-m*m,3.0/2.0))*sqrt(1.0-b*b/n/n);
}
if (!(F <= 1.0 && F>= 0.0))
{
if (F > 1.0) F = 1.0;
else F = 0.0;
}
return F;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4NuclearAbrasionGeometry::GetExcitationEnergyOfProjectile ()
{
G4double F1 = F();
G4double P1 = P();
G4double Es = 0.0;
Es = 0.95 * MeV * 4.0 * pi * rP*rP/fermi/fermi *
(1.0+P1-pow(1.0-F1,2.0/3.0));
// if (rT < rP && r < rP-rT)
if ((r-rP)/rT < rth)
{
G4double omega = 0.0;
if (AP < 12.0) omega = 1500.0;
else if (AP <= 16.0) omega = 1500.0 - 320.0*(AP-12.0);
Es *= 1.0 + F1*(5.0+omega*F1*F1);
}
if (Es < 0.0)
Es = 0.0;
else if (Es > B * AP)
Es = B * AP;
return Es;
}
//////////////////////////////////////////////////////////////////////////////////////
//
G4double G4NuclearAbrasionGeometry::GetExcitationEnergyOfTarget ()
{
//
//
// This member function declares a new G4NuclearAbrasionGeometry object but with the
// projectile and target exchanged to determine the values for F and P. Determination
// of the excess surface area and excitation energy is as above.
//
G4NuclearAbrasionGeometry *revAbrasionGeometry =
new G4NuclearAbrasionGeometry(AT, AP, r);
G4double F1 = revAbrasionGeometry->F();
G4double P1 = revAbrasionGeometry->P();
G4double Es = 0.0;
Es = 0.95 * MeV * 4.0 * pi * rT*rT/fermi/fermi *
(1.0+P1-pow(1.0-F1,2.0/3.0));
// if (rP < rT && r < rT-rP)
if ((r-rT)/rP < rth)
{
G4double omega = 0.0;
if (AT < 12.0) omega = 1500.0;
else if (AT <= 16.0) omega = 1500.0 - 320.0*(AT-12.0);
Es *= 1.0 + F1*(5.0+omega*F1*F1);
}
if (Es < 0.0)
Es = 0.0;
else if (Es > B * AT)
Es = B * AT;
return Es;
}
////////////////////////////////////////////////////////////////////////////////
//
@@ -0,0 +1,813 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * *
// * Parts of this code which have been developed by QinetiQ Ltd *
// * under contract to the European Space Agency (ESA) are the *
// * intellectual property of ESA. Rights to use, copy, modify and *
// * redistribute this software for general public use are granted *
// * in compliance with any licensing, distribution and development *
// * policy adopted by the Geant4 Collaboration. This code has been *
// * written by QinetiQ Ltd for the European Space Agency, under ESA *
// * contract 17191/03/NL/LvH (Aurora Programme). *
// * *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// MODULE: G4WilsonAbrasionModel.cc
//
// Version: B.1
// Date: 15/04/04
// Author: P R Truscott
// Organisation: QinetiQ Ltd, UK
// Customer: ESA/ESTEC, NOORDWIJK
// Contract: 17191/03/NL/LvH
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// CHANGE HISTORY
// --------------
//
// 6 October 2003, P R Truscott, QinetiQ Ltd, UK
// Created.
//
// 15 March 2004, P R Truscott, QinetiQ Ltd, UK
// Beta release
//
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
////////////////////////////////////////////////////////////////////////////////
//
#include "G4WilsonAbrasionModel.hh"
#include "G4WilsonRadius.hh"
#include "G4NuclearAbrasionGeometry.hh"
#include "G4WilsonAblationModel.hh"
#include "G4ExcitationHandler.hh"
#include "G4Evaporation.hh"
#include "G4FermiBreakUp.hh"
#include "G4StatMF.hh"
#include "G4ParticleDefinition.hh"
#include "G4DynamicParticle.hh"
#include "Randomize.hh"
#include "G4Fragment.hh"
#include "G4VNuclearDensity.hh"
#include "G4NuclearShellModelDensity.hh"
#include "G4NuclearFermiDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4ReactionProductVector.hh"
#include "G4LorentzVector.hh"
#include "G4ParticleMomentum.hh"
#include "G4Poisson.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "globals.hh"
////////////////////////////////////////////////////////////////////////////////
//
G4WilsonAbrasionModel::G4WilsonAbrasionModel (G4bool useAblation1)
{
//
//
// Send message to stdout to advise that the G4Abrasion model is being used.
//
PrintWelcomeMessage();
//
//
// Set the default verbose level to 0 - no output.
//
verboseLevel = 0;
useAblation = useAblation1;
//
//
// No de-excitation handler has been supplied - define the default handler.
//
theExcitationHandler = new G4ExcitationHandler;
theExcitationHandlerx = new G4ExcitationHandler;
if (useAblation)
{
theAblation = new G4WilsonAblationModel;
theAblation->SetVerboseLevel(verboseLevel);
theExcitationHandler->SetEvaporation(theAblation);
theExcitationHandlerx->SetEvaporation(theAblation);
}
else
{
theAblation = NULL;
G4Evaporation * theEvaporation = new G4Evaporation;
G4FermiBreakUp * theFermiBreakUp = new G4FermiBreakUp;
G4StatMF * theMF = new G4StatMF;
theExcitationHandler->SetEvaporation(theEvaporation);
theExcitationHandler->SetFermiModel(theFermiBreakUp);
theExcitationHandler->SetMultiFragmentation(theMF);
theExcitationHandler->SetMaxAandZForFermiBreakUp(12, 6);
theExcitationHandler->SetMinEForMultiFrag(5.0*MeV);
theEvaporation = new G4Evaporation;
theFermiBreakUp = new G4FermiBreakUp;
theExcitationHandlerx->SetEvaporation(theEvaporation);
theExcitationHandlerx->SetFermiModel(theFermiBreakUp);
theExcitationHandlerx->SetMaxAandZForFermiBreakUp(12, 6);
}
//
//
// Set the minimum and maximum range for the model (despite nomanclature, this
// is in energy per nucleon number).
//
SetMinEnergy(70.0*MeV);
SetMaxEnergy(10.1*GeV);
isBlocked = false;
//
//
// npK, when mutiplied by the nuclear Fermi momentum, determines the range of
// momentum over which the secondary nucleon momentum is sampled.
//
npK = 5.0;
B = 10.0 * MeV;
third = 1.0 / 3.0;
conserveEnergy = false;
conserveMomentum = true;
}
////////////////////////////////////////////////////////////////////////////////
//
G4WilsonAbrasionModel::G4WilsonAbrasionModel (G4ExcitationHandler *aExcitationHandler)
{
//
//
// Send message to stdout to advise that the G4Abrasion model is being used.
//
PrintWelcomeMessage();
//
//
// Set the default verbose level to 0 - no output.
//
verboseLevel = 0;
//
//
// The user is able to provide the excitation handler as well as an argument
// which is provided in this instantiation is used to determine
// whether the spectators of the interaction are free following the abrasion.
//
theExcitationHandler = aExcitationHandler;
theExcitationHandlerx = new G4ExcitationHandler;
G4Evaporation * theEvaporation = new G4Evaporation;
G4FermiBreakUp * theFermiBreakUp = new G4FermiBreakUp;
theExcitationHandlerx->SetEvaporation(theEvaporation);
theExcitationHandlerx->SetFermiModel(theFermiBreakUp);
theExcitationHandlerx->SetMaxAandZForFermiBreakUp(12, 6);
//
//
// Set the minimum and maximum range for the model (despite nomanclature, this
// is in energy per nucleon number).
//
SetMinEnergy(70.0*MeV);
SetMaxEnergy(10.1*GeV);
isBlocked = false;
//
//
// npK, when mutiplied by the nuclear Fermi momentum, determines the range of
// momentum over which the secondary nucleon momentum is sampled.
//
npK = 5.0;
B = 10.0 * MeV;
third = 1.0 / 3.0;
conserveEnergy = false;
conserveMomentum = true;
}
////////////////////////////////////////////////////////////////////////////////
//
G4WilsonAbrasionModel::~G4WilsonAbrasionModel ()
{
//
//
// The destructor doesn't have to do a great deal!
//
delete theExcitationHandler;
delete theExcitationHandlerx;
}
////////////////////////////////////////////////////////////////////////////////
//
G4HadFinalState *G4WilsonAbrasionModel::ApplyYourself (
const G4HadProjectile &theTrack, G4Nucleus &theTarget)
{
//
//
// The secondaries will be returned in G4HadFinalState &theParticleChange -
// initialise this. The original track will always be discontinued and
// secondaries followed.
//
theParticleChange.Clear();
theParticleChange.SetStatusChange(stopAndKill);
//
//
// Get relevant information about the projectile and target (A, Z, energy/nuc,
// momentum, etc).
//
const G4ParticleDefinition *definitionP = theTrack.GetDefinition();
const G4double AP = definitionP->GetBaryonNumber();
const G4double ZP = definitionP->GetPDGCharge();
G4LorentzVector pP = theTrack.Get4Momentum();
G4double E = theTrack.GetKineticEnergy()/AP;
G4double AT = theTarget.GetN();
G4double ZT = theTarget.GetZ();
G4double TotalEPre = theTrack.GetTotalEnergy() +
theTarget.AtomicMass(AT, ZT) + theTarget.GetEnergyDeposit();
G4double TotalEPost = 0.0;
//
//
// Determine the radii of the projectile and target nuclei.
//
G4WilsonRadius aR;
G4double rP = aR.GetWilsonRadius(AP);
G4double rT = aR.GetWilsonRadius(AT);
G4double rPsq = rP * rP;
G4double rTsq = rT * rT;
if (verboseLevel >= 2)
{
G4cout <<"########################################"
<<"########################################"
<<G4endl;
G4cout.precision(6);
G4cout <<"IN G4WilsonAbrasionModel" <<G4endl;
G4cout <<"Initial projectile A=" <<AP
<<", Z=" <<ZP
<<", radius = " <<rP/fermi <<" fm"
<<G4endl;
G4cout <<"Initial target A=" <<AT
<<", Z=" <<ZT
<<", radius = " <<rT/fermi <<" fm"
<<G4endl;
G4cout <<"Projectile momentum and Energy/nuc = " <<pP <<" ," <<E <<G4endl;
}
//
//
// The following variables are used to determine the impact parameter in the
// near-field (i.e. taking into consideration the electrostatic repulsion).
//
G4double rm = ZP * ZT * elm_coupling / (E * AP);
G4double r = 0.0;
G4double rsq = 0.0;
//
//
// Initialise some of the variables which wll be used to calculate the chord-
// length for nucleons in the projectile and target, and hence calculate the
// number of abraded nucleons and the excitation energy.
//
G4NuclearAbrasionGeometry *theAbrasionGeometry = NULL;
G4double CT = 0.0;
G4double F = 0.0;
G4int Dabr = 0;
//
//
// The following loop is performed until the number of nucleons which are
// abraded by the process is >1, i.e. an interaction MUST occur.
//
while (Dabr == 0)
{
//
//
// Sample the impact parameter. For the moment, this class takes account of
// electrostatic effects on the impact parameter, but (like HZETRN AND NUCFRG2)
// does not make any correction for the effects of nuclear-nuclear repulsion.
//
G4double rPT = rP + rT;
G4double rPTsq = rPT * rPT;
r = 1.1 * rPT;
while (r > rPT)
{
G4double bsq = rPTsq * G4UniformRand();
r = (rm + sqrt(rm*rm + 4.0*bsq)) / 2.0;
}
rsq = r * r;
//
//
// Now determine the chord-length through the target nucleus.
//
if (rT > rP)
{
G4double x = (rPsq + rsq - rTsq) / 2.0 / r;
if (x > 0.0) CT = 2.0 * sqrt(rTsq - x*x);
else CT = 2.0 * sqrt(rTsq - rsq);
}
else
{
G4double x = (rTsq + rsq - rPsq) / 2.0 / r;
if (x > 0.0) CT = 2.0 * sqrt(rTsq - x*x);
else CT = 2.0 * rT;
}
//
//
// Determine the number of abraded nucleons. Note that the mean number of
// abraded nucleons is used to sample the Poisson distribution. The Poisson
// distribution is sampled only ten times with the current impact parameter,
// and if it fails after this to find a case for which the number of abraded
// nucleons >1, the impact parameter is re-sampled.
//
theAbrasionGeometry = new G4NuclearAbrasionGeometry(AP,AT,r);
F = theAbrasionGeometry->F();
G4double lambda = 16.6*fermi / pow(E/MeV,0.26);
G4double Mabr = F * AP * (1.0 - exp(-CT/lambda));
G4long n = 0;
for (G4int i = 0; i<10; i++)
{
n = G4Poisson(Mabr);
if (n > 0)
{
if (n>AP) Dabr = (G4int) AP;
else Dabr = (G4int) n;
break;
}
}
}
if (verboseLevel >= 2)
{
G4cout <<G4endl;
G4cout <<"Impact parameter = " <<r/fermi <<" fm" <<G4endl;
G4cout <<"# Abraded nucleons = " <<Dabr <<G4endl;
}
//
//
// The number of abraded nucleons must be no greater than the number of
// nucleons in either the projectile or the target. If AP - Dabr < 2 or
// AT - Dabr < 2 then either we have only a nucleon left behind in the
// projectile/target or we've tried to abrade too many nucleons - and Dabr
// should be limited.
//
if (AP - (G4double) Dabr < 2.0) Dabr = (G4int) AP;
if (AT - (G4double) Dabr < 2.0) Dabr = (G4int) AT;
//
//
// Determine the abraded secondary nucleons from the projectile. *fragmentP
// is a pointer to the prefragment from the projectile and nSecP is the number
// of nucleons in theParticleChange which have been abraded. The total energy
// from these is determined.
//
G4ThreeVector boost = pP.findBoostToCM();
G4Fragment *fragmentP = GetAbradedNucleons (Dabr, AP, ZP, rP);
G4int nSecP = theParticleChange.GetNumberOfSecondaries();
G4int i = 0;
for (i=0; i<nSecP; i++)
{
TotalEPost += theParticleChange.GetSecondary(i)->
GetParticle()->GetTotalEnergy();
}
//
//
// Determine the number of spectators in the interaction region for the
// projectile.
//
G4int DspcP = (G4int) (AP*F) - Dabr;
if (DspcP <= 0) DspcP = 0;
else if (DspcP > AP-Dabr) DspcP = ((G4int) AP) - Dabr;
//
//
// Determine excitation energy associated with excess surface area of the
// projectile (EsP) and the excitation due to scattering of nucleons which are
// retained within the projectile (ExP). Add the total energy from the excited
// nucleus to the total energy of the secondaries.
//
G4bool excitationAbsorbedByProjectile = false;
if (fragmentP != NULL)
{
G4double EsP = theAbrasionGeometry->GetExcitationEnergyOfProjectile();
G4double ExP = 0.0;
if (Dabr < AT)
excitationAbsorbedByProjectile = G4UniformRand() < 0.5;
if (excitationAbsorbedByProjectile)
ExP = GetNucleonInducedExcitation(rP, rT, r);
G4double xP = EsP + ExP;
if (xP > B*(AP-Dabr)) xP = B*(AP-Dabr);
G4LorentzVector lorentzVector = fragmentP->GetMomentum();
lorentzVector.setE(lorentzVector.e()+xP);
fragmentP->SetMomentum(lorentzVector);
TotalEPost += lorentzVector.e();
}
G4double EMassP = TotalEPost;
//
//
// Determine the abraded secondary nucleons from the target. Note that it's
// assumed that the same number of nucleons are abraded from the target as for
// the projectile, and obviously no boost is applied to the products. *fragmentT
// is a pointer to the prefragment from the target and nSec is the total number
// of nucleons in theParticleChange which have been abraded. The total energy
// from these is determined.
//
G4Fragment *fragmentT = GetAbradedNucleons (Dabr, AT, ZT, rT);
G4int nSec = theParticleChange.GetNumberOfSecondaries();
for (i=nSecP; i<nSec; i++)
{
TotalEPost += theParticleChange.GetSecondary(i)->
GetParticle()->GetTotalEnergy();
}
//
//
// Determine the number of spectators in the interaction region for the
// target.
//
G4int DspcT = (G4int) (AT*F) - Dabr;
if (DspcT <= 0) DspcT = 0;
else if (DspcT > AP-Dabr) DspcT = ((G4int) AT) - Dabr;
//
//
// Determine excitation energy associated with excess surface area of the
// target (EsT) and the excitation due to scattering of nucleons which are
// retained within the target (ExT). Add the total energy from the excited
// nucleus to the total energy of the secondaries.
//
if (fragmentT != NULL)
{
G4double EsT = theAbrasionGeometry->GetExcitationEnergyOfTarget();
G4double ExT = 0.0;
if (!excitationAbsorbedByProjectile)
ExT = GetNucleonInducedExcitation(rT, rP, r);
G4double xT = EsT + ExT;
if (xT > B*(AT-Dabr)) xT = B*(AT-Dabr);
G4LorentzVector lorentzVector = fragmentT->GetMomentum();
lorentzVector.setE(lorentzVector.e()+xT);
fragmentT->SetMomentum(lorentzVector);
TotalEPost += lorentzVector.e();
}
//
//
// Now determine the difference between the pre and post interaction
// energy - this will be used to determine the Lorentz boost if conservation
// of energy is to be imposed/attempted.
//
G4double deltaE = TotalEPre - TotalEPost;
if (deltaE > 0.0 && conserveEnergy)
{
G4double beta = sqrt(1.0 - EMassP*EMassP/pow(deltaE+EMassP,2.0));
boost = boost / boost.mag() * beta;
}
//
//
// Now boost the secondaries from the projectile.
//
G4ThreeVector pBalance = pP.vect();
for (i=0; i<nSecP; i++)
{
G4DynamicParticle *dynamicP = theParticleChange.GetSecondary(i)->
GetParticle();
G4LorentzVector lorentzVector = dynamicP->Get4Momentum();
lorentzVector.boost(-boost);
dynamicP->Set4Momentum(lorentzVector);
pBalance -= lorentzVector.vect();
}
//
//
// Set the boost for the projectile prefragment. This is now based on the
// conservation of momentum. However, if the user selected momentum of the
// prefragment is not to be conserved this simply boosted to the velocity of the
// original projectile times the ratio of the unexcited to the excited mass
// of the prefragment (the excitation increases the effective mass of the
// prefragment, and therefore modifying the boost is an attempt to prevent
// the momentum of the prefragment being excessive).
//
if (fragmentP != NULL)
{
G4LorentzVector lorentzVector = fragmentP->GetMomentum();
G4double m = lorentzVector.m();
if (conserveMomentum)
fragmentP->SetMomentum
(G4LorentzVector(pBalance,sqrt(pBalance.mag2()+m*m+1.0*eV*eV)));
else
{
G4double mg = fragmentP->GetGroundStateMass();
fragmentP->SetMomentum(lorentzVector.boost(-boost * mg/m));
}
}
//
//
// Output information to user if verbose information requested.
//
if (verboseLevel >= 2)
{
G4cout <<G4endl;
G4cout <<"-----------------------------------" <<G4endl;
G4cout <<"Secondary nucleons from projectile:" <<G4endl;
G4cout <<"-----------------------------------" <<G4endl;
G4cout.precision(7);
for (i=0; i<nSecP; i++)
{
G4cout <<"Particle # " <<i <<G4endl;
theParticleChange.GetSecondary(i)->GetParticle()->DumpInfo();
G4DynamicParticle *dyn = theParticleChange.GetSecondary(i)->GetParticle();
G4cout <<"New nucleon (P) " <<dyn->GetDefinition()->GetParticleName()
<<" : " <<dyn->Get4Momentum()
<<G4endl;
}
G4cout <<"---------------------------" <<G4endl;
G4cout <<"The projectile prefragment:" <<G4endl;
G4cout <<"---------------------------" <<G4endl;
if (fragmentP != NULL)
G4cout <<*fragmentP <<G4endl;
else
G4cout <<"(No residual prefragment)" <<G4endl;
G4cout <<G4endl;
G4cout <<"-------------------------------" <<G4endl;
G4cout <<"Secondary nucleons from target:" <<G4endl;
G4cout <<"-------------------------------" <<G4endl;
G4cout.precision(7);
for (i=nSecP; i<nSec; i++)
{
G4cout <<"Particle # " <<i <<G4endl;
theParticleChange.GetSecondary(i)->GetParticle()->DumpInfo();
G4DynamicParticle *dyn = theParticleChange.GetSecondary(i)->GetParticle();
G4cout <<"New nucleon (T) " <<dyn->GetDefinition()->GetParticleName()
<<" : " <<dyn->Get4Momentum()
<<G4endl;
}
G4cout <<"-----------------------" <<G4endl;
G4cout <<"The target prefragment:" <<G4endl;
G4cout <<"-----------------------" <<G4endl;
if (fragmentT != NULL)
G4cout <<*fragmentT <<G4endl;
else
G4cout <<"(No residual prefragment)" <<G4endl;
}
//
//
// Now we can decay the nuclear fragments if present. The secondaries are
// collected and boosted as well. This is performed first for the projectile...
//
if (fragmentP !=NULL)
{
G4ReactionProductVector *products = NULL;
if (fragmentP->GetZ() != fragmentP->GetA())
products = theExcitationHandler->BreakItUp(*fragmentP);
else
products = theExcitationHandlerx->BreakItUp(*fragmentP);
delete fragmentP;
fragmentP = NULL;
G4ReactionProductVector::iterator iter;
for (iter = products->begin(); iter != products->end(); ++iter)
{
G4DynamicParticle *secondary =
new G4DynamicParticle((*iter)->GetDefinition(),
(*iter)->GetTotalEnergy(), (*iter)->GetMomentum());
G4String particleName = (*iter)->GetDefinition()->GetParticleName();
if (verboseLevel >= 2 && particleName.find("[",0) < particleName.size())
{
G4cout <<"------------------------" <<G4endl;
G4cout <<"The projectile fragment:" <<G4endl;
G4cout <<"------------------------" <<G4endl;
G4cout <<" fragmentP = " <<particleName
<<" Energy = " <<secondary->GetKineticEnergy()
<<G4endl;
}
}
}
//
//
// Now decay the target nucleus - no boost is applied since in this
// approximation it is assumed that there is negligible momentum transfer from
// the projectile.
//
if (fragmentT != NULL)
{
G4ReactionProductVector *products = NULL;
if (fragmentT->GetZ() != fragmentT->GetA())
products = theExcitationHandler->BreakItUp(*fragmentT);
else
products = theExcitationHandlerx->BreakItUp(*fragmentT);
delete fragmentT;
fragmentT = NULL;
G4ReactionProductVector::iterator iter;
for (iter = products->begin(); iter != products->end(); ++iter)
{
G4DynamicParticle *secondary =
new G4DynamicParticle((*iter)->GetDefinition(),
(*iter)->GetTotalEnergy(), (*iter)->GetMomentum());
theParticleChange.AddSecondary (secondary);
G4String particleName = (*iter)->GetDefinition()->GetParticleName();
if (verboseLevel >= 2 && particleName.find("[",0) < particleName.size())
{
G4cout <<"--------------------" <<G4endl;
G4cout <<"The target fragment:" <<G4endl;
G4cout <<"--------------------" <<G4endl;
G4cout <<" fragmentT = " <<particleName
<<" Energy = " <<secondary->GetKineticEnergy()
<<G4endl;
}
}
}
if (verboseLevel >= 2)
G4cout <<"########################################"
<<"########################################"
<<G4endl;
delete theAbrasionGeometry;
return &theParticleChange;
}
////////////////////////////////////////////////////////////////////////////////
//
G4Fragment *G4WilsonAbrasionModel::GetAbradedNucleons (G4int Dabr, G4double A,
G4double Z, G4double r)
{
//
//
// Initialise variables. tau is the Fermi radius of the nucleus. The variables
// p..., C... and g(amma) are used to help sample the secondary nucleon
// spectrum.
//
G4double pK = hbarc * pow(9.0 * pi / 4.0 * A, third) / (1.29 * r);
if (A <= 24.0) pK *= -0.229*pow(A,third) + 1.62;
G4double pKsq = pK * pK;
G4double p1sq = 2.0/5.0 * pKsq;
G4double p2sq = 6.0/5.0 * pKsq;
G4double p3sq = 500.0 * 500.0;
G4double C1 = 1.0;
G4double C2 = 0.03;
G4double C3 = 0.0002;
G4double g = 90.0 * MeV;
G4double maxn = C1 + C2 + C3;
//
//
// initialise the number of secondary nucleons abraded to zero, and initially set
// the type of nucleon abraded to proton ... just for now.
//
G4double Aabr = 0.0;
G4double Zabr = 0.0;
G4ParticleDefinition *typeNucleon = G4Proton::ProtonDefinition();
G4DynamicParticle *dynamicNucleon = NULL;
G4ParticleMomentum pabr(0.0, 0.0, 0.0);
//
//
// Now go through each abraded nucleon and sample type, spectrum and angle.
//
for (G4int i=0; i<Dabr; i++)
{
//
//
// Sample the nucleon momentum distribution by simple rejection techniques. We
// reject values of p == 0.0 since this causes bad behaviour in the sinh term.
//
G4double p = 0.0;
G4bool found = false;
while (!found)
{
while (p <= 0.0) p = npK * pK * G4UniformRand();
G4double psq = p * p;
found = maxn * G4UniformRand() < C1*exp(-psq/p1sq/2.0) +
C2*exp(-psq/p2sq/2.0) + C3*exp(-psq/p3sq/2.0) + p/g/sinh(p/g);
}
//
//
// Determine the type of particle abraded. Can only be proton or neutron,
// and the probability is determine to be proportional to the ratio as found
// in the nucleus at each stage.
//
G4double prob = (Z-Zabr)/(A-Aabr);
if (G4UniformRand()<prob)
{
Zabr++;
typeNucleon = G4Proton::ProtonDefinition();
}
else
typeNucleon = G4Neutron::NeutronDefinition();
Aabr++;
//
//
// The angular distribution of the secondary nucleons is approximated to an
// isotropic distribution in the rest frame of the nucleus (this will be Lorentz
// boosted later.
//
G4double costheta = 2.*G4UniformRand()-1.0;
G4double sintheta = sqrt((1.0 - costheta)*(1.0 + costheta));
G4double phi = 2.0*pi*G4UniformRand()*rad;
G4ThreeVector direction(sintheta*cos(phi),sintheta*sin(phi),costheta);
G4double nucleonMass = typeNucleon->GetPDGMass();
G4double E = sqrt(p*p + nucleonMass*nucleonMass)-nucleonMass;
dynamicNucleon = new G4DynamicParticle(typeNucleon,direction,E);
theParticleChange.AddSecondary (dynamicNucleon);
pabr += p*direction;
}
//
//
// Next determine the details of the nuclear prefragment .. that is if there
// is one or more protons in the residue. (Note that the 1 eV in the total
// energy is a safety factor to avoid any possibility of negative rest mass
// energy.)
//
G4Fragment *fragment = NULL;
if (Z-Zabr>=1.0)
{
G4double ionMass = G4ParticleTable::GetParticleTable()->GetIonTable()->
GetIonMass(G4lrint(Z-Zabr),G4lrint(A-Aabr));
G4double E = sqrt(pabr.mag2() + ionMass*ionMass);
G4LorentzVector lorentzVector = G4LorentzVector(-pabr, E + 1.0*eV);
fragment =
new G4Fragment((G4int) (A-Aabr), (G4int) (Z-Zabr), lorentzVector);
}
return fragment;
}
////////////////////////////////////////////////////////////////////////////////
//
G4double G4WilsonAbrasionModel::GetNucleonInducedExcitation
(G4double rP, G4double rT, G4double r)
{
//
//
// Initialise variables.
//
G4double Cl = 0.0;
G4double rPsq = rP * rP;
G4double rTsq = rT * rT;
G4double rsq = r * r;
//
//
// Depending upon the impact parameter, a different form of the chord length is
// is used.
//
if (r > rT) Cl = 2.0*sqrt(rPsq + 2.0*r*rT - rsq - rTsq);
else Cl = 2.0*rP;
G4double bP = (rPsq+rsq-rTsq)/2.0/r;
G4double Ct = 2.0*sqrt(rPsq - bP*bP);
G4double Ex = 13.0 * Cl / fermi;
if (Ct > 1.5*fermi)
Ex += 13.0 * Cl / fermi /3.0 * (Ct/fermi - 1.5);
return Ex;
}
////////////////////////////////////////////////////////////////////////////////
//
void G4WilsonAbrasionModel::SetUseAblation (G4bool useAblation1)
{
if (useAblation != useAblation1)
{
useAblation = useAblation1;
delete theExcitationHandler;
delete theExcitationHandlerx;
theExcitationHandler = new G4ExcitationHandler;
theExcitationHandlerx = new G4ExcitationHandler;
if (useAblation)
{
theAblation = new G4WilsonAblationModel;
theAblation->SetVerboseLevel(verboseLevel);
theExcitationHandler->SetEvaporation(theAblation);
theExcitationHandlerx->SetEvaporation(theAblation);
}
else
{
theAblation = NULL;
G4Evaporation * theEvaporation = new G4Evaporation;
G4FermiBreakUp * theFermiBreakUp = new G4FermiBreakUp;
G4StatMF * theMF = new G4StatMF;
theExcitationHandler->SetEvaporation(theEvaporation);
theExcitationHandler->SetFermiModel(theFermiBreakUp);
theExcitationHandler->SetMultiFragmentation(theMF);
theExcitationHandler->SetMaxAandZForFermiBreakUp(12, 6);
theExcitationHandler->SetMinEForMultiFrag(5.0*MeV);
theEvaporation = new G4Evaporation;
theFermiBreakUp = new G4FermiBreakUp;
theExcitationHandlerx->SetEvaporation(theEvaporation);
theExcitationHandlerx->SetFermiModel(theFermiBreakUp);
theExcitationHandlerx->SetMaxAandZForFermiBreakUp(12, 6);
}
}
return;
}
////////////////////////////////////////////////////////////////////////////////
//
void G4WilsonAbrasionModel::PrintWelcomeMessage ()
{
G4cout <<G4endl;
G4cout <<" *****************************************************************"
<<G4endl;
G4cout <<" Nuclear abrasion model for nuclear-nuclear interactions activated"
<<G4endl;
G4cout <<" (Written by QinetiQ Ltd for the European Space Agency)"
<<G4endl;
G4cout <<" *****************************************************************"
<<G4endl;
G4cout << G4endl;
return;
}
////////////////////////////////////////////////////////////////////////////////
//
@@ -211,6 +211,11 @@ G4HadFinalState * G4BinaryCascade::ApplyYourself(const G4HadProjectile & aTrack,
theParticleChange.SetStatusChange(stopAndKill);
G4ReactionProductVector::iterator iter;
G4double Efinal=0;
if (abs(theParticleChange.GetWeightChange() -1 ) > 1e-5 )
{
G4cout <<" BIC-weight change " << theParticleChange.GetWeightChange()<< G4endl;
}
for(iter = products->begin(); iter != products->end(); ++iter)
{
G4DynamicParticle * aNew =
@@ -245,6 +250,10 @@ G4HadFinalState * G4BinaryCascade::ApplyYourself(const G4HadProjectile & aTrack,
the3DNucleus = NULL; // protect from wrong usage...
if(getenv("BCDEBUG") ) G4cerr << " ######### Binary Cascade Reaction number ends ######### "<<eventcounter<<G4endl;
if (abs(theParticleChange.GetWeightChange() -1 ) > 1e-5 )
{
G4cout <<" BIC-fin-weight change " << theParticleChange.GetWeightChange()<< G4endl;
}
return &theParticleChange;
}
@@ -425,6 +434,12 @@ G4ReactionProductVector * G4BinaryCascade::Propagate(
PrintKTVector(&theFinalState,std::string(" FinalState uncorrected"));
#endif
//
CorrectFinalPandE();
#ifdef debug_G4BinaryCascade
@@ -436,41 +451,34 @@ G4ReactionProductVector * G4BinaryCascade::Propagate(
G4double ExcitationEnergy=GetExcitationEnergy();
// G4cerr <<"mon - all pushed to limit 2"<<G4endl;
//#ifdef HKM_DEBUG
// G4cout << " Excitation Energy final, Ekinout, #collisions: "
// << ExcitationEnergy << " "
// << Ekinout << " "
// << collisionCount <<G4endl;
// G4cout << " Out from casc: " << theFinalState.size() << G4endl;
//#endif
#ifdef debug_G4BinaryCascade
G4cout << " Excitation Energy final, #collisions:, out, captured "
<< ExcitationEnergy << " "
<< collisionCount << " "
<< theFinalState.size() << " "
<< theCapturedList.size()<<G4endl;
#endif
if ( ExcitationEnergy < 0. )
{
// if ( ExcitationEnergy < 0. )
{
#ifdef debug_G4BinaryCascade
G4cerr << "G4BinaryCascade-Warning: negative excitation energy ";
G4cerr <<ExcitationEnergy<<G4endl;
PrintKTVector(&theFinalState,std::string("FinalState"));
PrintKTVector(&theCapturedList,std::string("captured"));
G4cout << "negative ExE:Final 4Momentum .mag: " << GetFinal4Momentum()
<< " "<< GetFinal4Momentum().mag()<< G4endl
<< "negative ExE:FinalNucleusMom .mag: " << GetFinalNucleusMomentum()
<< " "<< GetFinalNucleusMomentum().mag()<< G4endl;
#endif
//#ifdef debug_G4BinaryCascade
// G4cerr << "G4BinaryCascade-Warning: negative excitation energy ";
// G4cerr <<ExcitationEnergy<<G4endl;
// PrintKTVector(&theFinalState,std::string("FinalState"));
// PrintKTVector(&theCapturedList,std::string("captured"));
// G4cout << "negative ExE:Final 4Momentum .mag: " << GetFinal4Momentum()
// << " "<< GetFinal4Momentum().mag()<< G4endl
// << "negative ExE:FinalNucleusMom .mag: " << GetFinalNucleusMomentum()
// << " "<< GetFinalNucleusMomentum().mag()<< G4endl;
//#endif
}
ClearAndDestroy(products);
return products; // return empty products
}
//#ifdef HKM_DEBUG
// G4cout << " Excitation Energy final, Ekinout, #collisions: "
// << ExcitationEnergy << " "
// << Ekinout << " "
// << collisionCount <<G4endl;
// G4cout << " Out from casc: " << theFinalState.size() << G4endl;
//#endif
// find a fragment and call the precompound model.
G4Fragment * fragment = 0;
@@ -808,7 +816,11 @@ void G4BinaryCascade::FindCollisions(G4KineticTrackVector * secondaries)
for(std::vector<G4KineticTrack *>::iterator i = secondaries->begin();
i != secondaries->end(); ++i)
{
for(std::vector<G4BCAction *>::iterator j = theImR.begin();
if ( (*i)->GetTrackingMomentum().mag2() < -1.*eV )
{
G4cout << "G4BinaryCascade::FindCollisions(): negative m2:" << (*i)->GetTrackingMomentum().mag2() << G4endl;
}
for(std::vector<G4BCAction *>::iterator j = theImR.begin();
j!=theImR.end(); j++)
{
const std::vector<G4CollisionInitialState *> & aCandList
@@ -1157,7 +1169,6 @@ void G4BinaryCascade::StepParticlesOut()
{
G4int counter=0;
G4int countreset=0;
G4double steplength=1.0 * fermi;
//G4cout << " nucl. Radius " << radius << G4endl;
// G4cerr <<"pre-while- theSecondaryList "<<G4endl;
while( theSecondaryList.size() > 0 )
@@ -1171,27 +1182,24 @@ void G4BinaryCascade::StepParticlesOut()
G4KineticTrack * kt = *i;
if( kt->GetState() == G4KineticTrack::inside )
{
if((kt->GetDefinition() == G4Proton::Proton()) || // @@@ GF why only for nucleons?
(kt->GetDefinition() == G4Neutron::Neutron()))
{
nsec++;
G4double tStep = steplength / ( kt->Get4Momentum().beta() * c_light );
G4double tStep(0), tdummy(0);
((G4RKPropagation*)thePropagator)->GetSphereIntersectionTimes(kt,tdummy,tStep);
#ifdef debug_G4BinaryCascade
G4cout << " minTimeStep, tStep Particle " <<minTimeStep << " " <<tStep
<< " " <<kt->GetDefinition()->GetParticleName() << " 4mom " << kt->GetTrackingMomentum()<<G4endl;
<< " " <<kt->GetDefinition()->GetParticleName()
<< " 4mom " << kt->GetTrackingMomentum()<<G4endl;
#endif
if(tStep<minTimeStep)
if(tStep<minTimeStep && tStep> 0 )
{
minTimeStep = tStep;
// G4cerr <<"Position "<<kt->GetPosition().mag()<<" "
// <<kt->GetTrackingMomentum().e()-kt->GetTrackingMomentum().mag()<<G4endl;
}
}
} else if ( kt->GetState() != G4KineticTrack::outside ){
PrintKTVector(&theSecondaryList, std::string(" state ERROR....."));
throw G4HadronicException(__FILE__, __LINE__, "G4BinaryCascade::StepParticlesOut() particle not in nucleus");
}
}
minTimeStep *= 1.2;
// G4cerr << "CaptureCount = "<<counter<<" "<<nsec<<" "<<minTimeStep<<" "<<1*ns<<G4endl;
G4double timeToCollision=DBL_MAX;
G4CollisionInitialState * nextCollision=0;
@@ -1281,11 +1289,22 @@ void G4BinaryCascade::StepParticlesOut()
void G4BinaryCascade::CorrectFinalPandE()
//----------------------------------------------------------------------------
{
if ( theFinalState.size() == 0 ) return;
#ifdef debug_G4BinaryCascade
G4cerr << " -CorrectFinalPandE 1" << G4endl;
#endif
if ( theFinalState.size() == 0 ) return;
#ifdef debug_G4BinaryCascade
G4cerr << " -CorrectFinalPandE 2" << G4endl;
#endif
G4KineticTrackVector::iterator i;
G4LorentzVector pNucleus=GetFinal4Momentum();
if ( pNucleus.e() == 0 ) return; // check against explicit 0 from GetNucleus4Momentum()
#ifdef debug_G4BinaryCascade
G4cerr << " -CorrectFinalPandE 3" << G4endl;
#endif
G4LorentzVector pFinals(0);
G4int nFinals(0);
for(i = theFinalState.begin(); i != theFinalState.end(); ++i)
@@ -1309,6 +1328,7 @@ void G4BinaryCascade::CorrectFinalPandE()
G4cout << "CorrectFinalPandE pCM, CMS pCM " << pCM << " " <<toCMS*pCM<< G4endl;
G4cout << "CorrectFinal CMS pN pF " <<toCMS*pNucleus << " "
<<pFinals << G4endl
<< " nucleus initial mass : " <<GetFinal4Momentum().mag()
<<" massInNucleus m(nucleus) m(finals) sqrt(s): " << massInNucleus << " " <<pNucleus.mag()<< " "
<< pFinals.mag() << " " << pCM.mag() << G4endl;
#endif
@@ -1316,12 +1336,23 @@ void G4BinaryCascade::CorrectFinalPandE()
G4LorentzRotation toLab = toCMS.inverse();
G4double s = pCM.mag2();
G4double m10 = massInNucleus; //pNucleus.mag();
// G4double m10 = massInNucleus; //pNucleus.mag();
G4double m10 = GetIonMass(currentZ,currentA);
G4double m20 = pFinals.mag();
if( s-(m10+m20)*(m10+m20) < 0 )
{
#ifdef debug_G4BinaryCascade
G4cout << "G4BinaryCascade::CorrectFinalPandE() : error! " << G4endl;
G4cout << "not enough mass to correct: mass, A,Z, mass(nucl), mass(finals) "
<< sqrt(-s+(m10+m20)*(m10+m20)) << " "
<< currentA << " " << currentZ << " "
<< m10 << " " << m20
<< G4endl;
G4cerr << " -CorrectFinalPandE 4" << G4endl;
PrintKTVector(&theFinalState," mass problem");
#endif
return;
}
@@ -1329,10 +1360,14 @@ void G4BinaryCascade::CorrectFinalPandE()
// Three momentum in cm system
G4double pInCM = sqrt((s-(m10+m20)*(m10+m20))*(s-(m10-m20)*(m10-m20))/(4.*s));
#ifdef debug_G4BinaryCascade
G4cout <<" CorrectFinalPandE pInCM current/new : " <<(pFinals).vect().mag() << " " <<pInCM << G4endl;
G4cout <<" CorrectFinalPandE pInCM new, CURRENT, ratio : " << pInCM
<< " " << (pFinals).vect().mag()<< " " << pInCM/(pFinals).vect().mag() << G4endl;
#endif
if ( pFinals.vect().mag() > pInCM )
{
#ifdef debug_G4BinaryCascade
G4cerr << " -CorrectFinalPandE 5" << G4endl;
#endif
G4ThreeVector p3finals=pInCM*pFinals.vect().unit();
// G4ThreeVector deltap=(p3finals - pFinals.vect() ) / nFinals;
@@ -1356,7 +1391,10 @@ void G4BinaryCascade::CorrectFinalPandE()
<< " CMS pFinals , mag, 3.mag : " << qFinals << " " << qFinals.mag() << " " << qFinals.vect().mag()<< G4endl;
#endif
}
#ifdef debug_G4BinaryCascade
else { G4cerr << " -CorrectFinalPandE 6" << G4endl; }
#endif
}
//----------------------------------------------------------------------------
@@ -1963,7 +2001,7 @@ G4LorentzVector G4BinaryCascade::GetFinalNucleusMomentum()
G4LorentzRotation nucleusBoost( -boost );
precompoundLorentzboost.set( boost );
#ifdef debug_G4BinaryCascade
G4cout << "it "<<NucleusMomentum<<" "<<CapturedMomentum<<" "<<G4endl;
G4cout << "GetFinalNucleusMomentum be4 boostNucleusMomentum, CapturedMomentum"<<NucleusMomentum<<" "<<CapturedMomentum<<" "<<G4endl;
#endif
NucleusMomentum *= nucleusBoost;
#ifdef debug_G4BinaryCascade
@@ -131,6 +131,7 @@
G4LorentzVector it;
G4FermiMomentum theFermi;
G4int tryCount(0);
while(!result)
{
projectile = new G4Fancy3DNucleus;
@@ -197,6 +198,28 @@
delete result; result=0;
delete fancyNucleus;
delete projectile;
if (++tryCount > 100)
{
// abort!!
G4cerr << "G4BinaryLightIonReaction no final state for: " << G4endl;
G4cerr << " Primary " << aTrack.GetDefinition()
<< ", (A,Z)=(" << aTrack.GetDefinition()->GetBaryonNumber()
<< "," << aTrack.GetDefinition()->GetPDGCharge() << ") "
<< ", kinetic energy " << aTrack.GetKineticEnergy()
<< G4endl;
G4cerr << " Target nucleus (A,Z)=(" << targetNucleus.GetN()
<< "," << targetNucleus.GetZ() << G4endl;
G4cerr << " if frequent, please submit above information as bug report"
<< G4endl << G4endl;
theResult.Clear();
theResult.SetStatusChange(isAlive);
theResult.SetEnergyChange(aTrack.GetKineticEnergy());
theResult.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
return &theResult;
}
}
else
{
@@ -366,11 +389,27 @@
proFrag = theHandler.BreakItUp(aProRes);
if ( momentum.vect().mag() > momentum.e() )
{
G4cout << "mom check: " << momentum
G4cerr << "mom check: " << momentum
<< " 3.mag "<< momentum.vect().mag() << G4endl
<< " .. iState/fState/spectators " << iState <<" "
<< fState << " " << pspectators << G4endl
<< " .. A,Z " << resA <<" "<< resZ << G4endl;
G4cerr << "G4BinaryLightIonReaction no final state for: " << G4endl;
G4cerr << " Primary " << aTrack.GetDefinition()
<< ", (A,Z)=(" << aTrack.GetDefinition()->GetBaryonNumber()
<< "," << aTrack.GetDefinition()->GetPDGCharge() << ") "
<< ", kinetic energy " << aTrack.GetKineticEnergy()
<< G4endl;
G4cerr << " Target nucleus (A,Z)=(" << targetNucleus.GetN()
<< "," << targetNucleus.GetZ() << G4endl;
G4cerr << " if frequent, please submit above information as bug report"
<< G4endl << G4endl;
theResult.Clear();
theResult.SetStatusChange(isAlive);
theResult.SetEnergyChange(aTrack.GetKineticEnergy());
theResult.SetMomentumChange(aTrack.Get4Momentum().vect().unit());
return &theResult;
}
G4LorentzRotation boost_fragments_here(momentum.boostVector());
@@ -477,6 +516,7 @@
if(swapped)
{
tmp*=toBreit.inverse();
tmp.setVect(-tmp.vect());
}
tmp *= toLab;
aNew->Set4Momentum(tmp);
@@ -240,7 +240,7 @@ void G4RKPropagation::Init(G4V3DNucleus * nucleus)
}
//#define debug_1_RKPropagation 1
//----------------------------------------------------------------------------
void G4RKPropagation::Transport(G4KineticTrackVector & active,
//----------------------------------------------------------------------------
@@ -328,7 +328,7 @@ void G4RKPropagation::Transport(G4KineticTrackVector & active,
if(newE <= kt->GetActualMass()) // the particle cannot enter the nucleus
{
// FixMe: should be "pushed back?"
// for the moment take it past teh nucleus, so we'll not worry next time..
// for the moment take it past the nucleus, so we'll not worry next time..
FreeTransport(kt, 1.1*t_leave); // take past nucleus
kt->SetState(G4KineticTrack::miss_nucleus);
continue;
@@ -623,15 +623,15 @@ G4bool G4RKPropagation::GetSphereIntersectionTimes(const G4KineticTrack * kt,
G4double radius = theOuterRadius + 3*fermi; // "safety" of 3 fermi
G4ThreeVector speed = kt->GetTrackingMomentum().vect()/kt->GetTrackingMomentum().e(); // bost vector
G4double scalarProd = kt->GetPosition().dot(speed);
G4double speedMag = speed.mag();
G4double speedMag2 = speed.mag2();
G4double sqrtArg = scalarProd*scalarProd -
speedMag*speedMag*(kt->GetPosition().mag2()-radius*radius);
speedMag2*(kt->GetPosition().mag2()-radius*radius);
if(sqrtArg <= 0.) // particle will not intersect the sphere
{
return false;
}
t1 = (-scalarProd - sqrt(sqrtArg))/speedMag/speedMag/c_light;
t2 = (-scalarProd + sqrt(sqrtArg))/speedMag/speedMag/c_light;
t1 = (-scalarProd - sqrt(sqrtArg))/speedMag2/c_light;
t2 = (-scalarProd + sqrt(sqrtArg))/speedMag2/c_light;
return true;
}

Some files were not shown because too many files have changed in this diff Show More