Geant4-11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
G4HadronicInteractionRegistry Class Reference

#include <G4HadronicInteractionRegistry.hh>

Public Member Functions

void Clean ()
 
std::vector< G4HadronicInteraction * > FindAllModels (const G4String &name)
 
G4HadronicInteractionFindModel (const G4String &name)
 
void InitialiseModels ()
 
void RegisterMe (G4HadronicInteraction *aModel)
 
void RemoveMe (G4HadronicInteraction *aModel)
 
 ~G4HadronicInteractionRegistry ()
 

Static Public Member Functions

static G4HadronicInteractionRegistryInstance ()
 

Private Member Functions

 G4HadronicInteractionRegistry ()
 

Private Attributes

std::vector< G4HadronicInteraction * > allModels
 

Static Private Attributes

static G4ThreadLocal G4HadronicInteractionRegistryinstance = nullptr
 

Friends

class G4ThreadLocalSingleton< G4HadronicInteractionRegistry >
 

Detailed Description

Definition at line 43 of file G4HadronicInteractionRegistry.hh.

Constructor & Destructor Documentation

◆ ~G4HadronicInteractionRegistry()

G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry ( )

Definition at line 48 of file G4HadronicInteractionRegistry.cc.

References Clean().

◆ G4HadronicInteractionRegistry()

G4HadronicInteractionRegistry::G4HadronicInteractionRegistry ( )
private

Definition at line 45 of file G4HadronicInteractionRegistry.cc.

46{}

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
57 // << " " << this << G4endl;
58 for (size_t i=0; i<nModels; ++i) {
59 if( allModels[i] ) {
60 //const char* xxx = (allModels[i]->GetModelName()).c_str();
61 //G4int len = (allModels[i]->GetModelName()).length();
62 //len = std::min(len, 9);
63 //const G4String mname = G4String(xxx, len);
64 //G4cout << "G4HadronicInteractionRegistry: delete " << i << " "
65 // << allModels[i] << " " << mname
66 // << " " << this << G4endl;
67 //if(mname != "NeutronHP" && mname != "ParticleH")
68 delete allModels[i];
69 // G4cout << "done " << this << G4endl;
70 }
71 }
72 allModels.clear();
73 //G4cout <<"G4HadronicInteractionRegistry::Clean() is done "<<G4endl;
74}
std::vector< G4HadronicInteraction * > allModels

References allModels.

Referenced by ~G4HadronicInteractionRegistry().

◆ FindAllModels()

std::vector< G4HadronicInteraction * > G4HadronicInteractionRegistry::FindAllModels ( const G4String name)

Definition at line 123 of file G4HadronicInteractionRegistry.cc.

124{
125 std::vector<G4HadronicInteraction*> models;
126 for (auto & mod : allModels) {
127 if(mod && mod->GetModelName() == name) {
128 models.push_back(mod);
129 }
130 }
131 return models;
132}
const char * name(G4int ptype)

References allModels, and G4InuclParticleNames::name().

Referenced by G4INCLXXInterfaceStore::UseAblaDeExcitation().

◆ FindModel()

G4HadronicInteraction * G4HadronicInteractionRegistry::FindModel ( const G4String name)

◆ InitialiseModels()

void G4HadronicInteractionRegistry::InitialiseModels ( )

Definition at line 76 of file G4HadronicInteractionRegistry.cc.

77{
78 for (auto & mod : allModels) {
79 if( mod ) { mod->InitialiseModel(); }
80 }
81}

References allModels.

Referenced by G4HadronicProcessStore::PrintInfo().

◆ Instance()

G4HadronicInteractionRegistry * G4HadronicInteractionRegistry::Instance ( void  )
static

Definition at line 36 of file G4HadronicInteractionRegistry.cc.

37{
38 if(nullptr == instance) {
40 instance = inst.Instance();
41 }
42 return instance;
43}
static G4ThreadLocal G4HadronicInteractionRegistry * instance

References G4ThreadLocalSingleton< T >::Instance(), and instance.

Referenced by G4TheoFSGenerator::ApplyYourself(), G4HadronInelasticQBBC::ConstructProcess(), G4IonINCLXXPhysics::ConstructProcess(), G4IonPhysics::ConstructProcess(), G4IonPhysicsPHP::ConstructProcess(), G4IonQMDPhysics::ConstructProcess(), G4BinaryCascade::G4BinaryCascade(), G4BinaryLightIonReaction::G4BinaryLightIonReaction(), G4ElectroVDNuclearModel::G4ElectroVDNuclearModel(), G4ExcitedStringDecay::G4ExcitedStringDecay(), G4GeneratorPrecompoundInterface::G4GeneratorPrecompoundInterface(), G4HadronicAbsorptionFritiof::G4HadronicAbsorptionFritiof(), G4HadronicInteraction::G4HadronicInteraction(), G4INCLXXInterface::G4INCLXXInterface(), G4INCLXXNeutronBuilder::G4INCLXXNeutronBuilder(), G4INCLXXProtonBuilder::G4INCLXXProtonBuilder(), G4LENDInelastic::G4LENDInelastic(), G4LowEGammaNuclearModel::G4LowEGammaNuclearModel(), G4MuMinusCapturePrecompound::G4MuMinusCapturePrecompound(), G4MuonVDNuclearModel::G4MuonVDNuclearModel(), G4PreCompoundDeexcitation::G4PreCompoundDeexcitation(), G4HadronicProcessStore::PrintInfo(), and G4INCLXXInterfaceStore::UseAblaDeExcitation().

◆ RegisterMe()

void G4HadronicInteractionRegistry::RegisterMe ( G4HadronicInteraction aModel)

Definition at line 84 of file G4HadronicInteractionRegistry.cc.

85{
86 if(!aModel) { return; }
87 for (auto & mod : allModels) {
88 if( aModel == mod ) { return; }
89 }
90 //G4cout << "Register model <" << aModel->GetModelName()
91 // << "> " << nModels+1 << " " << aModel << G4endl;
92 allModels.push_back(aModel);
93}

References allModels.

Referenced by G4HadronicInteraction::G4HadronicInteraction().

◆ RemoveMe()

void G4HadronicInteractionRegistry::RemoveMe ( G4HadronicInteraction aModel)

Definition at line 96 of file G4HadronicInteractionRegistry.cc.

97{
98 if(!aModel) { return; }
99 for (size_t i=0; i<allModels.size(); ++i) {
100 if( aModel == allModels[i] ) {
101 //G4cout << "DeRegister model <" << aModel
102 // << "> " << i << G4endl;
103 allModels[i] = nullptr;
104 return;
105 }
106 }
107}

References allModels.

Referenced by G4HadronicInteraction::~G4HadronicInteraction().

Friends And Related Function Documentation

◆ G4ThreadLocalSingleton< G4HadronicInteractionRegistry >

Definition at line 1 of file G4HadronicInteractionRegistry.hh.

Field Documentation

◆ allModels

std::vector<G4HadronicInteraction*> G4HadronicInteractionRegistry::allModels
private

◆ instance

G4ThreadLocal G4HadronicInteractionRegistry * G4HadronicInteractionRegistry::instance = nullptr
staticprivate

Definition at line 76 of file G4HadronicInteractionRegistry.hh.

Referenced by Instance().


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