IMP logo
IMP Reference Guide  2.20.2
The Integrative Modeling Platform
TiltSingletonScore.h
Go to the documentation of this file.
1 /**
2  * \file IMP/spb/TiltSingletonScore.h
3  * \brief A Score on the distance to a fixed point.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPSPB_TILT_SINGLETON_SCORE_H
9 #define IMPSPB_TILT_SINGLETON_SCORE_H
10 
11 #include <IMP/Pointer.h>
12 #include <IMP/SingletonScore.h>
13 #include <IMP/UnaryFunction.h>
14 #include <IMP/algebra/Vector3D.h>
15 #include <IMP/singleton_macros.h>
16 #include <IMP/spb/spb_config.h>
17 
18 IMPSPB_BEGIN_NAMESPACE
19 
20 //! Apply a function to the distance to a fixed point.
21 /** A particle is scored based on the distance between it and a constant
22  point as passed to a UnaryFunction. This is useful for anchoring
23  constraining particles within a sphere.
24 
25  To restrain a set of particles store in SingletonContainer pc in a sphere
26  do the following:
27  \htmlinclude restrain_in_sphere.py
28  */
29 class IMPSPBEXPORT TiltSingletonScore : public SingletonScore {
31  algebra::VectorD<3> local_;
32  algebra::VectorD<3> global_;
33 
34  public:
36  const algebra::VectorD<3> &v2);
37 
38  virtual double evaluate_index(IMP::Model *m, const IMP::ParticleIndex p,
39  DerivativeAccumulator *da) const override;
40 
42  IMP::Model *m, const IMP::ParticleIndexes &pis) const override;
43 
47  // IMP_SIMPLE_SINGLETON_SCORE(TiltSingletonScore);
48 };
49 
50 IMPSPB_END_NAMESPACE
51 
52 #endif /* IMPSPB_TILT_SINGLETON_SCORE_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Single variable function.
Macros for various classes.
#define IMP_SHOWABLE(Name)
A more IMP-like version of the std::vector.
Definition: Vector.h:42
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
A Cartesian vector in D-dimensions.
Definition: VectorD.h:56
Abstract class for scoring object(s) of type ParticleIndex.
#define IMP_SINGLETON_SCORE_METHODS(Name)
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:143
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const =0
Overload this method to specify the inputs.
Define SingletonScore.
A nullptr-initialized pointer to an IMP Object.
Simple 3D vector class.
virtual double evaluate_index(Model *m, ParticleIndex vt, DerivativeAccumulator *da) const =0
Compute the score and the derivative if needed.
Apply a function to the distance to a fixed point.
Abstract single variable functor class for score functions.
Definition: UnaryFunction.h:27
Class for adding derivatives from restraints to the model.