GEAR  1.9.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Friends Pages
MaterialMap.h
1 #ifndef GEAR_MATERIALMAP_H
2 #define GEAR_MATERIALMAP_H 1
3 
4 #include <string>
5 #include <vector>
6 
7 #include "gear/GEAR.h"
8 #include "gear/GearMgr.h"
9 
10 namespace gear {
11 
16  class MaterialMap {
17 
18  public:
27  MaterialMap(GearMgr *gearMgr,double xmin, double xmax, int nxsteps,
28  double ymin, double ymax, int nysteps,
29  double zmin, double zmax, int nzsteps, int coord);
31  virtual ~MaterialMap() {
32  ;}
36  double getInteractionLength(double x, double y, double z) const ;
40  double getRadiationLength(double x, double y, double z) const ;
42  static const int CARTESIAN = 0 ;
44  static const int CYLINDRICAL = 1 ;
46  static const int SPHERICAL = 2 ;
47 
48 
49  protected:
50  double _xmin{}, _xmax{};
51  int _nxsteps{};
52  double _ymin{}, _ymax{};
53  int _nysteps{};
54  double _zmin{}, _zmax{};
55  int _nzsteps{};
56  double _xstep{},_ystep{},_zstep{};
57  std::pair<double,double> _values{};
58  std::vector< std::vector< std::vector< std::pair<double,double> > > > _myMap{};
59  void calculateGridIndex(std::vector<int> & gpos,double x, double y, double z) const ;
60  void interpolateOnGrid(std::pair<double,double> &result, double x, double y, double z) const;
61  }; // class
62 } // namespace gear
63 #endif /* ifndef GEAR_MATERIALMAPFACTORY_H */
Material map using GearDistanceProperties.
Definition: MaterialMap.h:16
static const int CYLINDRICAL
coord=1 : CYLINDRICAL (r,phi,z)
Definition: MaterialMap.h:44
double getRadiationLength(double x, double y, double z) const
Returns the radiation length from the vertex at (0,0,0) to (x,y,z) using a distance wheighted interpo...
Definition: MaterialMap.cc:150
static const int CARTESIAN
coord=0 : CARTESIAN (x,y,z)
Definition: MaterialMap.h:42
static const int SPHERICAL
coord=2 : SPERICAL (r,theta,phi)
Definition: MaterialMap.h:46
Abstract interface for a manager class that returns the Gear classes for the relevant subdetectors...
Definition: GearMgr.h:36
MaterialMap(GearMgr *gearMgr, double xmin, double xmax, int nxsteps, double ymin, double ymax, int nysteps, double zmin, double zmax, int nzsteps, int coord)
Should be called through the MaterialMapFactory! Creating a material map in memory.
Definition: MaterialMap.cc:11
virtual ~MaterialMap()
Destructor.
Definition: MaterialMap.h:31
double getInteractionLength(double x, double y, double z) const
Returns the interaction length from the vertex at (0,0,0) to (x,y,z) using a distance wheighted inter...
Definition: MaterialMap.cc:140