Geant4 11.3.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleHPList Class Reference

#include <G4ParticleHPList.hh>

Public Member Functions

 G4ParticleHPList ()
 
 ~G4ParticleHPList ()
 
void SetValue (G4int i, G4double y)
 
G4double GetValue (G4int i) const
 
G4int GetListLength () const
 
void Dump ()
 
void Init (std::istream &aDataFile, G4int nPar, G4double unit=1.)
 
void Init (std::istream &aDataFile, G4double unit=1.)
 
void SetLabel (G4double aLabel)
 
G4double GetLabel () const
 

Detailed Description

Definition at line 37 of file G4ParticleHPList.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPList()

G4ParticleHPList::G4ParticleHPList ( )
inline

Definition at line 41 of file G4ParticleHPList.hh.

42 {
43 theData = new G4double[2];
44 nPoints = 2;
45 nEntries = 0;
46 theLabel = 0.0;
47 }
double G4double
Definition G4Types.hh:83

◆ ~G4ParticleHPList()

G4ParticleHPList::~G4ParticleHPList ( )
inline

Definition at line 49 of file G4ParticleHPList.hh.

49{ delete[] theData; }

Member Function Documentation

◆ Dump()

void G4ParticleHPList::Dump ( )

Definition at line 85 of file G4ParticleHPList.cc.

86{
87 // store orginal precision
88 std::ios::fmtflags oldform = G4cout.flags();
89 G4cout << std::setprecision(7) << std::setw(9) << theLabel << " " << theData[0] << " "
90 << theData[1] << G4endl;
91 // restore orginal precision
92 G4cout.flags(oldform);
93}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

◆ GetLabel()

G4double G4ParticleHPList::GetLabel ( ) const
inline

◆ GetListLength()

G4int G4ParticleHPList::GetListLength ( ) const
inline

Definition at line 58 of file G4ParticleHPList.hh.

58{ return nEntries; }

Referenced by GetValue().

◆ GetValue()

G4double G4ParticleHPList::GetValue ( G4int i) const

Definition at line 78 of file G4ParticleHPList.cc.

79{
80 if (i < 0) i = 0;
81 if (i >= GetListLength()) i = GetListLength() - 1;
82 return theData[i];
83}
G4int GetListLength() const

Referenced by G4ParticleHPContAngularPar::BuildByInterpolation(), and G4ParticleHPContAngularPar::G4ParticleHPContAngularPar().

◆ Init() [1/2]

void G4ParticleHPList::Init ( std::istream & aDataFile,
G4double unit = 1. )

Definition at line 67 of file G4ParticleHPList.cc.

68{
69 G4int total, i;
70 aDataFile >> total;
71 G4double y;
72 for (i = 0; i < total; i++) {
73 aDataFile >> y;
74 SetValue(i, y * unit);
75 }
76}
int G4int
Definition G4Types.hh:85
void SetValue(G4int i, G4double y)
G4double total(Particle const *const p1, Particle const *const p2)

◆ Init() [2/2]

void G4ParticleHPList::Init ( std::istream & aDataFile,
G4int nPar,
G4double unit = 1. )

Definition at line 57 of file G4ParticleHPList.cc.

58{
59 G4int i;
60 G4double y;
61 for (i = 0; i < nPar; i++) {
62 aDataFile >> y;
63 SetValue(i, y * unit);
64 }
65}

◆ SetLabel()

void G4ParticleHPList::SetLabel ( G4double aLabel)
inline

Definition at line 66 of file G4ParticleHPList.hh.

66{ theLabel = aLabel; }

◆ SetValue()

void G4ParticleHPList::SetValue ( G4int i,
G4double y )
inline

Definition at line 51 of file G4ParticleHPList.hh.

52 {
53 Check(i);
54 theData[i] = y;
55 }

Referenced by Init(), and Init().


The documentation for this class was generated from the following files: