Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef __MATERIALMANAGER__
#define __MATERIALMANAGER__
/*****************************************************************************
* Copyright (C) 2009-2014 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Adrien MATTA contact address: matta@ipno.in2p3.fr *
* *
* Creation Date : October 2014 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This singleton class contain a librairy of material available for *
* the geometry. Instantiate the needed material on demand, and generate the *
* associate DEDX table. *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
*****************************************************************************/
// Geant4
#include"G4Material.hh"
#include"G4Element.hh"
#include"G4ParticleDefinition.hh"
// STL
#include<map>
using namespace std;
class MaterialManager{
public:
// Designed to be a singleton (i.e. only one instance
// can exist). A member function called Instance is defined, which allows
// the user to get a pointer to the existing instance or to create it if
// it does not yet exist:
// (see the constructor for an explanation of the arguments)
static MaterialManager* getInstance();
// The analysis class instance can be deleted by calling the Destroy
// method (NOTE: The class destructor is protected, and can thus not be
// called directly):
static void Destroy();
protected:
// Constructor and Destructor are not public
MaterialManager();
~MaterialManager();
private:
// The static instance of MaterialManager:
static MaterialManager* instance;
// Map of element and material:
map<string,G4Element*> m_Element;
map<string,G4Material*> m_Material;
public:
G4Material* GetMaterialFromLibrary(string Name);
G4Element* GetElementFromLibrary(string Name);
void WriteDEDXTable(G4ParticleDefinition* Particle ,G4double Emin,G4double Emax);
};
#endif