Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4CrossSectionManager Class Reference

The manager class for accessing hadronic cross sections. More...

#include <TG4CrossSectionManager.h>

Inheritance diagram for TG4CrossSectionManager:

Public Member Functions

 TG4CrossSectionManager ()
 
virtual ~TG4CrossSectionManager ()
 
TObjArray * MakeHistograms ()
 
G4double GetCrossSection (TG4CrossSectionType type) const
 
void PrintCrossSections () const
 
void PrintCrossSection (TG4CrossSectionType type) const
 
void SetParticleName (const G4String &name)
 
void SetElementName (const G4String &name)
 
void SetNumberOfBinsE (G4int val)
 
void SetNumberOfBinsP (G4int val)
 
void SetMinKinEnergy (G4double val)
 
void SetMaxKinEnergy (G4double val)
 
void SetMinMomentum (G4double val)
 
void SetMaxMomentum (G4double val)
 
void SetLabel (const G4String &label)
 
void SetKinEnergy (G4double val)
 
void SetMomentum (G4double val)
 
void SetMakeHistograms (G4bool makeHistograms)
 
G4bool IsMakeHistograms () const
 
- Public Member Functions inherited from TG4Verbose
 TG4Verbose (const G4String &cmdName)
 
 TG4Verbose (const G4String &cmdName, G4int verboseLevel)
 
virtual ~TG4Verbose ()
 
virtual void VerboseLevel (G4int level)
 
virtual G4int VerboseLevel () const
 

Private Member Functions

 TG4CrossSectionManager (const TG4CrossSectionManager &right)
 Not implemented.
 
TG4CrossSectionManageroperator= (const TG4CrossSectionManager &right)
 Not implemented.
 
const G4ParticleDefinitionGetParticle () const
 
const G4Element * GetElement () const
 
G4double GetMomentum () const
 
void CreateHistograms ()
 
void FillHistograms ()
 

Private Attributes

TG4CrossSectionMessenger fMessenger
 messenger
 
TObjArray * fHistograms
 array of histograms
 
G4String fParticleName
 particle name
 
G4String fElementName
 element name
 
G4double fMinKinEnergy
 minimum kinetic energy (histogram range)
 
G4double fMaxKinEnergy
 maximum kinetic energy( histogram range)
 
G4double fMinMomentum
 minimum momentum (histogram range)
 
G4double fMaxMomentum
 maximum momentum (histogram range)
 
G4int fNofBinsE
 number of bins in kinetic energy
 
G4int fNofBinsP
 number of bins in momentum
 
G4String fLabel
 the histogram label
 
G4double fKinEnergy
 current kinetic energy
 
G4bool fIsInitialised
 info if histograms are created
 
G4bool fMakeHistograms
 option to make histograms (for ecternal use)
 

Static Private Attributes

static const G4String fgkDefaultParticleName = "proton"
 default particle name
 
static const G4String fgkDefaultElementName = "Al"
 default element name
 
static const G4double fgkDefaultMinKinEnergy = 0.1 * MeV
 default minimum kinetic energy
 
static const G4double fgkDefaultMaxKinEnergy = 1 * TeV
 default maximum kinetic energy
 
static const G4double fgkDefaultMinMomentum = 1 * MeV
 default minimum momentum
 
static const G4double fgkDefaultMaxMomentum = 100 * TeV
 default maximum momentum
 
static const G4int fgkDefaultNofBinsE = 700
 defualt number of bins in energy
 
static const G4int fgkDefaultNofBinsP = 800
 defualt number of bins in momentum
 
static const G4double fgkDefaultKinEnergy = 1 * MeV
 defualt kinetic energy
 

Detailed Description

The manager class for accessing hadronic cross sections.

The main methods:

The selection of the particle, the element and the histogram parameters (energy and moment range and number of bins) has to be done first via the set methods of the class.

In MakeHistograms(), the array with the following histograms for the selected parameters is filled and returned:

  • Elastic cross section (barn) as a functions of log10(p/GeV)
  • Elastic cross section (barn) as a functions of log10(E/MeV)
  • Inelastic cross section (barn) as a functions of log10(p/GeV)
  • Inelastic cross section (barn) as a functions of log10(E/MeV)
  • Capture cross section (barn) as a functions of log10(E/MeV)
  • Fission cross section (barn) as a functions of log10(E/MeV)
  • Charge exchange cross section (barn) as a functions of log10(E/MeV) (inactivated)

If verbose level is set >=1 then a table with cross section values per energy values is printed.

It is also possible to access the cross section value for a selected energy or a momentum via GetCrossSection() method. A selected cross section or all cross sections can be also printed via PrintCrossSection[s] methods.

Implemented according to the Geant4 example: extended/hadronic/Hadr00.

Author
I. Hrivnacova; IPN, Orsay

Definition at line 66 of file TG4CrossSectionManager.h.

Constructor & Destructor Documentation

◆ TG4CrossSectionManager() [1/2]

TG4CrossSectionManager::TG4CrossSectionManager ( )

Default constructor

Definition at line 44 of file TG4CrossSectionManager.cxx.

◆ ~TG4CrossSectionManager()

TG4CrossSectionManager::~TG4CrossSectionManager ( )
virtual

Destructor

Definition at line 65 of file TG4CrossSectionManager.cxx.

◆ TG4CrossSectionManager() [2/2]

TG4CrossSectionManager::TG4CrossSectionManager ( const TG4CrossSectionManager & right)
private

Not implemented.

Member Function Documentation

◆ MakeHistograms()

TObjArray * TG4CrossSectionManager::MakeHistograms ( )

This call first triggers creating and filling the array of histograms which is then returned. This method has to be called when the physics list is fully initialised, this is true for sure in the EndOfRunAction.

Definition at line 304 of file TG4CrossSectionManager.cxx.

Referenced by TG4RunAction::EndOfRunAction().

◆ GetCrossSection()

G4double TG4CrossSectionManager::GetCrossSection ( TG4CrossSectionType type) const

Return the value of the selected cross section type for the particle and element selected via set methods

Definition at line 317 of file TG4CrossSectionManager.cxx.

Referenced by PrintCrossSection(), and PrintCrossSections().

◆ PrintCrossSections()

void TG4CrossSectionManager::PrintCrossSections ( ) const

Print all cross sections for the particle and element selected via set methods

Definition at line 348 of file TG4CrossSectionManager.cxx.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ PrintCrossSection()

void TG4CrossSectionManager::PrintCrossSection ( TG4CrossSectionType type) const

Print the value of the selected cross section type for the particle and element selected via set methods

Definition at line 369 of file TG4CrossSectionManager.cxx.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetParticleName()

void TG4CrossSectionManager::SetParticleName ( const G4String & name)
inline

Set the particle name

Definition at line 145 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetElementName()

void TG4CrossSectionManager::SetElementName ( const G4String & name)
inline

Set the element name

Definition at line 151 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetNumberOfBinsE()

void TG4CrossSectionManager::SetNumberOfBinsE ( G4int val)
inline

Set the number of bins in kinetic energy

Definition at line 181 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetNumberOfBinsP()

void TG4CrossSectionManager::SetNumberOfBinsP ( G4int val)
inline

Set the number of bins in momentum

Definition at line 187 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetMinKinEnergy()

void TG4CrossSectionManager::SetMinKinEnergy ( G4double val)
inline

Set the minimum kinetic energy (histogram range)

Definition at line 157 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetMaxKinEnergy()

void TG4CrossSectionManager::SetMaxKinEnergy ( G4double val)
inline

Set the maximum kinetic energy( histogram range)

Definition at line 163 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetMinMomentum()

void TG4CrossSectionManager::SetMinMomentum ( G4double val)
inline

Set the minimum momentum (histogram range)

Definition at line 169 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetMaxMomentum()

void TG4CrossSectionManager::SetMaxMomentum ( G4double val)
inline

Set the maximum momentum (histogram range)

Definition at line 175 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetLabel()

void TG4CrossSectionManager::SetLabel ( const G4String & label)
inline

Set a label to the histogram. The label will be added at the beginning of the histogram title.

Definition at line 193 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetKinEnergy()

void TG4CrossSectionManager::SetKinEnergy ( G4double val)
inline

Set the current kinetic energy

Definition at line 200 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetMomentum()

void TG4CrossSectionManager::SetMomentum ( G4double val)

Recalculate the current kinetic energy for given momentum and selected particle

Definition at line 383 of file TG4CrossSectionManager.cxx.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ SetMakeHistograms()

void TG4CrossSectionManager::SetMakeHistograms ( G4bool makeHistograms)
inline

Set the option to make histograms (for external use)

Definition at line 206 of file TG4CrossSectionManager.h.

Referenced by TG4CrossSectionMessenger::SetNewValue().

◆ IsMakeHistograms()

G4bool TG4CrossSectionManager::IsMakeHistograms ( ) const
inline

Return the option to make histograms (for external use)

Definition at line 212 of file TG4CrossSectionManager.h.

Referenced by TG4RunAction::EndOfRunAction().

◆ operator=()

TG4CrossSectionManager & TG4CrossSectionManager::operator= ( const TG4CrossSectionManager & right)
private

Not implemented.

◆ GetParticle()

const G4ParticleDefinition * TG4CrossSectionManager::GetParticle ( ) const
private

Return the particle for selected particle name

Definition at line 78 of file TG4CrossSectionManager.cxx.

Referenced by FillHistograms(), GetCrossSection(), GetMomentum(), and SetMomentum().

◆ GetElement()

const G4Element * TG4CrossSectionManager::GetElement ( ) const
private

Return the element for selected element name

Definition at line 97 of file TG4CrossSectionManager.cxx.

Referenced by FillHistograms(), and GetCrossSection().

◆ GetMomentum()

G4double TG4CrossSectionManager::GetMomentum ( ) const
private

Return the momentum for selected particle and kinetic energy

Definition at line 117 of file TG4CrossSectionManager.cxx.

Referenced by PrintCrossSection(), and PrintCrossSections().

◆ CreateHistograms()

void TG4CrossSectionManager::CreateHistograms ( )
private

Create the cross sections histograms.

Definition at line 130 of file TG4CrossSectionManager.cxx.

Referenced by FillHistograms(), and MakeHistograms().

◆ FillHistograms()

void TG4CrossSectionManager::FillHistograms ( )
private

Fill the cross sections histograms. This method has to be called when the physics list is fully initialised, this is true for sure in the EndOfRunAction.

Definition at line 188 of file TG4CrossSectionManager.cxx.

Referenced by MakeHistograms().

Member Data Documentation

◆ fgkDefaultParticleName

const G4String TG4CrossSectionManager::fgkDefaultParticleName = "proton"
staticprivate

default particle name

Definition at line 114 of file TG4CrossSectionManager.h.

◆ fgkDefaultElementName

const G4String TG4CrossSectionManager::fgkDefaultElementName = "Al"
staticprivate

default element name

Definition at line 115 of file TG4CrossSectionManager.h.

◆ fgkDefaultMinKinEnergy

const G4double TG4CrossSectionManager::fgkDefaultMinKinEnergy = 0.1 * MeV
staticprivate

default minimum kinetic energy

Definition at line 117 of file TG4CrossSectionManager.h.

◆ fgkDefaultMaxKinEnergy

const G4double TG4CrossSectionManager::fgkDefaultMaxKinEnergy = 1 * TeV
staticprivate

default maximum kinetic energy

Definition at line 119 of file TG4CrossSectionManager.h.

◆ fgkDefaultMinMomentum

const G4double TG4CrossSectionManager::fgkDefaultMinMomentum = 1 * MeV
staticprivate

default minimum momentum

Definition at line 120 of file TG4CrossSectionManager.h.

◆ fgkDefaultMaxMomentum

const G4double TG4CrossSectionManager::fgkDefaultMaxMomentum = 100 * TeV
staticprivate

default maximum momentum

Definition at line 121 of file TG4CrossSectionManager.h.

◆ fgkDefaultNofBinsE

const G4int TG4CrossSectionManager::fgkDefaultNofBinsE = 700
staticprivate

defualt number of bins in energy

Definition at line 122 of file TG4CrossSectionManager.h.

◆ fgkDefaultNofBinsP

const G4int TG4CrossSectionManager::fgkDefaultNofBinsP = 800
staticprivate

defualt number of bins in momentum

Definition at line 123 of file TG4CrossSectionManager.h.

◆ fgkDefaultKinEnergy

const G4double TG4CrossSectionManager::fgkDefaultKinEnergy = 1 * MeV
staticprivate

defualt kinetic energy

Definition at line 124 of file TG4CrossSectionManager.h.

◆ fMessenger

TG4CrossSectionMessenger TG4CrossSectionManager::fMessenger
private

messenger

Definition at line 127 of file TG4CrossSectionManager.h.

◆ fHistograms

TObjArray* TG4CrossSectionManager::fHistograms
private

array of histograms

Definition at line 128 of file TG4CrossSectionManager.h.

Referenced by CreateHistograms(), FillHistograms(), MakeHistograms(), and ~TG4CrossSectionManager().

◆ fParticleName

G4String TG4CrossSectionManager::fParticleName
private

◆ fElementName

G4String TG4CrossSectionManager::fElementName
private

◆ fMinKinEnergy

G4double TG4CrossSectionManager::fMinKinEnergy
private

minimum kinetic energy (histogram range)

Definition at line 131 of file TG4CrossSectionManager.h.

Referenced by CreateHistograms(), FillHistograms(), and SetMinKinEnergy().

◆ fMaxKinEnergy

G4double TG4CrossSectionManager::fMaxKinEnergy
private

maximum kinetic energy( histogram range)

Definition at line 132 of file TG4CrossSectionManager.h.

Referenced by CreateHistograms(), FillHistograms(), and SetMaxKinEnergy().

◆ fMinMomentum

G4double TG4CrossSectionManager::fMinMomentum
private

minimum momentum (histogram range)

Definition at line 133 of file TG4CrossSectionManager.h.

Referenced by CreateHistograms(), FillHistograms(), and SetMinMomentum().

◆ fMaxMomentum

G4double TG4CrossSectionManager::fMaxMomentum
private

maximum momentum (histogram range)

Definition at line 134 of file TG4CrossSectionManager.h.

Referenced by CreateHistograms(), FillHistograms(), and SetMaxMomentum().

◆ fNofBinsE

G4int TG4CrossSectionManager::fNofBinsE
private

number of bins in kinetic energy

Definition at line 135 of file TG4CrossSectionManager.h.

Referenced by CreateHistograms(), FillHistograms(), and SetNumberOfBinsE().

◆ fNofBinsP

G4int TG4CrossSectionManager::fNofBinsP
private

number of bins in momentum

Definition at line 136 of file TG4CrossSectionManager.h.

Referenced by CreateHistograms(), FillHistograms(), and SetNumberOfBinsP().

◆ fLabel

G4String TG4CrossSectionManager::fLabel
private

the histogram label

Definition at line 137 of file TG4CrossSectionManager.h.

Referenced by CreateHistograms(), and SetLabel().

◆ fKinEnergy

G4double TG4CrossSectionManager::fKinEnergy
private

current kinetic energy

Definition at line 138 of file TG4CrossSectionManager.h.

Referenced by GetCrossSection(), GetMomentum(), PrintCrossSection(), PrintCrossSections(), SetKinEnergy(), and SetMomentum().

◆ fIsInitialised

G4bool TG4CrossSectionManager::fIsInitialised
private

info if histograms are created

Definition at line 139 of file TG4CrossSectionManager.h.

Referenced by CreateHistograms(), and FillHistograms().

◆ fMakeHistograms

G4bool TG4CrossSectionManager::fMakeHistograms
private

option to make histograms (for ecternal use)

Definition at line 140 of file TG4CrossSectionManager.h.

Referenced by IsMakeHistograms(), and SetMakeHistograms().


The documentation for this class was generated from the following files: