IMP logo
IMP Reference Guide  2.24.0
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-2026 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>
16 #include <deque>
17 
18 IMPNPCTRANSPORT_BEGIN_NAMESPACE
19 
20 class Statistics;
21 
22 /** Track the rotational correlation time of a rigid body particle*/
23 /** The correlation with at most the last 100 updates is tracked*/
24 class IMPNPCTRANSPORTEXPORT BodyStatisticsOptimizerState
25  : public OptimizerState {
26  private:
27  typedef OptimizerState P;
28  Particle *p_;
30 
31  // time series of the positions of particles in the chain:
32  std::deque<algebra::Transformation3D> positions_;
33  std::deque<double> times_fs_;
34 
35  Particle *get_particle() const { return p_; }
36 
37  void add_orientation(algebra::Rotation3D rot) { positions_.push_back(rot); }
38 
39  double get_dt() const;
40 
41  public:
42  /**
43  @param p the particle being wrapped
44  @param statistics_manager an optional statistical manager to which statistical updates are sent
45  (of e.g. zr-distribution that are collectively gathered)
46  @param periodicity frame interval for statistics, equiv. to set_period(1)
47  */
49  (Particle *p,
50  IMP::npctransport::Statistics* statistics_manager = nullptr,
51  unsigned int periodicity=1);
52 
53  double get_correlation_time() const;
54 
55  double get_diffusion_coefficient() const;
56 
57  void reset() override;
58 
59  /** updates the z-r distriubution table in owner's statistics
60  for this particle type (distribution of z coordinates and r coordinates)
61  */
62  void update_particle_type_zr_distribution_map();
63 
64  virtual void do_update(unsigned int call_num) override;
65 
67 };
69 
70 IMPNPCTRANSPORT_END_NAMESPACE
71 
72 #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
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:45
Shared optimizer state.
double get_diffusion_coefficient(const algebra::Vector3Ds &displacements, double dt)