BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
BDSPhysicsVectorLinear.hh
1/*
2Beam Delivery Simulation (BDSIM) Copyright (C) BDSIM Collaboration, 2001 - 2026.
3
4This file is part of BDSIM.
5
6BDSIM is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published
8by the Free Software Foundation version 3 of the License.
9
10BDSIM is distributed in the hope that it will be useful, but
11WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with BDSIM. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef BDSPHYSICSVECTORLINEAR_H
19#define BDSPHYSICSVECTORLINEAR_H
20
21#include "G4Types.hh"
22
23#include <vector>
24
37{
38public:
39 BDSPhysicsVectorLinear() = delete;
41 BDSPhysicsVectorLinear(const std::vector<G4double>& kineticEnergyIn,
42 const std::vector<G4double>& values);
43 ~BDSPhysicsVectorLinear() = default;
44
46 G4double Value(G4double eK) const;
47
48private:
49 std::vector<G4double> kineticEnergy;
50 std::vector<G4double> values;
51 G4double eKMin;
52 G4double eKMax;
53 G4double eKMinValue;
54 G4double eKMaxValue;
55};
56
57#endif
A vector of some values vs Ek that are linearly interpolated.
G4double Value(G4double eK) const
Get the linearly interpolated value for a given kinetic energy.