Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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$
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:
112 
117 
119  const G4int TotBin;
120 
121  protected:// with description
122  virtual void BuildLossTable();
123 
124  virtual G4double ComputeLoss(G4double AtomicNumber,
125  G4double KineticEnergy
126  ) const = 0;
127 
128  //-------------- Range Table ------------------------------------------
129  protected:
131 
132  virtual void BuildRangeVector(const G4Material* aMaterial,
133  G4RangeVector* rangeVector);
134 
135  std::vector< G4RangeVector* > fRangeVectorStore;
136 
137  protected:
139  G4RangeVector* theRangeVector,
140  G4double theCutInLength,
141  size_t materialIndex
142  ) const;
143 
144  public: // with description
145  void SetVerboseLevel(G4int value);
146  G4int GetVerboseLevel() const;
147  // controle flag for output message
148  // 0: Silent
149  // 1: Warning message
150  // 2: More
151 
152  private:
153  G4int verboseLevel;
154 
155 };
156 
157 inline
159 {
160  verboseLevel = value;
161 }
162 
163 inline
165 {
166  return verboseLevel;
167 }
168 
169 
170 inline
172 {
173  return theParticle;
174 }
175 #endif
176 
177 
178 
179 
180 
181 
182 
183