1 #ifndef OBS_PHIP2_HIST_HPP
2 #define OBS_PHIP2_HIST_HPP
4 #include "latlib/o815/o815.h"
6 #include "latlib/writeout.h"
8 #include "latlib/obstat.hpp"
14 class obs_phip2_hist : public o815::obs {
20 obs_phip2_hist(o815 *_O815);
24 void _meas(bool loadedobs, const int& nthmeas);
30 obs_phip2_hist::obs_phip2_hist(o815 *_O815) : o815::obs("phip2",
31 _O815->paraQ->getParaNames() + "nthstep:iruv:phip2absdiffequi", _O815,
35 Sim = (sim*)O815->Sim;
38 void obs_phip2_hist::_meas(bool loadedobs, const int& nthmeas) {
40 for (int kpiruv=0; kpiruv<2; kpiruv++) {
41 double ppt = 2.*M_PI/O815->comargs.lsize[0] * ( 0 + kpiruv * O815->comargs.lsize[0]/2 ) ;
42 double ppx = 2.*M_PI/O815->comargs.lsize[1] * ( 0 + kpiruv * O815->comargs.lsize[1]/2 );
44 OM->phip2[ kpiruv ] = 0;
46 for (int ixt = 0; ixt < O815->comargs.lsize[0]; ixt++)
47 for (int ixx = 0; ixx < O815->comargs.lsize[1]; ixx++)
48 for (int ixpt = 0; ixpt < O815->comargs.lsize[0]; ixpt++)
49 for (int ixpx = 0; ixpx < O815->comargs.lsize[1]; ixpx++)
50 OM->phip2[ kpiruv ] += real( conj( Sim->conf[ ixt*O815->comargs.lsize[1] + ixx ].phi )
51 * Sim->conf[ ixpt*O815->comargs.lsize[1] + ixpx ].phi
52 * exp ( _i_*(double)ppx*(double)(ixx-ixpx) + _i_*(double)ppt*(double)(ixt-ixpt) ) );
54 OM->phip2[ kpiruv ] /= Sim->LSIZE2;
58 for (int kpiruv=0; kpiruv<2; kpiruv++) {
59 double ppt = 2.*M_PI/O815->comargs.lsize[0] * ( 0 + kpiruv * O815->comargs.lsize[0]/2 ) ;
60 double ppx = 2.*M_PI/O815->comargs.lsize[1] * ( 0 + kpiruv * O815->comargs.lsize[1]/2 );
62 *out << O815->paraQ->getParaVals();
63 *out << "\t" << ( Sim->nequi + (nthmeas+1)*Sim->nskip );
64 *out << "\t" << kpiruv;
65 *out << "\t" << abs( OM->phip2[ kpiruv ] - 1./(ppt*ppt + ppx*ppx + Sim->m*Sim->m) ) << endl;