BOSS 6.6.4.p03
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 34 of file EvtModel.hh.

Member Function Documentation

◆ getFcn()

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

Definition at line 46 of file EvtModel.cc.

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

Referenced by EvtDecayTable::readDecayFile().

◆ instance()

EvtModel & EvtModel::instance ( )
inlinestatic

Definition at line 63 of file EvtModel.hh.

63 {
64 if ( _instance == 0 ) _instance=new EvtModel;
65 return *_instance;
66}

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

◆ isCommand()

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

Definition at line 92 of file EvtModel.cc.

92 {
93
94 if ( _commandNameHash.find(cmd)!=_commandNameHash.end() ) {
95 return 1;
96 }
97 return 0;
98}

Referenced by EvtDecayTable::readDecayFile().

◆ isModel()

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

Definition at line 83 of file EvtModel.cc.

83 {
84
85 if ( _modelNameHash.find(model_name)!=_modelNameHash.end() ) {
86 return 1;
87 }
88 return 0;
89}

Referenced by EvtDecayTable::readDecayFile().

◆ Register()

void EvtModel::Register ( EvtDecayBase prototype)

Definition at line 64 of file EvtModel.cc.

64 {
65
66 std::string modelName;
67 prototype->getName(modelName);
68
69 _modelNameHash[modelName]=prototype;
70
71 std::string commandName=prototype->commandName();
72
73 if (commandName!=""){
74
75 //report(DEBUG,"EvtGen") << "Adding command:"<<commandName<<endl;
76
77 _commandNameHash[commandName]=prototype;
78
79 }
80
81}
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 100 of file EvtModel.cc.

100 {
101
102 EvtDecayBase *model=0;
103 if ( _commandNameHash.find(cmd)!=_commandNameHash.end() ) {
104 model=_commandNameHash[cmd];
105 }
106
107 assert(model!=0);
108
109 model->command(cnfgstr);
110
111}
virtual void command(std::string cmd)

Referenced by EvtDecayTable::readDecayFile().


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