ATLAS Offline Software
Loading...
Searching...
No Matches
UserHooksFactory.cxx
Go to the documentation of this file.
2
3#include <stdexcept>
4
5/*
6 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
7*/
8namespace Pythia8_UserHooks{
9
10 UserHooks *UserHooksFactory::create(const std::string &name){
11 std::map<std::string, const ICreator*>::const_iterator it = s_creators().find(name);
12 if(it == s_creators().end()){
13 throw std::runtime_error("Pythia 8 UserHooksFactory: cannot create user hook " + name);
14 }
15 return it->second->create();
16 }
17
19 std::map<std::string, const UserHooksFactory::ICreator*> &UserHooksFactory::s_creators(){
20 static std::map<std::string, const UserHooksFactory::ICreator*> creators;
21 return creators;
22 }
23
24 template<>
25 std::map<std::string, double> &UserHooksFactory::userSettings(){
26 static std::map<std::string, double> settings;
27 return settings;
28 }
29
30 template<>
31 std::map<std::string, int> &UserHooksFactory::userSettings(){
32 static std::map<std::string, int> settings;
33 return settings;
34 }
35
36 template<>
37 std::map<std::string, bool> &UserHooksFactory::userSettings(){
38 static std::map<std::string, bool> settings;
39 return settings;
40 }
41
42
43 template<>
44 std::map<std::string, std::string> &UserHooksFactory::userSettings(){
45 static std::map<std::string, std::string> settings;
46 return settings;
47 }
48
49
50 std::map<std::string, double> &userParams(){
51 static std::map<std::string, double> params;
52 return params;
53 }
54
55 std::map<std::string, bool> &userFlags(){
56 static std::map<std::string, bool> flags;
57 return flags;
58 }
59
60
61 std::map<std::string, int> &userModes(){
62 static std::map<std::string, int> modes;
63 return modes;
64 }
65
66 std::map<std::string, std::string> &userWords(){
67 static std::map<std::string, std::string> words;
68 return words;
69 }
70
71}
72
static std::map< std::string, T > & userSettings()
static UserHooks * create(const std::string &hookName)
static std::map< std::string, const ICreator * > & s_creators()
static function to instantiate map of string name Vs. creator object on first use
Some common functions for determining pTs and navigating event records for the PoWHEG + Pythia user h...
std::map< std::string, bool > & userFlags()
std::map< std::string, std::string > & userWords()
std::map< std::string, int > & userModes()
std::map< std::string, double > & userParams()