Geant4_10
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 //
27 // $Id: G4VRangeToEnergyConverter.hh 70745 2013-06-05 10:54:00Z gcosmo $
28 //
29 //
30 // ------------------------------------------------------------
31 // GEANT 4 class header file
32 //
33 //
34 // Class Description
35 // This class is base class for Range to Energy Converters.
36 // Cut in energy corresponding to given cut value in range
37 // is calculated for a material by using Convert method
38 //
39 // ------------------------------------------------------------
40 // First Implementation 5 Oct. 2002 H.Kurahige
41 // ------------------------------------------------------------
42 
43 #ifndef G4VRangeToEnergyConverter_h
44 #define G4VRangeToEnergyConverter_h 1
45 
46 #include "globals.hh"
47 #include <cmath>
48 #include "G4ios.hh"
49 #include <vector>
50 
51 #include "G4ParticleDefinition.hh"
52 
53 #include "G4PhysicsTable.hh"
54 #include "G4Element.hh"
55 #include "G4Material.hh"
56 class G4PhysicsLogVector;
57 
59 {
60  public: // with description
61  // constructor
63 
64  // copy constructor
66 
68 
69  public:
70  // destructor
72 
73  // equal opperators
74  G4int operator==(const G4VRangeToEnergyConverter &right) const;
75  G4int operator!=(const G4VRangeToEnergyConverter &right) const;
76 
77  public: // with description
78  // calculate energy cut from given range cut for the material
79  virtual G4double Convert(G4double rangeCut, const G4Material* material);
80 
81  // set energy range for all particle type
82  static void SetEnergyRange(G4double lowedge, G4double highedge);
83 
84  // get energy range for all particle type
85  static G4double GetLowEdgeEnergy();
86  static G4double GetHighEdgeEnergy();
87 
88  // get/set max cut energy for all particle type
89  static G4double GetMaxEnergyCut();
90  static void SetMaxEnergyCut(G4double value);
91 
92  // return pointer to the particle type which this converter takes care
94 
95  // return the Loss Table
96  const G4PhysicsTable* GetLossTable() const;
97  //-------------- Loss Table ------------------------------------------
98  // theLossTable is a collection of loss vectors for all elements.
99  // Each loss vector has energy loss values (cross section values
100  // for neutral particles) which are calculated by
101  // ComputeLoss(G4double AtomicNumber,G4double KineticEnergy).
102  // ComputeLoss method is pure virtual and should be provided for each
103  // particle type
104 
105  // reset Loss Table and Range Vectors
106  virtual void Reset();
107 
108  protected:
109 
113 
118 
120  const G4int TotBin;
121 
122  protected:// with description
123  virtual void BuildLossTable();
124 
125  virtual G4double ComputeLoss(G4double AtomicNumber,
126  G4double KineticEnergy
127  ) =0;
128 
129  //-------------- Range Table ------------------------------------------
130  protected:
132 
133  virtual void BuildRangeVector(const G4Material* aMaterial,
134  G4RangeVector* rangeVector);
135 
136  std::vector< G4RangeVector* > fRangeVectorStore;
137 
138  protected:
140  G4RangeVector* theRangeVector,
141  G4double theCutInLength,
142  size_t materialIndex
143  ) const;
144 
145  public: // with description
146  void SetVerboseLevel(G4int value);
147  G4int GetVerboseLevel() const;
148  // controle flag for output message
149  // 0: Silent
150  // 1: Warning message
151  // 2: More
152 
153  private:
154  G4int verboseLevel;
155 
156 };
157 
158 inline
160 {
161  verboseLevel = value;
162 }
163 
164 inline
166 {
167  return verboseLevel;
168 }
169 
170 
171 inline
173 {
174  return theParticle;
175 }
176 #endif
177 
178 
179 
180 
181 
182 
183 
184 
G4int operator!=(const G4VRangeToEnergyConverter &right) const
virtual void BuildRangeVector(const G4Material *aMaterial, G4RangeVector *rangeVector)
const G4PhysicsTable * GetLossTable() const
int G4int
Definition: G4Types.hh:78
const G4ParticleDefinition * GetParticleType() const
string material
Definition: eplot.py:19
virtual G4double ComputeLoss(G4double AtomicNumber, G4double KineticEnergy)=0
G4double ConvertCutToKineticEnergy(G4RangeVector *theRangeVector, G4double theCutInLength, size_t materialIndex) const
virtual G4double Convert(G4double rangeCut, const G4Material *material)
G4int operator==(const G4VRangeToEnergyConverter &right) const
static void SetMaxEnergyCut(G4double value)
G4VRangeToEnergyConverter & operator=(const G4VRangeToEnergyConverter &right)
static void SetEnergyRange(G4double lowedge, G4double highedge)
std::vector< G4RangeVector * > fRangeVectorStore
const XML_Char int const XML_Char * value
Definition: expat.h:331
double G4double
Definition: G4Types.hh:76
const G4ParticleDefinition * theParticle