//-------------------------------------------------------------------------- // // Environment: // This software is part of the EvtGen package developed jointly // for the BaBar and CLEO collaborations. If you use all or part // of it, please give an appropriate acknowledgement. // // Copyright Information: See EvtGen/COPYRIGHT // Copyright (C) 1998 Caltech, UCSB // // Module: EvtModel.cc // // Description: // // Modification history: // // RYD September 25, 1996 Module created // //------------------------------------------------------------------------ // #include "EvtGenBase/EvtPatches.hh" #include #include #include #include #include #include #include "EvtGenBase/EvtParticle.hh" #include "EvtGenBase/EvtRandom.hh" #include "EvtGenBase/EvtModel.hh" #include "EvtGenBase/EvtPDL.hh" #include "EvtGenBase/EvtDecayParm.hh" #include "EvtGenBase/EvtDecayBase.hh" #include "EvtGenBase/EvtParticleDecayList.hh" #include "EvtGenBase/EvtParser.hh" #include "EvtGenBase/EvtReport.hh" #include using std::fstream; EvtModel* EvtModel::_instance=0; EvtModel::EvtModel() { } EvtDecayBase* EvtModel::GetFcn(std::string model_name){ EvtDecayBase *model=0; if ( _modelNameHash.find(model_name)!=_modelNameHash.end() ) { model=_modelNameHash[model_name]; } if (model==0){ report(ERROR,"EvtGen") << "Did not find the right model:" <clone(); } void EvtModel::Register(EvtDecayBase* prototype){ std::string modelName; prototype->getName(modelName); _modelNameHash[modelName]=prototype; std::string commandName=prototype->commandName(); if (commandName!=""){ //report(DEBUG,"EvtGen") << "Adding command:"<command(cnfgstr); }