StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
EvtModel.hh
1 //--------------------------------------------------------------------------
2 //
3 // Environment:
4 // This software is part of the EvtGen package developed jointly
5 // for the BaBar and CLEO collaborations. If you use all or part
6 // of it, please give an appropriate acknowledgement.
7 //
8 // Copyright Information: See EvtGen/COPYRIGHT
9 // Copyright (C) 1998 Caltech, UCSB
10 //
11 // Module: EvtGen/EvtModel.hh
12 //
13 // Description:
14 //
15 // Modification history:
16 //
17 // DJL/RYD August 8, 1998 Module created
18 //
19 //------------------------------------------------------------------------
20 
21 #ifndef EVTMODEL_HH
22 #define EVTMODEL_HH
23 
24 #include "EvtGenBase/EvtDecayBase.hh"
25 #include "EvtGenBase/EvtStringHash.hh"
26 #include <map>
27 //#include <fstream.h>
28 
29 
30 //Class to read in and handle the decays available
31 //to EvtGen for each particle, and the model to be
32 //used for each one.
33 
34 class EvtModel{
35 
36 public:
37 
38  static EvtModel& instance();
39 
40  void registerModel(EvtDecayBase* prototype);
41 
42  int isModel(std::string name);
43 
44  EvtDecayBase* getFcn(std::string model_name);
45 
46  int isCommand(std::string cmd);
47  void storeCommand(std::string cmd,std::string cnfgstr);
48 
49 
50 private:
51 
52  EvtModel();
53 
54  static EvtModel* _instance;
55 
56  std::map<std::string,EvtDecayBase*> _modelNameHash;
57  std::map<std::string,EvtDecayBase*> _commandNameHash;
58 
59 
60 };
61 
62 
63 inline EvtModel& EvtModel::instance() {
64  if ( _instance == 0 ) _instance=new EvtModel;
65  return *_instance;
66 }
67 
68 
69 #endif
70 
71 
72