VGM Version 5.3
Loading...
Searching...
No Matches
MaterialFactory.h
Go to the documentation of this file.
1// $Id$
2
3// -----------------------------------------------------------------------
4// The RootGM package of the Virtual Geometry Model
5// Copyright (C) 2007, Ivana Hrivnacova
6// All rights reserved.
7//
8// For the licensing terms see vgm/LICENSE.
9// Contact: ivana@ipno.in2p3.fr
10// -----------------------------------------------------------------------
11
13//
19
20#ifndef ROOT_GM_MATERIAL_FACTORY_H
21#define ROOT_GM_MATERIAL_FACTORY_H
22
24
25class TGeoElement;
26class TGeoMaterial;
27class TGeoMedium;
28
29namespace VGM {
30class IMaterial;
31class IIsotope;
32} // namespace VGM
33
34namespace RootGM {
35
37{
38 public:
40 virtual ~MaterialFactory();
41
42 //
43 // methods
44 //
46 const std::string& name, int z, int n, double a = 0.);
47
49 const std::string& name, const std::string& symbol, double z, double a);
50
51 virtual VGM::IElement* CreateElement(const std::string& name,
52 const std::string& symbol, const VGM::IsotopeVector& isotopes,
53 const VGM::RelAbundanceVector& relAbundances);
54
55 virtual VGM::IElement* CreateElement(int z, bool isotopes);
56
57 virtual VGM::IMaterial* CreateMaterial(const std::string& name,
58 double density, VGM::IElement* element, double radlen, double intlen);
59
60 virtual VGM::IMaterial* CreateMaterial(const std::string& name,
61 double density, VGM::IElement* element, double radlen, double intlen,
62 VGM::MaterialState state, double temperature, double pressure);
63
64 virtual VGM::IMaterial* CreateMaterial(const std::string& name,
65 double density, const VGM::ElementVector& elements,
66 const VGM::MassFractionVector& fractions);
67
68 virtual VGM::IMaterial* CreateMaterial(const std::string& name,
69 double density, const VGM::ElementVector& elements,
70 const VGM::MassFractionVector& fractions, VGM::MaterialState state,
71 double temperature, double pressure);
72
73 virtual VGM::IMaterial* CreateMaterial(const std::string& name,
74 double density, const VGM::ElementVector& elements,
75 const VGM::AtomCountVector& atomCounts);
76
77 virtual VGM::IMaterial* CreateMaterial(const std::string& name,
78 double density, const VGM::ElementVector& elements,
79 const VGM::AtomCountVector& atomCounts, VGM::MaterialState state,
80 double temperature, double pressure);
81
82 virtual VGM::IMedium* CreateMedium(const std::string& name, int mediumId,
83 VGM::IMaterial* material, int nofParameters, double* parameters);
84 // import/export
85 //
86 virtual bool Import();
87
88 protected:
90
91 private:
92 // methods
93 VGM::IIsotope* GetIsotope(double z, double n) const;
94 VGM::IElement* GetElement(double z, double a) const;
95 VGM::IElement* GetElement(const std::string& name) const;
96
97 bool CompareIsotopes(const TGeoElement* tgeoElement,
98 const VGM::IsotopeVector& isotopes,
99 const VGM::RelAbundanceVector& relAbundances) const;
100
101 void ImportIsotopes(TGeoElement* element);
102 void ImportElements(
103 TGeoMaterial* material, std::vector<VGM::IElement*>& elements);
104 void ImportMaterial(TGeoMaterial* material);
105 void ImportMedium(TGeoMedium* medium);
106
107 // data members
108 static const double fgkTolerance;
109};
110
111} // namespace RootGM
112
113#endif // ROOT_GM_MATERIAL_FACTORY_H
The abstract base class to material factory.
VGM material factory for Root.
virtual VGM::IMaterial * CreateMaterial(const std::string &name, double density, VGM::IElement *element, double radlen, double intlen)
Create a material.
virtual VGM::IElement * CreateElement(const std::string &name, const std::string &symbol, double z, double a)
Create a chemical element.
virtual bool Import()
Import native materials.
virtual VGM::IIsotope * CreateIsotope(const std::string &name, int z, int n, double a=0.)
Create a chemical isotope.
virtual VGM::IMedium * CreateMedium(const std::string &name, int mediumId, VGM::IMaterial *material, int nofParameters, double *parameters)
Create a tracking medium.
The VGM interface to elements.
Definition IElement.h:34
The VGM interface to elements.
Definition IIsotope.h:28
The VGM interface to materials.
Definition IMaterial.h:44
The VGM interface to tracking medium.
Definition IMedium.h:31
VGM implementation for Root.
Definition axis.h:28
VGM interfaces.
Definition VMedium.h:28
std::vector< double > RelAbundanceVector
Definition IElement.h:31
std::vector< int > AtomCountVector
Definition IMaterial.h:33
std::vector< double > MassFractionVector
Definition IMaterial.h:32
std::vector< IElement * > ElementVector
Definition IMaterial.h:31
std::vector< IIsotope * > IsotopeVector
Definition IElement.h:30
MaterialState
Definition IMaterial.h:36