GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PDGLibrary.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::PDGLibrary
5 
6 \brief Singleton class to load & serve a TDatabasePDG.
7 
8 \author Costas Andreopoulos <c.andreopoulos \at cern.ch>
9  University of Liverpool
10 
11  Changes required to implement the GENIE Boosted Dark Matter module
12  were installed by Josh Berger (Univ. of Wisconsin)
13 
14  Changes required to implement the GENIE Dark Neutrino module
15  were installed by Iker de Icaza (Univ. of Sussex)
16 
17  Changes required to implement the GENIE BeamHNL module
18  were installed by John Plows (Univ. of Oxford)
19 
20 \created May 06, 2004
21 
22 \cpright Copyright (c) 2003-2024, The GENIE Collaboration
23  For the full text of the license visit http://copyright.genie-mc.org
24 */
25 //____________________________________________________________________________
26 
27 #ifndef _PDG_LIBRARY_H_
28 #define _PDG_LIBRARY_H_
29 
30 #include <TDatabasePDG.h>
31 #include <TParticlePDG.h>
32 
33 namespace genie {
34 
36 {
37 public:
38 
39  static PDGLibrary * Instance(void);
40 
41  TDatabasePDG * DBase (void);
42  TParticlePDG * Find (int pdgc, bool must_exist = true );
43  void ReloadDBase (void);
44 
45  // Add dark matter and mediator with parameters from Boosted Dark Matter app configuration
46  // Ideally, this code should be in the Dark Matter app, not here.
47  // But presently there is no way to edit the PDGLibrary after it has been created.
48  void AddDarkMatter (double mass, double med_ratio);
49 
50 private:
51 
52  PDGLibrary();
53  PDGLibrary(const PDGLibrary & config_pool);
54  virtual ~PDGLibrary();
55 
56  bool LoadDBase(void);
57  bool AddDarkSector ();
58  bool AddHNL (void);
59 
61  TDatabasePDG * fDatabasePDG;
62 
63  struct Cleaner {
66  if (PDGLibrary::fInstance !=0) {
67  delete PDGLibrary::fInstance;
69  }
70  }
71  };
72  friend struct Cleaner;
73 };
74 
75 } // genie namespace
76 
77 #endif // _PDG_LIBRARY_H_
void AddDarkMatter(double mass, double med_ratio)
Definition: PDGLibrary.cxx:153
bool AddHNL(void)
Definition: PDGLibrary.cxx:176
TDatabasePDG * DBase(void)
Definition: PDGLibrary.cxx:81
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:61
static PDGLibrary * fInstance
Definition: PDGLibrary.h:60
bool LoadDBase(void)
Definition: PDGLibrary.cxx:100
virtual ~PDGLibrary()
Definition: PDGLibrary.cxx:63
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:68
Singleton class to load &amp; serve a TDatabasePDG.
Definition: PDGLibrary.h:35
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:86
void ReloadDBase(void)
Definition: PDGLibrary.cxx:224