Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleHPList Class Reference

#include <G4ParticleHPList.hh>

Public Member Functions

 G4ParticleHPList ()
 
 ~G4ParticleHPList ()
 
void SetValue (G4int i, G4double y)
 
G4double GetValue (G4int i)
 
G4int GetListLength ()
 
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 ()
 

Detailed Description

Definition at line 37 of file G4ParticleHPList.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPList()

G4ParticleHPList::G4ParticleHPList ( )
inline

Definition at line 40 of file G4ParticleHPList.hh.

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

◆ ~G4ParticleHPList()

G4ParticleHPList::~G4ParticleHPList ( )
inline

Definition at line 48 of file G4ParticleHPList.hh.

48{ delete[] theData; }

Member Function Documentation

◆ Dump()

void G4ParticleHPList::Dump ( )

Definition at line 91 of file G4ParticleHPList.cc.

92{
93 // store orginal precision
94 std::ios::fmtflags oldform = G4cout.flags();
95 G4cout << std::setprecision(7) << std::setw(9) << theLabel << " " << theData[0] << " "
96 << theData[1] << G4endl;
97 // restore orginal precision
98 G4cout.flags(oldform);
99}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

◆ GetLabel()

◆ GetListLength()

G4int G4ParticleHPList::GetListLength ( )
inline

Definition at line 57 of file G4ParticleHPList.hh.

57{ return nEntries; }

Referenced by GetValue().

◆ GetValue()

G4double G4ParticleHPList::GetValue ( G4int i)

Definition at line 78 of file G4ParticleHPList.cc.

79{
80 // G4cout << "TestList "<<i<<" "<<nEntries<<G4endl;
81 if (nEntries < 0) {
82 // G4cout <<nPoints<<" "<<nEntries<<" "<<theData<<G4endl;
83 // for(G4int ii=0; ii<2; ii++) G4cout << theData[ii]<<" ";
84 // G4cout << G4endl;
85 }
86 if (i < 0) i = 0;
87 if (i >= GetListLength()) i = GetListLength() - 1;
88 return theData[i];
89}

Referenced by G4ParticleHPContAngularPar::BuildByInterpolation(), G4ParticleHPContAngularPar::G4ParticleHPContAngularPar(), G4ParticleHPParticleYield::GetDecayConstant(), and G4ParticleHPContAngularPar::Sample().

◆ 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}

Referenced by G4ParticleHPContAngularPar::Init(), and G4ParticleHPParticleYield::InitDelayed().

◆ SetLabel()

void G4ParticleHPList::SetLabel ( G4double aLabel)
inline

◆ SetValue()

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

Definition at line 50 of file G4ParticleHPList.hh.

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

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


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