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

#include <G4HadronicInteractionRegistry.hh>

Public Member Functions

 ~G4HadronicInteractionRegistry ()
 
void Clean ()
 
void RegisterMe (G4HadronicInteraction *aModel)
 
void RemoveMe (G4HadronicInteraction *aModel)
 
G4HadronicInteractionFindModel (const G4String &name)
 

Static Public Member Functions

static G4HadronicInteractionRegistryInstance ()
 

Detailed Description

Definition at line 43 of file G4HadronicInteractionRegistry.hh.

Constructor & Destructor Documentation

◆ ~G4HadronicInteractionRegistry()

G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry ( )

Member Function Documentation

◆ Clean()

void G4HadronicInteractionRegistry::Clean ( )

Definition at line 53 of file G4HadronicInteractionRegistry.cc.

54{
55 size_t nModels = allModels.size();
56 //G4cout << "G4HadronicInteractionRegistry::Clean() start " << nModels << G4endl;
57 if(0 < nModels) {
58 for (size_t i=0; i<nModels; ++i) {
59 if( allModels[i] ) {
60 //G4cout << "delete " << i << G4endl;
61 //G4cout << allModels[i]->GetModelName() << G4endl;
62 G4HadronicInteraction * model = allModels[i];
63 allModels[i] = 0;
64 delete model;
65 }
66 }
67 allModels.clear();
68 }
69 //G4cout << "G4HadronicInteractionRegistry::Clean() is done " << G4endl;
70}

Referenced by ~G4HadronicInteractionRegistry(), and G4HadronicProcessStore::~G4HadronicProcessStore().

◆ FindModel()

G4HadronicInteraction * G4HadronicInteractionRegistry::FindModel ( const G4String name)

Definition at line 104 of file G4HadronicInteractionRegistry.cc.

105{
106 G4HadronicInteraction* model = 0;
107
108 size_t nModels = allModels.size();
109 for (size_t i=0; i<nModels; ++i) {
110 G4HadronicInteraction* p = allModels[i];
111 if(p) {
112 if (p->GetModelName() == name) {
113 model = p;
114 break;
115 }
116 }
117 }
118 return model;
119}
const G4String & GetModelName() const

Referenced by G4HadronInelasticQBBC::ConstructProcess(), G4BinaryCascade::G4BinaryCascade(), G4BinaryLightIonReaction::G4BinaryLightIonReaction(), G4GeneratorPrecompoundInterface::G4GeneratorPrecompoundInterface(), G4HadronicAbsorptionFritiof::G4HadronicAbsorptionFritiof(), and G4MuMinusCapturePrecompound::G4MuMinusCapturePrecompound().

◆ Instance()

◆ RegisterMe()

void G4HadronicInteractionRegistry::RegisterMe ( G4HadronicInteraction aModel)

Definition at line 73 of file G4HadronicInteractionRegistry.cc.

74{
75 if(!aModel) { return; }
76 size_t nModels = allModels.size();
77 if(nModels > 0) {
78 for (size_t i=0; i<nModels; ++i) {
79 if( aModel == allModels[i] ) { return; }
80 }
81 }
82 //G4cout << "Register model <" << aModel->GetModelName()
83 //<< "> " << nModels+1 << G4endl;
84 allModels.push_back(aModel);
85}

Referenced by G4HadronicInteraction::G4HadronicInteraction().

◆ RemoveMe()

void G4HadronicInteractionRegistry::RemoveMe ( G4HadronicInteraction aModel)

Definition at line 88 of file G4HadronicInteractionRegistry.cc.

89{
90 if(!aModel) { return; }
91 size_t nModels = allModels.size();
92 if(0 == nModels) { return; }
93 for (size_t i=0; i<nModels; ++i) {
94 if( aModel == allModels[i] ) {
95 //G4cout << "DeRegister model <" << aModel->GetModelName()
96 //<< "> " << i << G4endl;
97 allModels[i] = 0;
98 return;
99 }
100 }
101}

Referenced by G4HadronicInteraction::~G4HadronicInteraction().


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