ATLAS Offline Software
Loading...
Searching...
No Matches
UserResonanceFactory.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
8#include <vector>
9#include <stdexcept>
10
11namespace Pythia8_UserResonance{
12
13 std::shared_ptr<ResonanceWidths> UserResonanceFactory::create(const std::string &name, int pdgid){
14
15 std::map<std::string, const ICreator*>::const_iterator it = s_creators().find(name);
16 if(it == s_creators().end()){
17 //eek!
18 throw std::runtime_error("Pythia 8 UserResonanceFactory: cannot create user resonance " + name);
19 }
20 return it->second->create(pdgid);
21 }
22
24 std::map<std::string, const UserResonanceFactory::ICreator*> &UserResonanceFactory::s_creators(){
25 static std::map<std::string, const UserResonanceFactory::ICreator*> creators;
26 return creators;
27 }
28
29}
static std::shared_ptr< ResonanceWidths > create(const std::string &name, int pdgid)
Call this with the name of the ResonanceWidth and PDG ID to which it will be applied e....
static std::map< std::string, const ICreator * > & s_creators()
static function to instantiate map of string name Vs. creator object on first use