Import Geant4 8.0.0 source tree
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Cerenkov.cc,v 1.17 2004/12/10 18:49:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4Cerenkov.cc,v 1.20 2005/08/17 17:30:39 gum Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Cerenkov Radiation Class Implementation
|
||||
@@ -33,11 +33,15 @@
|
||||
// Version: 2.1
|
||||
// Created: 1996-02-21
|
||||
// Author: Juliet Armstrong
|
||||
// Updated: 2001-09-17, migration of Materials to pure STL (mma)
|
||||
// Updated: 2005-08-17 by Peter Gumplinger
|
||||
// > change variable name MeanNumPhotons -> MeanNumberOfPhotons
|
||||
// 2005-07-28 by Peter Gumplinger
|
||||
// > add G4ProcessType to constructor
|
||||
// 2001-09-17, migration of Materials to pure STL (mma)
|
||||
// 2000-11-12 by Peter Gumplinger
|
||||
// > add check on CerenkovAngleIntegrals->IsFilledVectorExist()
|
||||
// in method GetAverageNumberOfPhotons
|
||||
// > and a test for MeanNumPhotons <= 0.0 in DoIt
|
||||
// > and a test for MeanNumberOfPhotons <= 0.0 in DoIt
|
||||
// 2000-09-18 by Peter Gumplinger
|
||||
// > change: aSecondaryPosition=x0+rand*aStep.GetDeltaPosition();
|
||||
// aSecondaryTrack->SetTouchable(0);
|
||||
@@ -73,8 +77,8 @@ using namespace std;
|
||||
// Constructors
|
||||
/////////////////
|
||||
|
||||
G4Cerenkov::G4Cerenkov(const G4String& processName)
|
||||
: G4VContinuousProcess(processName)
|
||||
G4Cerenkov::G4Cerenkov(const G4String& processName, G4ProcessType type)
|
||||
: G4VContinuousProcess(processName, type)
|
||||
{
|
||||
fTrackSecondariesFirst = false;
|
||||
fMaxPhotons = 0;
|
||||
@@ -148,10 +152,10 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
if (!Rindex)
|
||||
return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
|
||||
|
||||
G4double MeanNumPhotons =
|
||||
G4double MeanNumberOfPhotons =
|
||||
GetAverageNumberOfPhotons(aParticle,aMaterial,Rindex);
|
||||
|
||||
if (MeanNumPhotons <= 0.0) {
|
||||
if (MeanNumberOfPhotons <= 0.0) {
|
||||
|
||||
// return unchanged particle and no secondaries
|
||||
|
||||
@@ -164,9 +168,9 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
G4double step_length;
|
||||
step_length = aStep.GetStepLength();
|
||||
|
||||
MeanNumPhotons = MeanNumPhotons * step_length;
|
||||
MeanNumberOfPhotons = MeanNumberOfPhotons * step_length;
|
||||
|
||||
G4int NumPhotons = (G4int) G4Poisson(MeanNumPhotons);
|
||||
G4int NumPhotons = (G4int) G4Poisson(MeanNumberOfPhotons);
|
||||
|
||||
if (NumPhotons <= 0) {
|
||||
|
||||
@@ -438,12 +442,12 @@ G4Cerenkov::GetContinuousStepLimit(const G4Track& aTrack,
|
||||
aMaterialPropertiesTable->GetProperty("RINDEX");
|
||||
if (!Rindex) return DBL_MAX;
|
||||
|
||||
G4double MeanNumPhotons =
|
||||
G4double MeanNumberOfPhotons =
|
||||
GetAverageNumberOfPhotons(aParticle,aMaterial,Rindex);
|
||||
|
||||
if(MeanNumPhotons <= 0.0) return DBL_MAX;
|
||||
if(MeanNumberOfPhotons <= 0.0) return DBL_MAX;
|
||||
|
||||
G4double StepLimit = fMaxPhotons / MeanNumPhotons;
|
||||
G4double StepLimit = fMaxPhotons / MeanNumberOfPhotons;
|
||||
|
||||
return StepLimit;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ForwardXrayTR.cc,v 1.12 2004/12/02 08:31:07 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// G4ForwardXrayTR class -- implementation file
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4GammaXTRadiator.cc,v 1.3 2004/12/02 08:31:07 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RegularXTRadiator.cc,v 1.6 2005/04/12 09:10:55 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4RegularXTRadiator.cc,v 1.7 2005/08/06 13:59:35 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
@@ -78,6 +78,7 @@ G4RegularXTRadiator::GetStackFactor( G4double energy,
|
||||
G4double gamma, G4double varAngle )
|
||||
{
|
||||
|
||||
// some gamma (10000/1000) like algorithm
|
||||
|
||||
G4double result, Za, Zb, Ma, Mb;
|
||||
|
||||
@@ -94,7 +95,7 @@ G4RegularXTRadiator::GetStackFactor( G4double energy,
|
||||
G4complex Ha = pow(Ca,-fAlphaPlate);
|
||||
G4complex Hb = pow(Cb,-fAlphaGas);
|
||||
G4complex H = Ha*Hb;
|
||||
|
||||
|
||||
G4complex F1 = (1.0 - Ha)*(1.0 - Hb )/(1.0 - H)
|
||||
* G4double(fPlateNumber);
|
||||
|
||||
@@ -102,14 +103,16 @@ G4RegularXTRadiator::GetStackFactor( G4double energy,
|
||||
* (1.0 - pow(H,fPlateNumber));
|
||||
|
||||
G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle);
|
||||
|
||||
|
||||
result = 2.0*real(R);
|
||||
|
||||
return result;
|
||||
|
||||
/*
|
||||
// numerically stable but slow algorithm
|
||||
|
||||
|
||||
/* // numerically unstable algorithm
|
||||
G4double result, Qa, Qb, Q, aZa, bZb, aMa, bMb, D;
|
||||
G4double result, Qa, Qb, Q, aZa, bZb, aMa, bMb; // , D;
|
||||
|
||||
aZa = fPlateThick/GetPlateFormationZone(energy,gamma,varAngle);
|
||||
bZb = fGasThick/GetGasFormationZone(energy,gamma,varAngle);
|
||||
aMa = fPlateThick*GetPlateLinearPhotoAbs(energy);
|
||||
@@ -122,6 +125,7 @@ G4RegularXTRadiator::GetStackFactor( G4double energy,
|
||||
G4complex Hb( exp(-0.5*bMb)*cos(bZb),
|
||||
-exp(-0.5*bMb)*sin(bZb) );
|
||||
G4complex H = Ha*Hb;
|
||||
|
||||
G4complex Hs = conj(H);
|
||||
D = 1.0 /( (1 - sqrt(Q))*(1 - sqrt(Q)) +
|
||||
4*sqrt(Q)*sin(0.5*(aZa+bZb))*sin(0.5*(aZa+bZb)) );
|
||||
@@ -130,6 +134,17 @@ G4RegularXTRadiator::GetStackFactor( G4double energy,
|
||||
G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb*(1.0-Hs)*(1.0-Hs)
|
||||
* (1.0 - pow(H,fPlateNumber)) * D*D;
|
||||
G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle);
|
||||
|
||||
|
||||
G4complex S(0.,0.), c(1.,0.);
|
||||
G4int k;
|
||||
for(k = 1; k < fPlateNumber; k++)
|
||||
{
|
||||
c *= H;
|
||||
S += ( G4double(fPlateNumber) - G4double(k) )*c;
|
||||
}
|
||||
G4complex R = (2.- Ha - 1./Ha)*S + (1. - Ha)*G4double(fPlateNumber);
|
||||
R *= OneInterfaceXTRdEdx(energy,gamma,varAngle);
|
||||
result = 2.0*real(R);
|
||||
return result;
|
||||
*/
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Scintillation.cc,v 1.22 2004/12/10 18:49:57 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4Scintillation.cc,v 1.25 2005/08/17 17:30:25 gum Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Scintillation Light Class Implementation
|
||||
@@ -33,10 +33,14 @@
|
||||
// Version: 1.0
|
||||
// Created: 1998-11-07
|
||||
// Author: Peter Gumplinger
|
||||
// Updated: 2004-08-05 by Peter Gumplinger
|
||||
// Updated: 2005-08-17 by Peter Gumplinger
|
||||
// > change variable name MeanNumPhotons -> MeanNumberOfPhotons
|
||||
// 2005-07-28 by Peter Gumplinger
|
||||
// > add G4ProcessType to constructor
|
||||
// 2004-08-05 by Peter Gumplinger
|
||||
// > changed StronglyForced back to Forced in GetMeanLifeTime
|
||||
// 2002-11-21 by Peter Gumplinger
|
||||
// > change to use G4Poisson for small MeanNumPhotons
|
||||
// > change to use G4Poisson for small MeanNumberOfPhotons
|
||||
// 2002-11-07 by Peter Gumplinger
|
||||
// > now allow for fast and slow scintillation component
|
||||
// 2002-11-05 by Peter Gumplinger
|
||||
@@ -76,8 +80,9 @@ using namespace std;
|
||||
// Constructors
|
||||
/////////////////
|
||||
|
||||
G4Scintillation::G4Scintillation(const G4String& processName)
|
||||
: G4VRestDiscreteProcess(processName)
|
||||
G4Scintillation::G4Scintillation(const G4String& processName,
|
||||
G4ProcessType type)
|
||||
: G4VRestDiscreteProcess(processName, type)
|
||||
{
|
||||
fTrackSecondariesFirst = false;
|
||||
|
||||
@@ -176,15 +181,15 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
|
||||
ScintillationYield = YieldFactor * ScintillationYield;
|
||||
|
||||
G4double MeanNumPhotons = ScintillationYield * TotalEnergyDeposit;
|
||||
G4double MeanNumberOfPhotons = ScintillationYield * TotalEnergyDeposit;
|
||||
|
||||
G4int NumPhotons;
|
||||
if (MeanNumPhotons > 10.) {
|
||||
G4double sigma = ResolutionScale * sqrt(MeanNumPhotons);
|
||||
NumPhotons = G4int(G4RandGauss::shoot(MeanNumPhotons,sigma)+0.5);
|
||||
if (MeanNumberOfPhotons > 10.) {
|
||||
G4double sigma = ResolutionScale * sqrt(MeanNumberOfPhotons);
|
||||
NumPhotons = G4int(G4RandGauss::shoot(MeanNumberOfPhotons,sigma)+0.5);
|
||||
}
|
||||
else {
|
||||
NumPhotons = G4int(G4Poisson(MeanNumPhotons));
|
||||
NumPhotons = G4int(G4Poisson(MeanNumberOfPhotons));
|
||||
}
|
||||
|
||||
if (NumPhotons <= 0) {
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4StrawTubeXTRadiator.cc,v 1.1 2005/04/22 09:44:18 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4StrawTubeXTRadiator.cc,v 1.2 2005/08/06 13:59:35 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
@@ -49,17 +49,17 @@ G4StrawTubeXTRadiator::G4StrawTubeXTRadiator(G4LogicalVolume *anEnvelope,
|
||||
|
||||
if( unishut )
|
||||
{
|
||||
fAlphaPlate = 25;
|
||||
fAlphaGas = 25;
|
||||
G4cout<<"straw uniform shuting: "<<"fAlphaPlate = "
|
||||
fAlphaPlate = 1./3.;
|
||||
fAlphaGas = 12.4;
|
||||
G4cout<<"straw uniform shooting: "<<"fAlphaPlate = "
|
||||
<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
fAlphaPlate = 9;
|
||||
fAlphaGas = 9;
|
||||
G4cout<<"straw isotropical shuting: "<<"fAlphaPlate = "
|
||||
fAlphaPlate = 0.5;
|
||||
fAlphaGas = 5.;
|
||||
G4cout<<"straw isotropical shooting: "<<"fAlphaPlate = "
|
||||
<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl;
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TransitionRadiation.cc,v 1.5 2005/06/27 15:29:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4TransitionRadiation.cc,v 1.6 2005/07/28 23:58:01 gum Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// G4TransitionRadiation class -- implementation file
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
// History:
|
||||
// 1st version 11.09.97 V. Grichine (Vladimir.Grichine@cern.ch )
|
||||
// 2nd version 16.12.97 V. Grichine
|
||||
// 3rd version 28.07.05, P.Gumplinger add G4ProcessType to constructor
|
||||
|
||||
|
||||
#include <cmath>
|
||||
@@ -61,8 +62,8 @@ using namespace std;
|
||||
//
|
||||
|
||||
G4TransitionRadiation::
|
||||
G4TransitionRadiation( const G4String& processName )
|
||||
: G4VDiscreteProcess(processName)
|
||||
G4TransitionRadiation( const G4String& processName, G4ProcessType type )
|
||||
: G4VDiscreteProcess(processName, type)
|
||||
{
|
||||
// fMatIndex1 = pMat1->GetIndex() ;
|
||||
// fMatIndex2 = pMat2->GetIndex() ;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4TransparentRegXTRadiator.cc,v 1.6 2005/05/29 15:46:41 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4TransparentRegXTRadiator.cc,v 1.7 2005/08/06 13:59:35 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
@@ -108,7 +108,15 @@ G4double G4TransparentRegXTRadiator::SpectralXTRdEdx(G4double energy)
|
||||
{
|
||||
tmp = pi*fPlateThick*(k + cof2)/(fPlateThick + fGasThick);
|
||||
result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2);
|
||||
sum += sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
|
||||
if( k == kMin && kMin == G4int(cofMin) )
|
||||
{
|
||||
sum += 0.5*sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
}
|
||||
else
|
||||
{
|
||||
sum += sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
|
||||
}
|
||||
// G4cout<<"k = "<<k<<"; sum = "<<sum<<G4endl;
|
||||
}
|
||||
result = 4*( cof1 + cof2 )*( cof1 + cof2 )*sum/energy;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VTransitionRadiation.cc,v 1.3 2004/12/02 08:31:08 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VTransitionRadiation.cc,v 1.4 2005/07/28 23:57:37 gum Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// G4VTransitionRadiation class -- implementation file
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
// History:
|
||||
// 29.02.04 V.Ivanchenko create
|
||||
// 28.07.05, P.Gumplinger add G4ProcessType to constructor
|
||||
|
||||
#include "G4VTransitionRadiation.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
@@ -43,8 +44,9 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4VTransitionRadiation::G4VTransitionRadiation( const G4String& processName )
|
||||
: G4VDiscreteProcess(processName),
|
||||
G4VTransitionRadiation::G4VTransitionRadiation( const G4String& processName,
|
||||
G4ProcessType type )
|
||||
: G4VDiscreteProcess(processName, type),
|
||||
nSteps(0),
|
||||
gammaMin(100),
|
||||
cosDThetaMax(cos(0.1))
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
|
||||
// $Id: G4VXTRenergyLoss.cc,v 1.15 2005/04/12 09:10:55 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
// $Id: G4VXTRenergyLoss.cc,v 1.21 2005/10/11 14:24:34 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-08-00 $
|
||||
//
|
||||
// History:
|
||||
// 2001-2002 R&D by V.Grichine
|
||||
// 19.06.03 V. Grichine, modifications in BuildTable for the integration
|
||||
// in respect of angle: range is increased, accuracy is
|
||||
// improved
|
||||
// 28.07.05, P.Gumplinger add G4ProcessType to constructor
|
||||
//
|
||||
|
||||
#include "G4Timer.hh"
|
||||
@@ -37,34 +37,41 @@
|
||||
#include "G4VXTRenergyLoss.hh"
|
||||
#include "G4Poisson.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4VDiscreteProcess.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4VSolid.hh"
|
||||
|
||||
#include "G4RotationMatrix.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4AffineTransform.hh"
|
||||
|
||||
#include "G4PhysicsVector.hh"
|
||||
#include "G4PhysicsLinearVector.hh"
|
||||
|
||||
// Initialization of local constants
|
||||
|
||||
G4double G4VXTRenergyLoss::fTheMinEnergyTR = 1.0*keV ;
|
||||
G4double G4VXTRenergyLoss::fTheMaxEnergyTR = 100.0*keV ;
|
||||
G4double G4VXTRenergyLoss::fTheMaxAngle = 1.0e-3 ;
|
||||
G4double G4VXTRenergyLoss::fTheMinAngle = 5.0e-6 ;
|
||||
G4int G4VXTRenergyLoss::fBinTR = 50 ;
|
||||
|
||||
G4double G4VXTRenergyLoss::fMinProtonTkin = 100.0*GeV ;
|
||||
G4double G4VXTRenergyLoss::fMaxProtonTkin = 100.0*TeV ;
|
||||
G4int G4VXTRenergyLoss::fTotBin = 50 ;
|
||||
// Proton energy vector initialization
|
||||
|
||||
using namespace std;
|
||||
|
||||
G4PhysicsLogVector* G4VXTRenergyLoss::
|
||||
// Initialization of local constants
|
||||
|
||||
G4double G4XTRenergyLoss::fTheMinEnergyTR = 1.0*keV ;
|
||||
G4double G4XTRenergyLoss::fTheMaxEnergyTR = 100.0*keV ;
|
||||
G4double G4XTRenergyLoss::fTheMaxAngle = 1.0e-3 ;
|
||||
G4double G4XTRenergyLoss::fTheMinAngle = 5.0e-6 ;
|
||||
G4int G4XTRenergyLoss::fBinTR = 50 ;
|
||||
|
||||
G4double G4XTRenergyLoss::fMinProtonTkin = 100.0*GeV ;
|
||||
G4double G4XTRenergyLoss::fMaxProtonTkin = 100.0*TeV ;
|
||||
G4int G4XTRenergyLoss::fTotBin = 50 ;
|
||||
// Proton energy vector initialization
|
||||
|
||||
G4PhysicsLogVector* G4XTRenergyLoss::
|
||||
fProtonEnergyVector = new G4PhysicsLogVector(fMinProtonTkin,
|
||||
fMaxProtonTkin,
|
||||
fTotBin ) ;
|
||||
|
||||
G4double G4VXTRenergyLoss::fPlasmaCof = 4.0*pi*fine_structure_const*
|
||||
G4double G4XTRenergyLoss::fPlasmaCof = 4.0*pi*fine_structure_const*
|
||||
hbarc*hbarc*hbarc/electron_mass_c2 ;
|
||||
|
||||
G4double G4VXTRenergyLoss::fCofTR = fine_structure_const/pi ;
|
||||
G4double G4XTRenergyLoss::fCofTR = fine_structure_const/pi ;
|
||||
|
||||
|
||||
|
||||
@@ -74,11 +81,13 @@ G4double G4VXTRenergyLoss::fCofTR = fine_structure_const/pi ;
|
||||
//
|
||||
// Constructor, destructor
|
||||
|
||||
G4VXTRenergyLoss::G4VXTRenergyLoss(G4LogicalVolume *anEnvelope,
|
||||
G4XTRenergyLoss::G4XTRenergyLoss(G4LogicalVolume *anEnvelope,
|
||||
G4Material* foilMat,G4Material* gasMat,
|
||||
G4double a, G4double b,
|
||||
G4int n,const G4String& processName) :
|
||||
G4VContinuousProcess(processName)
|
||||
G4int n,const G4String& processName,
|
||||
G4ProcessType type) :
|
||||
G4VDiscreteProcess(processName, type)
|
||||
// G4VContinuousProcess(processName, type)
|
||||
{
|
||||
fEnvelope = anEnvelope ;
|
||||
// fPlateNumber = fEnvelope->GetNoDaughters() ;
|
||||
@@ -88,11 +97,13 @@ G4VXTRenergyLoss::G4VXTRenergyLoss(G4LogicalVolume *anEnvelope,
|
||||
{
|
||||
G4Exception("No plates in X-ray TR radiator") ;
|
||||
}
|
||||
// default is XTR dEdx, not flux after radiator
|
||||
fExitFlux = false;
|
||||
fLambda = DBL_MAX;
|
||||
// Mean thicknesses of plates and gas gaps
|
||||
|
||||
fPlateThick = a ;
|
||||
fGasThick = b ;
|
||||
|
||||
fTotalDist = fPlateNumber*(fPlateThick+fGasThick) ;
|
||||
G4cout<<"total radiator thickness = "<<fTotalDist/cm<<" cm"<<G4endl ;
|
||||
|
||||
@@ -120,11 +131,13 @@ G4VXTRenergyLoss::G4VXTRenergyLoss(G4LogicalVolume *anEnvelope,
|
||||
ComputePlatePhotoAbsCof() ;
|
||||
ComputeGasPhotoAbsCof() ;
|
||||
|
||||
pParticleChange = &fParticleChange;
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4VXTRenergyLoss::~G4VXTRenergyLoss()
|
||||
G4XTRenergyLoss::~G4XTRenergyLoss()
|
||||
{
|
||||
G4int i ;
|
||||
|
||||
@@ -148,7 +161,7 @@ G4VXTRenergyLoss::~G4VXTRenergyLoss()
|
||||
// Returns condition for application of the model depending on particle type
|
||||
|
||||
|
||||
G4bool G4VXTRenergyLoss::IsApplicable(const G4ParticleDefinition& particle)
|
||||
G4bool G4XTRenergyLoss::IsApplicable(const G4ParticleDefinition& particle)
|
||||
{
|
||||
return ( particle.GetPDGCharge() != 0.0 ) ;
|
||||
}
|
||||
@@ -159,7 +172,7 @@ G4bool G4VXTRenergyLoss::IsApplicable(const G4ParticleDefinition& particle)
|
||||
//
|
||||
|
||||
G4double
|
||||
G4VXTRenergyLoss::GetContinuousStepLimit(const G4Track& ,
|
||||
G4XTRenergyLoss::GetContinuousStepLimit(const G4Track& ,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double& )
|
||||
@@ -169,18 +182,92 @@ G4VXTRenergyLoss::GetContinuousStepLimit(const G4Track& ,
|
||||
return StepLimit;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Calculate step size for XTR process inside raaditor
|
||||
|
||||
G4double G4XTRenergyLoss::GetMeanFreePath(const G4Track& aTrack,
|
||||
G4double, // previousStepSize,
|
||||
G4ForceCondition* condition)
|
||||
{
|
||||
G4int iTkin, iPlace;
|
||||
G4double lambda, sigma, kinEnergy, mass, gamma;
|
||||
G4double charge, chargeSq, massRatio, TkinScaled;
|
||||
G4double E1,E2,W,W1,W2;
|
||||
|
||||
*condition = NotForced;
|
||||
|
||||
if( aTrack.GetVolume()->GetLogicalVolume() != fEnvelope ) lambda = DBL_MAX;
|
||||
else
|
||||
{
|
||||
const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
|
||||
kinEnergy = aParticle->GetKineticEnergy();
|
||||
mass = aParticle->GetDefinition()->GetPDGMass();
|
||||
gamma = 1.0 + kinEnergy/mass;
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<" gamma = "<<gamma<<"; fGamma = "<<fGamma<<G4endl;
|
||||
}
|
||||
|
||||
if ( fabs( gamma - fGamma ) < 0.05*gamma ) lambda = fLambda;
|
||||
else
|
||||
{
|
||||
charge = aParticle->GetDefinition()->GetPDGCharge();
|
||||
chargeSq = charge*charge;
|
||||
massRatio = proton_mass_c2/mass;
|
||||
TkinScaled = kinEnergy*massRatio;
|
||||
|
||||
for(iTkin = 0; iTkin < fTotBin; iTkin++)
|
||||
{
|
||||
if( TkinScaled < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
|
||||
}
|
||||
iPlace = iTkin - 1 ;
|
||||
|
||||
if(iTkin == 0) lambda = DBL_MAX; // Tkin is too small, neglect of TR photon generation
|
||||
else // general case: Tkin between two vectors of the material
|
||||
{
|
||||
if(iTkin == fTotBin)
|
||||
{
|
||||
sigma = (*(*fEnergyDistrTable)(iPlace))(0)*chargeSq;
|
||||
}
|
||||
else
|
||||
{
|
||||
E1 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin - 1) ;
|
||||
E2 = fProtonEnergyVector->GetLowEdgeEnergy(iTkin) ;
|
||||
W = 1.0/(E2 - E1) ;
|
||||
W1 = (E2 - TkinScaled)*W ;
|
||||
W2 = (TkinScaled - E1)*W ;
|
||||
sigma = ( (*(*fEnergyDistrTable)(iPlace ))(0)*W1 +
|
||||
(*(*fEnergyDistrTable)(iPlace+1))(0)*W2 )*chargeSq;
|
||||
|
||||
}
|
||||
if (sigma < DBL_MIN) lambda = DBL_MAX;
|
||||
else lambda = 1./sigma;
|
||||
fLambda = lambda;
|
||||
fGamma = gamma;
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<" lambda = "<<lambda/mm<<" mm"<<G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return lambda;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Build integral energy distribution of XTR photons
|
||||
|
||||
void G4VXTRenergyLoss::BuildTable()
|
||||
void G4XTRenergyLoss::BuildTable()
|
||||
{
|
||||
G4int iTkin, iTR, iPlace ;
|
||||
G4double radiatorCof = 1.0 ; // for tuning of XTR yield
|
||||
G4int iTkin, iTR, iPlace;
|
||||
G4double radiatorCof = 1.0; // for tuning of XTR yield
|
||||
|
||||
fEnergyDistrTable = new G4PhysicsTable(fTotBin) ;
|
||||
fEnergyDistrTable = new G4PhysicsTable(fTotBin);
|
||||
|
||||
fGammaTkinCut = 0.0 ;
|
||||
fGammaTkinCut = 0.0;
|
||||
|
||||
// setting of min/max TR energies
|
||||
|
||||
@@ -193,6 +280,9 @@ void G4VXTRenergyLoss::BuildTable()
|
||||
G4cout.precision(4) ;
|
||||
G4Timer timer ;
|
||||
timer.Start() ;
|
||||
G4cout<<G4endl;
|
||||
G4cout<<"Lorentz Factor"<<"\t"<<"XTR photon number"<<G4endl;
|
||||
G4cout<<G4endl;
|
||||
|
||||
for( iTkin = 0 ; iTkin < fTotBin ; iTkin++ ) // Lorentz factor loop
|
||||
{
|
||||
@@ -207,51 +297,55 @@ void G4VXTRenergyLoss::BuildTable()
|
||||
|
||||
fTheMinAngle = 1.0e-3 ; // was 5.e-6, e-6 !!!, e-5, e-4
|
||||
|
||||
if( fMaxThetaTR > fTheMaxAngle ) fMaxThetaTR = fTheMaxAngle ;
|
||||
if( fMaxThetaTR > fTheMaxAngle ) fMaxThetaTR = fTheMaxAngle;
|
||||
else
|
||||
{
|
||||
if( fMaxThetaTR < fTheMinAngle ) fMaxThetaTR = fTheMinAngle ;
|
||||
if( fMaxThetaTR < fTheMinAngle ) fMaxThetaTR = fTheMinAngle;
|
||||
}
|
||||
G4PhysicsLinearVector* angleVector = new G4PhysicsLinearVector(0.0,
|
||||
fMaxThetaTR,
|
||||
fBinTR );
|
||||
|
||||
G4double energySum = 0.0 ;
|
||||
G4double angleSum = 0.0 ;
|
||||
G4double energySum = 0.0;
|
||||
G4double angleSum = 0.0;
|
||||
|
||||
G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral;
|
||||
G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral;
|
||||
|
||||
energyVector->PutValue(fBinTR-1,energySum) ;
|
||||
angleVector->PutValue(fBinTR-1,angleSum) ;
|
||||
energyVector->PutValue(fBinTR-1,energySum);
|
||||
angleVector->PutValue(fBinTR-1,angleSum);
|
||||
|
||||
for( iTR = fBinTR - 2 ; iTR >= 0 ; iTR-- )
|
||||
{
|
||||
energySum += radiatorCof*fCofTR*integral.Legendre10(
|
||||
this,&G4VXTRenergyLoss::SpectralXTRdEdx,
|
||||
this,&G4XTRenergyLoss::SpectralXTRdEdx,
|
||||
energyVector->GetLowEdgeEnergy(iTR),
|
||||
energyVector->GetLowEdgeEnergy(iTR+1) ) ;
|
||||
energyVector->GetLowEdgeEnergy(iTR+1) );
|
||||
|
||||
// angleSum += fCofTR*integral.Legendre96(
|
||||
// this,&G4VXTRenergyLoss::AngleXTRdEdx,
|
||||
// this,&G4XTRenergyLoss::AngleXTRdEdx,
|
||||
// angleVector->GetLowEdgeEnergy(iTR),
|
||||
// angleVector->GetLowEdgeEnergy(iTR+1) ) ;
|
||||
// angleVector->GetLowEdgeEnergy(iTR+1) );
|
||||
|
||||
energyVector->PutValue(iTR,energySum/fTotalDist) ;
|
||||
// angleVector ->PutValue(iTR,angleSum) ;
|
||||
energyVector->PutValue(iTR,energySum/fTotalDist);
|
||||
// angleVector ->PutValue(iTR,angleSum);
|
||||
}
|
||||
G4cout<<iTkin<<"\t"
|
||||
<<"fGamma = "<<fGamma<<"\t" // <<" fMaxThetaTR = "<<fMaxThetaTR
|
||||
<<"sumN = "<<energySum // <<" ; sumA = "<<angleSum
|
||||
<<G4endl ;
|
||||
iPlace = iTkin ;
|
||||
fEnergyDistrTable->insertAt(iPlace,energyVector) ;
|
||||
// fAngleDistrTable->insertAt(iPlace,angleVector) ;
|
||||
G4cout
|
||||
// <<iTkin<<"\t"
|
||||
// <<"fGamma = "
|
||||
<<fGamma<<"\t" // <<" fMaxThetaTR = "<<fMaxThetaTR
|
||||
// <<"sumN = "
|
||||
<<energySum // <<" ; sumA = "<<angleSum
|
||||
<<G4endl;
|
||||
iPlace = iTkin;
|
||||
fEnergyDistrTable->insertAt(iPlace,energyVector);
|
||||
// fAngleDistrTable->insertAt(iPlace,angleVector);
|
||||
}
|
||||
timer.Stop() ;
|
||||
G4cout.precision(6) ;
|
||||
G4cout<<G4endl ;
|
||||
timer.Stop();
|
||||
G4cout.precision(6);
|
||||
G4cout<<G4endl;
|
||||
G4cout<<"total time for build X-ray TR energy loss tables = "
|
||||
<<timer.GetUserElapsed()<<" s"<<G4endl ;
|
||||
<<timer.GetUserElapsed()<<" s"<<G4endl;
|
||||
fGamma = 0.;
|
||||
return ;
|
||||
}
|
||||
|
||||
@@ -259,7 +353,7 @@ G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral;
|
||||
//
|
||||
//
|
||||
|
||||
void G4VXTRenergyLoss::BuildEnergyTable()
|
||||
void G4XTRenergyLoss::BuildEnergyTable()
|
||||
{
|
||||
return ;
|
||||
}
|
||||
@@ -268,18 +362,146 @@ void G4VXTRenergyLoss::BuildEnergyTable()
|
||||
//
|
||||
//
|
||||
|
||||
void G4VXTRenergyLoss::BuildAngleTable()
|
||||
void G4XTRenergyLoss::BuildAngleTable()
|
||||
{
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The main function which is responsible for the treatment of a particle passage
|
||||
// trough G4Envelope with discrete generation of G4Gamma
|
||||
|
||||
G4VParticleChange* G4XTRenergyLoss::PostStepDoIt( const G4Track& aTrack,
|
||||
const G4Step& aStep )
|
||||
{
|
||||
G4int iTkin, iPlace;
|
||||
G4double energyTR, theta, phi, dirX, dirY, dirZ;
|
||||
|
||||
|
||||
fParticleChange.Initialize(aTrack);
|
||||
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<"Start of G4XTRenergyLoss::PostStepDoIt "<<G4endl ;
|
||||
G4cout<<"name of current material = "
|
||||
<<aTrack.GetVolume()->GetLogicalVolume()->GetMaterial()->GetName()<<G4endl ;
|
||||
}
|
||||
if( aTrack.GetVolume()->GetLogicalVolume() != fEnvelope )
|
||||
{
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<"Go out from G4XTRenergyLoss::PostStepDoIt: wrong volume "<<G4endl;
|
||||
}
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
|
||||
}
|
||||
else
|
||||
{
|
||||
G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
|
||||
const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
|
||||
|
||||
// Now we are ready to Generate one TR photon
|
||||
|
||||
G4double kinEnergy = aParticle->GetKineticEnergy() ;
|
||||
G4double mass = aParticle->GetDefinition()->GetPDGMass() ;
|
||||
G4double gamma = 1.0 + kinEnergy/mass ;
|
||||
|
||||
if(verboseLevel > 0 )
|
||||
{
|
||||
G4cout<<"gamma = "<<gamma<<G4endl ;
|
||||
}
|
||||
G4double massRatio = proton_mass_c2/mass ;
|
||||
G4double TkinScaled = kinEnergy*massRatio ;
|
||||
G4ThreeVector position = pPostStepPoint->GetPosition();
|
||||
G4ParticleMomentum direction = aParticle->GetMomentumDirection();
|
||||
G4double startTime = pPostStepPoint->GetGlobalTime();
|
||||
|
||||
for( iTkin = 0; iTkin < fTotBin; iTkin++ )
|
||||
{
|
||||
if(TkinScaled < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break;
|
||||
}
|
||||
iPlace = iTkin - 1;
|
||||
|
||||
if(iTkin == 0) // Tkin is too small, neglect of TR photon generation
|
||||
{
|
||||
if( verboseLevel )
|
||||
{
|
||||
G4cout<<"Go out from G4XTRenergyLoss::PostStepDoIt:iTkin = "<<iTkin<<G4endl;
|
||||
}
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
|
||||
}
|
||||
else // general case: Tkin between two vectors of the material
|
||||
{
|
||||
fParticleChange.SetNumberOfSecondaries(1);
|
||||
|
||||
energyTR = GetXTRrandomEnergy(TkinScaled,iTkin);
|
||||
|
||||
if( verboseLevel )
|
||||
{
|
||||
G4cout<<"energyTR = "<<energyTR/keV<<" keV"<<G4endl;
|
||||
}
|
||||
theta = fabs(G4RandGauss::shoot(0.0,pi/gamma));
|
||||
|
||||
if( theta >= 0.1 ) theta = 0.1;
|
||||
|
||||
// G4cout<<" : theta = "<<theta<<endl ;
|
||||
|
||||
phi = twopi*G4UniformRand();
|
||||
|
||||
dirX = sin(theta)*cos(phi);
|
||||
dirY = sin(theta)*sin(phi);
|
||||
dirZ = cos(theta);
|
||||
|
||||
G4ThreeVector directionTR(dirX,dirY,dirZ);
|
||||
directionTR.rotateUz(direction);
|
||||
directionTR.unit();
|
||||
|
||||
G4DynamicParticle* aPhotonTR = new G4DynamicParticle(G4Gamma::Gamma(),
|
||||
directionTR, energyTR);
|
||||
|
||||
// A XTR photon is set on the particle track inside the radiator
|
||||
// and is moved to the G4Envelope surface for standard X-ray TR models
|
||||
// only. The case of fExitFlux=true
|
||||
|
||||
if( fExitFlux )
|
||||
{
|
||||
const G4RotationMatrix* rotM = pPostStepPoint->GetTouchable()->GetRotation();
|
||||
G4ThreeVector transl = pPostStepPoint->GetTouchable()->GetTranslation();
|
||||
G4AffineTransform transform = G4AffineTransform(rotM,transl);
|
||||
transform.Invert();
|
||||
G4ThreeVector localP = transform.TransformPoint(position);
|
||||
G4ThreeVector localV = transform.TransformAxis(directionTR);
|
||||
|
||||
G4double distance = fEnvelope->GetSolid()->DistanceToOut(localP, localV);
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<"distance to exit = "<<distance/mm<<" mm"<<G4endl;
|
||||
}
|
||||
position += distance*directionTR;
|
||||
startTime += distance/c_light;
|
||||
}
|
||||
G4Track* aSecondaryTrack = new G4Track( aPhotonTR,
|
||||
startTime, position );
|
||||
aSecondaryTrack->SetTouchableHandle(
|
||||
aStep.GetPostStepPoint()->GetTouchableHandle());
|
||||
aSecondaryTrack->SetParentID( aTrack.GetTrackID() );
|
||||
|
||||
fParticleChange.AddSecondary(aSecondaryTrack);
|
||||
fParticleChange.ProposeEnergy(kinEnergy);
|
||||
}
|
||||
}
|
||||
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The main function which is responsible for the treatment of a particle passage
|
||||
// trough G4Envelope
|
||||
|
||||
G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
G4VParticleChange* G4XTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
const G4Step& aStep )
|
||||
{
|
||||
G4int iTkin, iPlace, numOfTR, iTR ;
|
||||
@@ -290,7 +512,7 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<"Start of G4VXTRenergyLoss::AlongStepDoIt "<<G4endl ;
|
||||
G4cout<<"Start of G4XTRenergyLoss::AlongStepDoIt "<<G4endl ;
|
||||
G4cout<<"name of current material = "
|
||||
<<aTrack.GetVolume()->GetLogicalVolume()->GetMaterial()->GetName()<<G4endl ;
|
||||
}
|
||||
@@ -300,9 +522,9 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
{
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<"Go out from G4VXTRenergyLoss::AlongStepDoIt: wrong volume "<<G4endl;
|
||||
G4cout<<"Go out from G4XTRenergyLoss::AlongStepDoIt: wrong volume "<<G4endl;
|
||||
}
|
||||
return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
|
||||
// return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
|
||||
}
|
||||
G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
|
||||
@@ -335,7 +557,7 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
|
||||
for(iTkin=0;iTkin<fTotBin;iTkin++)
|
||||
{
|
||||
if(TkinScaled < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break ;
|
||||
if(TkinScaled < fProtonEnergyVector->GetLowEdgeEnergy(iTkin)) break;
|
||||
}
|
||||
iPlace = iTkin - 1 ;
|
||||
|
||||
@@ -343,9 +565,9 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
{
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<"Go out from G4VXTRenergyLoss::AlongStepDoIt:iTkin = "<<iTkin<<G4endl;
|
||||
G4cout<<"Go out from G4XTRenergyLoss::AlongStepDoIt:iTkin = "<<iTkin<<G4endl;
|
||||
}
|
||||
return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
|
||||
// return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
|
||||
}
|
||||
else // general case: Tkin between two vectors of the material
|
||||
{
|
||||
@@ -381,10 +603,10 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
aParticleChange.SetNumberOfSecondaries(0);
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<"Go out from G4VXTRenergyLoss::AlongStepDoIt: numOfTR = "
|
||||
G4cout<<"Go out from G4XTRenergyLoss::AlongStepDoIt: numOfTR = "
|
||||
<<numOfTR<<G4endl ;
|
||||
}
|
||||
return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
|
||||
// return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -449,7 +671,24 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
|
||||
G4ThreeVector positionTR = startPos + delta*direction ;
|
||||
|
||||
if( fExitFlux )
|
||||
{
|
||||
const G4RotationMatrix* rotM = pPostStepPoint->GetTouchable()->GetRotation();
|
||||
G4ThreeVector transl = pPostStepPoint->GetTouchable()->GetTranslation();
|
||||
G4AffineTransform transform = G4AffineTransform(rotM,transl);
|
||||
transform.Invert();
|
||||
G4ThreeVector localP = transform.TransformPoint(positionTR);
|
||||
G4ThreeVector localV = transform.TransformAxis(directionTR);
|
||||
|
||||
G4double distance = fEnvelope->GetSolid()->DistanceToOut(localP, localV);
|
||||
if(verboseLevel)
|
||||
{
|
||||
G4cout<<"distance to exit = "<<distance/mm<<" mm"<<G4endl;
|
||||
}
|
||||
positionTR += distance*directionTR;
|
||||
aSecondaryTime += distance/c_light;
|
||||
}
|
||||
|
||||
G4Track* aSecondaryTrack = new G4Track( aPhotonTR,
|
||||
aSecondaryTime,positionTR ) ;
|
||||
aSecondaryTrack->SetTouchableHandle(aStep.GetPostStepPoint()
|
||||
@@ -466,6 +705,7 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
return &aParticleChange;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// This function returns the spectral and angle density of TR quanta
|
||||
@@ -476,7 +716,7 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
|
||||
// varAngle =2* (1 - cos(theta)) or approximately = theta*theta
|
||||
//
|
||||
|
||||
G4complex G4VXTRenergyLoss::OneInterfaceXTRdEdx( G4double energy,
|
||||
G4complex G4XTRenergyLoss::OneInterfaceXTRdEdx( G4double energy,
|
||||
G4double gamma,
|
||||
G4double varAngle )
|
||||
{
|
||||
@@ -495,7 +735,7 @@ G4complex G4VXTRenergyLoss::OneInterfaceXTRdEdx( G4double energy,
|
||||
// For photon energy distribution tables. Integrate first over angle
|
||||
//
|
||||
|
||||
G4double G4VXTRenergyLoss::SpectralAngleXTRdEdx(G4double varAngle)
|
||||
G4double G4XTRenergyLoss::SpectralAngleXTRdEdx(G4double varAngle)
|
||||
{
|
||||
G4double result = GetStackFactor(fEnergy,fGamma,varAngle) ;
|
||||
if(result < 0.0) result = 0.0 ;
|
||||
@@ -506,16 +746,20 @@ G4double G4VXTRenergyLoss::SpectralAngleXTRdEdx(G4double varAngle)
|
||||
//
|
||||
// For second integration over energy
|
||||
|
||||
G4double G4VXTRenergyLoss::SpectralXTRdEdx(G4double energy)
|
||||
G4double G4XTRenergyLoss::SpectralXTRdEdx(G4double energy)
|
||||
{
|
||||
fEnergy = energy ;
|
||||
G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre96(this,&G4VXTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.0,0.3*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4VXTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.3*fMaxThetaTR,0.6*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4VXTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.6*fMaxThetaTR,fMaxThetaTR) ;
|
||||
G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.0,0.1*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.1*fMaxThetaTR,0.2*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.2*fMaxThetaTR,0.4*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.4*fMaxThetaTR,0.7*fMaxThetaTR) +
|
||||
integral.Legendre96(this,&G4XTRenergyLoss::SpectralAngleXTRdEdx,
|
||||
0.7*fMaxThetaTR,fMaxThetaTR) ;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -523,7 +767,7 @@ G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral
|
||||
// for photon angle distribution tables
|
||||
//
|
||||
|
||||
G4double G4VXTRenergyLoss::AngleSpectralXTRdEdx(G4double energy)
|
||||
G4double G4XTRenergyLoss::AngleSpectralXTRdEdx(G4double energy)
|
||||
{
|
||||
G4double result = GetStackFactor(energy,fGamma,fVarAngle) ;
|
||||
if(result < 0) result = 0.0 ;
|
||||
@@ -534,35 +778,22 @@ G4double G4VXTRenergyLoss::AngleSpectralXTRdEdx(G4double energy)
|
||||
//
|
||||
//
|
||||
|
||||
G4double G4VXTRenergyLoss::AngleXTRdEdx(G4double varAngle)
|
||||
G4double G4XTRenergyLoss::AngleXTRdEdx(G4double varAngle)
|
||||
{
|
||||
fVarAngle = varAngle ;
|
||||
G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre10(this,&G4VXTRenergyLoss::AngleSpectralXTRdEdx,
|
||||
G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre10(this,&G4XTRenergyLoss::AngleSpectralXTRdEdx,
|
||||
fMinEnergyTR,fMaxEnergyTR) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Calculates formation zone for plates. Omega is energy !!!
|
||||
|
||||
G4double G4VXTRenergyLoss::GetPlateFormationZone( G4double omega ,
|
||||
G4double G4XTRenergyLoss::GetPlateFormationZone( G4double omega ,
|
||||
G4double gamma ,
|
||||
G4double varAngle )
|
||||
{
|
||||
@@ -576,7 +807,7 @@ G4double G4VXTRenergyLoss::GetPlateFormationZone( G4double omega ,
|
||||
//
|
||||
// Calculates complex formation zone for plates. Omega is energy !!!
|
||||
|
||||
G4complex G4VXTRenergyLoss::GetPlateComplexFZ( G4double omega ,
|
||||
G4complex G4XTRenergyLoss::GetPlateComplexFZ( G4double omega ,
|
||||
G4double gamma ,
|
||||
G4double varAngle )
|
||||
{
|
||||
@@ -598,7 +829,7 @@ G4complex G4VXTRenergyLoss::GetPlateComplexFZ( G4double omega ,
|
||||
// Computes matrix of Sandia photo absorption cross section coefficients for
|
||||
// plate material
|
||||
|
||||
void G4VXTRenergyLoss::ComputePlatePhotoAbsCof()
|
||||
void G4XTRenergyLoss::ComputePlatePhotoAbsCof()
|
||||
{
|
||||
G4int i, j, numberOfElements ;
|
||||
static const G4MaterialTable*
|
||||
@@ -648,7 +879,7 @@ void G4VXTRenergyLoss::ComputePlatePhotoAbsCof()
|
||||
// Returns the value of linear photo absorption coefficient (in reciprocal
|
||||
// length) for plate for given energy of X-ray photon omega
|
||||
|
||||
G4double G4VXTRenergyLoss::GetPlateLinearPhotoAbs(G4double omega)
|
||||
G4double G4XTRenergyLoss::GetPlateLinearPhotoAbs(G4double omega)
|
||||
{
|
||||
G4int i ;
|
||||
G4double omega2, omega3, omega4 ;
|
||||
@@ -663,7 +894,7 @@ G4double G4VXTRenergyLoss::GetPlateLinearPhotoAbs(G4double omega)
|
||||
}
|
||||
if( i == 0 )
|
||||
{
|
||||
G4Exception("Invalid (<I1) energy in G4VXTRenergyLoss::GetPlateLinearPhotoAbs");
|
||||
G4Exception("Invalid (<I1) energy in G4XTRenergyLoss::GetPlateLinearPhotoAbs");
|
||||
}
|
||||
else i-- ;
|
||||
|
||||
@@ -675,7 +906,7 @@ G4double G4VXTRenergyLoss::GetPlateLinearPhotoAbs(G4double omega)
|
||||
//
|
||||
// Calculates formation zone for gas. Omega is energy !!!
|
||||
|
||||
G4double G4VXTRenergyLoss::GetGasFormationZone( G4double omega ,
|
||||
G4double G4XTRenergyLoss::GetGasFormationZone( G4double omega ,
|
||||
G4double gamma ,
|
||||
G4double varAngle )
|
||||
{
|
||||
@@ -691,7 +922,7 @@ G4double G4VXTRenergyLoss::GetGasFormationZone( G4double omega ,
|
||||
//
|
||||
// Calculates complex formation zone for gas gaps. Omega is energy !!!
|
||||
|
||||
G4complex G4VXTRenergyLoss::GetGasComplexFZ( G4double omega ,
|
||||
G4complex G4XTRenergyLoss::GetGasComplexFZ( G4double omega ,
|
||||
G4double gamma ,
|
||||
G4double varAngle )
|
||||
{
|
||||
@@ -715,7 +946,7 @@ G4complex G4VXTRenergyLoss::GetGasComplexFZ( G4double omega ,
|
||||
// Computes matrix of Sandia photo absorption cross section coefficients for
|
||||
// gas material
|
||||
|
||||
void G4VXTRenergyLoss::ComputeGasPhotoAbsCof()
|
||||
void G4XTRenergyLoss::ComputeGasPhotoAbsCof()
|
||||
{
|
||||
G4int i, j, numberOfElements ;
|
||||
static const G4MaterialTable*
|
||||
@@ -765,7 +996,7 @@ void G4VXTRenergyLoss::ComputeGasPhotoAbsCof()
|
||||
// Returns the value of linear photo absorption coefficient (in reciprocal
|
||||
// length) for gas
|
||||
|
||||
G4double G4VXTRenergyLoss::GetGasLinearPhotoAbs(G4double omega)
|
||||
G4double G4XTRenergyLoss::GetGasLinearPhotoAbs(G4double omega)
|
||||
{
|
||||
G4int i ;
|
||||
G4double omega2, omega3, omega4 ;
|
||||
@@ -780,7 +1011,7 @@ G4double G4VXTRenergyLoss::GetGasLinearPhotoAbs(G4double omega)
|
||||
}
|
||||
if( i == 0 )
|
||||
{
|
||||
G4Exception("Invalid (<I1) energy in G4VXTRenergyLoss::GetGasLinearPhotoAbs");
|
||||
G4Exception("Invalid (<I1) energy in G4XTRenergyLoss::GetGasLinearPhotoAbs");
|
||||
}
|
||||
else i-- ;
|
||||
|
||||
@@ -794,7 +1025,7 @@ G4double G4VXTRenergyLoss::GetGasLinearPhotoAbs(G4double omega)
|
||||
// Calculates the product of linear cof by formation zone for plate.
|
||||
// Omega is energy !!!
|
||||
|
||||
G4double G4VXTRenergyLoss::GetPlateZmuProduct( G4double omega ,
|
||||
G4double G4XTRenergyLoss::GetPlateZmuProduct( G4double omega ,
|
||||
G4double gamma ,
|
||||
G4double varAngle )
|
||||
{
|
||||
@@ -805,7 +1036,7 @@ G4double G4VXTRenergyLoss::GetPlateZmuProduct( G4double omega ,
|
||||
// Calculates the product of linear cof by formation zone for plate.
|
||||
// G4cout and output in file in some energy range.
|
||||
|
||||
void G4VXTRenergyLoss::GetPlateZmuProduct()
|
||||
void G4XTRenergyLoss::GetPlateZmuProduct()
|
||||
{
|
||||
ofstream outPlate("plateZmu.dat", ios::out ) ;
|
||||
outPlate.setf( ios::scientific, ios::floatfield );
|
||||
@@ -829,7 +1060,7 @@ void G4VXTRenergyLoss::GetPlateZmuProduct()
|
||||
// Calculates the product of linear cof by formation zone for gas.
|
||||
// Omega is energy !!!
|
||||
|
||||
G4double G4VXTRenergyLoss::GetGasZmuProduct( G4double omega ,
|
||||
G4double G4XTRenergyLoss::GetGasZmuProduct( G4double omega ,
|
||||
G4double gamma ,
|
||||
G4double varAngle )
|
||||
{
|
||||
@@ -840,7 +1071,7 @@ G4double G4VXTRenergyLoss::GetGasZmuProduct( G4double omega ,
|
||||
// Calculates the product of linear cof byformation zone for gas.
|
||||
// G4cout and output in file in some energy range.
|
||||
|
||||
void G4VXTRenergyLoss::GetGasZmuProduct()
|
||||
void G4XTRenergyLoss::GetGasZmuProduct()
|
||||
{
|
||||
ofstream outGas("gasZmu.dat", ios::out ) ;
|
||||
outGas.setf( ios::scientific, ios::floatfield );
|
||||
@@ -869,7 +1100,7 @@ void G4VXTRenergyLoss::GetGasZmuProduct()
|
||||
//
|
||||
|
||||
G4double
|
||||
G4VXTRenergyLoss::OneBoundaryXTRNdensity( G4double energy,G4double gamma,
|
||||
G4XTRenergyLoss::OneBoundaryXTRNdensity( G4double energy,G4double gamma,
|
||||
G4double varAngle ) const
|
||||
{
|
||||
G4double formationLength1, formationLength2 ;
|
||||
@@ -886,13 +1117,20 @@ G4VXTRenergyLoss::OneBoundaryXTRNdensity( G4double energy,G4double gamma,
|
||||
|
||||
}
|
||||
|
||||
G4double G4XTRenergyLoss::GetStackFactor( G4double energy, G4double gamma,
|
||||
G4double varAngle )
|
||||
{
|
||||
// return stack factor corresponding to one interface
|
||||
|
||||
return std::real( OneInterfaceXTRdEdx(energy,gamma,varAngle) );
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// For photon energy distribution tables. Integrate first over angle
|
||||
//
|
||||
|
||||
G4double G4VXTRenergyLoss::XTRNSpectralAngleDensity(G4double varAngle)
|
||||
G4double G4XTRenergyLoss::XTRNSpectralAngleDensity(G4double varAngle)
|
||||
{
|
||||
return OneBoundaryXTRNdensity(fEnergy,fGamma,varAngle)*
|
||||
GetStackFactor(fEnergy,fGamma,varAngle) ;
|
||||
@@ -902,13 +1140,13 @@ G4double G4VXTRenergyLoss::XTRNSpectralAngleDensity(G4double varAngle)
|
||||
//
|
||||
// For second integration over energy
|
||||
|
||||
G4double G4VXTRenergyLoss::XTRNSpectralDensity(G4double energy)
|
||||
G4double G4XTRenergyLoss::XTRNSpectralDensity(G4double energy)
|
||||
{
|
||||
fEnergy = energy ;
|
||||
G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre96(this,&G4VXTRenergyLoss::XTRNSpectralAngleDensity,
|
||||
G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre96(this,&G4XTRenergyLoss::XTRNSpectralAngleDensity,
|
||||
0.0,0.2*fMaxThetaTR) +
|
||||
integral.Legendre10(this,&G4VXTRenergyLoss::XTRNSpectralAngleDensity,
|
||||
integral.Legendre10(this,&G4XTRenergyLoss::XTRNSpectralAngleDensity,
|
||||
0.2*fMaxThetaTR,fMaxThetaTR) ;
|
||||
}
|
||||
|
||||
@@ -917,7 +1155,7 @@ G4double G4VXTRenergyLoss::XTRNSpectralDensity(G4double energy)
|
||||
// for photon angle distribution tables
|
||||
//
|
||||
|
||||
G4double G4VXTRenergyLoss::XTRNAngleSpectralDensity(G4double energy)
|
||||
G4double G4XTRenergyLoss::XTRNAngleSpectralDensity(G4double energy)
|
||||
{
|
||||
return OneBoundaryXTRNdensity(energy,fGamma,fVarAngle)*
|
||||
GetStackFactor(energy,fGamma,fVarAngle) ;
|
||||
@@ -927,11 +1165,11 @@ G4double G4VXTRenergyLoss::XTRNAngleSpectralDensity(G4double energy)
|
||||
//
|
||||
//
|
||||
|
||||
G4double G4VXTRenergyLoss::XTRNAngleDensity(G4double varAngle)
|
||||
G4double G4XTRenergyLoss::XTRNAngleDensity(G4double varAngle)
|
||||
{
|
||||
fVarAngle = varAngle ;
|
||||
G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre96(this,&G4VXTRenergyLoss::XTRNAngleSpectralDensity,
|
||||
G4Integrator<G4XTRenergyLoss,G4double(G4XTRenergyLoss::*)(G4double)> integral ;
|
||||
return integral.Legendre96(this,&G4XTRenergyLoss::XTRNAngleSpectralDensity,
|
||||
fMinEnergyTR,fMaxEnergyTR) ;
|
||||
}
|
||||
|
||||
@@ -940,7 +1178,7 @@ G4double G4VXTRenergyLoss::XTRNAngleDensity(G4double varAngle)
|
||||
// Check number of photons for a range of Lorentz factors from both energy
|
||||
// and angular tables
|
||||
|
||||
void G4VXTRenergyLoss::GetNumberOfPhotons()
|
||||
void G4XTRenergyLoss::GetNumberOfPhotons()
|
||||
{
|
||||
G4int iTkin ;
|
||||
G4double gamma, numberE ;
|
||||
@@ -970,7 +1208,7 @@ void G4VXTRenergyLoss::GetNumberOfPhotons()
|
||||
// Returns randon energy of a X-ray TR photon for given scaled kinetic energy
|
||||
// of a charged particle
|
||||
|
||||
G4double G4VXTRenergyLoss::GetXTRrandomEnergy( G4double scaledTkin, G4int iTkin )
|
||||
G4double G4XTRenergyLoss::GetXTRrandomEnergy( G4double scaledTkin, G4int iTkin )
|
||||
{
|
||||
G4int iTransfer, iPlace ;
|
||||
G4double transfer = 0.0, position, E1, E2, W1, W2, W ;
|
||||
@@ -1021,7 +1259,7 @@ G4double G4VXTRenergyLoss::GetXTRrandomEnergy( G4double scaledTkin, G4int iTkin
|
||||
// Returns approximate position of X-ray photon energy during random sampling
|
||||
// over integral energy distribution
|
||||
|
||||
G4double G4VXTRenergyLoss::GetXTRenergy( G4int iPlace,
|
||||
G4double G4XTRenergyLoss::GetXTRenergy( G4int iPlace,
|
||||
G4double position,
|
||||
G4int iTransfer )
|
||||
{
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
|
||||
#include "G4XTRGammaRadModel.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
#include "G4Gamma.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constructor, destructor
|
||||
|
||||
G4XTRGammaRadModel::G4XTRGammaRadModel(G4LogicalVolume* anEnvelope,
|
||||
G4double alphaPlate,
|
||||
G4double alphaGas,
|
||||
G4Material* foilMat,G4Material* gasMat,
|
||||
G4double a, G4double b, G4int n,
|
||||
const G4String& processName) :
|
||||
G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,n,processName)
|
||||
{
|
||||
G4cout<<"Gammma distributed X-ray TR radiator model is called"<<G4endl ;
|
||||
|
||||
// Build energy and angular integral spectra of X-ray TR photons from
|
||||
// a radiator
|
||||
|
||||
fAlphaPlate = alphaPlate ;
|
||||
fAlphaGas = alphaGas ;
|
||||
G4cout<<"fAlphaPlate = "<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl ;
|
||||
fExitFlux = true;
|
||||
BuildTable() ;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4XTRGammaRadModel::~G4XTRGammaRadModel()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Rough approximation for radiator interference factor for the case of
|
||||
// fully GamDistr radiator. The plate and gas gap thicknesses are distributed
|
||||
// according to exponent. The mean values of the plate and gas gap thicknesses
|
||||
// are supposed to be about XTR formation zones but much less than
|
||||
// mean absorption length of XTR photons in coresponding material.
|
||||
|
||||
G4double
|
||||
G4XTRGammaRadModel::GetStackFactor( G4double energy,
|
||||
G4double gamma, G4double varAngle )
|
||||
{
|
||||
G4double result, Qa, Qb, Q, Za, Zb, Ma, Mb ;
|
||||
|
||||
Za = GetPlateFormationZone(energy,gamma,varAngle) ;
|
||||
Zb = GetGasFormationZone(energy,gamma,varAngle) ;
|
||||
|
||||
Ma = GetPlateLinearPhotoAbs(energy) ;
|
||||
Mb = GetGasLinearPhotoAbs(energy) ;
|
||||
|
||||
Qa = ( 1.0 + fPlateThick*Ma/fAlphaPlate ) ;
|
||||
Qa = std::pow(Qa,-fAlphaPlate) ;
|
||||
Qb = ( 1.0 + fGasThick*Mb/fAlphaGas ) ;
|
||||
Qb = std::pow(Qb,-fAlphaGas) ;
|
||||
Q = Qa*Qb ;
|
||||
|
||||
G4complex Ca(1.0+0.5*fPlateThick*Ma/fAlphaPlate,fPlateThick/Za/fAlphaPlate) ;
|
||||
G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas) ;
|
||||
|
||||
G4complex Ha = std::pow(Ca,-fAlphaPlate) ;
|
||||
G4complex Hb = std::pow(Cb,-fAlphaGas) ;
|
||||
G4complex H = Ha*Hb ;
|
||||
|
||||
G4complex F1 = ( 0.5*(1+Qa)*(1.0+H) - Ha - Qa*Hb )/(1.0-H) ;
|
||||
|
||||
G4complex F2 = (1.0-Ha)*(Qa-Ha)*Hb/(1.0-H)/(Q-H) ;
|
||||
|
||||
F2 *= std::pow(Q,G4double(fPlateNumber)) - std::pow(H,fPlateNumber) ;
|
||||
|
||||
result = ( 1 - std::pow(Q,G4double(fPlateNumber)) )/( 1 - Q ) ;
|
||||
|
||||
G4complex stack = result*F1;
|
||||
stack += F2;
|
||||
stack *= 2.0*OneInterfaceXTRdEdx(energy,gamma,varAngle);
|
||||
|
||||
result = std::real(stack);
|
||||
|
||||
// result *= 2.0*std::real(F1);
|
||||
// result += 2.0*std::real(F2);
|
||||
|
||||
return result ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
|
||||
#include "G4XTRRegularRadModel.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
#include "G4Gamma.hh"
|
||||
using namespace std;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constructor, destructor
|
||||
|
||||
G4XTRRegularRadModel::G4XTRRegularRadModel(G4LogicalVolume *anEnvelope,
|
||||
G4Material* foilMat,G4Material* gasMat,
|
||||
G4double a, G4double b, G4int n,
|
||||
const G4String& processName) :
|
||||
G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,n,processName)
|
||||
{
|
||||
G4cout<<" XTR Regular discrete radiator model is called"<<G4endl ;
|
||||
|
||||
fExitFlux = true;
|
||||
|
||||
// Build energy and angular integral spectra of X-ray TR photons from
|
||||
// a radiator
|
||||
|
||||
BuildTable() ;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4XTRRegularRadModel::~G4XTRRegularRadModel()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Approximation for radiator interference factor for the case of
|
||||
// fully Regular radiator. The plate and gas gap thicknesses are fixed .
|
||||
// The mean values of the plate and gas gap thicknesses
|
||||
// are supposed to be about XTR formation zones but much less than
|
||||
// mean absorption length of XTR photons in coresponding material.
|
||||
|
||||
G4double
|
||||
G4XTRRegularRadModel::GetStackFactor( G4double energy,
|
||||
G4double gamma, G4double varAngle )
|
||||
{
|
||||
G4double result, Qa, Qb, Q, aZa, bZb, aMa, bMb, I2 ;
|
||||
|
||||
aZa = fPlateThick/GetPlateFormationZone(energy,gamma,varAngle) ;
|
||||
bZb = fGasThick/GetGasFormationZone(energy,gamma,varAngle) ;
|
||||
|
||||
aMa = fPlateThick*GetPlateLinearPhotoAbs(energy) ;
|
||||
bMb = fGasThick*GetGasLinearPhotoAbs(energy) ;
|
||||
|
||||
Qa = std::exp(-aMa) ;
|
||||
Qb = std::exp(-bMb) ;
|
||||
Q = Qa*Qb ;
|
||||
|
||||
// G4complex Ca(1.0+0.5*fPlateThick*Ma,fPlateThick/Za) ;
|
||||
// G4complex Cb(1.0+0.5*fGasThick*Mb,fGasThick/Zb) ;
|
||||
|
||||
G4complex Ha( std::exp(-0.5*aMa)*std::cos(aZa),
|
||||
-std::exp(-0.5*aMa)*std::sin(aZa) ) ;
|
||||
|
||||
G4complex Hb( std::exp(-0.5*bMb)*std::cos(bZb),
|
||||
-std::exp(-0.5*bMb)*std::sin(bZb) ) ;
|
||||
|
||||
G4complex H = Ha*Hb ;
|
||||
|
||||
G4complex Hs = std::conj(H) ;
|
||||
|
||||
// G4complex F1 = ( 0.5*(1+Qa)*(1+H) - Ha - Qa*Hb )/(1-H) ;
|
||||
|
||||
G4complex F2 = (1.0-Ha)*(Qa-Ha)*Hb*(1.0-Hs)*(Q-Hs) ;
|
||||
|
||||
F2 *= std::pow(Q,G4double(fPlateNumber)) - std::pow(H,fPlateNumber) ;
|
||||
|
||||
result = ( 1 - std::pow(Q,G4double(fPlateNumber)) )/( 1 - Q ) ;
|
||||
|
||||
result *= (1 - Qa)*(1 + Qa - 2*std::sqrt(Qa)*std::cos(aZa)) ;
|
||||
|
||||
result /= (1 - std::sqrt(Q))*(1 - std::sqrt(Q)) +
|
||||
4*std::sqrt(Q)*std::sin(0.5*(aZa+bZb))*std::sin(0.5*(aZa+bZb)) ;
|
||||
|
||||
I2 = 1.; // 2.0*std::real(F2) ;
|
||||
|
||||
I2 /= (1 - std::sqrt(Q))*(1 - std::sqrt(Q)) +
|
||||
4*std::sqrt(Q)*std::sin(0.5*(aZa+bZb))*std::sin(0.5*(aZa+bZb)) ;
|
||||
|
||||
I2 /= Q*( (std::sqrt(Q)-std::cos(aZa+bZb))*(std::sqrt(Q)-std::cos(aZa+bZb)) +
|
||||
std::sin(aZa+bZb)*std::sin(aZa+bZb) ) ;
|
||||
|
||||
G4complex stack = 2.*I2*F2;
|
||||
stack += result;
|
||||
stack *= OneInterfaceXTRdEdx(energy,gamma,varAngle);
|
||||
|
||||
// result += I2 ;
|
||||
result = std::real(stack);
|
||||
|
||||
return result ;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
|
||||
#include <complex>
|
||||
|
||||
#include "G4XTRTransparentRegRadModel.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4Integrator.hh"
|
||||
#include "G4Gamma.hh"
|
||||
|
||||
using namespace std;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Constructor, destructor
|
||||
|
||||
G4XTRTransparentRegRadModel::G4XTRTransparentRegRadModel(G4LogicalVolume *anEnvelope,
|
||||
G4Material* foilMat,G4Material* gasMat,
|
||||
G4double a, G4double b, G4int n,
|
||||
const G4String& processName) :
|
||||
G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,n,processName)
|
||||
{
|
||||
G4cout<<"Regular transparent X-ray TR radiator EM process is called"<<G4endl;
|
||||
|
||||
// Build energy and angular integral spectra of X-ray TR photons from
|
||||
// a radiator
|
||||
fExitFlux = true;
|
||||
fAlphaPlate = 10000;
|
||||
fAlphaGas = 1000;
|
||||
|
||||
BuildTable();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
G4XTRTransparentRegRadModel::~G4XTRTransparentRegRadModel()
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4double G4XTRTransparentRegRadModel::SpectralXTRdEdx(G4double energy)
|
||||
{
|
||||
G4double result, sum = 0., tmp, cof1, cof2, cofMin, cofPHC,aMa, bMb, sigma;
|
||||
G4int k, kMax, kMin;
|
||||
|
||||
aMa = fPlateThick*GetPlateLinearPhotoAbs(energy);
|
||||
bMb = fGasThick*GetGasLinearPhotoAbs(energy);
|
||||
sigma = aMa + bMb;
|
||||
|
||||
cofPHC = 4*pi*hbarc;
|
||||
tmp = (fSigma1 - fSigma2)/cofPHC/energy;
|
||||
cof1 = fPlateThick*tmp;
|
||||
cof2 = fGasThick*tmp;
|
||||
|
||||
cofMin = energy*(fPlateThick + fGasThick)/fGamma/fGamma;
|
||||
cofMin += (fPlateThick*fSigma1 + fGasThick*fSigma2)/energy;
|
||||
cofMin /= cofPHC;
|
||||
|
||||
// if (fGamma < 1200) kMin = G4int(cofMin); // 1200 ?
|
||||
// else kMin = 1;
|
||||
|
||||
|
||||
kMin = G4int(cofMin);
|
||||
if (cofMin > kMin) kMin++;
|
||||
|
||||
// tmp = (fPlateThick + fGasThick)*energy*fMaxThetaTR;
|
||||
// tmp /= cofPHC;
|
||||
// kMax = G4int(tmp);
|
||||
// if(kMax < 0) kMax = 0;
|
||||
// kMax += kMin;
|
||||
|
||||
|
||||
kMax = kMin + 19; // 9; // kMin + G4int(tmp);
|
||||
|
||||
// tmp /= fGamma;
|
||||
// if( G4int(tmp) < kMin ) kMin = G4int(tmp);
|
||||
// G4cout<<"kMin = "<<kMin<<"; kMax = "<<kMax<<G4endl;
|
||||
|
||||
for( k = kMin; k <= kMax; k++ )
|
||||
{
|
||||
tmp = pi*fPlateThick*(k + cof2)/(fPlateThick + fGasThick);
|
||||
result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2);
|
||||
|
||||
if( k == kMin && kMin == G4int(cofMin) )
|
||||
{
|
||||
sum += 0.5*sin(tmp)*sin(tmp)*std::abs(k-cofMin)/result;
|
||||
}
|
||||
else
|
||||
{
|
||||
sum += sin(tmp)*sin(tmp)*std::abs(k-cofMin)/result;
|
||||
}
|
||||
// G4cout<<"k = "<<k<<"; sum = "<<sum<<G4endl;
|
||||
}
|
||||
result = 4.*( cof1 + cof2 )*( cof1 + cof2 )*sum/energy;
|
||||
result *= ( 1. - exp(-fPlateNumber*sigma) )/( 1. - exp(-sigma) );
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Approximation for radiator interference factor for the case of
|
||||
// fully Regular radiator. The plate and gas gap thicknesses are fixed .
|
||||
// The mean values of the plate and gas gap thicknesses
|
||||
// are supposed to be about XTR formation zones but much less than
|
||||
// mean absorption length of XTR photons in coresponding material.
|
||||
|
||||
G4double
|
||||
G4XTRTransparentRegRadModel::GetStackFactor( G4double energy,
|
||||
G4double gamma, G4double varAngle )
|
||||
{
|
||||
/*
|
||||
G4double result, Za, Zb, Ma, Mb, sigma;
|
||||
|
||||
Za = GetPlateFormationZone(energy,gamma,varAngle);
|
||||
Zb = GetGasFormationZone(energy,gamma,varAngle);
|
||||
Ma = GetPlateLinearPhotoAbs(energy);
|
||||
Mb = GetGasLinearPhotoAbs(energy);
|
||||
sigma = Ma*fPlateThick + Mb*fGasThick;
|
||||
|
||||
G4complex Ca(1.0+0.5*fPlateThick*Ma/fAlphaPlate,fPlateThick/Za/fAlphaPlate);
|
||||
G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas);
|
||||
|
||||
G4complex Ha = pow(Ca,-fAlphaPlate);
|
||||
G4complex Hb = pow(Cb,-fAlphaGas);
|
||||
G4complex H = Ha*Hb;
|
||||
G4complex F1 = (1.0 - Ha)*(1.0 - Hb )/(1.0 - H)
|
||||
* G4double(fPlateNumber) ;
|
||||
G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb/(1.0-H)/(1.0-H)
|
||||
* (1.0 - exp(-0.5*fPlateNumber*sigma)) ;
|
||||
// *(1.0 - pow(H,fPlateNumber)) ;
|
||||
G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle);
|
||||
// G4complex R = F2*OneInterfaceXTRdEdx(energy,gamma,varAngle);
|
||||
result = 2.0*real(R);
|
||||
return result;
|
||||
*/
|
||||
// numerically unstable result
|
||||
|
||||
G4double result, Qa, Qb, Q, aZa, bZb, aMa, bMb, D, sigma;
|
||||
|
||||
aZa = fPlateThick/GetPlateFormationZone(energy,gamma,varAngle);
|
||||
bZb = fGasThick/GetGasFormationZone(energy,gamma,varAngle);
|
||||
aMa = fPlateThick*GetPlateLinearPhotoAbs(energy);
|
||||
bMb = fGasThick*GetGasLinearPhotoAbs(energy);
|
||||
sigma = aMa*fPlateThick + bMb*fGasThick;
|
||||
Qa = exp(-0.5*aMa);
|
||||
Qb = exp(-0.5*bMb);
|
||||
Q = Qa*Qb;
|
||||
|
||||
G4complex Ha( Qa*cos(aZa), -Qa*sin(aZa) );
|
||||
G4complex Hb( Qb*cos(bZb), -Qb*sin(bZb) );
|
||||
G4complex H = Ha*Hb;
|
||||
G4complex Hs = conj(H);
|
||||
D = 1.0 /( (1 - Q)*(1 - Q) +
|
||||
4*Q*sin(0.5*(aZa + bZb))*sin(0.5*(aZa + bZb)) );
|
||||
G4complex F1 = (1.0 - Ha)*(1.0 - Hb)*(1.0 - Hs)
|
||||
* G4double(fPlateNumber)*D;
|
||||
G4complex F2 = (1.0 - Ha)*(1.0 - Ha)*Hb*(1.0 - Hs)*(1.0 - Hs)
|
||||
// * (1.0 - pow(H,fPlateNumber)) * D*D;
|
||||
* (1.0 - exp(-0.5*fPlateNumber*sigma)) * D*D;
|
||||
G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle);
|
||||
result = 2.0*real(R);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user