ATLAS Offline Software
Loading...
Searching...
No Matches
UserProcessFactory.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <stdexcept>
8
9namespace Pythia8_UserProcess{
10
11 std::shared_ptr<Sigma2Process> UserProcessFactory::create(const std::string &name){
12 std::map<std::string, const ICreator*>::const_iterator it = s_creators().find(name);
13 if(it == s_creators().end()){
14 //eek!
15 throw std::runtime_error("Pythia 8 UserProcessFactory: cannot create user process " + name);
16 }
17
18 return it->second->create();
19 }
20
22 std::map<std::string, const UserProcessFactory::ICreator*> &UserProcessFactory::s_creators(){
23 static std::map<std::string, const UserProcessFactory::ICreator*> creators;
24 return creators;
25 }
26
27}
28
static std::map< std::string, const ICreator * > & s_creators()
static function to instantiate map of string name Vs. creator object on first use
static std::shared_ptr< Sigma2Process > create(const std::string &procName)