BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtModel.hh
Go to the documentation of this file.
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 "EvtDecayBase.hh"
25#include "EvtStringHash.hh"
26#include <map>
27// #include <fstream.h>
28
29// Class to read in and handle the decays available
30// to EvtGen for each particle, and the model to be
31// used for each one.
32
33class EvtModel {
34
35public:
36 static EvtModel& instance();
37
38 void Register( EvtDecayBase* prototype );
39
40 int isModel( std::string name );
41
42 EvtDecayBase* getFcn( std::string model_name );
43
44 int isCommand( std::string cmd );
45 void storeCommand( std::string cmd, std::string cnfgstr );
46
47private:
48 EvtModel();
49
50 static EvtModel* _instance;
51
52 std::map<std::string, EvtDecayBase*> _modelNameHash;
53 std::map<std::string, EvtDecayBase*> _commandNameHash;
54};
55
56inline EvtModel& EvtModel::instance() {
57 if ( _instance == 0 ) _instance = new EvtModel;
58 return *_instance;
59}
60
61#endif
EvtDecayBase * getFcn(std::string model_name)
Definition EvtModel.cc:44
void storeCommand(std::string cmd, std::string cnfgstr)
Definition EvtModel.cc:89
void Register(EvtDecayBase *prototype)
Definition EvtModel.cc:59
int isModel(std::string name)
Definition EvtModel.cc:77
static EvtModel & instance()
Definition EvtModel.hh:56
int isCommand(std::string cmd)
Definition EvtModel.cc:83