BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtModel Class Reference

#include <EvtModel.hh>

Public Member Functions

void Register (EvtDecayBase *prototype)
int isModel (std::string name)
EvtDecayBasegetFcn (std::string model_name)
int isCommand (std::string cmd)
void storeCommand (std::string cmd, std::string cnfgstr)

Static Public Member Functions

static EvtModelinstance ()

Detailed Description

Definition at line 33 of file EvtModel.hh.

Member Function Documentation

◆ getFcn()

EvtDecayBase * EvtModel::getFcn ( std::string model_name)

Definition at line 44 of file EvtModel.cc.

44 {
45
46 EvtDecayBase* model = 0;
47 if ( _modelNameHash.find( model_name ) != _modelNameHash.end() )
48 { model = _modelNameHash[model_name]; }
49
50 if ( model == 0 )
51 {
52 report( ERROR, "EvtGen" ) << "Did not find the right model:" << model_name.c_str() << "\n";
53 return 0;
54 }
55
56 return model->clone();
57}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
virtual EvtDecayBase * clone()=0

Referenced by EvtDecayTable::readDecayFile().

◆ instance()

EvtModel & EvtModel::instance ( )
inlinestatic

Definition at line 56 of file EvtModel.hh.

56 {
57 if ( _instance == 0 ) _instance = new EvtModel;
58 return *_instance;
59}

Referenced by EvtModelReg::EvtModelReg(), and EvtDecayTable::readDecayFile().

◆ isCommand()

int EvtModel::isCommand ( std::string cmd)

Definition at line 83 of file EvtModel.cc.

83 {
84
85 if ( _commandNameHash.find( cmd ) != _commandNameHash.end() ) { return 1; }
86 return 0;
87}

Referenced by EvtDecayTable::readDecayFile().

◆ isModel()

int EvtModel::isModel ( std::string name)

Definition at line 77 of file EvtModel.cc.

77 {
78
79 if ( _modelNameHash.find( model_name ) != _modelNameHash.end() ) { return 1; }
80 return 0;
81}

Referenced by EvtDecayTable::readDecayFile().

◆ Register()

void EvtModel::Register ( EvtDecayBase * prototype)

Definition at line 59 of file EvtModel.cc.

59 {
60
61 std::string modelName;
62 prototype->getName( modelName );
63
64 _modelNameHash[modelName] = prototype;
65
66 std::string commandName = prototype->commandName();
67
68 if ( commandName != "" )
69 {
70
71 // report(DEBUG,"EvtGen") << "Adding command:"<<commandName<<endl;
72
73 _commandNameHash[commandName] = prototype;
74 }
75}
virtual void getName(std::string &name)=0
virtual std::string commandName()

Referenced by EvtModelReg::EvtModelReg().

◆ storeCommand()

void EvtModel::storeCommand ( std::string cmd,
std::string cnfgstr )

Definition at line 89 of file EvtModel.cc.

89 {
90
91 EvtDecayBase* model = 0;
92 if ( _commandNameHash.find( cmd ) != _commandNameHash.end() )
93 { model = _commandNameHash[cmd]; }
94
95 assert( model != 0 );
96
97 model->command( cnfgstr );
98}
virtual void command(std::string cmd)

Referenced by EvtDecayTable::readDecayFile().


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