Changeset View
Changeset View
Standalone View
Standalone View
src/EvtGenBase/EvtModel.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
EvtDecayBase* EvtModel::getFcn( std::string model_name ) | EvtDecayBase* EvtModel::getFcn( std::string model_name ) | ||||
{ | { | ||||
EvtDecayBase* model = nullptr; | EvtDecayBase* model = nullptr; | ||||
if ( _modelNameHash.find( model_name ) != _modelNameHash.end() ) { | if ( _modelNameHash.find( model_name ) != _modelNameHash.end() ) { | ||||
model = _modelNameHash[model_name]; | model = _modelNameHash[model_name]; | ||||
} | } | ||||
if ( model == nullptr ) { | if ( !model ) { | ||||
EvtGenReport( EVTGEN_ERROR, "EvtGen" ) | EvtGenReport( EVTGEN_ERROR, "EvtGen" ) | ||||
<< "Did not find the right model:" << model_name.c_str() << "\n"; | << "Did not find the right model:" << model_name.c_str() << "\n"; | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
return model->clone(); | return model->clone(); | ||||
} | } | ||||
Show All 28 Lines | |||||
void EvtModel::storeCommand( std::string cmd, std::string cnfgstr ) | void EvtModel::storeCommand( std::string cmd, std::string cnfgstr ) | ||||
{ | { | ||||
EvtDecayBase* model = nullptr; | EvtDecayBase* model = nullptr; | ||||
if ( _commandNameHash.find( cmd ) != _commandNameHash.end() ) { | if ( _commandNameHash.find( cmd ) != _commandNameHash.end() ) { | ||||
model = _commandNameHash[cmd]; | model = _commandNameHash[cmd]; | ||||
} | } | ||||
assert( model != 0 ); | assert( model ); | ||||
model->command( cnfgstr ); | model->command( cnfgstr ); | ||||
} | } |