cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
MadGraphProcessFactory.cpp
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2023-2024 Laurent Forthomme
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
#include "
CepGen/Core/Exception.h
"
20
#include "
CepGen/Modules/ModuleFactory.h
"
21
#include "
CepGenAddOns/MadGraphWrapper/MadGraphProcess.h
"
22
23
namespace
cepgen
{
24
template
class
ModuleFactory<MadGraphProcess>;
25
26
template
<>
27
ModuleFactory<MadGraphProcess>::ModuleFactory
(
const
std::string& desc) : description_(desc) {}
28
29
template
<>
30
std::vector<std::string>
ModuleFactory<MadGraphProcess>::modules
()
const
{
31
std::vector<std::string> out;
32
std::transform(map_.begin(), map_.end(), std::back_inserter(out), [](
const
auto
& val) { return val.first; });
33
std::sort(out.begin(), out.end());
34
return
out;
35
}
36
37
template
<>
38
std::unique_ptr<MadGraphProcess>
ModuleFactory<MadGraphProcess>::build
(
const
std::string& mod_name,
39
const
ParametersList
& params)
const
{
40
if
(map_.count(mod_name) == 0)
41
throw
CG_FATAL
(
"ModuleFactory"
) <<
"Failed to build a mg5_aMC process with name '"
<< mod_name <<
"'.\n"
42
<<
"Registered modules: "
<< modules() <<
"."
;
43
return
map_.at(mod_name)(params_map_.at(mod_name).validate(params));
44
}
45
}
// namespace cepgen
Exception.h
CG_FATAL
#define CG_FATAL(mod)
Definition
Exception.h:61
MadGraphProcess.h
ModuleFactory.h
cepgen::ModuleFactory::build
std::unique_ptr< T > build(const ParametersList &) const
Build one instance of a named module.
Definition
ModuleFactory.cpp:29
cepgen::ModuleFactory::ModuleFactory
ModuleFactory(const ModuleFactory &)=delete
Disabled copy constructor.
cepgen::ModuleFactory::modules
std::vector< std::string > modules() const
List of modules registred in the database.
Definition
ModuleFactory.cpp:123
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
CepGenAddOns
MadGraphWrapper
MadGraphProcessFactory.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7