Geant4 11.1.1
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 )
55 {
56 theData.push_back ( new G4ParticleHPElementData );
57 }
58 for (G4int i=0; i<numEle; ++i)
59 {
60 (*theData[i]).Init((*(G4Element::GetElementTable()))[i], projectile, theDataDirVariable);
61 }
62 }
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:403
static size_t GetNumberOfElements()
Definition: G4Element.cc:410
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:93
void Init()
Definition: G4IonTable.cc:77

◆ ~G4ParticleHPData()

G4ParticleHPData::~G4ParticleHPData ( )

Definition at line 64 of file G4ParticleHPData.cc.

65 {
66 for (auto it = theData.cbegin() ; it != theData.cend() ; ++it) delete *it;
67 theData.clear();
68 }

Member Function Documentation

◆ DoPhysicsVector()

G4PhysicsVector * G4ParticleHPData::DoPhysicsVector ( G4ParticleHPVector theVector)

Definition at line 78 of file G4ParticleHPData.cc.

79 {
80 G4int len = theVector->GetVectorLength();
81 if(len==0) return new G4PhysicsFreeVector(0, 0., 0.);
82 G4double emin = theVector->GetX(0);
83 G4double emax = theVector->GetX(len-1);
84
85 G4PhysicsFreeVector * theResult = new G4PhysicsFreeVector(len, emin, emax);
86 for (G4int i=0; i<len; ++i)
87 {
88 theResult->PutValues(i, theVector->GetX(i), theVector->GetY(i));
89 }
90 return theResult;
91 }
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)

Referenced by MakePhysicsVector().

◆ Instance()

G4ParticleHPData * G4ParticleHPData::Instance ( G4ParticleDefinition projectile)
static

Definition at line 70 of file G4ParticleHPData.cc.

71 {
72 static G4ThreadLocal G4ParticleHPData *theCrossSectionData_G4MT_TLS_ = nullptr ;
73 if ( !theCrossSectionData_G4MT_TLS_ ) theCrossSectionData_G4MT_TLS_ = new G4ParticleHPData(projectile);
74 G4ParticleHPData &theCrossSectionData = *theCrossSectionData_G4MT_TLS_;
75 return &theCrossSectionData;
76 }
#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:182
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: