Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
+24 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.56 2007/05/11 14:22:54 gcosmo Exp $
$Id: History,v 1.62 2007/11/02 20:56:36 gum Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,29 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
02 November 07: P. Gumplinger (xrays-V09-00-03)
- G4Cerenkov constructor add warning printout about the change
to G4VDiscreteProcess
30 September 07: P. Gumplinger (xrays-V09-00-02)
- G4Cerenkov change inheritance to G4VDiscreteProcess
changed the arguments of G4Cerenkov::GetAverageNumberOfPhotons
28 September 07: V.Ivant (xrays-V09-00-01)
- G4VXTRenergyLoss: general cleanup of old comments;
removed all static members;
use verboseLevel variable to control cout
- G4XTRTransparentRegRadModel, G4XTRRegularRadModel,
G4StrawTubeXTRadiator : cleanup, use verboseLevel to control cout
02 July 07: V.Ivant (xrays-V09-00-00)
- G4VXTRenergyLoss: fixed valgrind complains for wrong memory allocation
by removing internal initialisation of Sandia table but using Sandia
table from material
19 June 07: V.Ivant (xrays-V08-03-01)
- G4VXTRenergyLoss: restore version 1.34 after failing to clean it up
11 May 07: G.Cosmo (xrays-V08-03-00)
- Use call to G4GeometryTolerance instead of kCarTolerance in G4ForwardXrayTR.
- Requires tag "global-V08-03-00" and related tag set.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4Cerenkov.hh,v 1.8 2006/06/29 19:55:31 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4Cerenkov.hh,v 1.9 2007/09/30 22:17:04 gum Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -33,11 +33,12 @@
////////////////////////////////////////////////////////////////////////
//
// File: G4Cerenkov.hh
// Description: Continuous Process -- Generation of Cerenkov Photons
// Description: Discrete Process - Generation of Cerenkov Photons
// Version: 2.0
// Created: 1996-02-21
// Author: Juliet Armstrong
// Updated: 2005-07-28 add G4ProcessType to constructor
// Updated: 2007-09-30 change inheritance to G4VDiscreteProcess
// 2005-07-28 add G4ProcessType to constructor
// 1999-10-29 add method and class descriptors
// 1997-04-09 by Peter Gumplinger
// > G4MaterialPropertiesTable; new physics/tracking scheme
@@ -58,7 +59,7 @@
#include "G4ThreeVector.hh"
#include "G4ParticleMomentum.hh"
#include "G4Step.hh"
#include "G4VContinuousProcess.hh"
#include "G4VDiscreteProcess.hh"
#include "G4OpticalPhoton.hh"
#include "G4DynamicParticle.hh"
#include "G4Material.hh"
@@ -67,15 +68,15 @@
#include "G4PhysicsOrderedFreeVector.hh"
// Class Description:
// Continuous Process -- Generation of Cerenkov Photons.
// Class inherits publicly from G4VContinuousProcess.
// Discrete Process -- Generation of Cerenkov Photons.
// Class inherits publicly from G4VDiscreteProcess.
// Class Description - End:
/////////////////////
// Class Definition
/////////////////////
class G4Cerenkov : public G4VContinuousProcess
class G4Cerenkov : public G4VDiscreteProcess
{
private:
@@ -108,14 +109,13 @@ public: // With description
G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
// Returns true -> 'is applicable', for all charged particles.
G4double GetContinuousStepLimit(const G4Track& aTrack,
G4double ,
G4double ,
G4double& );
// Returns the continuous step limit defined by the Cerenkov
// process.
G4double GetMeanFreePath(const G4Track& aTrack,
G4double ,
G4ForceCondition* );
// Returns the discrete step limit and sets the 'StronglyForced'
// condition for the DoIt to be invoked at every step.
G4VParticleChange* AlongStepDoIt(const G4Track& aTrack,
G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
const G4Step& aStep);
// This is the method implementing the Cerenkov process.
@@ -146,7 +146,8 @@ private:
// Helper Functions
/////////////////////
G4double GetAverageNumberOfPhotons(const G4DynamicParticle *aParticle,
G4double GetAverageNumberOfPhotons(const G4double charge,
const G4double beta,
const G4Material *aMaterial,
const G4MaterialPropertyVector* Rindex) const;
@@ -25,7 +25,7 @@
//
//
// $Id: G4ForwardXrayTR.hh,v 1.14 2006/06/29 19:55:33 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// G4ForwardXrayTR -- header file
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4GammaXTRadiator.hh,v 1.4 2006/06/29 19:55:35 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
///////////////////////////////////////////////////////////////////////////
@@ -25,7 +25,7 @@
//
//
// $Id: G4RegularXTRadiator.hh,v 1.3 2006/06/29 19:55:37 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
///////////////////////////////////////////////////////////////////////////
@@ -25,7 +25,7 @@
//
//
// $Id: G4Scintillation.hh,v 1.13 2006/06/29 19:55:39 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
////////////////////////////////////////////////////////////////////////
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4StrawTubeXTRadiator.hh,v 1.2 2006/06/29 19:55:41 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4StrawTubeXTRadiator.hh,v 1.4 2007/09/29 17:49:34 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
///////////////////////////////////////////////////////////////////////////
@@ -40,47 +40,42 @@
//
// History:
// 22.04.05 V. Grichine, first version
// 28.09.07, V.Ivanchenko general cleanup without change of algorithms
//
#ifndef G4StrawTubeXTRadiator_h
#define G4StrawTubeXTRadiator_h 1
#include <complex>
#include "G4VXTRenergyLoss.hh"
class G4SandiaTable;
class G4StrawTubeXTRadiator : public G4VXTRenergyLoss
{
public:
G4StrawTubeXTRadiator (G4LogicalVolume* anEnvelope, G4Material*, G4Material*,
G4double,G4double,G4Material*,G4bool unishut = false,
const G4String & processName = "StrawTubeXTRadiator");
~G4StrawTubeXTRadiator ();
G4double,G4double,G4Material*,G4bool unishut = false,
const G4String & processName = "StrawTubeXTRadiator");
virtual ~G4StrawTubeXTRadiator ();
// Auxiliary functions for plate/gas material parameters
// Auxiliary functions for plate/gas material parameters
G4double GetMediumFormationZone(G4double,G4double,G4double) ;
void ComputeMediumPhotoAbsCof() ;
G4double GetMediumLinearPhotoAbs(G4double) ;
G4complex GetMediumComplexFZ(G4double,G4double,G4double) ;
// Pure virtual function from base class
G4double GetStackFactor( G4double energy, G4double gamma, G4double varAngle);
protected:
G4int fMatIndex3;
G4double fSigma3;
G4double** fMediumPhotoAbsCof ;
G4int fMediumIntervalNumber ;
G4SandiaTable* fMediumPhotoAbsCof;
};
#endif
@@ -25,7 +25,7 @@
//
//
// $Id: G4SynchrotronRadiation.hh,v 1.4 2006/06/29 19:55:43 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4SynchrotronRadiationInMat.hh,v 1.2 2006/06/29 19:55:45 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// ------------------------------------------------------------
// GEANT 4 class header file
@@ -25,7 +25,7 @@
//
//
// $Id: G4TransitionRadiation.hh,v 1.9 2006/06/29 19:55:47 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// G4TransitionRadiation -- header file
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4TransparentRegXTRadiator.hh,v 1.2 2006/06/29 19:55:49 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
//
///////////////////////////////////////////////////////////////////////////
@@ -25,7 +25,7 @@
//
//
// $Id: G4VTRModel.hh,v 1.3 2006/06/29 19:55:51 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// G4VTRModel -- header file
//
@@ -25,7 +25,7 @@
//
//
// $Id: G4VTransitionRadiation.hh,v 1.3 2006/06/29 19:55:53 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// G4VTransitionRadiation -- header file
//
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VXTRenergyLoss.hh,v 1.18 2006/06/29 19:55:55 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4VXTRenergyLoss.hh,v 1.24 2007/09/29 17:49:34 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
//
///////////////////////////////////////////////////////////////////////////
@@ -38,12 +38,11 @@
// 06.10.05 V. Grichine first step to discrete process
// 15.01.02 V. Grichine first version
// 28.07.05, P.Gumplinger add G4ProcessType to constructor
// 28.09.07, V.Ivanchenko general cleanup without change of algorithms
//
#ifndef G4XTRenergyLoss_h
#define G4XTRenergyLoss_h 1
#ifndef G4VXTRenergyLoss_h
#define G4VXTRenergyLoss_h 1
#include <complex>
#include "globals.hh"
@@ -68,38 +67,27 @@
#include "G4Integrator.hh"
#include "G4ParticleChange.hh"
class G4SandiaTable;
class G4VParticleChange;
class G4PhysicsFreeVector;
class G4XTRenergyLoss : public G4VDiscreteProcess // G4VContinuousProcess
class G4VXTRenergyLoss : public G4VDiscreteProcess // G4VContinuousProcess
{
public:
G4XTRenergyLoss (G4LogicalVolume *anEnvelope,G4Material*,G4Material*,
G4VXTRenergyLoss (G4LogicalVolume *anEnvelope,G4Material*,G4Material*,
G4double,G4double,G4int,
const G4String & processName = "XTRenergyLoss",
G4ProcessType type = fElectromagnetic);
virtual ~G4XTRenergyLoss ();
virtual ~G4VXTRenergyLoss ();
// These virtual has to be implemented in inherited particular TR radiators
virtual G4double GetStackFactor( G4double energy, G4double gamma,
G4double varAngle );
G4bool IsApplicable(const G4ParticleDefinition&);
G4double GetContinuousStepLimit(const G4Track& aTrack,
G4double ,
G4double ,
G4double& );
// Returns the continuous step limit defined by the XTR process.
G4VParticleChange* AlongStepDoIt(const G4Track& aTrack,
const G4Step& aStep);
G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
const G4Step& aStep);
@@ -161,91 +149,89 @@ public:
void GetGasZmuProduct();
G4double GetGasZmuProduct(G4double,G4double,G4double);
G4double GetPlateCompton(G4double);
G4double GetGasCompton(G4double);
G4double GetComptonPerAtom(G4double,G4double);
G4double GetPlateCompton(G4double);
G4double GetGasCompton(G4double);
G4double GetComptonPerAtom(G4double,G4double);
G4double GetXTRrandomEnergy( G4double scaledTkin, G4int iTkin );
G4double GetXTRenergy( G4int iPlace, G4double position, G4int iTransfer );
G4double GetXTRrandomEnergy( G4double scaledTkin, G4int iTkin );
G4double GetXTRenergy( G4int iPlace, G4double position, G4int iTransfer );
G4double GetRandomAngle( G4double energyXTR, G4int iTkin );
G4double GetAngleXTR(G4int iTR,G4double position,G4int iAngle);
G4double GetRandomAngle( G4double energyXTR, G4int iTkin );
G4double GetAngleXTR(G4int iTR,G4double position,G4int iAngle);
G4double GetGamma() {return fGamma;};
G4double GetEnergy() {return fEnergy;};
G4double GetVarAngle(){return fVarAngle;};
G4double GetGamma() {return fGamma;};
G4double GetEnergy() {return fEnergy;};
G4double GetVarAngle(){return fVarAngle;};
void SetGamma(G4double gamma) {fGamma = gamma;};
void SetEnergy(G4double energy) {fEnergy = energy;};
void SetVarAngle(G4double varAngle){fVarAngle = varAngle;};
void SetAngleRadDistr(G4bool pAngleRadDistr){fAngleRadDistr=pAngleRadDistr;};
void SetCompton(G4bool pC){fCompton=pC;};
void SetVerboseLevel(G4int verbose){fVerbose=verbose;};
static G4PhysicsLogVector* GetProtonVector(){ return fProtonEnergyVector;};
static G4int GetTotBin(){return fTotBin;};
G4PhysicsLogVector* GetProtonVector(){ return fProtonEnergyVector;};
G4int GetTotBin(){return fTotBin;};
G4PhysicsFreeVector* GetAngleVector(G4double energy, G4int n);
protected:
G4ParticleDefinition* fPtrGamma ; // pointer to TR photon
G4ParticleDefinition* fPtrGamma ; // pointer to TR photon
G4double* fGammaCutInKineticEnergy ; // TR photon cut in energy array
G4double fGammaTkinCut ; // Tkin cut of TR photon in current mat.
G4double fGammaTkinCut ; // Tkin cut of TR photon in current mat.
G4LogicalVolume* fEnvelope ;
G4PhysicsTable* fAngleDistrTable ;
G4PhysicsTable* fEnergyDistrTable ;
G4PhysicsTable* fAngleDistrTable ;
G4PhysicsTable* fEnergyDistrTable ;
static G4PhysicsLogVector* fProtonEnergyVector ;
static G4PhysicsLogVector* fXTREnergyVector ;
G4PhysicsLogVector* fProtonEnergyVector ;
G4PhysicsLogVector* fXTREnergyVector ;
G4double fTheMinEnergyTR; // min TR energy
G4double fTheMaxEnergyTR; // max TR energy
G4double fMinEnergyTR; // min TR energy in material
G4double fMaxEnergyTR; // max TR energy in material
G4double fTheMaxAngle; // max theta of TR quanta
G4double fTheMinAngle; // max theta of TR quanta
G4double fMaxThetaTR; // max theta of TR quanta
G4int fBinTR; // number of bins in TR vectors
static G4double fTheMinEnergyTR; // static min TR energy
static G4double fTheMaxEnergyTR; // static max TR energy
G4double fMinEnergyTR; // min TR energy in material
G4double fMaxEnergyTR; // max TR energy in material
static G4double fTheMaxAngle; // max theta of TR quanta
static G4double fTheMinAngle; // max theta of TR quanta
G4double fMaxThetaTR; // max theta of TR quanta
static G4int fBinTR; // number of bins in TR vectors
static G4double fMinProtonTkin; // min Tkin of proton in tables
static G4double fMaxProtonTkin; // max Tkin of proton in tables
static G4int fTotBin; // number of bins in log scale
G4double fGamma; // current Lorentz factor
G4double fEnergy; // energy and
G4double fVarAngle; // angle squared
G4double fMinProtonTkin; // min Tkin of proton in tables
G4double fMaxProtonTkin; // max Tkin of proton in tables
G4int fTotBin; // number of bins in log scale
G4double fGamma; // current Lorentz factor
G4double fEnergy; // energy and
G4double fVarAngle; // angle squared
G4double fLambda;
static G4double fPlasmaCof ; // physical consts for plasma energy
static G4double fCofTR ;
G4double fPlasmaCof ; // physical consts for plasma energy
G4double fCofTR ;
G4bool fExitFlux;
G4bool fAngleRadDistr;
G4bool fCompton;
G4double fSigma1;
G4double fSigma2; // plasma energy Sq of matter1/2
G4bool fExitFlux;
G4bool fAngleRadDistr;
G4bool fCompton;
G4double fSigma1, fSigma2 ; // plasma energy Sq of matter1/2
G4int fMatIndex1;
G4int fMatIndex2;
G4int fPlateNumber;
G4int fMatIndex1, fMatIndex2 ;
G4double fTotalDist;
G4double fPlateThick;
G4double fGasThick;
G4double fAlphaPlate;
G4double fAlphaGas ;
G4int fPlateNumber ;
G4double fTotalDist ;
G4double** fPlatePhotoAbsCof ;
G4int fPlateIntervalNumber ;
G4double fPlateThick ;
G4SandiaTable* fPlatePhotoAbsCof;
G4double** fGasPhotoAbsCof ;
G4int fGasIntervalNumber ;
G4double fGasThick ;
G4double fAlphaPlate, fAlphaGas ;
G4SandiaTable* fGasPhotoAbsCof;
G4ParticleChange fParticleChange;
G4PhysicsTable* fAngleForEnergyTable;
std::vector<G4PhysicsTable*> fAngleBank;
G4int fVerbose;
};
typedef G4XTRenergyLoss G4VXTRenergyLoss;
#endif
@@ -48,22 +48,21 @@
// 03.10.05 V. Grichine, first version
//
#ifndef G4XTRGammaRadModel_h
#define G4XTRGammaRadModel_h 1
#include "G4VXTRenergyLoss.hh"
class G4XTRGammaRadModel : public G4XTRenergyLoss
class G4XTRGammaRadModel : public G4VXTRenergyLoss
{
public:
G4XTRGammaRadModel (G4LogicalVolume *anEnvelope,
G4double,G4double,
G4Material*,G4Material*,
G4double,G4double,G4int,
const G4String & processName = "XTRgammaRadiator" );
~G4XTRGammaRadModel ();
G4XTRGammaRadModel (G4LogicalVolume *anEnvelope,
G4double,G4double,
G4Material*,G4Material*,
G4double,G4double,G4int,
const G4String & processName = "XTRgammaRadiator" );
virtual ~G4XTRGammaRadModel ();
// Pure virtual function from base class
@@ -41,21 +41,19 @@
// 10.10.05 V. Grichine, first version
//
#ifndef G4XTRRegularRadModel_h
#define G4XTRRegularRadModel_h 1
#include "G4VXTRenergyLoss.hh"
class G4XTRRegularRadModel : public G4XTRenergyLoss
class G4XTRRegularRadModel : public G4VXTRenergyLoss
{
public:
G4XTRRegularRadModel (G4LogicalVolume *anEnvelope,G4Material*,G4Material*,
G4XTRRegularRadModel (G4LogicalVolume *anEnvelope,G4Material*,G4Material*,
G4double,G4double,G4int,
const G4String & processName = "XTRegularModel");
~G4XTRRegularRadModel ();
virtual ~G4XTRRegularRadModel ();
// Pure virtual function from base class
@@ -24,19 +24,23 @@
// ********************************************************************
//
//
// $Id: G4Cerenkov.cc,v 1.21 2006/06/29 19:56:03 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4Cerenkov.cc,v 1.23 2007/10/15 20:05:23 gum Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
////////////////////////////////////////////////////////////////////////
// Cerenkov Radiation Class Implementation
////////////////////////////////////////////////////////////////////////
//
// File: G4Cerenkov.cc
// Description: Continuous Process -- Generation of Cerenkov Photons
// Description: Discrete Process -- Generation of Cerenkov Photons
// Version: 2.1
// Created: 1996-02-21
// Author: Juliet Armstrong
// Updated: 2005-08-17 by Peter Gumplinger
// Updated: 2007-09-30 by Peter Gumplinger
// > change inheritance to G4VDiscreteProcess
// GetContinuousStepLimit -> GetMeanFreePath (StronglyForced)
// AlongStepDoIt -> PostStepDoIt
// 2005-08-17 by Peter Gumplinger
// > change variable name MeanNumPhotons -> MeanNumberOfPhotons
// 2005-07-28 by Peter Gumplinger
// > add G4ProcessType to constructor
@@ -81,8 +85,15 @@ using namespace std;
/////////////////
G4Cerenkov::G4Cerenkov(const G4String& processName, G4ProcessType type)
: G4VContinuousProcess(processName, type)
: G4VDiscreteProcess(processName, type)
{
G4cout << "G4Cerenkov::G4Cerenkov constructor" << G4endl;
G4cout << "NOTE: this is now a G4VDiscreteProcess!" << G4endl;
G4cout << "Required change in UserPhysicsList: " << G4endl;
G4cout << "change: pmanager->AddContinuousProcess(theCerenkovProcess);" << G4endl;
G4cout << "to: pmanager->AddProcess(theCerenkovProcess);" << G4endl;
G4cout << " pmanager->SetProcessOrdering(theCerenkovProcess,idxPostStep);" << G4endl;
fTrackSecondariesFirst = false;
fMaxPhotons = 0;
@@ -115,11 +126,11 @@ G4Cerenkov::~G4Cerenkov()
// Methods
////////////
// AlongStepDoIt
// PostStepDoIt
// -------------
//
G4VParticleChange*
G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
G4Cerenkov::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
// This routine is called for each tracking Step of a charged particle
// in a radiator. A Poisson-distributed number of photons is generated
@@ -129,6 +140,7 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
// they are added to the particle change.
{
//////////////////////////////////////////////////////
// Should we ensure that the material is dispersive?
//////////////////////////////////////////////////////
@@ -148,15 +160,22 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
G4MaterialPropertiesTable* aMaterialPropertiesTable =
aMaterial->GetMaterialPropertiesTable();
if (!aMaterialPropertiesTable)
return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
const G4MaterialPropertyVector* Rindex =
aMaterialPropertiesTable->GetProperty("RINDEX");
if (!Rindex)
return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
// particle charge
const G4double charge = aParticle->GetDefinition()->GetPDGCharge();
// particle beta
const G4double beta = (pPreStepPoint ->GetBeta() +
pPostStepPoint->GetBeta())/2.;
G4double MeanNumberOfPhotons =
GetAverageNumberOfPhotons(aParticle,aMaterial,Rindex);
GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
if (MeanNumberOfPhotons <= 0.0) {
@@ -164,7 +183,7 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
aParticleChange.SetNumberOfSecondaries(0);
return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
@@ -181,7 +200,7 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
aParticleChange.SetNumberOfSecondaries(0);
return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
////////////////////////////////////////////////////////////////
@@ -201,8 +220,7 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
G4double nMax = Rindex->GetMaxProperty();
G4double BetaInverse = aParticle->GetTotalEnergy() /
aParticle->GetTotalMomentum();
G4double BetaInverse = 1./beta;
G4double maxCos = BetaInverse / nMax;
G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
@@ -311,7 +329,7 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
<< aParticleChange.GetNumberOfSecondaries() << G4endl;
}
return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
// BuildThePhysicsTable for the Cerenkov process
@@ -418,16 +436,16 @@ void G4Cerenkov::BuildThePhysicsTable()
}
}
// GetContinuousStepLimit
// ----------------------
// GetMeanFreePath
// ---------------
//
G4double
G4Cerenkov::GetContinuousStepLimit(const G4Track& aTrack,
G4double ,
G4double ,
G4double& )
G4double G4Cerenkov::GetMeanFreePath(const G4Track& aTrack,
G4double,
G4ForceCondition* condition)
{
*condition = StronglyForced;
// If user has defined an average maximum number of photons to
// be generated in a Step, then return the Step length for that
// number of photons.
@@ -445,8 +463,15 @@ G4Cerenkov::GetContinuousStepLimit(const G4Track& aTrack,
aMaterialPropertiesTable->GetProperty("RINDEX");
if (!Rindex) return DBL_MAX;
// particle charge
const G4double charge = aParticle->GetDefinition()->GetPDGCharge();
// particle beta
const G4double beta = aParticle->GetTotalMomentum() /
aParticle->GetTotalEnergy();
G4double MeanNumberOfPhotons =
GetAverageNumberOfPhotons(aParticle,aMaterial,Rindex);
GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
if(MeanNumberOfPhotons <= 0.0) return DBL_MAX;
@@ -462,16 +487,16 @@ G4Cerenkov::GetContinuousStepLimit(const G4Track& aTrack,
// ^^^^^^^^^^
G4double
G4Cerenkov::GetAverageNumberOfPhotons(const G4DynamicParticle* aParticle,
G4Cerenkov::GetAverageNumberOfPhotons(const G4double charge,
const G4double beta,
const G4Material* aMaterial,
const G4MaterialPropertyVector* Rindex) const
{
const G4double Rfact = 369.81/(eV * cm);
if(aParticle->GetTotalMomentum() <= 0.0)return 0.0;
if(beta <= 0.0)return 0.0;
G4double BetaInverse = aParticle->GetTotalEnergy() /
aParticle->GetTotalMomentum();
G4double BetaInverse = 1./beta;
// Vectors used in computation of Cerenkov Angle Integral:
// - Refraction Indices for the current material
@@ -536,9 +561,6 @@ G4Cerenkov::GetAverageNumberOfPhotons(const G4DynamicParticle* aParticle,
}
}
// particle charge
G4double charge = aParticle->GetDefinition()->GetPDGCharge();
// Calculate number of photons
G4double NumPhotons = Rfact * charge/eplus * charge/eplus *
(dp - ge * BetaInverse*BetaInverse);
@@ -25,7 +25,7 @@
//
//
// $Id: G4ForwardXrayTR.cc,v 1.14 2007/05/11 14:23:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// G4ForwardXrayTR class -- implementation file
@@ -25,7 +25,7 @@
//
//
// $Id: G4GammaXTRadiator.cc,v 1.5 2006/06/29 19:56:07 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
#include <complex>
@@ -25,7 +25,7 @@
//
//
// $Id: G4RegularXTRadiator.cc,v 1.9 2006/06/29 19:56:09 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
#include <complex>
@@ -25,7 +25,7 @@
//
//
// $Id: G4Scintillation.cc,v 1.26 2006/06/29 19:56:11 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
////////////////////////////////////////////////////////////////////////
// Scintillation Light Class Implementation
@@ -24,15 +24,12 @@
// ********************************************************************
//
//
// $Id: G4StrawTubeXTRadiator.cc,v 1.4 2006/06/29 19:56:13 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4StrawTubeXTRadiator.cc,v 1.6 2007/09/29 17:49:34 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
#include <complex>
#include "G4StrawTubeXTRadiator.hh"
#include "Randomize.hh"
#include "G4Gamma.hh"
using namespace std;
@@ -48,42 +45,44 @@ G4StrawTubeXTRadiator::G4StrawTubeXTRadiator(G4LogicalVolume *anEnvelope,
const G4String& processName) :
G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,1,processName)
{
G4cout<<"Straw tube X-ray TR radiator EM process is called"<<G4endl;
if(verboseLevel > 0)
G4cout<<"Straw tube X-ray TR radiator EM process is called"<<G4endl;
if( unishut )
{
fAlphaPlate = 1./3.;
fAlphaGas = 12.4;
G4cout<<"straw uniform shooting: "<<"fAlphaPlate = "
<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl;
if(verboseLevel > 0)
G4cout<<"straw uniform shooting: "<<"fAlphaPlate = "
<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl;
}
else
{
fAlphaPlate = 0.5;
fAlphaGas = 5.;
G4cout<<"straw isotropical shooting: "<<"fAlphaPlate = "
<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl;
if(verboseLevel > 0)
G4cout<<"straw isotropical shooting: "<<"fAlphaPlate = "
<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl;
}
// index of medium material
fMatIndex3 = mediumMat->GetIndex();
G4cout<<"medium material = "<<mediumMat->GetName()<<G4endl;
if(verboseLevel > 0)
G4cout<<"medium material = "<<mediumMat->GetName()<<G4endl;
// plasma energy squared for plate material
// plasma energy squared for plate material
fSigma3 = fPlasmaCof*mediumMat->GetElectronDensity();
G4cout<<"medium plasma energy = "<<sqrt(fSigma3)/eV<<" eV"<<G4endl;
if(verboseLevel > 0)
G4cout<<"medium plasma energy = "<<sqrt(fSigma3)/eV<<" eV"<<G4endl;
// Compute cofs for preparation of linear photo absorption in external medium
// Compute cofs for preparation of linear photo absorption in external medium
ComputeMediumPhotoAbsCof();
// Build energy and angular integral spectra of X-ray TR photons from
// a radiator
@@ -94,11 +93,8 @@ G4StrawTubeXTRadiator::G4StrawTubeXTRadiator(G4LogicalVolume *anEnvelope,
G4StrawTubeXTRadiator::~G4StrawTubeXTRadiator()
{
;
}
///////////////////////////////////////////////////////////////////////////
//
// Approximation for radiator interference factor for the case of
@@ -121,7 +117,6 @@ G4StrawTubeXTRadiator::GetStackFactor( G4double energy,
M2 = GetPlateLinearPhotoAbs(energy);
M3 = GetGasLinearPhotoAbs(energy);
G4complex C2(1.0 + 0.5*fPlateThick*M2/fAlphaPlate, fPlateThick/L2/fAlphaPlate);
G4complex C3(1.0 + 0.5*fGasThick*M3/fAlphaGas, fGasThick/L3/fAlphaGas);
@@ -189,47 +184,9 @@ G4complex G4StrawTubeXTRadiator::GetMediumComplexFZ( G4double omega ,
void G4StrawTubeXTRadiator::ComputeMediumPhotoAbsCof()
{
G4int i, j, numberOfElements;
static const G4MaterialTable*
theMaterialTable = G4Material::GetMaterialTable();
G4SandiaTable thisMaterialSandiaTable(fMatIndex3);
numberOfElements = (*theMaterialTable)[fMatIndex3]->GetNumberOfElements();
G4int* thisMaterialZ = new G4int[numberOfElements];
for(i=0;i<numberOfElements;i++)
{
thisMaterialZ[i] = (G4int)(*theMaterialTable)[fMatIndex3]->
GetElement(i)->GetZ() ;
}
fMediumIntervalNumber = thisMaterialSandiaTable.SandiaIntervals
(thisMaterialZ,numberOfElements) ;
fMediumIntervalNumber = thisMaterialSandiaTable.SandiaMixing
( thisMaterialZ ,
(*theMaterialTable)[fMatIndex3]->GetFractionVector() ,
numberOfElements,fMediumIntervalNumber);
fMediumPhotoAbsCof = new G4double*[fMediumIntervalNumber];
for(i=0;i<fMediumIntervalNumber;i++)
{
fMediumPhotoAbsCof[i] = new G4double[5];
}
for(i=0;i<fMediumIntervalNumber;i++)
{
fMediumPhotoAbsCof[i][0] = thisMaterialSandiaTable.
GetPhotoAbsorpCof(i+1,0);
for(j=1;j<5;j++)
{
fMediumPhotoAbsCof[i][j] = thisMaterialSandiaTable.
GetPhotoAbsorpCof(i+1,j)*
(*theMaterialTable)[fMatIndex3]->GetDensity();
}
}
delete[] thisMaterialZ;
return;
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
const G4Material* mat = (*theMaterialTable)[fMatIndex3];
fMediumPhotoAbsCof = mat->GetSandiaTable();
}
//////////////////////////////////////////////////////////////////////
@@ -239,30 +196,19 @@ void G4StrawTubeXTRadiator::ComputeMediumPhotoAbsCof()
G4double G4StrawTubeXTRadiator::GetMediumLinearPhotoAbs(G4double omega)
{
G4int i ;
G4double omega2, omega3, omega4;
omega2 = omega*omega;
omega3 = omega2*omega;
omega4 = omega2*omega2;
for(i=0;i<fMediumIntervalNumber;i++)
{
if( omega < fMediumPhotoAbsCof[i][0] ) break;
}
if( i == 0 )
{
G4Exception("Invalid (<I1) energy in G4VXTRenergyLoss::GetMediumLinearPhotoAbs");
}
else i-- ;
return fMediumPhotoAbsCof[i][1]/omega + fMediumPhotoAbsCof[i][2]/omega2 +
fMediumPhotoAbsCof[i][3]/omega3 + fMediumPhotoAbsCof[i][4]/omega4 ;
G4double* SandiaCof = fMediumPhotoAbsCof->GetSandiaCofForMaterial(omega);
G4double cross = SandiaCof[0]/omega + SandiaCof[1]/omega2 +
SandiaCof[2]/omega3 + SandiaCof[3]/omega4;
return cross;
}
//
//
////////////////////////////////////////////////////////////////////////////
@@ -25,7 +25,7 @@
//
//
// $Id: G4SynchrotronRadiation.cc,v 1.5 2006/06/29 19:56:15 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
@@ -25,7 +25,7 @@
//
//
// $Id: G4SynchrotronRadiationInMat.cc,v 1.2 2006/06/29 19:56:17 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
@@ -25,7 +25,7 @@
//
//
// $Id: G4TransitionRadiation.cc,v 1.7 2006/06/29 19:56:19 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// G4TransitionRadiation class -- implementation file
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4TransparentRegXTRadiator.cc,v 1.10 2006/06/29 19:56:21 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// $Id: G4TransparentRegXTRadiator.cc,v 1.11 2007/09/29 17:49:34 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-01 $
//
#include <complex>
@@ -47,7 +47,8 @@ G4TransparentRegXTRadiator::G4TransparentRegXTRadiator(G4LogicalVolume *anEnvelo
const G4String& processName) :
G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,n,processName)
{
G4cout<<"Regular transparent X-ray TR radiator EM process is called"<<G4endl;
if(verboseLevel > 0)
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
@@ -120,7 +121,7 @@ G4double G4TransparentRegXTRadiator::SpectralXTRdEdx(G4double energy)
{
sum += sin(tmp)*sin(tmp)*abs(k-cofMin)/result;
}
if(fVerbose > 2)
if(verboseLevel > 2)
{
G4cout<<"k = "<<k<<"; tmp = "<<sin(tmp)*sin(tmp)*abs(k-cofMin)/result
<<"; sum = "<<sum<<G4endl;
@@ -25,7 +25,7 @@
//
//
// $Id: G4VTransitionRadiation.cc,v 1.5 2006/06/29 19:56:23 gunter Exp $
// GEANT4 tag $Name: geant4-09-00 $
// GEANT4 tag $Name: geant4-09-01 $
//
// G4VTransitionRadiation class -- implementation file
File diff suppressed because it is too large Load Diff