Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4PhysicsOrderedFreeVector.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: G4PhysicsOrderedFreeVector.hh 98864 2016-08-15 11:53:26Z gcosmo $
28 //
30 // PhysicsOrderedFreeVector Class Definition
32 //
33 // File: G4PhysicsOrderedFreeVector.hh
34 // Created: 1996-08-13
35 // Author: Juliet Armstrong
36 // Updated: 1997-03-25 by Peter Gumplinger
37 // > cosmetics (only)
38 // 2000-11-11 by H.Kurashige
39 // > use STL vector for dataVector and binVector
40 // mail: gum@triumf.ca
41 //
42 // Class description:
43 //
44 // A physics ordered free vector inherits from G4PhysicsVector which
45 // has values of energy-loss, cross-section, and other physics values
46 // of a particle in matter in a given range of the energy, momentum,
47 // etc.). In addition, the ordered free vector provides a method for
48 // the user to insert energy/value pairs in sequence. Methods to
49 // Retrieve the Max and Min energies and values from the vector are
50 // also provided.
51 
53 
54 #ifndef G4PhysicsOrderedFreeVector_h
55 #define G4PhysicsOrderedFreeVector_h 1
56 
58 // Includes
60 
61 #include "G4PhysicsVector.hh"
62 
64 // Class Definition
66 
68 {
69 
70  public: // with description
71 
73  // Constructors and Destructor
75 
77  // the vector will be filled from exteran file using Retrieve
78  // or InsertValues methods
79 
81  G4double* Values,
82  size_t VectorLength);
83  // the vector is filled in this constructor
84  // 'Energies' and 'Values' need to have the same vector length
85  // 'Energies' assumed to be ordered
86 
88 
90  // Methods
92 
94 
95  G4double GetEnergy(G4double aValue);
96 
97  inline G4double GetMaxValue();
98 
99  inline G4double GetMinValue();
100 
101  inline G4double GetMaxLowEdgeEnergy();
102 
103  inline G4double GetMinLowEdgeEnergy();
104 
105  private:
106 
107  size_t FindValueBinLocation(G4double aValue);
108 
109  G4double LinearInterpolationOfEnergy(G4double aValue, size_t theLocBin);
110 };
111 
112 inline
114 {
115  return dataVector.back();
116 }
117 
118 inline
120 {
121  return dataVector.front();
122 }
123 
124 inline
126 {
127  return binVector.back();
128 }
129 
130 inline
132 {
133  return binVector.front();
134 }
135 
136 #endif /* G4PhysicsOrderedFreeVector_h */
137 
138 
139 
140 
141 
142 
G4PVDataVector dataVector
void InsertValues(G4double energy, G4double value)
G4PVDataVector binVector
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4double GetEnergy(G4double aValue)
G4double energy(const ThreeVector &p, const G4double m)
double G4double
Definition: G4Types.hh:76