23 #include "core/ActionRegister.h"
24 #include "tools/Grid.h"
25 #include "tools/KernelFunctions.h"
26 #include "tools/IFile.h"
27 #include "tools/OFile.h"
93 std::vector<unsigned>
gbin;
102 PLUMED_REGISTER_ACTION(
Histogram,
"HISTOGRAM")
106 keys.add(
"compulsory",
"GRID_MIN",
"the lower bounds for the grid");
107 keys.add(
"compulsory",
"GRID_MAX",
"the upper bounds for the grid");
108 keys.add(
"compulsory",
"GRID_BIN",
"the number of bins for the grid");
109 keys.add(
"compulsory",
"KERNEL",
"gaussian",
"the kernel function you are using. More details on the kernels available in plumed can be found in \\ref kernelfunctions.");
110 keys.add(
"compulsory",
"BANDWIDTH",
"the bandwdith for kernel density estimation");
111 keys.add(
"compulsory",
"GRID_WFILE",
"histogram",
"the file on which to write the grid");
112 keys.use(
"NOMEMORY");
117 gmin(getNumberOfArguments()),
118 gmax(getNumberOfArguments()),
119 point(getNumberOfArguments()),
120 bw(getNumberOfArguments()),
121 gbin(getNumberOfArguments())
152 std::vector<bool> pbc; std::string dmin,dmax;
184 gridfile.
close();
delete gg;
bool getPeriodicityInformation(const unsigned &i, std::string &dmin, std::string &dmax)
Returns true if argument i is periodic together with the domain.
Log & log
Reference to the log stream.
bool usingMemory() const
Are we analyzing each data block separately (if we are not this also returns the old normalization ) ...
void getDataPoint(const unsigned &idata, std::vector< double > &point, double &weight) const
Retrieve the ith point.
void parseOutputFile(const std::string &key, std::string &filename)
This is used to read in output file names for analysis methods.
FileBase & link(FILE *)
Link to an already open filed.
void checkRead()
Check if Action was properly read.
double getNormalization() const
Return the normalization constant.
void parse(const std::string &key, T &t)
Parse one keyword as generic type.
This class holds the keywords and their documentation.
IFile & open(const std::string &name)
Opens the file.
This class is used to bring the relevant information to the Action constructor.
OFile & link(OFile &)
Allows linking this OFile to another one.
void addKernel(const KernelFunctions &kernel)
add a kernel function to the grid
int printf(const char *fmt,...)
Formatted output with explicit format - a la printf.
void close()
Closes the file Should be used only for explicitely opened files.
void parseVector(const std::string &key, std::vector< T > &t)
Parse one keyword as std::vector.
std::vector< unsigned > gbin
std::vector< Value * > getArguments()
Overwrite ActionWithArguments getArguments() so that we don't return the bias.
unsigned getNumberOfDataPoints() const
Return the number of data points.
This is the abstract base class to use for implementing new methods for analyzing the trajectory...
virtual void writeToFile(OFile &)
dump grid on file
unsigned getNumberOfArguments() const
Return the number of arguments (this overwrites the one in ActionWithArguments)
std::vector< std::string > gmin
virtual void scaleAllValuesAndDerivatives(const double &scalef)
Scale all grid values and derivatives by a constant factor.
bool FileExist(const std::string &path)
Check if the file exists.
std::vector< double > point
static void registerKeywords(Keywords &keys)
Histogram(const ActionOptions &ao)
void setOutputFmt(std::string ss)
set output format
void setBackupString(const std::string &)
Set the string name to be used for automatic backup.
Provides the keyword HISTOGRAM
static void registerKeywords(Keywords &keys)
OFile & open(const std::string &name)
Opens the file using automatic append/backup.
std::vector< std::string > gmax
std::string getOutputFormat() const
Return the format to use for numbers in output files.
static Grid * create(const std::string &, std::vector< Value * >, IFile &, bool, bool, bool)
read grid from file
#define PLUMED_ANALYSIS_INIT(ao)