Geant4 11.1.1
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 36 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.

49 {
50 delete [] theData;
51 }

Member Function Documentation

◆ Dump()

void G4ParticleHPList::Dump ( )

Definition at line 92 of file G4ParticleHPList.cc.

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

◆ GetLabel()

◆ GetListLength()

G4int G4ParticleHPList::GetListLength ( )
inline

Definition at line 60 of file G4ParticleHPList.hh.

60{return nEntries;}

Referenced by GetValue().

◆ GetValue()

G4double G4ParticleHPList::GetValue ( G4int  i)

Definition at line 77 of file G4ParticleHPList.cc.

78 {
79// G4cout << "TestList "<<i<<" "<<nEntries<<G4endl;
80 if(nEntries<0)
81 {
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 65 of file G4ParticleHPList.cc.

66 {
67 G4int total, i;
68 aDataFile >> total;
69 G4double y;
70 for (i=0;i<total;i++)
71 {
72 aDataFile >>y;
73 SetValue(i,y*unit);
74 }
75 }
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 54 of file G4ParticleHPList.cc.

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

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 53 of file G4ParticleHPList.hh.

54 {
55 Check(i);
56 theData[i]=y;
57 }

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


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