VGM
Version 5.5
Toggle main menu visibility
Loading...
Searching...
No Matches
packages
BaseVGM
source
materials
material.cxx
Go to the documentation of this file.
1
// $Id$
2
3
// -----------------------------------------------------------------------
4
// The BaseVGM 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
12
// VGM::IMaterial output stream
13
// ------------------------
14
//
15
// Author: Ivana Hrivnacova; IPN Orsay
16
17
#include "
VGM/materials/IElement.h
"
18
#include "
VGM/materials/IMaterial.h
"
19
20
#include <string>
21
22
//_____________________________________________________________________________
23
std::ostream&
operator<<
(std::ostream& out,
const
VGM::IMaterial
& material)
24
{
25
std::string stateName;
26
switch
(material.
State
()) {
27
case
VGM::kSolid
:
28
stateName =
"Solid"
;
29
break
;
30
case
VGM::kLiquid
:
31
stateName =
"Liquid"
;
32
break
;
33
case
VGM::kGas
:
34
stateName =
"Gas"
;
35
break
;
36
case
VGM::kUndefined
:
37
default
:
38
stateName =
"Undefined"
;
39
}
40
41
out <<
"Material: "
42
<<
"\""
<< material.
Name
() <<
"\""
43
<<
" density "
<< material.
Density
() <<
" g/cm3"
44
<<
" radlen "
<< material.
RadiationLength
() / 10. <<
" cm"
45
<<
" intlen "
<< material.
NuclearInterLength
() / 10. <<
" cm"
46
<<
" state "
47
<<
"\""
<< stateName <<
"\""
48
<<
" temperature "
<< material.
Temperature
() <<
" kelvin"
49
<<
" pressure "
<< material.
Pressure
() <<
" atm"
<< std::endl;
50
51
for
(
int
i = 0; i < material.
NofElements
(); i++) {
52
out <<
" "
<< i <<
"th element: "
<< *material.
Element
(i)
53
<<
" Elm mass fraction: "
<< material.
MassFraction
(i) * 100. <<
" %"
;
54
if
(i < material.
NofElements
() - 1) out << std::endl;
55
}
56
57
return
out;
58
}
IElement.h
IMaterial.h
VGM::IMaterial
The VGM interface to materials.
Definition
IMaterial.h:44
VGM::IMaterial::Pressure
virtual double Pressure() const =0
Return the density in atmosphere.
VGM::IMaterial::Element
virtual IElement * Element(int iel) const =0
Return the i-th element constituing this material.
VGM::IMaterial::NuclearInterLength
virtual double NuclearInterLength() const =0
Return the nuclear interaction length in mm.
VGM::IMaterial::Density
virtual double Density() const =0
Return the density in g/cm3.
VGM::IMaterial::Temperature
virtual double Temperature() const =0
Return the temperature in kelvins.
VGM::IMaterial::Name
virtual std::string Name() const =0
Return the name of this element.
VGM::IMaterial::RadiationLength
virtual double RadiationLength() const =0
Return the radiation length in mm.
VGM::IMaterial::State
virtual MaterialState State() const =0
Return the material state.
VGM::IMaterial::MassFraction
virtual double MassFraction(int iel) const =0
Return the mass fraction of the i-th element constituing this material.
VGM::IMaterial::NofElements
virtual int NofElements() const =0
Return the number of elements constituing this material.
operator<<
std::ostream & operator<<(std::ostream &out, const VGM::IMaterial &material)
Definition
material.cxx:23
VGM::kGas
@ kGas
Gas materila.
Definition
IMaterial.h:40
VGM::kLiquid
@ kLiquid
Liquid material.
Definition
IMaterial.h:39
VGM::kSolid
@ kSolid
Solid material.
Definition
IMaterial.h:38
VGM::kUndefined
@ kUndefined
Undefined material state.
Definition
IMaterial.h:37
Generated on
for VGM by
1.17.0