Files
geant4/source/processes/electromagnetic/xrays/include/G4Scintillation.hh
T
2016-06-09 10:49:58 +02:00

284 lines
8.9 KiB
C++

//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4Scintillation.hh,v 1.11 2002/11/25 18:48:51 gum Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
//
//
////////////////////////////////////////////////////////////////////////
// Scintillation Light Class Definition
////////////////////////////////////////////////////////////////////////
//
// File: G4Scintillation.hh
// Description: Discrete Process - Generation of Scintillation Photons
// Version: 1.0
// Created: 1998-11-07
// Author: Peter Gumplinger
// Updated: 2002-11-21 change to user G4Poisson for small MeanNumPotons
// 2002-11-07 allow for fast and slow scintillation
// 2002-11-05 make use of constant material properties
// 2002-05-16 changed to inherit from VRestDiscreteProcess
// 2002-05-09 changed IsApplicable method
// 1999-10-29 add method and class descriptors
//
// mail: gum@triumf.ca
//
////////////////////////////////////////////////////////////////////////
#ifndef G4Scintillation_h
#define G4Scintillation_h 1
/////////////
// Includes
/////////////
#include "globals.hh"
#include "templates.hh"
#include "Randomize.hh"
#include "G4Poisson.hh"
#include "G4ThreeVector.hh"
#include "G4ParticleMomentum.hh"
#include "G4Step.hh"
#include "G4VRestDiscreteProcess.hh"
#include "G4OpticalPhoton.hh"
#include "G4DynamicParticle.hh"
#include "G4Material.hh"
#include "G4PhysicsTable.hh"
#include "G4MaterialPropertiesTable.hh"
#include "G4PhysicsOrderedFreeVector.hh"
// Class Description:
// RestDiscrete Process - Generation of Scintillation Photons.
// Class inherits publicly from G4VRestDiscreteProcess.
// Class Description - End:
/////////////////////
// Class Definition
/////////////////////
class G4Scintillation : public G4VRestDiscreteProcess
{
private:
//////////////
// Operators
//////////////
// G4Scintillation& operator=(const G4Scintillation &right);
public: // Without description
////////////////////////////////
// Constructors and Destructor
////////////////////////////////
G4Scintillation(const G4String& processName = "Scintillation");
// G4Scintillation(const G4Scintillation &right);
~G4Scintillation();
////////////
// Methods
////////////
public: // With description
// G4Scintillation Process has both PostStepDoIt (for energy
// deposition of particles in flight) and AtRestDoIt (for energy
// given to the medium by particles at rest)
G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
// Returns true -> 'is applicable', for any particle type except
// for an 'opticalphoton'
G4double GetMeanFreePath(const G4Track& aTrack,
G4double ,
G4ForceCondition* );
// Returns infinity; i. e. the process does not limit the step,
// but sets the 'StronglyForced' condition for the DoIt to be
// invoked at every step.
G4double GetMeanLifeTime(const G4Track& aTrack,
G4ForceCondition* );
// Returns infinity; i. e. the process does not limit the time,
// but sets the 'StronglyForced' condition for the DoIt to be
// invoked at every step.
G4VParticleChange* PostStepDoIt(const G4Track& aTrack,
const G4Step& aStep);
G4VParticleChange* AtRestDoIt (const G4Track& aTrack,
const G4Step& aStep);
// These are the methods implementing the scintillation process.
void SetTrackSecondariesFirst(const G4bool state);
// If set, the primary particle tracking is interrupted and any
// produced scintillation photons are tracked next. When all
// have been tracked, the tracking of the primary resumes.
G4bool GetTrackSecondariesFirst() const;
// Returns the boolean flag for tracking secondaries first.
void SetScintillationYieldFactor(const G4double yieldfactor);
// Called to set the scintillation photon yield factor, needed when
// the yield is different for different types of particles. This
// scales the yield obtained from the G4MaterialPropertiesTable.
G4double GetScintillationYieldFactor() const;
// Returns the photon yield factor.
void SetScintillationExcitationRatio(const G4double excitationratio);
// Called to set the scintillation exciation ratio, needed when
// the scintillation level excitation is different for different
// types of particles. This overwrites the YieldRatio obtained
// from the G4MaterialPropertiesTable.
G4double GetScintillationExcitationRatio() const;
// Returns the scintillation level excitation ratio.
G4PhysicsTable* GetFastIntegralTable() const;
// Returns the address of the fast scintillation integral table.
G4PhysicsTable* GetSlowIntegralTable() const;
// Returns the address of the slow scintillation integral table.
void DumpPhysicsTable() const;
// Prints the fast and slow scintillation integral tables.
private:
void BuildThePhysicsTable();
// It builds either the fast or slow scintillation integral table;
// or both.
///////////////////////
// Class Data Members
///////////////////////
protected:
G4PhysicsTable* theSlowIntegralTable;
G4PhysicsTable* theFastIntegralTable;
private:
G4bool fTrackSecondariesFirst;
G4double YieldFactor;
G4double ExcitationRatio;
};
////////////////////
// Inline methods
////////////////////
inline
G4bool G4Scintillation::IsApplicable(const G4ParticleDefinition& aParticleType)
{
if (aParticleType.GetParticleName() == "opticalphoton"){
return false;
} else {
return true;
}
}
inline
void G4Scintillation::SetTrackSecondariesFirst(const G4bool state)
{
fTrackSecondariesFirst = state;
}
inline
G4bool G4Scintillation::GetTrackSecondariesFirst() const
{
return fTrackSecondariesFirst;
}
inline
void G4Scintillation::SetScintillationYieldFactor(const G4double yieldfactor)
{
YieldFactor = yieldfactor;
}
inline
G4double G4Scintillation::GetScintillationYieldFactor() const
{
return YieldFactor;
}
inline
void G4Scintillation::SetScintillationExcitationRatio(const G4double excitationratio)
{
ExcitationRatio = excitationratio;
}
inline
G4double G4Scintillation::GetScintillationExcitationRatio() const
{
return ExcitationRatio;
}
inline
G4PhysicsTable* G4Scintillation::GetSlowIntegralTable() const
{
return theSlowIntegralTable;
}
inline
G4PhysicsTable* G4Scintillation::GetFastIntegralTable() const
{
return theFastIntegralTable;
}
inline
void G4Scintillation::DumpPhysicsTable() const
{
if (theFastIntegralTable) {
G4int PhysicsTableSize = theFastIntegralTable->entries();
G4PhysicsOrderedFreeVector *v;
for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
{
v = (G4PhysicsOrderedFreeVector*)(*theFastIntegralTable)[i];
v->DumpValues();
}
}
if (theSlowIntegralTable) {
G4int PhysicsTableSize = theSlowIntegralTable->entries();
G4PhysicsOrderedFreeVector *v;
for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
{
v = (G4PhysicsOrderedFreeVector*)(*theSlowIntegralTable)[i];
v->DumpValues();
}
}
}
#endif /* G4Scintillation_h */