IMP  2.0.1
The Integrative Modeling Platform
WeightedExcludedVolumeRestraint.h
Go to the documentation of this file.
1 /**
2  * \file IMP/multifit/WeightedExcludedVolumeRestraint.h
3  * \brief Calculate weighted excluded volume between rigid bodies
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPMULTIFIT_WEIGHTED_EXCLUDED_VOLUME_RESTRAINT_H
10 #define IMPMULTIFIT_WEIGHTED_EXCLUDED_VOLUME_RESTRAINT_H
11 
12 #include <IMP/multifit/multifit_config.h>
13 #include <IMP/em/DensityMap.h>
14 #include <IMP/em/CoarseCC.h>
16 
17 #include <IMP/atom/Hierarchy.h>
18 #include <IMP/core/XYZR.h>
19 #include <IMP/Model.h>
20 #include <IMP/Restraint.h>
21 #include <IMP/VersionInfo.h>
22 #include <IMP/Refiner.h>
23 
24 IMPMULTIFIT_BEGIN_NAMESPACE
25 
26 //! Calculate score based on fit to EM map
27 /** \ingroup exp_restraint
28 
29  */
30 class IMPMULTIFITEXPORT WeightedExcludedVolumeRestraint : public Restraint
31 {
32 public:
33  //! Constructor
34  /**
35  \param[in] rbs Excluded volume will be calculated between these Rigid bodies
36  \param[in] refiner rigid body refiner
37  \param[in] weight_key the name of the weight attribute of the particles
38  \note Particles that are rigid-bodies are interpolated and not resampled.
39  This significantly reduces the running time but is less accurate.
40  */
42  core::RigidBodies rbs,
43  Refiner *refiner,
44  FloatKey weight_key= IMP::atom::Mass::get_mass_key());
45 
46  virtual double
47  unprotected_evaluate(IMP::kernel::DerivativeAccumulator *accum)
48  const IMP_OVERRIDE;
49  virtual IMP::kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
51 
52 #ifndef SWIG
53  IMP_LIST(private, Particle, particle, Particle*, Particles);
54 #endif
55 
56 private:
57  //! Create density maps: one for each rigid body
58  /**
59  \todo the user should pass a refiner for each rigid body. For now we
60  assume that each rigid body is a molecular hierarchy
61  */
62  void initialize_model_density_map(FloatKey weight_key);
63  core::RigidBodies rbs_;
64  //one surface map for each rigid body
65  mutable em::SurfaceShellDensityMaps rbs_surface_maps_;
66  // reference to the IMP environment
67  // derivatives
68  std::vector<std::vector<float> >rb_refined_dx_,
69  rb_refined_dy_ , rb_refined_dz_;
70  // bool special_treatment_of_particles_outside_of_density_;
71  //rigid bodies handling
72  std::vector<IMP::algebra::Transformation3D> rbs_orig_trans_;
73  IMP::OwnerPointer<Refiner> rb_refiner_;//refiner for rigid bodies
74 };
75 
76 IMPMULTIFIT_END_NAMESPACE
77 
78 #endif /* IMPMULTIFIT_WEIGHTED_EXCLUDED_VOLUME_RESTRAINT_H */