]> git.treefish.org Git - phys/heatbath.git/blobdiff - obs_phip2_hist.hpp
...
[phys/heatbath.git] / obs_phip2_hist.hpp
index a239d0e444600d1231d5047c85bbd905c98cbfd7..60c86b8e41e40bb18cfbf3152fe7acfdd5c99822 100644 (file)
@@ -15,7 +15,7 @@ class obs_phip2_hist : public o815::obs {
 
 public:
   struct obsmem {
-    double phip2[2];
+    double phip2[4];
   };
   obs_phip2_hist(o815 *_O815);
   
@@ -28,7 +28,7 @@ private:
 };
 
 obs_phip2_hist::obs_phip2_hist(o815 *_O815) : o815::obs("phip2", 
-                                                       _O815->paraQ->getParaNames() + "nthstep:iruv:phip2absdiffequi", _O815, 
+                                                       _O815->paraQ->getParaNames() + "nthstep:imode:kt:kx:phip2absdiffequi", _O815, 
                                                        sizeof(obsmem), 
                                                        "_hist") {
   OM = (obsmem*)obsMem;
@@ -36,33 +36,30 @@ obs_phip2_hist::obs_phip2_hist(o815 *_O815) : o815::obs("phip2",
 }
 
 void obs_phip2_hist::_meas(bool loadedobs, const int& nthmeas) {
-  if (!loadedobs) {
-    for (int kpiruv=0; kpiruv<2; kpiruv++) {
-      double ppt = 2.*M_PI/O815->comargs.lsize[0] * ( 0 + kpiruv * O815->comargs.lsize[0]/2 ) ;
-      double ppx = 2.*M_PI/O815->comargs.lsize[1] * ( 0 + kpiruv * O815->comargs.lsize[1]/2 );
+  for (int kpimode=0; kpimode<4; kpimode++) {
+    const double ppt = 2.*M_PI/O815->comargs.lsize[0] * ( 0 + int( kpimode/4. * O815->comargs.lsize[0] ) ) ;
+    const double ppx = 2.*M_PI/O815->comargs.lsize[1] * ( 0 + int( kpimode/4. * O815->comargs.lsize[1] ) );
 
-      OM->phip2[ kpiruv ] = 0;
+    if (!loadedobs) {
+      OM->phip2[ kpimode ] = 0;
        
       for (int ixt = 0; ixt < O815->comargs.lsize[0]; ixt++)
        for (int ixx = 0; ixx < O815->comargs.lsize[1]; ixx++)
          for (int ixpt = 0; ixpt < O815->comargs.lsize[0]; ixpt++)
            for (int ixpx = 0; ixpx < O815->comargs.lsize[1]; ixpx++)
-             OM->phip2[ kpiruv ] += real( conj( Sim->conf[ ixt*O815->comargs.lsize[1] + ixx ].phi )
-                                          * Sim->conf[ ixpt*O815->comargs.lsize[1] + ixpx ].phi
-                                          * exp ( _i_*(double)ppx*(double)(ixx-ixpx) + _i_*(double)ppt*(double)(ixt-ixpt) ) );
+             OM->phip2[ kpimode ] += real( conj( Sim->conf[ ixt*O815->comargs.lsize[1] + ixx ].phi )
+                                           * Sim->conf[ ixpt*O815->comargs.lsize[1] + ixpx ].phi
+                                           * exp ( _i_*(double)ppx*(double)(ixx-ixpx) + _i_*(double)ppt*(double)(ixt-ixpt) ) );
        
-      OM->phip2[ kpiruv ] /= Sim->LSIZE2;
+      OM->phip2[ kpimode ] /= Sim->LSIZE2;
     }
-  }
-  
-  for (int kpiruv=0; kpiruv<2; kpiruv++) {
-    double ppt = 2.*M_PI/O815->comargs.lsize[0] * ( 0 + kpiruv * O815->comargs.lsize[0]/2 ) ;
-    double ppx = 2.*M_PI/O815->comargs.lsize[1] * ( 0 + kpiruv * O815->comargs.lsize[1]/2 );
-
+    
     *out << O815->paraQ->getParaVals();
     *out << "\t" << ( Sim->nequi + (nthmeas+1)*Sim->nskip );
-    *out << "\t" << kpiruv;
-    *out << "\t" << abs( OM->phip2[ kpiruv ] - 1./(ppt*ppt + ppx*ppx + Sim->m*Sim->m) ) << endl;
+    *out << "\t" << kpimode;
+    *out << "\t" << 0 + int( kpimode/4. * O815->comargs.lsize[0] );
+    *out << "\t" << 0 + int( kpimode/4. * O815->comargs.lsize[1] );
+    *out << "\t" << abs( OM->phip2[ kpimode ] - 1./(ppt*ppt + ppx*ppx + Sim->m*Sim->m) ) << endl;
   }
 };