IMP logo
IMP Reference Guide  develop.d97d4ead1f,2024/11/21
The Integrative Modeling Platform
BodyStatisticsOptimizerState.h
Go to the documentation of this file.
1 /**
2  * \file npctransport/BodyStatisticsOptimizerState.h
3  * \brief Track the rotational correlation time of a rigid body particle
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPNPCTRANSPORT_BODY_STATISTICS_OPTIMIZER_STATE_H
9 #define IMPNPCTRANSPORT_BODY_STATISTICS_OPTIMIZER_STATE_H
10 
11 #include "npctransport_config.h"
12 #include <IMP/Particle.h>
14 #include <IMP/OptimizerState.h>
15 //#include <IMP/optimizer_state_macros.h>
18 #include <deque>
19 
20 IMPNPCTRANSPORT_BEGIN_NAMESPACE
21 
22 class Statistics;
23 
24 /** Track the rotational correlation time of a rigid body particle*/
25 /** The correlation with at most the last 100 updates is tracked*/
26 class IMPNPCTRANSPORTEXPORT BodyStatisticsOptimizerState
28  private:
30  Particle *p_;
32 
33  // time series of the positions of particles in the chain:
34  std::deque<algebra::Transformation3D> positions_;
35  std::deque<double> times_fs_;
36 
37  Particle *get_particle() const { return p_; }
38 
39  void add_orientation(algebra::Rotation3D rot) { positions_.push_back(rot); }
40 
41  double get_dt() const;
42 
43  public:
44  /**
45  @param p the particle being wrapped
46  @param statistics_manager an optional statistical manager to which statistical updates are sent
47  (of e.g. zr-distribution that are collectively gathered)
48  @param periodicity frame interval for statistics, equiv. to set_period(1)
49  */
51  (Particle *p,
52  IMP::npctransport::Statistics* statistics_manager = nullptr,
53  unsigned int periodicity=1);
54 
55  double get_correlation_time() const;
56 
57  double get_diffusion_coefficient() const;
58 
59  void reset() override;
60 
61  /** updates the z-r distriubution table in owner's statistics
62  for this particle type (distribution of z coordinates and r coordinates)
63  */
64  void update_particle_type_zr_distribution_map();
65 
66  virtual void do_update(unsigned int call_num) override;
67 
69 };
71 
72 IMPNPCTRANSPORT_END_NAMESPACE
73 
74 #endif /* IMPNPCTRANSPORT_BODY_STATISTICS_OPTIMIZER_STATE_H */
Smart pointer to Object-derived classes that does not refcount.
Definition: WeakPointer.h:77
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Angle restraint between three particles.
virtual void do_update(unsigned int)
Statistics and order parameters about the simulations.
A more IMP-like version of the std::vector.
Definition: Vector.h:50
virtual void reset()
Reset counters, as if at the start of an optimize run.
Simple 3D transformation class.
3D rotation class.
Definition: Rotation3D.h:52
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
Shared optimizer state that is invoked upon commitment of new coordinates.
description
Class to handle individual particles of a Model object.
Definition: Particle.h:43
Shared optimizer state.
double get_diffusion_coefficient(const algebra::Vector3Ds &displacements, double dt)