ATLAS Offline Software
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 
11 namespace 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 }
skel.it
it
Definition: skel.GENtoEVGEN.py:396
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Pythia8_UserResonance::UserResonanceFactory::create
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....
Definition: UserResonanceFactory.cxx:13
UserResonanceFactory.h
Pythia8_UserResonance
Definition: UserResonanceFactory.h:14
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Pythia8_UserResonance::UserResonanceFactory::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: UserResonanceFactory.cxx:24