Geant4-11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
G4ParticleHPData Class Reference

#include <G4ParticleHPData.hh>

Public Member Functions

G4PhysicsVectorDoPhysicsVector (G4ParticleHPVector *theVector)
 
 G4ParticleHPData (G4ParticleDefinition *projectile)
 
G4PhysicsVectorMakePhysicsVector (G4Element *thE, G4ParticleHPCaptureData *theP)
 
G4PhysicsVectorMakePhysicsVector (G4Element *thE, G4ParticleHPElasticData *theP)
 
G4PhysicsVectorMakePhysicsVector (G4Element *thE, G4ParticleHPFissionData *theP)
 
G4PhysicsVectorMakePhysicsVector (G4Element *thE, G4ParticleHPInelasticData *theP)
 
 ~G4ParticleHPData ()
 

Static Public Member Functions

static G4ParticleHPDataInstance (G4ParticleDefinition *projectile)
 

Private Member Functions

void addPhysicsVector ()
 

Private Attributes

G4int numEle
 
std::vector< G4ParticleHPElementData * > theData
 
G4String theDataDirVariable
 
G4ParticleDefinitiontheProjectile
 

Detailed Description

Definition at line 45 of file G4ParticleHPData.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPData()

G4ParticleHPData::G4ParticleHPData ( G4ParticleDefinition projectile)

Definition at line 35 of file G4ParticleHPData.cc.

36 : theProjectile(projectile)
37{
38 //const char* theDataDirVariable;
39 if( projectile == G4Neutron::Neutron() ) {
40 theDataDirVariable = "G4NEUTRONHPDATA";
41 }else if( projectile == G4Proton::Proton() ) {
42 theDataDirVariable = "G4PROTONHPDATA";
43 }else if( projectile == G4Deuteron::Deuteron() ) {
44 theDataDirVariable = "G4DEUTERONHPDATA";
45 }else if( projectile == G4Triton::Triton() ) {
46 theDataDirVariable = "G4TRITONHPDATA";
47 }else if( projectile == G4He3::He3() ) {
48 theDataDirVariable = "G4HE3HPDATA";
49 }else if( projectile == G4Alpha::Alpha() ) {
50 theDataDirVariable = "G4ALPHAHPDATA";
51 }
52
54 for ( G4int i = 0 ; i < numEle ; i++ ) theData.push_back ( new G4ParticleHPElementData );
55// G4cout << "G4ParticleHPData::G4ParticleHPData(): numEle="<<numEle<<G4endl;
56 for (G4int i=0; i<numEle; i++)
57 {
58 (*theData[i]).Init((*(G4Element::GetElementTable()))[i], projectile, theDataDirVariable);
59 }
60 }
int G4int
Definition: G4Types.hh:85
static G4Alpha * Alpha()
Definition: G4Alpha.cc:88
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:93
static G4ElementTable * GetElementTable()
Definition: G4Element.cc:397
static size_t GetNumberOfElements()
Definition: G4Element.cc:404
static G4He3 * He3()
Definition: G4He3.cc:93
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
G4ParticleDefinition * theProjectile
G4String theDataDirVariable
std::vector< G4ParticleHPElementData * > theData
static G4Proton * Proton()
Definition: G4Proton.cc:92
static G4Triton * Triton()
Definition: G4Triton.cc:93
void Init()
Definition: G4IonTable.cc:77

References G4Alpha::Alpha(), G4Deuteron::Deuteron(), G4Element::GetElementTable(), G4Element::GetNumberOfElements(), G4He3::He3(), lightions::Init(), G4Neutron::Neutron(), numEle, G4Proton::Proton(), theData, theDataDirVariable, and G4Triton::Triton().

Referenced by Instance().

◆ ~G4ParticleHPData()

G4ParticleHPData::~G4ParticleHPData ( )

Definition at line 62 of file G4ParticleHPData.cc.

63 {
64 for ( std::vector<G4ParticleHPElementData*>::iterator it = theData.begin() ; it != theData.end() ; it++ ) delete *it;
65 theData.clear();
66 }

References theData.

Member Function Documentation

◆ addPhysicsVector()

void G4ParticleHPData::addPhysicsVector ( )
private

◆ DoPhysicsVector()

G4PhysicsVector * G4ParticleHPData::DoPhysicsVector ( G4ParticleHPVector theVector)

Definition at line 76 of file G4ParticleHPData.cc.

77 {
78// G4cout << "Entered G4ParticleHPData::DoPhysicsVector."<<G4endl;
79 G4int len = theVector->GetVectorLength();
80// G4cout <<"zahl der energie-punkte "<< len<<G4endl;
81 if(len==0) return new G4PhysicsFreeVector(0, 0., 0.);
82 G4double emin = theVector->GetX(0);
83 G4double emax = theVector->GetX(len-1);
84// G4cout <<"zahl der energie-punkte "<< len<<" "<<emin<<" "<<emax<<G4endl;
85
86 // G4int dummy; G4cin >> dummy;
87 G4PhysicsFreeVector * theResult = new G4PhysicsFreeVector(len, emin, emax);
88 for (G4int i=0; i<len; i++)
89 {
90 theResult->PutValues(i, theVector->GetX(i), theVector->GetY(i));
91 }
92 return theResult;
93 }
static const G4double emax
double G4double
Definition: G4Types.hh:83
G4double GetY(G4double x)
G4double GetX(G4int i) const
G4int GetVectorLength() const
void PutValues(const std::size_t index, const G4double energy, const G4double value)

References emax, G4ParticleHPVector::GetVectorLength(), G4ParticleHPVector::GetX(), G4ParticleHPVector::GetY(), and G4PhysicsFreeVector::PutValues().

Referenced by MakePhysicsVector().

◆ Instance()

G4ParticleHPData * G4ParticleHPData::Instance ( G4ParticleDefinition projectile)
static

Definition at line 68 of file G4ParticleHPData.cc.

69 {
70 static G4ThreadLocal G4ParticleHPData *theCrossSectionData_G4MT_TLS_ = 0 ;
71 if ( !theCrossSectionData_G4MT_TLS_ ) theCrossSectionData_G4MT_TLS_ = new G4ParticleHPData(projectile);
72 G4ParticleHPData &theCrossSectionData = *theCrossSectionData_G4MT_TLS_;
73 return &theCrossSectionData;
74 }
G4ParticleHPData(G4ParticleDefinition *projectile)
#define G4ThreadLocal
Definition: tls.hh:77

References G4ParticleHPData(), and G4ThreadLocal.

Referenced by G4ParticleHPCaptureData::BuildPhysicsTable(), G4ParticleHPElasticData::BuildPhysicsTable(), G4ParticleHPFissionData::BuildPhysicsTable(), and G4ParticleHPInelasticData::BuildPhysicsTable().

◆ MakePhysicsVector() [1/4]

G4PhysicsVector * G4ParticleHPData::MakePhysicsVector ( G4Element thE,
G4ParticleHPCaptureData theP 
)
inline

Definition at line 58 of file G4ParticleHPData.hh.

59 {
60 if ( numEle <= (G4int)thE->GetIndex() ) addPhysicsVector();
61 return DoPhysicsVector((*theData[thE->GetIndex()]).GetData(theP));
62 }
size_t GetIndex() const
Definition: G4Element.hh:182
G4PhysicsVector * DoPhysicsVector(G4ParticleHPVector *theVector)

References addPhysicsVector(), DoPhysicsVector(), G4Element::GetIndex(), numEle, and theData.

◆ MakePhysicsVector() [2/4]

G4PhysicsVector * G4ParticleHPData::MakePhysicsVector ( G4Element thE,
G4ParticleHPElasticData theP 
)
inline

Definition at line 63 of file G4ParticleHPData.hh.

64 {
65 if ( numEle <= (G4int)thE->GetIndex() ) addPhysicsVector();
66 return DoPhysicsVector((*theData[thE->GetIndex()]).GetData(theP));
67 }

References addPhysicsVector(), DoPhysicsVector(), G4Element::GetIndex(), numEle, and theData.

◆ MakePhysicsVector() [3/4]

G4PhysicsVector * G4ParticleHPData::MakePhysicsVector ( G4Element thE,
G4ParticleHPFissionData theP 
)
inline

◆ MakePhysicsVector() [4/4]

G4PhysicsVector * G4ParticleHPData::MakePhysicsVector ( G4Element thE,
G4ParticleHPInelasticData theP 
)
inline

Definition at line 68 of file G4ParticleHPData.hh.

69 {
70// G4cout << "entered G4ParticleHPData::MakePhysicsVector!!!"<<G4endl;
71// G4cout << "thE->GetIndex()="<<thE->GetIndex()<<G4endl;
72 if ( numEle <= (G4int)thE->GetIndex() ) addPhysicsVector();
73 return DoPhysicsVector((*theData[thE->GetIndex()]).GetData(theP));
74 }

References addPhysicsVector(), DoPhysicsVector(), G4Element::GetIndex(), numEle, and theData.

Field Documentation

◆ numEle

G4int G4ParticleHPData::numEle
private

Definition at line 83 of file G4ParticleHPData.hh.

Referenced by addPhysicsVector(), G4ParticleHPData(), and MakePhysicsVector().

◆ theData

std::vector< G4ParticleHPElementData* > G4ParticleHPData::theData
private

◆ theDataDirVariable

G4String G4ParticleHPData::theDataDirVariable
private

Definition at line 87 of file G4ParticleHPData.hh.

Referenced by addPhysicsVector(), and G4ParticleHPData().

◆ theProjectile

G4ParticleDefinition* G4ParticleHPData::theProjectile
private

Definition at line 86 of file G4ParticleHPData.hh.

Referenced by addPhysicsVector().


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