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 <constantinos.andreopoulos \at cern.ch>
9  University of Liverpool & STFC Rutherford Appleton Laboratory
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 \created May 06, 2004
18 
19 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
20  For the full text of the license visit http://copyright.genie-mc.org
21 */
22 //____________________________________________________________________________
23 
24 #ifndef _PDG_LIBRARY_H_
25 #define _PDG_LIBRARY_H_
26 
27 #include <TDatabasePDG.h>
28 #include <TParticlePDG.h>
29 
30 namespace genie {
31 
33 {
34 public:
35 
36  static PDGLibrary * Instance(void);
37 
38  TDatabasePDG * DBase (void);
39  TParticlePDG * Find (int pdgc, bool must_exist = true );
40  void ReloadDBase (void);
41 
42  // Add dark matter and mediator with parameters from Boosted Dark Matter app configuration
43  // Ideally, this code should be in the Dark Matter app, not here.
44  // But presently there is no way to edit the PDGLibrary after it has been created.
45  void AddDarkMatter (double mass, double med_ratio);
46  // Similarly for the NHL app
47  void AddNHL (double mass);
48 
49 private:
50 
51  PDGLibrary();
52  PDGLibrary(const PDGLibrary & config_pool);
53  virtual ~PDGLibrary();
54 
55  bool LoadDBase(void);
56  bool AddDarkSector ();
57 
59  TDatabasePDG * fDatabasePDG;
60 
61  struct Cleaner {
64  if (PDGLibrary::fInstance !=0) {
65  delete PDGLibrary::fInstance;
67  }
68  }
69  };
70  friend struct Cleaner;
71 };
72 
73 } // genie namespace
74 
75 #endif // _PDG_LIBRARY_H_
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
void AddDarkMatter(double mass, double med_ratio)
Definition: PDGLibrary.cxx:142
TDatabasePDG * DBase(void)
Definition: PDGLibrary.cxx:70
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:59
static PDGLibrary * fInstance
Definition: PDGLibrary.h:58
void AddNHL(double mass)
Definition: PDGLibrary.cxx:165
bool LoadDBase(void)
Definition: PDGLibrary.cxx:89
virtual ~PDGLibrary()
Definition: PDGLibrary.cxx:52
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
Singleton class to load & serve a TDatabasePDG.
Definition: PDGLibrary.h:32
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
void ReloadDBase(void)
Definition: PDGLibrary.cxx:210