Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VRangeToEnergyConverter.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4VRangeToEnergyConverter
27//
28// Class description:
29//
30// Base class for Range to Energy Converters.
31// Cut in energy corresponding to given cut value in range
32// is calculated for a material by using Convert() method.
33
34// Author: H.Kurashige, 05 October 2002 - First implementation
35// --------------------------------------------------------------------
36#ifndef G4VRangeToEnergyConverter_hh
37#define G4VRangeToEnergyConverter_hh 1
38
39#include <cmath>
40#include <vector>
41
42#include "globals.hh"
43#include "G4ios.hh"
45#include "G4PhysicsTable.hh"
46#include "G4Element.hh"
47#include "G4Material.hh"
48
50
52{
53 public:
54
56 // Constructor
57
59 // Copy constructor
60
62 // Assignment operator
63
65 // Destructor
66
69 // Equality operators
70
71 virtual G4double Convert(G4double rangeCut, const G4Material* material);
72 // Calculate energy cut from given range cut for the material
73
74 static void SetEnergyRange(G4double lowedge, G4double highedge);
75 // Set energy range for all particle type
76
79 // Get energy range for all particle type
80
82 static void SetMaxEnergyCut(G4double value);
83 // Get/set max cut energy for all particle type
84
85 inline const G4ParticleDefinition* GetParticleType() const;
86 // Return pointer to the particle type which this converter takes care of
87
89 // theLossTable is a collection of loss vectors for all elements.
90 // Each loss vector has energy loss values (cross-section values
91 // for neutral particles) which are calculated by
92 // ComputeLoss(G4double AtomicNumber, G4double KineticEnergy).
93 // ComputeLoss method is pure virtual and should be provided
94 // for each particle type
95
96 virtual void Reset();
97 // Reset Loss Table and Range Vectors
98
99 inline void SetVerboseLevel(G4int value);
100 inline G4int GetVerboseLevel() const;
101 // control flag for output message
102 // 0: Silent
103 // 1: Warning message
104 // 2: More
105
106 protected:
107
108 virtual void BuildLossTable();
109
110 virtual G4double ComputeLoss(G4double AtomicNumber,
111 G4double KineticEnergy) = 0;
112
113 // ------------- Range Table --------------------------------------
114
118
119 virtual void BuildRangeVector(const G4Material* aMaterial,
120 G4RangeVector* rangeVector);
121
123 G4double theCutInLength,
124 std::size_t materialIndex ) const;
125 protected:
126
130
134
135 const G4int TotBin = 300;
136
137 std::vector< G4RangeVector* > fRangeVectorStore;
138
139 private:
140
141 G4int verboseLevel = 1;
142};
143
144// ------------------
145// Inline methods
146// ------------------
147
148inline
150{
151 verboseLevel = value;
152}
153
154inline
156{
157 return verboseLevel;
158}
159
160inline
162{
163 return theParticle;
164}
165
166#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
std::vector< G4RangeVector * > fRangeVectorStore
virtual void BuildRangeVector(const G4Material *aMaterial, G4RangeVector *rangeVector)
G4bool operator!=(const G4VRangeToEnergyConverter &r) const
G4bool operator==(const G4VRangeToEnergyConverter &r) const
virtual G4double Convert(G4double rangeCut, const G4Material *material)
virtual G4double ComputeLoss(G4double AtomicNumber, G4double KineticEnergy)=0
G4double ConvertCutToKineticEnergy(G4RangeVector *theRangeVector, G4double theCutInLength, std::size_t materialIndex) const
const G4ParticleDefinition * GetParticleType() const
const G4PhysicsTable * GetLossTable() const
static void SetMaxEnergyCut(G4double value)
static void SetEnergyRange(G4double lowedge, G4double highedge)
const G4ParticleDefinition * theParticle
G4VRangeToEnergyConverter & operator=(const G4VRangeToEnergyConverter &r)