DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Material.h
Go to the documentation of this file.
1 #ifndef DDRec_Material_H
2 #define DDRec_Material_H
3 
4 #include "DD4hep/Objects.h"
5 #include "DDSurfaces/IMaterial.h"
6 
7 #include <list>
8 
9 namespace DD4hep {
10  namespace DDRec {
11 
12 
21 
22  protected:
23  std::string _name ;
24  double _Z ;
25  double _A ;
26  double _rho ;
27  double _x0 ;
28  double _lambda ;
29 
30  public:
31 
34 
35  _name("unknown"),
36  _Z( -1. ),
37  _A( 0. ),
38  _rho( 0. ),
39  _x0( 0. ),
40  _lambda( 0.) {
41 
42  if( m.isValid() ) {
43 
44  _name= m.name() ;
45  _Z = m.Z() ;
46  _A = m.A() ;
47  _rho = m.density() ;
48  _x0 = m.radLength() ;
49  _lambda = m.intLength() ;
50 
51  }
52  }
53 
55  MaterialData() : _name("unknown"),
56  _Z( -1. ),
57  _A( 0. ),
58  _rho( 0. ),
59  _x0( 0. ),
60  _lambda( 0.) {}
61 
63  MaterialData( const std::string& nam, double Z_val, double A_val, double density_val, double radLength, double intLength )
64  : _name( nam ),
65  _Z( Z_val ),
66  _A( A_val ),
67  _rho( density_val ),
68  _x0( radLength ),
69  _lambda( intLength ) {}
70 
72  MaterialData( const MaterialData& m ) : _name( m.name() ),
73  _Z( m.Z() ),
74  _A( m.A() ),
75  _rho( m.density() ),
76  _x0( m.radiationLength() ),
77  _lambda( m.interactionLength() ) {}
78 
80  MaterialData( const IMaterial& m ) : _name( m.name() ),
81  _Z( m.Z() ),
82  _A( m.A() ),
83  _rho( m.density() ),
84  _x0( m.radiationLength() ),
85  _lambda( m.interactionLength() ) {}
86 
89  if ( this != &m ) {
90  _name = m._name ;
91  _Z = m._Z ;
92  _A = m._A ;
93  _rho = m._rho ;
94  _x0 = m._x0 ;
95  _lambda = m._lambda ;
96  }
97  return *this ;
98  }
99 
102  if ( this != &m ) {
103  _name = m.name() ;
104  _Z = m.Z() ;
105  _A = m.A() ;
106  _rho = m.density() ;
107  _x0 = m.radiationLength() ;
108  _lambda = m.interactionLength() ;
109  }
110  return *this ;
111  }
112 
115 
116  if( m.isValid() ) {
117 
118  _name = m.name() ;
119  _Z = m.Z() ;
120  _A = m.A() ;
121  _rho = m.density() ;
122  _x0 = m.radLength() ;
123  _lambda = m.intLength() ;
124 
125  } else {
126 
127  _name= "unknown";
128  _Z = -1. ;
129  _A = 0. ;
130  _rho = 0. ;
131  _x0 = 0. ;
132  _lambda = 0. ;
133  }
134 
135  return *this ;
136  }
137 
139  bool isValid() const { return ( _Z > 0. ) ; }
140 
142  virtual ~MaterialData() {}
143 
145  virtual std::string name() const { return _name ; }
146 
148  virtual double Z() const { return _Z ; }
149 
151  virtual double A() const { return _A ; }
152 
154  virtual double density() const { return _rho ; }
155 
157  virtual double radiationLength() const { return _x0 ; }
158 
160  virtual double interactionLength() const { return _lambda ; }
161 
162  };
163 
164 
165  } /* namespace */
166 } /* namespace */
167 
168 #endif /* DDRec_Material_H */
virtual double radiationLength() const
radiation length - tgeo units
Definition: Material.h:157
MaterialData & operator=(const MaterialData &m)
copy assignement
Definition: Material.h:88
virtual std::string name() const
material name
Definition: Material.h:145
const char * name() const
Access the object name (or "" if not supported by the object)
Definition: Handle.inl:36
virtual double A() const =0
averaged atomic number
Handle class describing a material.
Definition: Objects.h:300
bool isValid() const
Check the validity of the object held by the handle.
Definition: Handle.h:124
MaterialData(const IMaterial &m)
Definition: Material.h:80
double intLength() const
Access the interaction length of the underlying material.
Definition: Objects.cpp:225
virtual double density() const
density
Definition: Material.h:154
virtual std::string name() const =0
material name
MaterialData & operator=(const Geometry::Material &m)
assignment from Geometry::Material
Definition: Material.h:114
MaterialData & operator=(const IMaterial &m)
assignment from Geometry::Material
Definition: Material.h:101
MaterialData(const MaterialData &m)
Definition: Material.h:72
virtual double density() const =0
density - units ?
MaterialData(Geometry::Material m)
Definition: Material.h:33
double radLength() const
Access the radiation length of the underlying material.
Definition: Objects.cpp:213
virtual double interactionLength() const
interaction length - tgeo units
Definition: Material.h:160
double A() const
atomic number of the underlying material
Definition: Objects.cpp:189
virtual double Z() const =0
averaged proton number
double Z() const
proton number of the underlying material
Definition: Objects.cpp:178
virtual double Z() const
averaged proton number
Definition: Material.h:148
double density() const
density of the underlying material
Definition: Objects.cpp:201
virtual double interactionLength() const =0
interaction length - units ?
virtual double A() const
averaged atomic number
Definition: Material.h:151
virtual double radiationLength() const =0
radiation length - units ?
TGeoShape TGeoMedium * m
Definition: Volumes.cpp:294
bool isValid() const
true if initialized
Definition: Material.h:139
MaterialData(const std::string &nam, double Z_val, double A_val, double density_val, double radLength, double intLength)
Definition: Material.h:63