1 #ifndef OBS_PHI2_HIST_HPP
2 #define OBS_PHI2_HIST_HPP
4 #include "latlib/o815/o815.h"
6 #include "latlib/writeout.h"
8 #include "latlib/obstat.hpp"
14 class obs_phi2_hist : public o815::obs {
20 obs_phi2_hist(o815 *_O815);
24 void _meas(bool loadedobs, const int& nthmeas);
31 obs_phi2_hist::obs_phi2_hist(o815 *_O815) : o815::obs("phi2",
32 _O815->paraQ->getParaNames() + "nthstep:phi2:phi2_err",
33 _O815, sizeof(obsmem), "_hist") {
35 Sim = (sim*)O815->Sim;
38 void obs_phi2_hist::_meas(bool loadedobs, const int& nthmeas) {
42 *out << O815->paraQ->getParaVals();
43 *out << "\t" << ( Sim->nequi + (nthmeas+1)*Sim->nskip );
44 *out << "\t" << OM->phi2 << endl;
47 void obs_phi2_hist::phi2Compute()
51 for (int ix = 0; ix < Sim->LSIZE2; ix++)
52 OM->phi2 += norm( Sim->conf[ix].phi );
54 OM->phi2 /= Sim->LSIZE2;