ATLAS Offline Software
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 */
8 namespace 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 
Pythia8_UserHooks::userParams
std::map< std::string, double > & userParams()
Definition: UserHooksFactory.cxx:50
Pythia8_UserHooks::userModes
std::map< std::string, int > & userModes()
Definition: UserHooksFactory.cxx:61
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
skel.it
it
Definition: skel.GENtoEVGEN.py:423
Pythia8_UserHooks::userFlags
std::map< std::string, bool > & userFlags()
Definition: UserHooksFactory.cxx:55
Pythia8_UserHooks
Some common functions for determining pTs and navigating event records for the PoWHEG + Pythia user h...
Definition: UserHooksFactory.h:30
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
UserHooksFactory.h
Pythia8_UserHooks::UserHooksFactory::s_creators
static std::map< std::string, const ICreator * > & s_creators()
static function to instantiate map of string name Vs. creator object on first use
Definition: UserHooksFactory.cxx:19
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Pythia8_UserHooks::userWords
std::map< std::string, std::string > & userWords()
Definition: UserHooksFactory.cxx:66
Pythia8_UserHooks::UserHooksFactory::userSettings
static std::map< std::string, T > & userSettings()
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
checkFileSG.words
words
Definition: checkFileSG.py:76
Pythia8_UserHooks::UserHooksFactory::create
static UserHooks * create(const std::string &hookName)
Definition: UserHooksFactory.cxx:10