8 #ifndef IMPNPCTRANSPORT_Z_BIAS_SINGLETON_SCORE_H
9 #define IMPNPCTRANSPORT_Z_BIAS_SINGLETON_SCORE_H
11 #include "npctransport_config.h"
19 IMPNPCTRANSPORT_BEGIN_NAMESPACE
42 double max_r = HALF_SQRT_MAX_DOUBLE,
43 double z = std::numeric_limits<double>::min())
44 : k_(k), max_r2_( max_r * max_r ), z_(z) {}
50 double get_k()
const {
return k_; }
61 double r2 = std::pow(d.
get_x(), 2) + std::pow(d.
get_y(), 2);
62 if (r2 > max_r2_ && max_r2_ > 0.0) {
65 return std::make_pair(score, v_deriv);
68 double dz = d.
get_z() - z_;
73 else if (dz < -1e-6) {
82 return std::make_pair(score, v_deriv);
89 auto score_deriv = evaluate_deriv(d);
90 auto score = score_deriv.first;
91 auto v_deriv = score_deriv.second;
93 IMP_LOG(
VERBOSE,
"result in " << score
94 <<
" and " << v_deriv << std::endl);
109 IMPNPCTRANSPORT_END_NAMESPACE
void add_to_derivatives(const algebra::Vector3D &v, DerivativeAccumulator &d)
Add the vector v to the derivative vector of the x,y,z coordinates.
useful enums and constants
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Macros for various classes.
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Get the particles from a list of indexes.
A more IMP-like version of the std::vector.
Class for storing model, its restraints, constraints, and particles.
Score that biases particles to go down the Z axis.
Abstract class for scoring object(s) of type ParticleIndex.
#define IMP_SINGLETON_SCORE_METHODS(Name)
Produce copious output to allow someone to trace through the computation.
virtual double evaluate_index(Model *m, ParticleIndex pi, DerivativeAccumulator *da) const override
Compute the score and the derivative if needed.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
std::pair< double, algebra::Vector3D > evaluate_deriv(const core::XYZR &d) const
Class for adding derivatives from restraints to the model.
A decorator for a particle with x,y,z coordinates and a radius.