IMP logo
IMP Reference Guide  2.22.0
The Integrative Modeling Platform
MembraneRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/pmi/MembraneRestraint.h
3  * \brief Favor configurations where target is in the membrane.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPPMI_MEMBRANE_RESTRAINT_H
10 #define IMPPMI_MEMBRANE_RESTRAINT_H
11 
12 #include <IMP/pmi/pmi_config.h>
13 #include <IMP/isd/ISDRestraint.h>
14 #include <IMP/Particle.h>
15 
16 IMPPMI_BEGIN_NAMESPACE
17 
18 //! Membrane Restraint
19 /** Favors configurations where target is in the membrane.
20  This is the C++ implementation; for most modeling the Python wrapper
21  is more useful - see IMP.pmi.restraints.basic.MembraneRestraint.
22  */
23 class IMPPMIEXPORT MembraneRestraint : public isd::ISDRestraint {
24  ParticleIndex z_nuisance_;
25  double thickness_;
26  double softness_;
27  double plateau_;
28  double linear_;
29  double max_float_;
30  double log_max_float_;
31 
32  ParticleIndexes particles_below_;
33  ParticleIndexes particles_above_;
34  ParticleIndexes particles_inside_;
35 
36 public:
37  MembraneRestraint(Model *m, ParticleIndex z_nuisance, double thickness,
38  double softness, double plateau, double linear);
39  void add_particles_below(ParticleIndexes const &particles);
40  void add_particles_above(ParticleIndexes const &particles);
41  void add_particles_inside(ParticleIndexes const &particles);
42  double get_score(double prob) const;
43  double get_probability_above(double z, double z_slope_center_upper) const;
44  double get_score_above(double z, double z_slope_center_upper) const;
45  double get_probability_below(double z, double z_slope_center_lower) const;
46  double get_score_below(double z, double z_slope_center_lower) const;
47  double get_score_inside(double z, double z_slope_center_lower,
48  double z_slope_center_upper) const;
49  virtual double unprotected_evaluate(DerivativeAccumulator *) const
50  override;
51  virtual IMP::ModelObjectsTemp do_get_inputs() const override;
53 };
54 
55 IMPPMI_END_NAMESPACE
56 
57 #endif /* IMPPMI_MEMBRANE_RESTRAINT_H */
A base class for ISD Restraints.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
virtual ModelObjectsTemp do_get_inputs() const override
virtual double unprotected_evaluate(DerivativeAccumulator *accum) const override
Return the unweighted score for the restraint.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
double get_score() const
Class for adding derivatives from restraints to the model.