00001 //-------------------------------------------------------------------------- 00002 // 00003 // Environment: 00004 // This software is part of the EvtGen package developed jointly 00005 // for the BaBar and CLEO collaborations. If you use all or part 00006 // of it, please give an appropriate acknowledgement. 00007 // 00008 // Copyright Information: See EvtGen/COPYRIGHT 00009 // Copyright (C) 1998 Caltech, UCSB 00010 // 00011 // Module: EvtGen/EvtModel.hh 00012 // 00013 // Description: 00014 // 00015 // Modification history: 00016 // 00017 // DJL/RYD August 8, 1998 Module created 00018 // 00019 //------------------------------------------------------------------------ 00020 00021 #ifndef EVTMODEL_HH 00022 #define EVTMODEL_HH 00023 00024 #include "EvtGenBase/EvtDecayBase.hh" 00025 #include "EvtGenBase/EvtStringHash.hh" 00026 #include <map> 00027 //#include <fstream.h> 00028 00029 00030 //Class to read in and handle the decays available 00031 //to EvtGen for each particle, and the model to be 00032 //used for each one. 00033 00034 class EvtModel{ 00035 00036 public: 00037 00038 static EvtModel& instance(); 00039 00040 void Register(EvtDecayBase* prototype); 00041 00042 int isModel(std::string name); 00043 00044 EvtDecayBase* getFcn(std::string model_name); 00045 00046 int isCommand(std::string cmd); 00047 void storeCommand(std::string cmd,std::string cnfgstr); 00048 00049 00050 private: 00051 00052 EvtModel(); 00053 00054 static EvtModel* _instance; 00055 00056 std::map<std::string,EvtDecayBase*> _modelNameHash; 00057 std::map<std::string,EvtDecayBase*> _commandNameHash; 00058 00059 00060 }; 00061 00062 00063 inline EvtModel& EvtModel::instance() { 00064 if ( _instance == 0 ) _instance=new EvtModel; 00065 return *_instance; 00066 } 00067 00068 00069 #endif 00070 00071 00072