9 #ifndef IMPSAXS_FORM_FACTOR_TABLE_H
10 #define IMPSAXS_FORM_FACTOR_TABLE_H
12 #include <IMP/saxs/saxs_config.h>
24 IMPSAXS_BEGIN_NAMESPACE
71 return vacuum_zero_form_factors_[OH2];
76 return dummy_zero_form_factors_[OH2];
98 return vacuum_form_factors_[OH2];
103 return dummy_form_factors_[OH2];
113 void show(std::ostream &out=std::cout, std::string prefix=
"")
const;
123 enum FormFactorAtomType {
124 H, He, Li, Be, B, C, N, O, F, Ne,
125 Na, Mg, Al, Si, P, S, Cl, Ar,
126 K, Ca, Cr, Mn, Fe, Co, Ni, Cu, Zn, Se, Br,
127 I, Ir, Pt, Au, Hg, ALL_ATOM_SIZE = 34,
128 CH=34, CH2=35, CH3=36, NH=37, NH2=38, NH3=39, OH=40, OH2=41, SH=42,
129 HEAVY_ATOM_SIZE=43,
UNK=44};
132 static std::map<atom::Element, FormFactorAtomType> element_ff_type_map_;
136 FormFactor(
double ff,
double vacuum_ff,
double dummy_ff) :
137 ff_(ff), vacuum_ff_(vacuum_ff), dummy_ff_(dummy_ff) {}
138 double ff_, vacuum_ff_, dummy_ff_;
142 static std::map<atom::ResidueType, FormFactor> residue_type_form_factor_map_;
145 static Float zero_form_factors_[];
147 static Float vacuum_zero_form_factors_[];
149 static Float dummy_zero_form_factors_[];
152 static IntKey form_factor_type_key_;
155 class AtomFactorCoefficients {
165 friend std::istream& operator>>(std::istream& s,
166 AtomFactorCoefficients& atom_factor_coefficients);
169 friend std::ostream& operator<<(std::ostream& s,
170 const AtomFactorCoefficients& atom_factor_coefficients);
173 int read_form_factor_table(
const String& table_name);
175 void init_element_form_factor_map();
177 void init_residue_type_form_factor_map();
179 void compute_form_factors_all_atoms();
181 void compute_form_factors_heavy_atoms();
183 float get_form_factor(atom::ResidueType rt)
const;
185 float get_vacuum_form_factor(atom::ResidueType rt)
const;
187 float get_dummy_form_factor(atom::ResidueType rt)
const;
189 FormFactorAtomType get_form_factor_atom_type(
atom::Element e)
const;
191 FormFactorAtomType get_form_factor_atom_type(
Particle* p,
194 FormFactorAtomType get_carbon_atom_type(
const atom::AtomType& atom_type,
195 const atom::ResidueType& residue_type)
const;
197 FormFactorAtomType get_nitrogen_atom_type(
const atom::AtomType& atom_type,
198 const atom::ResidueType& residue_type)
const;
200 FormFactorAtomType get_oxygen_atom_type(
const atom::AtomType& atom_type,
201 const atom::ResidueType& residue_type)
const;
203 FormFactorAtomType get_sulfur_atom_type(
const atom::AtomType& atom_type,
204 const atom::ResidueType& residue_type)
const;
208 std::vector<AtomFactorCoefficients> form_factors_coefficients_;
211 std::vector<Floats> form_factors_;
214 std::vector<Floats> vacuum_form_factors_;
217 std::vector<Floats> dummy_form_factors_;
220 Float min_q_, max_q_, delta_q_;
222 WarningContext warn_context_;
225 IMPSAXSEXPORT FormFactorTable* default_form_factor_table();
227 IMPSAXS_END_NAMESPACE