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

#include <G4HadDataHandler.hh>

Public Member Functions

 G4HadDataHandler (std::size_t nTable)
 
 ~G4HadDataHandler ()
 
void AddTable (G4PhysicsTable *)
 
void UpdateTable (G4PhysicsTable *, std::size_t idx)
 
void CleanTable (std::size_t idx)
 
void SetMasterProcess (const G4VProcess *)
 
const G4VProcessGetMasterProcess (std::size_t idx) const
 
const G4PhysicsTableGetTable (std::size_t idx) const
 
G4PhysicsTableTable (std::size_t idx) const
 
const G4PhysicsVectorGetVector (std::size_t itable, std::size_t ivec) const
 
const std::vector< G4PhysicsTable * > & GetTables () const
 
G4HadDataHandleroperator= (const G4HadDataHandler &right)=delete
 
 G4HadDataHandler (const G4HadDataHandler &)=delete
 

Detailed Description

Definition at line 60 of file G4HadDataHandler.hh.

Constructor & Destructor Documentation

◆ G4HadDataHandler() [1/2]

G4HadDataHandler::G4HadDataHandler ( std::size_t nTable)
explicit

Definition at line 47 of file G4HadDataHandler.cc.

47 : tLength(n)
48{
49 data.resize(n, nullptr);
50}

◆ ~G4HadDataHandler()

G4HadDataHandler::~G4HadDataHandler ( )

Definition at line 54 of file G4HadDataHandler.cc.

55{
56 for(std::size_t i=0; i<tLength; ++i) {
57 for(std::size_t j = i+1; j<tLength; ++j) {
58 if(data[j] == data[i]) { data[j] = nullptr; }
59 }
60 CleanTable(i);
61 }
62}
void CleanTable(std::size_t idx)

◆ G4HadDataHandler() [2/2]

G4HadDataHandler::G4HadDataHandler ( const G4HadDataHandler & )
delete

Member Function Documentation

◆ AddTable()

void G4HadDataHandler::AddTable ( G4PhysicsTable * ptr)

Definition at line 66 of file G4HadDataHandler.cc.

67{
68 data.push_back(ptr);
69 ++tLength;
70}

◆ CleanTable()

void G4HadDataHandler::CleanTable ( std::size_t idx)

Definition at line 87 of file G4HadDataHandler.cc.

88{
89 if(idx < tLength && nullptr != data[idx]) {
90 data[idx]->clearAndDestroy();
91 delete data[idx];
92 data[idx] = nullptr;
93 }
94}

Referenced by ~G4HadDataHandler().

◆ GetMasterProcess()

const G4VProcess * G4HadDataHandler::GetMasterProcess ( std::size_t idx) const

Definition at line 105 of file G4HadDataHandler.cc.

106{
107 return (idx < masterProcess.size()) ? masterProcess[idx] : nullptr;
108}

◆ GetTable()

const G4PhysicsTable * G4HadDataHandler::GetTable ( std::size_t idx) const
inline

Definition at line 84 of file G4HadDataHandler.hh.

84 {
85 return (idx < tLength) ? data[idx] : nullptr;
86 }

◆ GetTables()

const std::vector< G4PhysicsTable * > & G4HadDataHandler::GetTables ( ) const
inline

Definition at line 96 of file G4HadDataHandler.hh.

96{ return data; }

Referenced by G4NeutronGeneralProcess::BuildPhysicsTable().

◆ GetVector()

const G4PhysicsVector * G4HadDataHandler::GetVector ( std::size_t itable,
std::size_t ivec ) const
inline

Definition at line 93 of file G4HadDataHandler.hh.

94 { return (*(data[itable]))[ivec]; }

Referenced by G4NeutronGeneralProcess::ComputeGeneralLambda(), and G4NeutronGeneralProcess::GetProbability().

◆ operator=()

G4HadDataHandler & G4HadDataHandler::operator= ( const G4HadDataHandler & right)
delete

◆ SetMasterProcess()

void G4HadDataHandler::SetMasterProcess ( const G4VProcess * ptr)

Definition at line 98 of file G4HadDataHandler.cc.

99{
100 masterProcess.push_back(ptr);
101}

◆ Table()

G4PhysicsTable * G4HadDataHandler::Table ( std::size_t idx) const
inline

Definition at line 87 of file G4HadDataHandler.hh.

87 {
88 return (idx < tLength) ? data[idx] : nullptr;
89 }

Referenced by G4NeutronGeneralProcess::StorePhysicsTable().

◆ UpdateTable()

void G4HadDataHandler::UpdateTable ( G4PhysicsTable * ptr,
std::size_t idx )

Definition at line 74 of file G4HadDataHandler.cc.

75{
76 // update table pointer but not delete previous
77 if(idx < tLength) {
78 if(ptr != data[idx]) { data[idx] = ptr; }
79 } else {
80 G4cout << "### G4HadDataHandler::UpdateTable fail for idx=" << idx
81 << " length=" << tLength << G4endl;
82 }
83}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

Referenced by G4NeutronGeneralProcess::PreparePhysicsTable().


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