Geant4  10.03.p01
 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)
 
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 ( )
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:76
G4ParticleHPList::~G4ParticleHPList ( )
inline

Definition at line 48 of file G4ParticleHPList.hh.

49  {
50  delete [] theData;
51  }

Member Function Documentation

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 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

G4double G4ParticleHPList::GetLabel ( )
inline

Definition at line 70 of file G4ParticleHPList.hh.

70 { return theLabel; }

Here is the caller graph for this function:

G4int G4ParticleHPList::GetListLength ( )
inline

Definition at line 60 of file G4ParticleHPList.hh.

60 {return nEntries;}

Here is the caller graph for this function:

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  }

Here is the call graph for this function:

Here is the caller graph for this function:

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  }
int G4int
Definition: G4Types.hh:78
void SetValue(G4int i, G4double y)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

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:78
void SetValue(G4int i, G4double y)
G4double total(Particle const *const p1, Particle const *const p2)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void G4ParticleHPList::SetLabel ( G4double  aLabel)
inline

Definition at line 68 of file G4ParticleHPList.hh.

68 { theLabel = aLabel; }

Here is the caller graph for this function:

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  }

Here is the caller graph for this function:


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