IMP logo
IMP Reference Guide  2.19.0
The Integrative Modeling Platform
FretData.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/FretData.h \brief Auxiliary class useful for FRET_R restraint
3  *
4  * Copyright 2007-2022 IMP Inventors. All rights reserved.
5  */
6 
7 #ifndef IMPISD_FRET_DATA_H
8 #define IMPISD_FRET_DATA_H
9 
10 #include <IMP/isd/isd_config.h>
11 #include <IMP/macros.h>
12 #include <IMP/Model.h>
13 #include <IMP/constants.h>
14 #include <math.h>
15 #include <cereal/access.hpp>
16 #include <cereal/types/vector.hpp>
17 
18 IMPISD_BEGIN_NAMESPACE
19 
20 //! Auxiliary class for FRET_R restraint
21 /**
22  */
23 
24 class IMPISDEXPORT FretData : public Object {
25  Floats d_term_;
26  Floats d_center_;
27  Floats s_grid_;
28  std::vector<unsigned> nbin_;
29  unsigned dimension_;
30  Floats grid_;
31  Floats norm_;
32 
33  friend class cereal::access;
34 
35  template<class Archive> void serialize(Archive &ar) {
36  ar(cereal::base_class<Object>(this), d_term_, d_center_, s_grid_, nbin_,
37  dimension_, grid_, norm_);
38  }
39 
40  unsigned get_index(unsigned indices[3]) const;
41  void init_grids(const Floats& d_grid_int, Float R0, Float Rmin, Float Rmax,
42  bool do_limit);
43 
44  public:
45  FretData(Floats d_term, Floats d_center, Floats d_int, Floats s_grid,
46  Float R0, Float Rmin, Float Rmax, bool do_limit = true);
47  FretData() : Object("") {}
48 
49  int get_closest(std::vector<double> const& vec, double value) const;
50 
51  Float get_probability(Float distn, Float dist, Float sigma) const;
52 
53  Float get_kernel(Float dist, Float R0) const;
54 
55  FloatPair get_marginal_element(Float d_term, Float d_center,
56  Float sigma) const;
57 
59 };
60 
61 IMPISD_END_NAMESPACE
62 
63 #endif /* IMPISD_FRET_DATA_H */
Helper functions to check for NaN or infinity.
Various useful constants.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Storage of a model, its restraints, constraints and particles.
std::pair< double, double > FloatPair
A generic pair of floats.
Definition: types.h:26
Various general useful macros for IMP.
Ints get_index(const ParticlesTemp &particles, const Subset &subset, const Subsets &excluded)
Common base class for heavy weight IMP objects.
Definition: Object.h:111
Object(std::string name)
Construct an object with the given name.
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19
Auxiliary class for FRET_R restraint.
Definition: FretData.h:24