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

#include <G4CrossSectionDataSetRegistry.hh>

Public Member Functions

 ~G4CrossSectionDataSetRegistry ()
void Register (G4VCrossSectionDataSet *)
void DeRegister (G4VCrossSectionDataSet *)
void Register (G4VComponentCrossSection *)
void DeRegister (G4VComponentCrossSection *)
void DeleteComponent (G4VComponentCrossSection *)
void Clean ()
G4VCrossSectionDataSetGetCrossSectionDataSet (const G4String &name, G4bool warning=false)
G4VComponentCrossSectionGetComponentCrossSection (const G4String &name)
 G4CrossSectionDataSetRegistry (G4CrossSectionDataSetRegistry &)=delete
G4CrossSectionDataSetRegistryoperator= (const G4CrossSectionDataSetRegistry &right)=delete

Static Public Member Functions

static G4CrossSectionDataSetRegistryInstance ()

Friends

class G4ThreadLocalSingleton< G4CrossSectionDataSetRegistry >

Detailed Description

Definition at line 55 of file G4CrossSectionDataSetRegistry.hh.

Constructor & Destructor Documentation

◆ ~G4CrossSectionDataSetRegistry()

G4CrossSectionDataSetRegistry::~G4CrossSectionDataSetRegistry ( )

◆ G4CrossSectionDataSetRegistry()

G4CrossSectionDataSetRegistry::G4CrossSectionDataSetRegistry ( G4CrossSectionDataSetRegistry & )
delete

Member Function Documentation

◆ Clean()

void G4CrossSectionDataSetRegistry::Clean ( )

Definition at line 87 of file G4CrossSectionDataSetRegistry.cc.

88{
89 std::size_t n = xSections.size();
90 for (std::size_t i=0; i<n; ++i) {
91 G4VCrossSectionDataSet* p = xSections[i];
92 if(nullptr != p) {
93 delete p;
94 xSections[i] = nullptr;
95 }
96 }
97 n = xComponents.size();
98 for (std::size_t i=0; i<n; ++i) {
99 auto p = xComponents[i];
100 if(nullptr != p) {
101 delete p;
102 xComponents[i] = nullptr;
103 }
104 }
105}

Referenced by ~G4CrossSectionDataSetRegistry().

◆ DeleteComponent()

void G4CrossSectionDataSetRegistry::DeleteComponent ( G4VComponentCrossSection * p)

Definition at line 150 of file G4CrossSectionDataSetRegistry.cc.

151{
152 if(nullptr == p) { return; }
153 std::size_t n = xComponents.size();
154 for (std::size_t i=0; i<n; ++i) {
155 if(xComponents[i] == p) {
156 delete p;
157 return;
158 }
159 }
160}

◆ DeRegister() [1/2]

void G4CrossSectionDataSetRegistry::DeRegister ( G4VComponentCrossSection * p)

Definition at line 137 of file G4CrossSectionDataSetRegistry.cc.

138{
139 if(nullptr == p) { return; }
140 std::size_t n = xComponents.size();
141 for (std::size_t i=0; i<n; ++i) {
142 if(xComponents[i] == p) {
143 xComponents[i] = nullptr;
144 return;
145 }
146 }
147}

◆ DeRegister() [2/2]

void G4CrossSectionDataSetRegistry::DeRegister ( G4VCrossSectionDataSet * p)

Definition at line 116 of file G4CrossSectionDataSetRegistry.cc.

117{
118 if(nullptr == p) { return; }
119 std::size_t n = xSections.size();
120 for (std::size_t i=0; i<n; ++i) {
121 if(xSections[i] == p) {
122 xSections[i] = nullptr;
123 return;
124 }
125 }
126}

◆ GetComponentCrossSection()

G4VComponentCrossSection * G4CrossSectionDataSetRegistry::GetComponentCrossSection ( const G4String & name)

Definition at line 185 of file G4CrossSectionDataSetRegistry.cc.

186{
187 for (auto & xsec : xComponents) {
188 if(nullptr != xsec && xsec->GetName() == name) { return xsec; }
189 }
190 G4VComponentCrossSection* ptr = nullptr;
191 return ptr;
192}

Referenced by G4HadProcesses::ElasticXS(), G4FTFParameters::G4FTFParameters(), G4NeutronElasticXS::G4NeutronElasticXS(), G4NeutronInelasticXS::G4NeutronInelasticXS(), G4QGSPAntiBarionBuilder::G4QGSPAntiBarionBuilder(), and G4HadProcesses::InelasticXS().

◆ GetCrossSectionDataSet()

G4VCrossSectionDataSet * G4CrossSectionDataSetRegistry::GetCrossSectionDataSet ( const G4String & name,
G4bool warning = false )

Definition at line 163 of file G4CrossSectionDataSetRegistry.cc.

165{
166 for (auto const & xsec : xSections) {
167 if (nullptr != xsec && xsec->GetName() == name) { return xsec; }
168 }
169 // check if factory exists...
170 //
171 G4CrossSectionFactoryRegistry* factories =
173 // This throws if factory is not found, add second parameter
174 // to false to avoid this
175 G4VBaseXSFactory* factory = factories->GetFactory(name, warning );
176 if (nullptr != factory ) {
177 return factory->Instantiate();
178 } else {
179 G4VCrossSectionDataSet* ptr = nullptr;
180 return ptr;
181 }
182}
static G4CrossSectionFactoryRegistry * Instance()
G4VBaseXSFactory * GetFactory(const G4String &name, G4bool abortIfNotFound=true) const
virtual G4VCrossSectionDataSet * Instantiate()=0

Referenced by G4GammaNuclearXS::G4GammaNuclearXS().

◆ Instance()

G4CrossSectionDataSetRegistry * G4CrossSectionDataSetRegistry::Instance ( )
static

Definition at line 70 of file G4CrossSectionDataSetRegistry.cc.

71{
72 if(nullptr == instance) {
74 instance = inst.Instance();
75 }
76 return instance;
77}

Referenced by G4INCLXXNeutronBuilder::Build(), LBE::ConstructHad(), G4HadronPhysicsLEND::ConstructProcess(), G4NeutronCrossSectionXS::ConstructProcess(), G4HadProcesses::ElasticXS(), G4AntiNuclElastic::G4AntiNuclElastic(), G4ChipsComponentXS::G4ChipsComponentXS(), G4ChipsElasticModel::G4ChipsElasticModel(), G4ChipsKaonZeroElasticXS::G4ChipsKaonZeroElasticXS(), G4ChipsKaonZeroInelasticXS::G4ChipsKaonZeroInelasticXS(), G4ElectroVDNuclearModel::G4ElectroVDNuclearModel(), G4FTFParameters::G4FTFParameters(), G4GammaNuclearXS::G4GammaNuclearXS(), G4InterfaceToXS::G4InterfaceToXS(), G4MuonVDNuclearModel::G4MuonVDNuclearModel(), G4NeutronElasticXS::G4NeutronElasticXS(), G4NeutronInelasticXS::G4NeutronInelasticXS(), G4ParticleInelasticXS::G4ParticleInelasticXS(), G4QGSPAntiBarionBuilder::G4QGSPAntiBarionBuilder(), G4QuasiElRatios::G4QuasiElRatios(), G4VComponentCrossSection::G4VComponentCrossSection(), G4VCrossSectionDataSet::G4VCrossSectionDataSet(), and G4HadProcesses::InelasticXS().

◆ operator=()

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

◆ Register() [1/2]

void G4CrossSectionDataSetRegistry::Register ( G4VComponentCrossSection * p)

Definition at line 128 of file G4CrossSectionDataSetRegistry.cc.

129{
130 if(nullptr == p) { return; }
131 for (auto & xsec : xComponents) {
132 if(xsec == p) { return; }
133 }
134 xComponents.push_back(p);
135}

◆ Register() [2/2]

void G4CrossSectionDataSetRegistry::Register ( G4VCrossSectionDataSet * p)

Definition at line 107 of file G4CrossSectionDataSetRegistry.cc.

108{
109 if(nullptr == p) { return; }
110 for (auto & xsec : xSections) {
111 if(xsec == p) { return; }
112 }
113 xSections.push_back(p);
114}

◆ G4ThreadLocalSingleton< G4CrossSectionDataSetRegistry >

Definition at line 1 of file G4CrossSectionDataSetRegistry.hh.


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