Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab has been updated. More info
here
and
there
.
Show more breadcrumbs
np
nptool
Commits
faeeb796
Commit
faeeb796
authored
2 years ago
by
Adrien Matta
Browse files
Options
Downloads
Patches
Plain Diff
* adding mettalic lithium to material manager
parent
71deea02
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NPSimulation/Core/MaterialManager.cc
+45
-2
45 additions, 2 deletions
NPSimulation/Core/MaterialManager.cc
NPSimulation/Core/MaterialManager.hh
+26
-25
26 additions, 25 deletions
NPSimulation/Core/MaterialManager.hh
with
71 additions
and
27 deletions
NPSimulation/Core/MaterialManager.cc
+
45
−
2
View file @
faeeb796
...
...
@@ -59,6 +59,8 @@ MaterialManager::MaterialManager() {
m_D
=
NULL
;
m_T
=
NULL
;
m_He3
=
NULL
;
m_Li6
=
NULL
;
m_Li7
=
NULL
;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...
...
@@ -78,6 +80,8 @@ void MaterialManager::ClearMaterialLibrary() {
m_D
=
NULL
;
m_T
=
NULL
;
m_He3
=
NULL
;
m_Li6
=
NULL
;
m_Li7
=
NULL
;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...
...
@@ -216,7 +220,30 @@ G4Material* MaterialManager::GetMaterialFromLibrary(string Name, double density)
m_Material
[
Name
]
=
material
;
return
material
;
}
else
if
(
Name
==
"Li"
)
{
if
(
!
density
)
density
=
0.534
*
g
/
cm3
;
G4Material
*
material
=
new
G4Material
(
"NPS_"
+
Name
,
density
,
1
);
material
->
AddElement
(
GetElementFromLibrary
(
"Li"
),
1
);
m_Material
[
Name
]
=
material
;
return
material
;
}
else
if
(
Name
==
"6Li"
)
{
if
(
!
density
)
density
=
0.534
*
g
/
cm3
;
G4Material
*
material
=
new
G4Material
(
"NPS_"
+
Name
,
density
,
1
);
material
->
AddElement
(
GetElementFromLibrary
(
"Li6"
),
1
);
m_Material
[
Name
]
=
material
;
return
material
;
}
else
if
(
Name
==
"7Li"
)
{
if
(
!
density
)
density
=
0.534
*
g
/
cm3
;
G4Material
*
material
=
new
G4Material
(
"NPS_"
+
Name
,
density
,
1
);
material
->
AddElement
(
GetElementFromLibrary
(
"Li7"
),
1
);
m_Material
[
Name
]
=
material
;
return
material
;
}
// Cooling
else
if
(
Name
==
"N2_liquid"
)
{
if
(
!
density
)
...
...
@@ -527,7 +554,7 @@ G4Material* MaterialManager::GetMaterialFromLibrary(string Name, double density)
return
material
;
}
else
if
(
Name
==
"Ge"
||
Name
==
"Germanium"
)
{
else
if
(
Name
==
"Ge"
||
Name
==
"Germanium"
)
{
if
(
!
density
)
density
=
5.323
*
g
/
cm3
;
G4Material
*
material
=
new
G4Material
(
"NPS_"
+
Name
,
density
,
1
);
...
...
@@ -1163,6 +1190,22 @@ G4Element* MaterialManager::GetElementFromLibrary(string Name) {
}
return
m_He3
;
}
else
if
(
Name
==
"Li6"
||
Name
==
"6Li"
)
{
if
(
!
m_Li6
)
{
m_Li6
=
new
G4Element
(
Name
.
c_str
(),
Name
.
c_str
(),
1
);
G4Isotope
*
isotope
=
new
G4Isotope
(
Name
.
c_str
(),
3
,
3
,
6.01512289
*
g
/
mole
);
m_Li6
->
AddIsotope
(
isotope
,
1
);
}
return
m_Li6
;
}
else
if
(
Name
==
"Li7"
||
Name
==
"7Li"
)
{
if
(
!
m_Li7
)
{
m_Li7
=
new
G4Element
(
Name
.
c_str
(),
Name
.
c_str
(),
1
);
G4Isotope
*
isotope
=
new
G4Isotope
(
Name
.
c_str
(),
3
,
4
,
7.01600343
*
g
/
mole
);
m_Li7
->
AddIsotope
(
isotope
,
1
);
}
return
m_Li7
;
}
G4NistManager
*
man
=
G4NistManager
::
Instance
();
return
man
->
FindOrBuildElement
(
Name
.
c_str
());
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/Core/MaterialManager.hh
+
26
−
25
View file @
faeeb796
...
...
@@ -24,18 +24,18 @@
*****************************************************************************/
// Geant4
#include
"G4Material.hh"
#include
"G4Element.hh"
#include
"G4ParticleDefinition.hh"
#include
"G4LogicalVolume.hh"
#include
"G4Material.hh"
#include
"G4ParticleDefinition.hh"
// STL
#include
<map>
#include
<set>
#include
<map>
#include
<set>
using
namespace
std
;
class
MaterialManager
{
class
MaterialManager
{
public:
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
...
...
@@ -48,23 +48,26 @@ public:
// called directly):
static
void
Destroy
();
protected:
// Constructor and Destructor are not public
MaterialManager
();
~
MaterialManager
();
protected:
// Constructor and Destructor are not public
MaterialManager
();
~
MaterialManager
();
private:
private:
// The static instance of MaterialManager:
static
MaterialManager
*
instance
;
// Map of element and material:
map
<
string
,
G4Material
*>
m_Material
;
private:
map
<
string
,
G4Material
*>
m_Material
;
private:
G4Element
*
m_D
;
G4Element
*
m_T
;
G4Element
*
m_He3
;
public:
G4Element
*
m_Li6
;
G4Element
*
m_Li7
;
public:
// clear all exising material from the library
void
ClearMaterialLibrary
();
...
...
@@ -78,32 +81,30 @@ public:
G4Material
*
GetGasFromLibrary
(
string
Name
,
double
Pressure
,
double
Temperature
);
// Same as above but for Element.
G4Element
*
GetElementFromLibrary
(
string
Name
);
G4Element
*
GetElementFromLibrary
(
string
Name
);
// Let the user directly add a custom material to the library
// It is howver overwritting existing material having the same name
void
AddMaterialToLibrary
(
G4Material
*
);
// Create tiny block of active material so the DEDX tables are generated
// Create tiny block of active material so the DEDX tables are generated
// prevent crash if the user define material but don't use it
void
CreateSampleVolumes
(
G4LogicalVolume
*
world_log
);
// Write the DEDx table for all material instantiate in the MaterialManager
// for a given particle
void
WriteDEDXTable
(
G4ParticleDefinition
*
Particle
,
G4double
Emin
,
G4double
Emax
);
void
WriteDEDXTable
(
G4ParticleDefinition
*
Particle
,
G4double
Emin
,
G4double
Emax
);
// Write the DEDx table for all material instantiate in the MaterialManager
// for a list of particle name
void
WriteDEDXTable
(
std
::
set
<
string
>
Particle
,
G4double
Emin
,
G4double
Emax
);
void
WriteDEDXTable
(
std
::
set
<
string
>
Particle
,
G4double
Emin
,
G4double
Emax
);
// Write the Cross Section table for all material instantiate in the MaterialManager
// for a given particle
void
WriteCrossSectionTable
(
G4ParticleDefinition
*
Particle
,
G4double
Emin
,
G4double
Emax
);
void
WriteCrossSectionTable
(
G4ParticleDefinition
*
Particle
,
G4double
Emin
,
G4double
Emax
);
// Write the Cross Section table for all material instantiate in the MaterialManager
// for a list of particle name
void
WriteCrossSectionTable
(
std
::
set
<
string
>
Particle
,
G4double
Emin
,
G4double
Emax
);
void
WriteCrossSectionTable
(
std
::
set
<
string
>
Particle
,
G4double
Emin
,
G4double
Emax
);
};
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment