Import Geant4 10.3.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History 97385 2016-06-02 09:59:53Z gcosmo $
|
||||
$Id: History 98002 2016-06-30 13:03:36Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,10 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
20 Jun 16: P. Gumplinger (xrays-V10-02-05)
|
||||
- Add a stacking flag to G4Scintillation and G4Cerenkov and add
|
||||
GetNumPhotons() method
|
||||
|
||||
1 Jun 16: D.Sawkey (xrays-V10-02-04)
|
||||
- Most files: use C++11 keywords override, delete, explicit, nullptr
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Cerenkov.hh 97385 2016-06-02 09:59:53Z gcosmo $
|
||||
// $Id: G4Cerenkov.hh 98002 2016-06-30 13:03:36Z gcosmo $
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -175,6 +175,15 @@ public:
|
||||
// Returns the maximum number of Cerenkov photons allowed to be
|
||||
// generated during a tracking step.
|
||||
|
||||
void SetStackPhotons(const G4bool );
|
||||
// Call by the user to set the flag for stacking the scint. photons
|
||||
|
||||
G4bool GetStackPhotons() const;
|
||||
// Return the boolean for whether or not the scint. photons are stacked
|
||||
|
||||
G4int GetNumPhotons() const;
|
||||
// Returns the current number of scint. photons (after PostStepDoIt)
|
||||
|
||||
G4PhysicsTable* GetPhysicsTable() const;
|
||||
// Returns the address of the physics table.
|
||||
|
||||
@@ -210,6 +219,10 @@ private:
|
||||
G4bool fTrackSecondariesFirst;
|
||||
G4double fMaxBetaChange;
|
||||
G4int fMaxPhotons;
|
||||
|
||||
G4bool fStackingFlag;
|
||||
|
||||
G4int fNumPhotons;
|
||||
};
|
||||
|
||||
////////////////////
|
||||
@@ -234,6 +247,24 @@ G4int G4Cerenkov::GetMaxNumPhotonsPerStep() const
|
||||
return fMaxPhotons;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Cerenkov::SetStackPhotons(const G4bool stackingFlag)
|
||||
{
|
||||
fStackingFlag = stackingFlag;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4Cerenkov::GetStackPhotons() const
|
||||
{
|
||||
return fStackingFlag;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4Cerenkov::GetNumPhotons() const
|
||||
{
|
||||
return fNumPhotons;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Cerenkov::DumpPhysicsTable() const
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Scintillation.hh 97385 2016-06-02 09:59:53Z gcosmo $
|
||||
// $Id: G4Scintillation.hh 98002 2016-06-30 13:03:36Z gcosmo $
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -216,6 +216,15 @@ public:
|
||||
// Return the boolean for whether or not the
|
||||
// G4ScintillationTrackInformation is set to the scint. photon track
|
||||
|
||||
void SetStackPhotons(const G4bool );
|
||||
// Call by the user to set the flag for stacking the scint. photons
|
||||
|
||||
G4bool GetStackPhotons() const;
|
||||
// Return the boolean for whether or not the scint. photons are stacked
|
||||
|
||||
G4int GetNumPhotons() const;
|
||||
// Returns the current number of scint. photons (after PostStepDoIt)
|
||||
|
||||
void DumpPhysicsTable() const;
|
||||
// Prints the fast and slow scintillation integral tables.
|
||||
|
||||
@@ -245,6 +254,10 @@ private:
|
||||
|
||||
G4bool fScintillationTrackInfo;
|
||||
|
||||
G4bool fStackingFlag;
|
||||
|
||||
G4int fNumPhotons;
|
||||
|
||||
#ifdef G4DEBUG_SCINTILLATION
|
||||
G4double ScintTrackEDep, ScintTrackYield;
|
||||
#endif
|
||||
@@ -368,6 +381,24 @@ G4bool G4Scintillation::GetScintillationTrackInfo() const
|
||||
return fScintillationTrackInfo;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Scintillation::SetStackPhotons(const G4bool stackingFlag)
|
||||
{
|
||||
fStackingFlag = stackingFlag;
|
||||
}
|
||||
|
||||
inline
|
||||
G4bool G4Scintillation::GetStackPhotons() const
|
||||
{
|
||||
return fStackingFlag;
|
||||
}
|
||||
|
||||
inline
|
||||
G4int G4Scintillation::GetNumPhotons() const
|
||||
{
|
||||
return fNumPhotons;
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Scintillation::DumpPhysicsTable() const
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Cerenkov.cc 97385 2016-06-02 09:59:53Z gcosmo $
|
||||
// $Id: G4Cerenkov.cc 98002 2016-06-30 13:03:36Z gcosmo $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Cerenkov Radiation Class Implementation
|
||||
@@ -97,7 +97,9 @@ G4Cerenkov::G4Cerenkov(const G4String& processName, G4ProcessType type)
|
||||
: G4VProcess(processName, type),
|
||||
fTrackSecondariesFirst(false),
|
||||
fMaxBetaChange(0.0),
|
||||
fMaxPhotons(0)
|
||||
fMaxPhotons(0),
|
||||
fStackingFlag(true),
|
||||
fNumPhotons(0)
|
||||
{
|
||||
SetProcessSubType(fCerenkov);
|
||||
|
||||
@@ -204,6 +206,8 @@ G4Cerenkov::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
// particle beta
|
||||
G4double beta = (pPreStepPoint->GetBeta() + pPostStepPoint->GetBeta())*0.5;
|
||||
|
||||
fNumPhotons = 0;
|
||||
|
||||
G4double MeanNumberOfPhotons =
|
||||
GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
|
||||
|
||||
@@ -221,9 +225,9 @@ G4Cerenkov::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
|
||||
MeanNumberOfPhotons = MeanNumberOfPhotons * step_length;
|
||||
|
||||
G4int NumPhotons = (G4int) G4Poisson(MeanNumberOfPhotons);
|
||||
fNumPhotons = (G4int) G4Poisson(MeanNumberOfPhotons);
|
||||
|
||||
if (NumPhotons <= 0) {
|
||||
if ( fNumPhotons <= 0 || !fStackingFlag ) {
|
||||
|
||||
// return unchanged particle and no secondaries
|
||||
|
||||
@@ -235,7 +239,7 @@ G4Cerenkov::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(NumPhotons);
|
||||
aParticleChange.SetNumberOfSecondaries(fNumPhotons);
|
||||
|
||||
if (fTrackSecondariesFirst) {
|
||||
if (aTrack.GetTrackStatus() == fAlive )
|
||||
@@ -263,7 +267,7 @@ G4Cerenkov::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
G4double MeanNumberOfPhotons2 =
|
||||
GetAverageNumberOfPhotons(charge,beta2,aMaterial,Rindex);
|
||||
|
||||
for (G4int i = 0; i < NumPhotons; i++) {
|
||||
for (G4int i = 0; i < fNumPhotons; i++) {
|
||||
|
||||
// Determine photon energy
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Scintillation.cc 95281 2016-02-03 11:43:18Z gcosmo $
|
||||
// $Id: G4Scintillation.cc 98002 2016-06-30 13:03:36Z gcosmo $
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
// Scintillation Light Class Implementation
|
||||
@@ -93,6 +93,7 @@
|
||||
//G4double G4Scintillation::fExcitationRatio = 1.0;
|
||||
//G4bool G4Scintillation::fScintillationByParticleType = false;
|
||||
//G4bool G4Scintillation::fScintillationTrackInfo = false;
|
||||
//G4bool G4Scintillation::fStackingFlag = true;
|
||||
//G4EmSaturation* G4Scintillation::fEmSaturation = NULL;
|
||||
|
||||
//////////////
|
||||
@@ -116,6 +117,8 @@ G4Scintillation::G4Scintillation(const G4String& processName,
|
||||
fExcitationRatio(1.0),
|
||||
fScintillationByParticleType(false),
|
||||
fScintillationTrackInfo(false),
|
||||
fStackingFlag(true),
|
||||
fNumPhotons(0),
|
||||
fEmSaturation(nullptr)
|
||||
{
|
||||
SetProcessSubType(fScintillation);
|
||||
@@ -264,19 +267,17 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
else
|
||||
MeanNumberOfPhotons = ScintillationYield*TotalEnergyDeposit;
|
||||
|
||||
G4int NumPhotons;
|
||||
|
||||
if (MeanNumberOfPhotons > 10.)
|
||||
{
|
||||
G4double sigma = ResolutionScale * std::sqrt(MeanNumberOfPhotons);
|
||||
NumPhotons = G4int(G4RandGauss::shoot(MeanNumberOfPhotons,sigma)+0.5);
|
||||
fNumPhotons=G4int(G4RandGauss::shoot(MeanNumberOfPhotons,sigma)+0.5);
|
||||
}
|
||||
else
|
||||
{
|
||||
NumPhotons = G4int(G4Poisson(MeanNumberOfPhotons));
|
||||
fNumPhotons = G4int(G4Poisson(MeanNumberOfPhotons));
|
||||
}
|
||||
|
||||
if (NumPhotons <= 0)
|
||||
if ( fNumPhotons <= 0 || !fStackingFlag )
|
||||
{
|
||||
// return unchanged particle and no secondaries
|
||||
|
||||
@@ -287,7 +288,7 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
aParticleChange.SetNumberOfSecondaries(NumPhotons);
|
||||
aParticleChange.SetNumberOfSecondaries(fNumPhotons);
|
||||
|
||||
if (fTrackSecondariesFirst) {
|
||||
if (aTrack.GetTrackStatus() == fAlive )
|
||||
@@ -301,7 +302,7 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
// Retrieve the Scintillation Integral for this material
|
||||
// new G4PhysicsOrderedFreeVector allocated to hold CII's
|
||||
|
||||
G4int Num = NumPhotons;
|
||||
G4int Num = fNumPhotons;
|
||||
|
||||
for (G4int scnt = 1; scnt <= nscnt; scnt++) {
|
||||
|
||||
@@ -341,10 +342,10 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
G4double yieldRatio = aMaterialPropertiesTable->
|
||||
GetConstProperty("YIELDRATIO");
|
||||
if ( fExcitationRatio == 1.0 || fExcitationRatio == 0.0) {
|
||||
Num = G4int (std::min(yieldRatio,1.0) * NumPhotons);
|
||||
Num = G4int (std::min(yieldRatio,1.0) * fNumPhotons);
|
||||
}
|
||||
else {
|
||||
Num = G4int (std::min(fExcitationRatio,1.0) * NumPhotons);
|
||||
Num = G4int (std::min(fExcitationRatio,1.0) * fNumPhotons);
|
||||
}
|
||||
ScintillationTime = aMaterialPropertiesTable->
|
||||
GetConstProperty("FASTTIMECONSTANT");
|
||||
@@ -359,7 +360,7 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
|
||||
}
|
||||
}
|
||||
else {
|
||||
Num = NumPhotons - Num;
|
||||
Num = fNumPhotons - Num;
|
||||
ScintillationTime = aMaterialPropertiesTable->
|
||||
GetConstProperty("SLOWTIMECONSTANT");
|
||||
if (fFiniteRiseTime) {
|
||||
|
||||
Reference in New Issue
Block a user