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:imode:kt:kx:phip2absdiffequi", _O815,
35 Sim = (sim*)O815->Sim;
38 void obs_phip2_hist::_meas(bool loadedobs, const int& nthmeas) {
39 for (int kpimode=0; kpimode<4; kpimode++) {
40 const double ppt = 2.*M_PI/O815->comargs.lsize[0] * ( 0 + int( kpimode/4. * O815->comargs.lsize[0] ) ) ;
41 const double ppx = 2.*M_PI/O815->comargs.lsize[1] * ( 0 + int( kpimode/4. * O815->comargs.lsize[1] ) );
44 OM->phip2[ kpimode ] = 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[ kpimode ] += 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[ kpimode ] /= Sim->LSIZE2;
57 *out << O815->paraQ->getParaVals();
58 *out << "\t" << ( Sim->nequi + (nthmeas+1)*Sim->nskip );
59 *out << "\t" << kpimode;
60 *out << "\t" << 0 + int( kpimode/4. * O815->comargs.lsize[0] );
61 *out << "\t" << 0 + int( kpimode/4. * O815->comargs.lsize[1] );
62 *out << "\t" << abs( OM->phip2[ kpimode ] - 1./(ppt*ppt + ppx*ppx + Sim->m*Sim->m) ) << endl;