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

#include <G4ParticleHPData.hh>

Public Member Functions

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

Static Public Member Functions

static G4ParticleHPDataInstance (G4ParticleDefinition *projectile)
 

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
static G4Proton * Proton()
Definition: G4Proton.cc:92
static G4Triton * Triton()
Definition: G4Triton.cc:94
void Init()
Definition: G4IonTable.cc:77

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

Member Function Documentation

◆ 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 G4LPhysicsFreeVector(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 G4LPhysicsFreeVector * theResult = new G4LPhysicsFreeVector(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 }
double G4double
Definition: G4Types.hh:83
void PutValues(std::size_t index, G4double e, G4double dataValue)
G4double GetY(G4double x)
G4double GetX(G4int i) const
G4int GetVectorLength() const

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 }
#define G4ThreadLocal
Definition: tls.hh:77

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:181
G4PhysicsVector * DoPhysicsVector(G4ParticleHPVector *theVector)

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

◆ MakePhysicsVector() [3/4]

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

Definition at line 53 of file G4ParticleHPData.hh.

54 {
55 if ( numEle <= (G4int)thE->GetIndex() ) addPhysicsVector();
56 return DoPhysicsVector((*theData[thE->GetIndex()]).GetData(theP));
57 }

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

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

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