ATLAS Offline Software
Loading...
Searching...
No Matches
Pythia8_UserResonance::UserResonanceFactory Class Reference

#include <UserResonanceFactory.h>

Collaboration diagram for Pythia8_UserResonance::UserResonanceFactory:

Classes

class  Creator
class  ICreator

Static Public Member Functions

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.g.

Private Member Functions

 UserResonanceFactory ()

Static Private Member Functions

static std::map< std::string, const ICreator * > & s_creators ()
 static function to instantiate map of string name Vs. creator object on first use

Detailed Description

Definition at line 18 of file UserResonanceFactory.h.

Constructor & Destructor Documentation

◆ UserResonanceFactory()

Pythia8_UserResonance::UserResonanceFactory::UserResonanceFactory ( )
inlineprivate

Definition at line 31 of file UserResonanceFactory.h.

31{};

Member Function Documentation

◆ create()

std::shared_ptr< ResonanceWidths > Pythia8_UserResonance::UserResonanceFactory::create ( const std::string & name,
int pdgid )
static

Call this with the name of the ResonanceWidth and PDG ID to which it will be applied e.g.

create("MyResonance", 23) will return a MyResonance instance that will be applied to the Z

Definition at line 13 of file UserResonanceFactory.cxx.

13 {
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 }
static std::map< std::string, const ICreator * > & s_creators()
static function to instantiate map of string name Vs. creator object on first use

◆ s_creators()

std::map< std::string, const UserResonanceFactory::ICreator * > & Pythia8_UserResonance::UserResonanceFactory::s_creators ( )
staticprivate

static function to instantiate map of string name Vs. creator object on first use

Definition at line 24 of file UserResonanceFactory.cxx.

24 {
25 static std::map<std::string, const UserResonanceFactory::ICreator*> creators;
26 return creators;
27 }

The documentation for this class was generated from the following files: