Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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// G4PhysicsOrderedFreeVector
27//
28// Class description:
29//
30// A physics ordered free vector inherits from G4PhysicsVector which
31// has values of energy-loss, cross-section, and other physics values
32// of a particle in matter in a given range of energy, momentum, etc.).
33// In addition, the ordered free vector provides a method for
34// the user to insert energy/value pairs in sequence. Methods to
35// retrieve the Max and Min energies and values from the vector are
36// also provided.
37
38// Author: Juliet Armstrong (TRIUMF), 13 August 1996
39// Revisions:
40// - 11.11.2000, H.Kurashige: use STL vector for dataVector and binVector
41// --------------------------------------------------------------------
42#ifndef G4PhysicsOrderedFreeVector_hh
43#define G4PhysicsOrderedFreeVector_hh 1
44
45#include "G4PhysicsVector.hh"
46
48{
49 public:
51 // The vector will be filled from extern file using Retrieve()
52 // or InsertValues() methods
53
54 G4PhysicsOrderedFreeVector(const std::vector<G4double>& Energies,
55 const std::vector<G4double>& Values);
57 std::size_t VectorLength);
58 // The vector is filled in this constructor.
59 // 'Energies' and 'Values' need to have the same vector length
60 // 'Energies' assumed to be ordered
61
63
64 void InsertValues(G4double energy, G4double value);
65
67
68 inline G4double GetMaxValue();
69
70 inline G4double GetMinValue();
71
73
75
76 private:
77 std::size_t FindValueBinLocation(G4double aValue);
78
79 G4double LinearInterpolationOfEnergy(G4double aValue, std::size_t locBin);
80};
81
82// -----------------------------
83// Inline methods implementation
84// -----------------------------
85
87{
88 return dataVector.back();
89}
90
92{
93 return dataVector.front();
94}
95
97{
98 return binVector.back();
99}
100
102{
103 return binVector.front();
104}
105
106#endif
double G4double
Definition: G4Types.hh:83
void InsertValues(G4double energy, G4double value)
G4double GetEnergy(G4double aValue)
G4PVDataVector binVector
G4PVDataVector dataVector