Belle II Software development
EvtGenModelRegister.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <generators/evtgen/EvtGenModelRegister.h>
10
11#include <memory>
12
13using namespace std;
14
15namespace Belle2 {
22 {
23 static unique_ptr<EvtGenModelRegister> instance(new EvtGenModelRegister());
24 return *instance;
25 }
26
27 list<EvtDecayBase*> EvtGenModelRegister::getModels()
28 {
29 list<EvtDecayBase*> modelList;
30 for (auto factory : getInstance().m_models) {
31 modelList.push_back(factory());
32 }
33 return modelList;
34 }
36}
Class to keep a register of all Belle2 EvtDecayBases.
std::vector< ModelFactory * > m_models
List of all registered EvtGenModels.
EvtGenModelRegister()
Singleton: private constructor.
static EvtGenModelRegister & getInstance()
Return reference to the instance.
static std::list< EvtDecayBase * > getModels()
Return a list of models.
Abstract base class for different kinds of events.
STL namespace.