GENIEGenerator
Loading...
Searching...
No Matches
genie::Pythia8Singleton Class Reference

Manage a single instance of pythia8. More...

#include <Pythia8Singleton.h>

Collaboration diagram for genie::Pythia8Singleton:
[legend]

Classes

struct  Cleaner
 proper de-allocation of the singleton object More...

Static Public Member Functions

static Pythia8SingletonInstance (void)

Private Member Functions

 Pythia8Singleton ()
 singleton class: constructors are private
 Pythia8Singleton (const Pythia8Singleton &cache)
virtual ~Pythia8Singleton ()

Static Private Attributes

static Pythia8SingletonfInstance = 0
 print

Friends

struct Cleaner

Detailed Description

Manage a single instance of pythia8.

Author
Robert Hatcher <rhatcher \at fnal.gov> Fermilab
Created:\n May 15, 2024
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 31 of file Pythia8Singleton.h.

Constructor & Destructor Documentation

◆ Pythia8Singleton() [1/2]

genie::Pythia8Singleton::Pythia8Singleton ( )
private

singleton class: constructors are private

Definition at line 26 of file Pythia8Singleton.cxx.

27{
28 fInstance = 0;
29#ifdef __GENIE_PYTHIA8_ENABLED__
30 fPythia = 0;
31#endif
32
33}
static Pythia8Singleton * fInstance
print

References fInstance.

Referenced by Instance(), and Pythia8Singleton().

◆ Pythia8Singleton() [2/2]

genie::Pythia8Singleton::Pythia8Singleton ( const Pythia8Singleton & cache)
private

References Pythia8Singleton().

◆ ~Pythia8Singleton()

genie::Pythia8Singleton::~Pythia8Singleton ( )
privatevirtual

Definition at line 35 of file Pythia8Singleton.cxx.

36{
37#ifdef __GENIE_PYTHIA8_ENABLED__
38 if (fPythia) {
39 delete fPythia;
40 }
41#endif
42 fInstance = 0;
43}

References fInstance.

Member Function Documentation

◆ Instance()

Pythia8Singleton * genie::Pythia8Singleton::Instance ( void )
static

Definition at line 45 of file Pythia8Singleton.cxx.

46{
47 if (fInstance == 0) {
48 static Pythia8Singleton::Cleaner cleaner;
49 cleaner.DummyMethodAndSilentCompiler();
50
52
53#ifdef __GENIE_PYTHIA8_ENABLED__
54 // actually create the one to be held
55 fInstance->fPythia = new Pythia8::Pythia();
56#endif
57 }
58 return fInstance;
59}
Pythia8Singleton()
singleton class: constructors are private

References genie::Pythia8Singleton::Cleaner::DummyMethodAndSilentCompiler(), fInstance, and Pythia8Singleton().

Referenced by genie::AGCharmPythia8Hadro2023::CopyOriginalDecayFlags(), genie::Pythia8Hadro2019::CopyOriginalDecayFlags(), genie::Pythia8Decayer2023::Decay(), genie::Pythia8Hadro2019::Hadronize(), genie::AGCharmPythia8Hadro2023::HadronizeRemnant(), genie::Pythia8Decayer2023::InhibitDecay(), genie::AGCharmPythia8Hadro2023::Initialize(), genie::LeptoHadPythia8::Initialize(), genie::PhotonCOHWdecPythia8::Initialize(), genie::Pythia8Decayer2023::Initialize(), genie::Pythia8Hadro2019::Initialize(), genie::Pythia8Hadro2019::LoadConfig(), genie::AGCharmPythia8Hadro2023::RestoreOriginalDecayFlags(), genie::Pythia8Hadro2019::RestoreOriginalDecayFlags(), genie::AGCharmPythia8Hadro2023::SetDesiredDecayFlags(), genie::Pythia8Hadro2019::SetDesiredDecayFlags(), and genie::Pythia8Decayer2023::UnInhibitDecay().

◆ Cleaner

friend struct Cleaner
friend

Definition at line 69 of file Pythia8Singleton.h.

Member Data Documentation

◆ fInstance

Pythia8Singleton * genie::Pythia8Singleton::fInstance = 0
staticprivate

print

singleton instance

Definition at line 48 of file Pythia8Singleton.h.

Referenced by Instance(), Pythia8Singleton(), genie::Pythia8Singleton::Cleaner::~Cleaner(), and ~Pythia8Singleton().


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