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 <costas.andreopoulos \at stfc.ac.uk>
9  University of Liverpool & STFC Rutherford Appleton Lab
10 
11  Changes required to implement the GENIE Boosted Dark Matter module
12  were installed by Josh Berger (Univ. of Wisconsin)
13 
14 \created May 06, 2004
15 
16 \cpright Copyright (c) 2003-2019, The GENIE Collaboration
17  For the full text of the license visit http://copyright.genie-mc.org
18  or see $GENIE/LICENSE
19 */
20 //____________________________________________________________________________
21 
22 #ifndef _PDG_LIBRARY_H_
23 #define _PDG_LIBRARY_H_
24 
25 #include <TDatabasePDG.h>
26 #include <TParticlePDG.h>
27 
28 namespace genie {
29 
30 class PDGLibrary
31 {
32 public:
33 
34  static PDGLibrary * Instance(void);
35 
36  TDatabasePDG * DBase (void);
37  TParticlePDG * Find (int pdgc);
38  void ReloadDBase (void);
39 
40  // Add dark matter and mediator with parameters from Boosted Dark Matter app configuration
41  // Ideally, this code should be in the Dark Matter app, not here.
42  // But presently there is no way to edit the PDGLibrary after it has been created.
43  void AddDarkMatter (double mass, double med_ratio);
44 
45 private:
46 
47  PDGLibrary();
48  PDGLibrary(const PDGLibrary & config_pool);
49  virtual ~PDGLibrary();
50 
51  bool LoadDBase(void);
52 
54  TDatabasePDG * fDatabasePDG;
55 
56  struct Cleaner {
59  if (PDGLibrary::fInstance !=0) {
60  delete PDGLibrary::fInstance;
62  }
63  }
64  };
65  friend struct Cleaner;
66 };
67 
68 } // genie namespace
69 
70 #endif // _PDG_LIBRARY_H_
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
void AddDarkMatter(double mass, double med_ratio)
Definition: PDGLibrary.cxx:113
TDatabasePDG * DBase(void)
Definition: PDGLibrary.cxx:56
TDatabasePDG * fDatabasePDG
Definition: PDGLibrary.h:54
static PDGLibrary * fInstance
Definition: PDGLibrary.h:53
bool LoadDBase(void)
Definition: PDGLibrary.cxx:69
virtual ~PDGLibrary()
Definition: PDGLibrary.cxx:38
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:43
Singleton class to load & serve a TDatabasePDG.
Definition: PDGLibrary.h:30
TParticlePDG * Find(int pdgc)
Definition: PDGLibrary.cxx:61
void ReloadDBase(void)
Definition: PDGLibrary.cxx:137