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
54 FormFactorTable(
const std::string& table_name,
double min_q,
double max_q,
64 double get_vacuum_form_factor(
Particle* p,
68 double get_dummy_form_factor(
Particle* p,
76 return vacuum_zero_form_factors_[OH2];
81 return dummy_zero_form_factors_[OH2];
100 return form_factors_[OH2];
105 return vacuum_form_factors_[OH2];
110 return dummy_form_factors_[OH2];
120 void show(std::ostream& out = std::cout, std::string prefix =
"")
const;
130 enum FormFactorAtomType {
175 HEAVY_ATOM_SIZE = 43,
180 static std::map<atom::Element, FormFactorAtomType> element_ff_type_map_;
184 FormFactor(
double ff,
double vacuum_ff,
double dummy_ff)
185 : ff_(ff), vacuum_ff_(vacuum_ff), dummy_ff_(dummy_ff) {}
186 double ff_, vacuum_ff_, dummy_ff_;
190 static std::map<atom::ResidueType, FormFactor> residue_type_form_factor_map_;
193 static double zero_form_factors_[];
195 static double vacuum_zero_form_factors_[];
197 static double dummy_zero_form_factors_[];
200 static IntKey form_factor_type_key_;
203 class AtomFactorCoefficients {
205 std::string atom_type_;
213 friend std::istream& operator>>(
214 std::istream& s, AtomFactorCoefficients& atom_factor_coefficients);
217 friend std::ostream& operator<<(
218 std::ostream& s,
const AtomFactorCoefficients& atom_factor_coefficients);
221 int read_form_factor_table(
const std::string& table_name);
223 void init_element_form_factor_map();
225 void init_residue_type_form_factor_map();
227 void compute_form_factors_all_atoms();
229 void compute_form_factors_heavy_atoms();
231 double get_form_factor(atom::ResidueType rt)
const;
233 double get_vacuum_form_factor(atom::ResidueType rt)
const;
235 double get_dummy_form_factor(atom::ResidueType rt)
const;
237 FormFactorAtomType get_form_factor_atom_type(
atom::Element e)
const;
239 FormFactorAtomType get_form_factor_atom_type(Particle* p,
242 FormFactorAtomType get_carbon_atom_type(
const atom::AtomType& atom_type,
243 const atom::ResidueType& residue_type)
246 FormFactorAtomType get_nitrogen_atom_type(
247 const atom::AtomType& atom_type,
248 const atom::ResidueType& residue_type)
const;
250 FormFactorAtomType get_oxygen_atom_type(
const atom::AtomType& atom_type,
251 const atom::ResidueType& residue_type)
254 FormFactorAtomType get_sulfur_atom_type(
const atom::AtomType& atom_type,
255 const atom::ResidueType& residue_type)
260 Vector<AtomFactorCoefficients> form_factors_coefficients_;
263 Vector<Vector<double> > form_factors_;
266 Vector<Vector<double> > vacuum_form_factors_;
269 Vector<Vector<double> > dummy_form_factors_;
272 double min_q_, max_q_, delta_q_;
274 WarningContext warn_context_;
280 IMPSAXS_END_NAMESPACE
Define the elements used in IMP.
FormFactorTable * get_default_form_factor_table()
Key< 1, true > IntKey
The type used to identify int attributes in the Particles.
double get_volume(const BoundingBoxD< D > &bb)
See BoundingBoxD.
Functions to deal with very common math operations.
A decorator for Residues.
const ResidueType UNK
Unknown residue.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
std::ostream & show(Hierarchy h, std::ostream &out=std::cout)
Print the hierarchy using a given decorator to display each node.
Class to handle individual model particles.
FormFactorType
type of the form factors for profile calculations
Element
The various elements currently supported/known.