ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4PhysicsOrderedFreeVector.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4PhysicsOrderedFreeVector.hh
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 //
29 // PhysicsOrderedFreeVector Class Definition
31 //
32 // File: G4PhysicsOrderedFreeVector.hh
33 // Created: 1996-08-13
34 // Author: Juliet Armstrong
35 // Updated: 1997-03-25 by Peter Gumplinger
36 // > cosmetics (only)
37 // 2000-11-11 by H.Kurashige
38 // > use STL vector for dataVector and binVector
39 // mail: gum@triumf.ca
40 //
41 // Class description:
42 //
43 // A physics ordered free vector inherits from G4PhysicsVector which
44 // has values of energy-loss, cross-section, and other physics values
45 // of a particle in matter in a given range of the energy, momentum,
46 // etc.). In addition, the ordered free vector provides a method for
47 // the user to insert energy/value pairs in sequence. Methods to
48 // Retrieve the Max and Min energies and values from the vector are
49 // also provided.
50 
52 
53 #ifndef G4PhysicsOrderedFreeVector_h
54 #define G4PhysicsOrderedFreeVector_h 1
55 
57 // Includes
59 
60 #include "G4PhysicsVector.hh"
61 
63 // Class Definition
65 
67 {
68 
69  public: // with description
70 
72  // Constructors and Destructor
74 
76  // the vector will be filled from exteran file using Retrieve
77  // or InsertValues methods
78 
80  G4double* Values,
81  size_t VectorLength);
82  // the vector is filled in this constructor
83  // 'Energies' and 'Values' need to have the same vector length
84  // 'Energies' assumed to be ordered
85 
87 
89  // Methods
91 
93 
94  G4double GetEnergy(G4double aValue);
95 
96  inline G4double GetMaxValue();
97 
98  inline G4double GetMinValue();
99 
100  inline G4double GetMaxLowEdgeEnergy();
101 
102  inline G4double GetMinLowEdgeEnergy();
103 
104  private:
105 
106  size_t FindValueBinLocation(G4double aValue);
107 
108  G4double LinearInterpolationOfEnergy(G4double aValue, size_t theLocBin);
109 };
110 
111 inline
113 {
114  return dataVector.back();
115 }
116 
117 inline
119 {
120  return dataVector.front();
121 }
122 
123 inline
125 {
126  return binVector.back();
127 }
128 
129 inline
131 {
132  return binVector.front();
133 }
134 
135 #endif /* G4PhysicsOrderedFreeVector_h */
136 
137 
138 
139 
140 
141