IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
ChainStatisticsOptimizerState.h
Go to the documentation of this file.
1/**
2 * \file npctransport/ChainStatisticsOptimizerState.h
3 * \brief description
4 *
5 * Copyright 2007-2026 IMP Inventors. All rights reserved.
6 */
7
8#ifndef IMPNPCTRANSPORT_CHAIN_STATISTICS_OPTIMIZER_STATE_H
9#define IMPNPCTRANSPORT_CHAIN_STATISTICS_OPTIMIZER_STATE_H
10
11#include "npctransport_config.h"
12#include <IMP/Particle.h>
13#include <IMP/OptimizerState.h>
15#include <deque>
16
17IMPNPCTRANSPORT_BEGIN_NAMESPACE
18
19/** Compute various statistics of a chain.*/
20class IMPNPCTRANSPORTEXPORT ChainStatisticsOptimizerState
21 : public OptimizerState {
22 private:
23 typedef OptimizerState P;
24
25 // particles in the chain:
26 ParticlesTemp ps_;
27
28 // time series of the positions of particles in the chain:
29 std::deque<algebra::Vector3Ds> positions_;
30 std::deque<double> times_fs_;
31
32 // mean radius-of-gyration and its square since last reset
33 double mean_rgyr_;
34 double mean_rgyr2_;
35
36 // mean end-to-end length and its square since last reset
37 double mean_end_to_end_;
38 double mean_end_to_end2_;
39
40 // mean bond distance and its square since last reset
41 double mean_bond_distance_;
42 double mean_bond_distance2_;
43
44 // number of samples over which means are computed
45 int n_;
46
47 double get_dt() const;
48
49 public:
50 /**
51 @param ps the particles being wrapped
52 @param periodicity frame interval for statistics, equiv. to set_period(1)
53 */
55 ( const ParticlesTemp &ps,
56 unsigned int periodicity = 1);
57
58 double get_correlation_time() const;
59
60 //! returns a vector of diffusion coefficients
61 //! for each particle in the chain, computed in the local
62 //! reference frame of the chain (by locally aligning
63 //! the chain)
65
66 //! get an estimate of the diffusion coefficient
67 //! of the entire chain in A^2/fs units
69
70 //! returns the mean Rgyr of this chain
72 return mean_rgyr_;
73 }
74
75 //! returns the mean Rgyr^2, which can be used to compute
76 //! std-dev (but recorded separately so it could be averaged with
77 //! other chains)
79 return mean_rgyr2_;
80 }
81
82 //! returns the mean end-to-end distance of this chain
84 return mean_end_to_end_;
85 }
86
87 //! returns the mean square end-to-end distance, which can be used to compute
88 //! std-dev (but recorded separately so it could be averaged with
89 //! other chains)
91 return mean_end_to_end2_;
92 }
93
94 //! returns the mean bond distance of this chain
95 double get_mean_bond_distance() const{
96 return mean_bond_distance_;
97 }
98
99 //! returns the mean square bond distance, which can be used to compute
100 //! std-dev (but recorded separately so it could be averaged with
101 //! other chains)
103 return mean_bond_distance2_;
104 }
105
106 /**
107 Resets all the statistics about that chain
108 */
109 void reset() override;
110 virtual void do_update(unsigned int call_num) override;
112};
114
115IMPNPCTRANSPORT_END_NAMESPACE
116
117#endif /* IMPNPCTRANSPORT_CHAIN_STATISTICS_OPTIMIZER_STATE_H */
Shared optimizer state.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
OptimizerState(Model *m, std::string name)
Constructor.
virtual void do_update(unsigned int call_num) override
double get_mean_bond_distance() const
returns the mean bond distance of this chain
ChainStatisticsOptimizerState(const ParticlesTemp &ps, unsigned int periodicity=1)
double get_mean_end_to_end_distance() const
returns the mean end-to-end distance of this chain
double get_mean_radius_of_gyration() const
returns the mean Rgyr of this chain
IMP::Vector< IMP::Pointer< ChainStatisticsOptimizerState > > ChainStatisticsOptimizerStates
IMP::Vector< Float > Floats
Standard way to pass a bunch of Float values.
Definition types.h:46
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
description