00001 #ifndef CCTBX_ELTBX_HENKE_H
00002 #define CCTBX_ELTBX_HENKE_H
00003
00004 #include <cctbx/eltbx/fp_fdp.h>
00005 #include <scitbx/constants.h>
00006
00007 namespace cctbx { namespace eltbx { namespace henke {
00008
00010
00028 class table
00029 {
00030 public:
00032 table() : label_z_e_fp_fdp_(0) {}
00033
00035
00048 explicit
00049 table(
00050 std::string const& label,
00051 bool exact=false,
00052 bool exception_if_no_match=true);
00053
00055
00059 bool
00060 is_valid() const
00061 {
00062 return label_z_e_fp_fdp_ != 0 && label_z_e_fp_fdp_->label != 0;
00063 }
00064
00066 const char*
00067 label() const { return label_z_e_fp_fdp_->label; }
00068
00070 int
00071 atomic_number() const { return label_z_e_fp_fdp_->z; }
00072
00074
00081 fp_fdp
00082 at_ev(double energy) const;
00083
00085
00089 fp_fdp
00090 at_kev(double energy) const { return at_ev(energy * 1000); }
00091
00100 fp_fdp
00101 at_angstrom(double wavelength) const
00102 {
00103 return at_ev(scitbx::constants::factor_ev_angstrom / wavelength);
00104 }
00105
00106 private:
00107 const anomalous::label_z_e_fp_fdp* label_z_e_fp_fdp_;
00108 friend class table_iterator;
00109 };
00110
00113 class table_iterator
00114 {
00115 public:
00117 table_iterator();
00118
00120
00122 table
00123 next();
00124
00125 private:
00126 table current_;
00127 };
00128
00129 }}}
00130
00131 #endif // CCTBX_ELTBX_HENKE_H